A discipline an agent applies when adding or changing behavior. Start with a preflight: decide whether TDD adds regression value, then whether the project already has usable test infrastructure for that behavior. Only then enter RED → GREEN → REFACTOR. Synthesized from four public TDD skills (mattpocock, obra/superpowers, NousResearch/hermes-agent, affaan-m/ECC).
- Preflight before RED — decide whether the change warrants TDD and whether the affected behavior is testable with the project's existing setup.
- Never introduce test infrastructure silently — ask first; if declined, prioritize the current task with direct verification; if approved, present a project-specific engineering plan and wait for confirmation.
- Write the test first, watch it fail, write the minimum code to pass, refactor on green.
- No production code without a failing test — code written before its test gets deleted.
- One behavior per cycle — vertical tracer bullets, never all-tests-then-all-code.
- Test observable behavior through the public interface, not implementation details.
- A test only counts once you've watched it fail for the right reason.
Pure markdown, language- and framework-agnostic — preflight selects the path; the cycle stays strict once TDD applies.
Core
| Topic | Description | Reference |
|---|---|---|
| Preflight | Decide TDD value, detect usable project test infrastructure, ask before introducing it | core-preflight |
| Cycle | RED → GREEN → REFACTOR mechanics, watch-it-fail mandate, per-cycle checklist | core-cycle |
| Discipline | The Iron Law, delete-and-restart, rationalization rebuttals, red flags | core-discipline |
| Tracer Bullets | Vertical slices vs horizontal slicing; planning what to test | core-tracer-bullets |
Features
| Topic | Description | Reference |
|---|---|---|
| Good Tests | Behavior over implementation, the brittle-test smell, anti-patterns, mocking | features-good-tests |
| Coverage | Test types, edge/error coverage, the RED gate, evidence trail | features-coverage |