test-driven-development

Enforce test-first development with failing tests before production code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/HTRamsey/claude-config --skill test-driven-development-htramsey
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/HTRamsey/claude-config/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/HTRamsey/claude-config --skill test-driven-development-htramsey

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces the Red-Green-Refactor cycle and test-first development as the default approach.

Core Features & Use Cases

  • The Iron Law: No production code without a failing test
  • Red-Green-Refactor workflow and recommended practices
  • Guidance on async tests and mutation testing

Quick Start

Write a failing test, run tests to see red, implement minimal code to pass, then refactor while keeping tests green, and repeat for new features.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement test-driven development in my workflow?

Test-driven development requires writing a failing test before any production code. Write your test, run it to see red, implement minimal code to pass, then refactor while keeping tests green. Repeat this red-green-refactor cycle for each feature or bug fix.

What's the red-green-refactor cycle and why does it matter?

Red-green-refactor is the core TDD workflow: red (write a failing test), green (write minimal code to pass), refactor (improve code without breaking tests). This cycle prevents unverified production code and catches bugs early.

Can I use TDD with async code and flaky tests?

Yes. TDD covers condition-based waiting strategies for async tests to ensure they're reliable and not flaky. The approach requires real tests during development, not mocks, to maintain test integrity throughout the workflow.

What testing anti-patterns should I avoid in TDD?

Avoid exploratory or untested coding while changing behavior, relying on mocks as substitutes for real tests during development, and skipping the red phase. TDD mandates a failing test first—no production code changes without test-driven verification.

When should I apply TDD to my codebase?

Apply TDD when implementing features, fixing bugs, adding tests, fixing flaky tests, refactoring, or changing behavior. The Iron Law enforces it universally: no production code without a failing test, ensuring all changes remain verified.