Test-driven development with red-green-refactor. Use when the user wants test-first implementation, asks for TDD, mentions red-green-refactor, wants integration tests, or when a feature/bug should be built as thin vertical slices with public-interface tests. Adapted from mattpocock/skills.
Write behavior tests through public interfaces, then implement the smallest vertical slice that turns the test green.
No horizontal slicing. Do not write every test first and then all implementation. Use one thin, demoable slice at a time:
Good tests verify what the system does:
Bad tests verify implementation:
Read tests.md when choosing the test seam or reviewing test quality. Read mocking.md before adding mocks. Read refactoring.md after the green step when deciding what to clean up.
For each slice, record:
| Slice | Red test | Green change | Refactor | Proof |
|---|
Mark slices:
AFK: agent can implement and verify aloneHITL: needs human product/taste/authority inputtests for general test writing.diagnosing-bugs for repro-first debugging.agent-iteration-loop for execution cadence.no-sus-code-doctor for pre-ship review.Upstream: github.com/mattpocock/skills/skills/engineering/tdd/SKILL.md at 5d78bd0903420f97c791f834201e550c765699f8.