tdd
Originally fromcitypaul/dotfiles
Installation
SKILL.md
Test-Driven Development
When to use
- New logic or behavior
- Bug fixes
- Changes that could break existing behavior
Process
- Understand the requirement and the relevant code.
- Write a failing test for the behavior you want.
- Write the minimum code needed to make the test pass.
- Simplify the code and tests while they stay green.
- Run the full relevant test suite before finishing.
Verification
- The new behavior has a failing-then-passing test
- Bug fixes include a reproduction test
- Tests describe behavior, not implementation details
- The final test suite passes
Rules
- Make the smallest safe change that satisfies the failing test.
- Preserve existing contracts unless the task explicitly changes them.
- Add tests for failure paths when they matter to the behavior.
- Do not write implementation code before you have a failing test for the behavior.
- Skip TDD for documentation, formatting, or non-behavioral scaffolding work.
- Prefer testing behavior over internals.
- Use mocks sparingly. Prefer real boundaries when practical.
Related skills
More from owainlewis/blueprint
debug
Debug systematically: observe, hypothesize, test, fix, verify.
92refactor
Refactor code to simplify it without changing behavior.
92plan
Break a project, phase, spec, or rough request into discrete tasks that can be stored in a task management system and delegated to AI agents.
92spec
Write the requested implementation spec to a file, tailor detail to the task, and pause for human review.
90coverage
Evaluate test coverage and fill real gaps with high-value tests.
86commit
Stage and commit the intended changes with a clear message.
83