Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

tdd-workflow

/tdd-workflow

Pisze funkcje i poprawki test-first, w cyklu czerwony, zielony, refaktor, jako domyślny przepływ pracy dla REDEVKIT.

Repozytorium
redevkit ↗
Licencja
MIT
Ostatnia zmiana repozytorium
12.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Pisze funkcje i poprawki test-first, w cyklu czerwony, zielony, refaktor, jako domyślny przepływ pracy dla REDEVKIT.

Oryginalny opis (EN)

Test-driven development (RED-GREEN-REFACTOR), the REDEVKIT default; use when implementing features or fixes test first.

Jak działa

  1. 1. TDD in REDEVKIT
  2. 2. The Cycle
  3. 3. The Three Laws of TDD
  4. 4. RED Phase
  5. 5. GREEN Phase
  6. 6. REFACTOR Phase
  7. 7. AAA Pattern
  8. 8. When TDD Pays Off Most
  9. 9. Test Prioritization
  10. 10. Anti-Patterns
Sekcje z nagłówków SKILL.md, w oryginale · 132 linii, 742 słów
Podgląd SKILL.md
---
name: tdd-workflow
description: Test-driven development (RED-GREEN-REFACTOR), the REDEVKIT default; use when implementing features or fixes test first.
---

# TDD Workflow

> Write tests first, code second. The test is the specification.

## 1. TDD in REDEVKIT

- **TDD is the default.** The project constitution (`.redevkit/memory/constitution.md`) starts
  with a Test-First principle; only a constitution amendment can waive it.
- **Tasks:** in `specs/NNN-name/tasks.md`, every user story starts with the tasks that write
  failing tests, then the implementation tasks (`{{SKILL:redevkit-tasks}}`).
- **Implementation:** `{{SKILL:redevkit-implement}}` runs the test tasks first and confirms they
  fail before writing production code.
- **Bugs:** the regression test that reproduces the bug comes before the fix
  (`{{SKILL:systematic-debugging}}`, artifacts in `.redevkit/bugs/<slug>/`).
- **Test runs:** `{{CMD:redevkit-test}}` fills the gaps between acceptance scenarios and tests,
  runs the full suite and appends the run to `specs/NNN-name/test-report.md`.

If the constitution waives TDD for this project, still write tests for each user story, but
the order is free.

## 2. The Cycle

```text
🔴 RED      → write a failing test and watch it fail
    ↓
🟢 GREEN    → write the minimal code to pass
    ↓
🔵 REFACTOR → improve the code, tests stay green
    ↓
   repeat
```

## 3. The Three Laws of TDD

1. Write production code only to make a failing test pass.
2. Write only enough test to demonstrate a failure.
3. Write only enough code to make the test pass.

## 4. RED Phase

| Focus | Example |
| --- | --- |
| Behavior | "should add two numbers" |
| Edge cases | "should handle empty input" |
| Error states | "should throw for invalid data" |

Rules:

- Run the test and see it fail **for the expected reason** (an assertion, not a typo or an
  import error).
- The test name describes the expected behavior.
- One behavior per test.
- Derive tests from the acceptance scenarios in `spec.md` when they exist.

## 5. GREEN Phase

| Principle | Meaning |
| --- | --- |
| **YAGNI** | You Aren't Gonna Need It |
| **Simplest thing** | Write the minimum to pass |
| **No optimization** | Just make it work |

Rules:

- Don't write code no test asks for.
- Don't optimize yet.
- Run the test again and record that it passes.

## 6. REFACTOR Phase

| Area | Action |
| --- | --- |
| Duplication | Extract common code |
| Naming | Make intent clear |
| Structure | Improve organization |
| Complexity | Simplify logic (see `{{SKILL:simplify-code}}`) |

Rules:

- All tests stay green after every step.
- Small, incremental changes.
- Re-run the suite before moving to the next test.

## 7. AAA Pattern

| Step | Purpose |
| --- | --- |
| **Arrange** | Set up test data |
| **Act** | Execute the code under test |
| **Assert** | Verify the expected outcome |

## 8. When TDD Pays Off Most

| Scenario | TDD value |
| --- | --- |
| New feature | High |
| Bug fix | High (regression test first) |
| Complex logic | High |
| Exploratory spike | Low: spike, throw it away, then rebuild test first |
| Pure layout / styling | Low: prefer visual or e2e checks (`{{SKILL:webapp-testing}}`) |

## 9. Test Prioritization

| Priority | Test type |
| --- | --- |
| 1 | Happy path |
| 2 | Error cases |
| 3 | Edge cases |
| 4 | Performance |

## 10. Anti-Patterns

| ❌ Don't | ✅ Do |
| --- | --- |
| Skip the RED phase | Watch the test fail first |
| Write tests after the code | Write tests before |
| Over-engineer the first version | Keep it simple |
| Test several behaviors at once | One behavior per test |
| Test implementation details | Test behavior |
| Claim "tests pass" without running them | Show the command and its output |

## 11. Splitting RED and GREEN Across Agents

When work is delegated, one agent can write the failing tests and another implement against
them. The implementer must not edit the tests to make them pass; a test that seems wrong goes
back to the orchestrator as a question. The test tasks finish (and fail) before the
implementation tasks start; `[P]` applies only to tasks in the same phase whose files are
disjoint.

> **Remember:** If you can't write a test, you don't understand the requirement yet.

Wersje

RepozytoriumWynikLicencja
Ta strona · Reprograme/redevkit100MIT
drvoss/everything-copilot-cli100MIT
momochenisme/speclink100MIT
travisjneuman/.claude100MIT
kookr-ai/kookr100Apache-2.0
madappgang/magus100MIT
aAAaqwq/AGI-Super-Team100MIT
affaan-m/ECC100MIT
affaan-m/ECC100MIT

Migawka bazy z 13.11.2026 · wersja paczki c1d67cfb9b08 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100tdd
    Prowadzi pracę test-first w cyklu czerwony, zielony, refaktoryzacja, przy nowych funkcjach i poprawkach błędów.
  • 100tdd
    Prowadzi pracę test-first w cyklu czerwony, zielony, refaktoryzacja, przy nowych funkcjach i poprawkach błędów.
  • 100tdd
    Prowadzi pracę test-first w cyklu czerwony, zielony, refaktoryzacja, przy nowych funkcjach i poprawkach błędów.
  • 100tdd
    Prowadzi pracę test-first w cyklu czerwony, zielony, refaktoryzacja, przy nowych funkcjach i poprawkach błędów.
  • 100tdd
    Pomaga budować funkcje i poprawiać błędy test-first, z testami integracyjnymi, w cyklu czerwony, zielony, refaktoryzacja.
  • 100tdd
    Prowadzi pracę test-first w cyklu czerwony, zielony, refaktoryzacja, przy nowych funkcjach i poprawkach błędów.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.