Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

tdd

/tdd

Prowadzi ścisłą pętlę red-green-refactor dla jednego kryterium akceptacji: najpierw failujący test, potem minimalny kod.

Licencja
MIT
Ostatnia zmiana repozytorium
09.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 09.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

Prowadzi ścisłą pętlę red-green-refactor dla jednego kryterium akceptacji: najpierw failujący test, potem minimalny kod.

Argumenty

/tdd <S-NNN AC#> | <behaviour description>
Oryginalny opis (EN)

Runs a strict red-green-refactor loop for one acceptance criterion or behaviour: write the failing test, show the failure, write the minimum code, show it passing, refactor with tests green. Use inside /dev-story, or whenever the user wants to build or fix behaviour test-first.

Jak działa

  1. Inputs
  2. Phases
  3. Rules
  4. Rigor
  5. Next step
Sekcje z nagłówków SKILL.md, w oryginale · 69 linii, 382 słów
Podgląd SKILL.md
---
name: tdd
description: "Runs a strict red-green-refactor loop for one acceptance criterion or behaviour: write the failing test, show the failure, write the minimum code, show it passing, refactor with tests green. Use inside /dev-story, or whenever the user wants to build or fix behaviour test-first."
argument-hint: "<S-NNN AC#> | <behaviour description>"
user-invocable: true
allowed-tools: Read, Glob, Grep, Write, Edit, AskUserQuestion, Bash(bash .claude/scripts/*), Bash(npx vitest run*), Bash(npx jest*), Bash(pytest*), Bash(go test*), Bash(npx playwright test*)
model: sonnet
---

# TDD

One behaviour at a time, three steps, each shown to the user. The rule: **no
production code is written until a test has been seen failing for the right
reason.**

## Inputs

- The AC (Given/When/Then) or the behaviour description
- The story's `## Tests` map for the planned test location
- `.claude/docs/stack-matrix.md` for the test runner and conventions
- `.claude/rules/test-standards.md`

## Phases

### Phase 1: Choose the test level

| Behaviour | Level | Example |
|---|---|---|
| Pure rule (pricing, validation, permissions logic) | unit | `tests/unit/pricing.test.ts` |
| Endpoint / server action / query | integration (real test DB) | `tests/integration/projects.test.ts` |
| Component behaviour | component (Testing Library) | `src/components/__tests__/InviteForm.test.tsx` |
| User journey across pages | e2e (Playwright) | `tests/e2e/signup.spec.ts` |

Pick the lowest level that proves the AC. Name the test after the behaviour,
not the function (`rejects an expired reset token`).

### Phase 2: Red

Write the test, then ask to write it ("May I write this test to `<path>`?").
Run only that test. Show the failure output. It must fail **because the
behaviour is missing**: an import error or typo is not a valid red; fix the test
and run it again.

### Phase 3: Green

Write the **minimum** code that makes the test pass. No extra features, no
speculative abstractions. Show the diff, ask before writing, run the test, show
it passing.

### Phase 4: Refactor

With the test green, improve names, remove duplication, extract functions
(standards: ≤ 40 lines, complexity ≤ 10). Run the related tests after each change.
Skip if nothing needs it; say so.

### Phase 5: Repeat or finish

Next AC → Phase 1. When all are done, run the full suite
(`bash .claude/scripts/test-run.sh all`) and report.

## Rules

- Deterministic tests: fixed clock, seeded data, mocked third-party HTTP (MSW,
  respx, httptest), never real payment, email or AI calls.
- Query UI by role and label; never by CSS class.
- Never change a test's expectation to make code pass unless the spec changed;
  then say so and update the spec too.

## Rigor

Under `minimal`, `/tdd` is opt-in and the hook only warns. Under `full`, the
`tdd-guard` hook blocks source changes without a matching test change.

## Next step

Back to `/dev-story` Phase 4, or `/story-done`.

Wersje

RepozytoriumWynikLicencja
Ta strona · chatquill/claude-code-websites100MIT
kdlbs/kandev100AGPL-3.0
sentimony/skills100MIT
sentimony/skills100MIT
TerminalSkills/skills100Apache-2.0
duronext/jig100MIT
xoai/sage100MIT
rolemodel/skills100MIT
matteocodogno/wellforge100MIT

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

Pobrania w ostatnich 30 dniach: 0 · ranking

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

Podobne skille

  • 100red-green-refactor
    Prowadzi przez cykl TDD red-green-refactor: najpierw test, który pada, potem minimalny kod przechodzący test i refaktoryzacja przy zielonych testach.
  • 100tdd-workflow
    Pomaga zacząć nową funkcję od padających testów, a potem wdrożyć minimalny kod, który je przechodzi (Red, Green, Refactor).
  • 100test-driven-development
    Prowadzi przez TDD: pętlę red-green-refactor, wybór kolejnego testu, projektowanie przez testy oraz sytuacje, w których TDD ma sens lub nie.
  • 100tdd-expert
    Prowadzi pracę ścisłym cyklem Red-Green-Refactor: jeden padający test, minimalny kod i refaktoryzacja na zielonym, z planowaniem listy testów i przykładowym cyklem kata.
  • 100tdd-feature
    Dostarcza szkielet red-green-refactor do budowy nowych funkcji w TDD: najpierw padające testy, potem implementacja, która je przechodzi.
  • 90tdd-guide
    Prowadzi pracę test-first: najpierw nieprzechodzące testy, cykl RED, GREEN, REFACTOR, dla funkcji, błędów i refaktoryzacji zmieniających zachowanie.

Uwagi i zgłoszenia

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