| name | tdd |
| description | Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
|
| allowed-tools | Read, Write, Edit, Bash, Grep, Glob |
Test-Driven Development
Tests verify behavior through public interfaces, not implementation details. Always use vertical slices (one test -> one implementation -> repeat), never horizontal slices.
Additional resources
Workflow
1. Planning
2. Tracer Bullet
Write ONE test that confirms ONE thing about the system:
RED: Write test for first behavior -> test fails
GREEN: Write minimal code to pass -> test passes
3. Incremental Loop
For each remaining behavior:
RED: Write next test -> fails
GREEN: Minimal code to pass -> passes
- One test at a time
- Only enough code to pass current test
- Don't anticipate future tests
4. Refactor
After all tests pass:
Never refactor while RED. Get to GREEN first.
Checklist Per Cycle
Completion Criteria
Gotchas
- Iterate this section: After each TDD session, append new gotchas here