What problem does it solve?
Developers often write code first, then tests, leading to untested edge cases, fragile code, and difficulty distinguishing new bugs from old ones. This skill enforces a rigorous Test-Driven Development (TDD) cycle, ensuring every piece of code is verified by a failing test first.
Core Features & Use Cases
- Red-Green-Refactor Cycle: Guides you through writing failing tests, implementing minimal code to pass, and then refactoring for clean design.
- Iron Law Enforcement: Mandates "NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST," preventing untested code from entering the codebase.
- Anti-Rationalization: Explicitly counters common excuses for skipping TDD, ensuring disciplined adherence even under pressure.
- Bug Fix Integration: Requires writing a failing test to reproduce any bug before fixing it, proving the fix and preventing regressions.
Quick Start
I'm implementing a new user authentication feature. Use the test-driven-development skill to guide me through the process, starting with a failing test.