What problem does it solve?
Writing production code before writing tests leads to untested edge cases, hidden bugs, post-change regressions, and wasted time debugging avoidable issues. This Skill eliminates that risk by enforcing a strict test-first workflow that ensures every piece of code is validated against expected behavior before it is merged.
Core Features & Use Cases
- Strict RED-GREEN-REFACTOR Cycle: Enforces the mandatory order of writing a failing test first, writing minimal code to pass the test, then refactoring while keeping all tests green.
- TDD Anti-Pattern Protection: Blocks common rationalizations for skipping TDD, such as writing tests after implementation or keeping unverified "reference" code.
- Verification Checklists: Includes mandatory checkpoints to confirm each test was verified to fail before implementation, and all tests pass after changes.
- Use Case: Use this Skill when implementing any new feature, bug fix, or refactor to ensure all code is fully tested, prevent regressions, and create living documentation of expected behavior via automated tests.
Quick Start
Use the test-driven-development skill to implement the new user login feature by first writing a failing test for each required behavior (such as successful login with valid credentials and error handling for invalid passwords) before writing any production code.