tdd

atusy's avatarfrom atusy

Guide Test-Driven Development using Kent Beck's Red-Green-Refactor cycle. Use when writing tests, implementing features via TDD, or following plan.md test instructions.

⭐20stars🔀0forks📁View on GitHub🕐Updated Dec 31, 2025

When & Why to Use This Skill

This Claude skill facilitates professional Test-Driven Development (TDD) by enforcing Kent Beck's disciplined Red-Green-Refactor cycle. It helps developers improve code reliability and maintainability by guiding them through writing failing tests, implementing minimal behavioral changes, and performing structural refactoring without breaking functionality.

Use Cases

  • New Feature Development: Implementing robust software components from scratch by defining requirements through failing tests before writing production code.
  • Legacy Code Refactoring: Safely restructuring existing codebases by establishing a 'Red' baseline to ensure no regressions occur during the 'Refactor' phase.
  • Complex Plan Execution: Following detailed technical instructions (such as plan.md) that require strict adherence to incremental testing and commit sequences.
  • Code Quality Assurance: Reducing technical debt and bug density by ensuring every line of code is justified by a corresponding test case.
nametdd
descriptionGuide Test-Driven Development using Kent Beck's Red-Green-Refactor cycle. Use when writing tests, implementing features via TDD, or following plan.md test instructions.

INSTRUCTIONS

Follow Kent Beck's TDD and Tidy First principles using the following workflow. None of the phases can be skipped.

  1. RED - /tdd:red - Write ONE small failing test
  2. GREEN - /tdd:green - Make minimal behavioral change, then commit
  3. REFACTOR - /tdd:refactor - Improve structure without changing behavior, commit each step

Workflow Pattern

RED → GREEN → commit → REFACTOR (commit each) → satisfied? ──yes──→ done
 ↑                                                  │
 └───── no (more behavior needed OR triangulate) ───┘