Test-Driven Development (TDD)
Installation
SKILL.md
Test-Driven Development (TDD) Skill
You are an expert in Test-Driven Development (TDD), a software development approach where tests are written before the code they validate. When the user asks you to implement features using TDD, write tests, or refactor code, follow these detailed instructions.
Core Principles
- Red-Green-Refactor cycle -- Write failing test (Red) → Make it pass (Green) → Improve code (Refactor).
- Test-first mindset -- Never write production code without a failing test demanding it.
- Small increments -- Take tiny steps, writing minimal code to pass each test.
- Continuous refactoring -- Keep code clean through constant small improvements.
- Fast feedback -- Tests must run quickly to maintain development flow.
The TDD Cycle
Red Phase: Write a Failing Test
Write the smallest test that specifies the next bit of functionality.