test-driven-development
Installation
SKILL.md
Test-Driven Development (TDD)
Write the test first. Watch it fail. Write minimal code to pass. Then refactor.
Core Principle
If you didn't watch the test fail, you don't know if it tests the right thing. Production code only after a failing test. No exceptions unless the user explicitly approves (e.g. throwaway prototype, generated config).
When to Activate
- Implementing a new feature or function
- Fixing a bug (write failing test that reproduces the bug first)
- Refactoring (tests protect behavior)
- User asks for "TDD", "test first", or "red-green-refactor"
Do not skip for "quick fix", "too simple", or "I'll add tests after." Tests written after code pass immediately and do not prove the test is correct.