tdd-cycle
Installation
SKILL.md
TDD Cycle Skill
Goal
Implement any feature using strict Test-Driven Development: write the failing test first, implement minimal code to pass it, then refactor. The false-positive check is mandatory.
Steps
Phase 1 — Red (Failing Test)
-
Understand the requirement
- Read the relevant task from project/TASKS.md or the user's description
- Identify the expected behavior as a verifiable predicate
- Write the requirement in EARS format if not already: "WHEN [X] THE SYSTEM SHALL [Y]"
-
Write the failing test
- Create the test file if it doesn't exist (mirrors source file path in tests/ directory)
- Write the minimal test that captures the expected behavior
- Use descriptive test names:
"should return 422 when email is invalid" - Test ONE behavior per test case (single assertion focus)