Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

tdd

/tdd

Wymusza ścisły cykl czerwony, zielony, refaktoryzacja i nie pozwala pisać kodu produkcyjnego przed nieudanym testem.

Repozytorium
sift-coder ↗
Licencja
MIT
Ostatnia zmiana repozytorium
03.06.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 03.06.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

Wymusza ścisły cykl czerwony, zielony, refaktoryzacja i nie pozwala pisać kodu produkcyjnego przed nieudanym testem.

Wyzwalacze z opisu

write test firsttest-driven
Oryginalny opis (EN)

Use when the user invokes TDD discipline, says "write test first", "test-driven", "/tdd". Strict red-green-refactor. Refuses to write production code before a failing test exists.

Jak działa

  1. Method
  2. Rules — non-negotiable
  3. Output shape per cycle
  4. Anti-patterns
  5. When NOT to use
  6. Subagent dispatch
  7. Memory capture
  8. Value over native CC
Sekcje z nagłówków SKILL.md, w oryginale · 60 linii, 431 słów
Podgląd SKILL.md
---
name: tdd
description: Use when the user invokes TDD discipline, says "write test first", "test-driven", "/tdd". Strict red-green-refactor. Refuses to write production code before a failing test exists.
---

# tdd

Strict TDD. Test first, fail first, then code, then refactor. Non-negotiable order.

## Method

For each unit of behaviour:

1. **Red.** Write **one** test that asserts the desired behaviour. Run it. **It must fail** — verify the failure mode is the absent behaviour, not a syntax error or wrong import.
2. **Green.** Write the **simplest** code that makes the test pass. Hardcoded values are fine if the test only asserts one input. Run all tests. All green.
3. **Refactor.** With all tests green, improve structure. Extract, rename, dedup. Run tests after every change — must stay green.
4. **Next.** New test that triggers a generalisation. Repeat.

## Rules — non-negotiable

- **No production code without a failing test.** If you find yourself writing code and there's no failing test for it, stop, write the test.
- **Test must have actually failed.** If you wrote a test and it passed immediately, you wrote the wrong test or the code was already there. Diagnose; don't claim done.
- **Tests are first-class.** Bad test names, no assertions, mocking the thing under test = same as no test.
- **Refactor only when green.** Never refactor on a failing test (you lose your ground truth).
- **One test at a time.** Don't write three tests then implement all three.

## Output shape per cycle

```
Cycle N
  Behaviour:  <one sentence>
  Red:        <test path>:<line>  ← failed with: <quoted error>
  Green:      <smallest change to make it pass>
  Tests:      M passing
  Refactor:   <what changed>  | tests: M passing
```

## Anti-patterns

- Writing the production code "in your head" before the test (cheating)
- Test that asserts implementation detail (e.g. private method called) instead of behaviour
- Big-bang test that asserts 5 behaviours — split it
- Refactoring during red (you have no safety net)
- Skipping refactor because "it works" (debt accumulates fast)

## When NOT to use

- Spike / exploration code (use `/siftcoder:dream` or scratch)
- Pure config / data file changes
- Generated code (e.g. graphql codegen) — test the inputs, not the output

## Subagent dispatch

- `tester` agent (if installed) — knows behaviour-coverage gates, not just line coverage
- `Plan` to break a feature into TDD-shaped units of behaviour before starting

## Memory capture

Each red-green-refactor cycle is a captured event. Future "how do we test X" queries surface prior TDD cycles in the same module.

## Value over native CC

CC will write tests if asked. CC won't refuse to write code first if you ask it for code first. This skill enforces the order. The discipline IS the value.

Wersje

RepozytoriumWynikLicencja
Ta strona · ialameh/sift-coder100MIT
kdlbs/kandev100AGPL-3.0
sentimony/skills100MIT
TerminalSkills/skills100Apache-2.0
duronext/jig100MIT
xoai/sage100MIT
rolemodel/skills100MIT
j0hanz/j0hanz-marketplace100MIT
mthines/agent-skills100MIT

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

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

Podobne skille

  • 100test-driven-development
    Pomaga pisać testy przed kodem: cykl czerwony-zielony-refaktoryzacja, wzorce testów dla stosu, nazewnictwo testów i mockowanie.
  • 100strict-tdd
    Egzekwuje dyscyplinę TDD: blokuje pisanie kodu produkcyjnego, dopóki nie istnieje test, który się nie przechodzi, jako barierę Red-Green-Refactor w ramach sesji, włączaną przez /strict-tdd.
  • 90tdd-cycle
    Prowadzi pętlę TDD czerwony-zielony-refaktor z obowiązkowym sprawdzeniem fałszywie dodatnich wyników testu.
  • 100test-driven-development
    Wymusza cykl red-green-refactor w TDD: żadnego kodu produkcyjnego bez wcześniejszego testu, który nie przechodzi, przy funkcjach, poprawkach błędów i kodzie produkcyjnym.
  • 100tdd-with-agents
    Egzekwuje TDD w cyklu czerwony, zielony, refaktoryzacja we wszystkich warstwach, wraz ze wzorcami testów.
  • 84test-driven-development
    Wymusza cykl czerwony-zielony-refaktoryzacja przed napisaniem kodu funkcji lub poprawki błędu.

Uwagi i zgłoszenia

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