What problem does it solve?
This skill solves the problem of writing fragile, implementation-coupled tests that break during code refactors, and helps developers build reliable, behavior-focused features using test-driven development.
Core Features & Use Cases
- Red-Green-Refactor Workflow: Guides you through the core TDD loop of writing a failing test first, implementing minimal code to pass it, then refactoring safely.
- Behavior-Focused Testing: Teaches you to write integration-style tests that verify public interface behavior, so they survive internal code changes and refactors.
- Anti-Pattern Avoidance: Explicitly warns against the horizontal slicing anti-pattern of writing all tests first then all implementation, which leads to low-quality, behavior-agnostic tests.
- Use Case: For example, when adding a new user profile update feature to a web app, use this skill to write a test for the profile update behavior first, implement the minimal code to pass the test, then refactor the code without breaking existing functionality.
Quick Start
Use the tdd skill to implement the new user password reset feature by first writing a test for successful password reset with a valid token, then building the minimal code to pass that test.