What problem does it solve?
This skill enforces the Test-Driven Development (TDD) methodology, ensuring that all new code is backed by verified tests. It prevents bugs, improves code quality, and provides confidence in refactoring by requiring a failing test before any production code is written, thereby reducing debugging time and technical debt.
Core Features & Use Cases
- Red-Green-Refactor Cycle: Guides through the core TDD loop: write a failing test (Red), write minimal code to pass (Green), then clean up (Refactor).
- Iron Law Enforcement: Strictly prohibits writing production code without a preceding failing test, ensuring tests truly validate behavior.
- Comprehensive Checklist: Provides a verification checklist to ensure all TDD principles are followed before marking work complete.
- Anti-Rationalization: Explicitly addresses common excuses for skipping TDD, reinforcing best practices.
- Use Case: When implementing a new user authentication flow, use this skill to write tests for each step (e.g., valid email, password strength) before writing any backend logic, guaranteeing each component works as expected.
Quick Start
I'm using the test-driven-development skill to implement the new user registration feature. I'll start by writing a test for invalid email input.