tdd-playbook
Guides strict TDD (red/green/refactor), prioritizing domain unit tests and small steps.
When & Why to Use This Skill
The TDD Playbook is a specialized Claude skill designed to enforce rigorous Test-Driven Development (TDD) workflows. It guides developers through the essential Red-Green-Refactor cycle, ensuring high code quality by prioritizing domain-specific unit tests and incremental development. By focusing on the smallest possible invariants and minimal code changes, it helps eliminate technical debt and ensures robust software architecture from the first line of code.
Use Cases
- Feature Implementation: Systematically build complex business logic by defining requirements through failing tests before writing any production code.
- Legacy Code Refactoring: Safely modernize existing codebases by establishing a 'green' test baseline and performing small, verifiable refactoring steps.
- Logic Debugging: Resolve difficult bugs by isolating them into the smallest possible failing test cases to ensure the fix is precise and permanent.
- Developer Mentoring: Serve as an automated coach for junior engineers to instill disciplined engineering habits and the 'minimal code to pass' philosophy.
| name | tdd-playbook |
|---|---|
| description | Guides strict TDD (red/green/refactor), prioritizing domain unit tests and small steps. |
| allowed-tools | Read, Edit, Grep, Glob |
TDD Playbook (training)
- One failing test at a time.
- Minimal code to pass.
- Refactor only with green tests.
- Prefer domain tests over UI tests. If stuck: restate smallest invariant and propose the next tiny test.