About tdd
A test-driven development skill that guides coding agents through a failing test, the smallest passing implementation, and refinement. It is intended for behavior changes and bug fixes, with explicit exceptions for documentation, formatting, and non-behavioral scaffolding.
Key features
- 01Read request, sources, and relevant code
- 02Prove failure with a focused test
- 03Implement the minimum passing change
- 04Refine while keeping tests passing
- 05Run relevant checks and report results
Use cases
- 01Add behavior covered by a new test
- 02Reproduce and fix a bug
- 03Validate failure paths for a change
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ owainlewis/ blueprint --skill tddAfter installing, type/tddin Claude Code to confirm it loaded.
Details
From the project READMETDD
- Read the request, its sources, and the relevant code. Ask before writing tests only when a missing decision would change behavior, interfaces, or checks.
- Red: write the smallest failing test that proves the behavior or reproduces the bug. Run it and confirm it fails for the expected reason.
- Green: write the minimum implementation that passes. Don't change existing interfaces or user-visible behavior unless the task requires it. Add failure-path tests where they matter.
- Refine: simplify code and tests while they keep passing. Run focused checks, then wider ones.
- Report the test that failed before, passes after, and final checks.
Rules
- No implementation code before a failing test for the behavior.
- State low-risk assumptions and keep moving.
- Tests describe behavior, not implementation details.
- Prefer real boundaries over mocks when practical.
- Skip TDD for docs, formatting, or non-behavioral scaffolding.
Comments
Markdown supported