test-driven-development

Enforce test-first development using Red-Green-Refactor with failing tests before production code.

3.9k|296|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/parcadei/Continuous-Claude --skill test-driven-development-parcadei
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/parcadei/Continuous-Claude/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/parcadei/Continuous-Claude --skill test-driven-development-parcadei

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces test-driven development to ensure code correctness before implementation.

Core Features & Use Cases

  • Red-Green-Refactor: Red tests, green implementation, refactor.
  • No production code without failing tests: The Iron Law.
  • Use Case: Ensure new features are test-driven.

Quick Start

The workflow emphasizes writing tests first and running them before implementing.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is test-driven development and why should I use it?

Test-driven development (TDD) is a discipline where you write failing tests before implementing production code, ensuring functionality is verified before deployment. It prevents unverified code from reaching production and catches bugs early, improving overall code quality and reliability.

How do I start with the red-green-refactor workflow?

Red-green-refactor is TDD's core cycle: write a failing test (red), write minimal code to pass it (green), then refactor for clarity. Begin by writing a test for the desired behavior, run it to confirm failure, implement code to pass the test, then improve the implementation while keeping tests green.

Can I apply test-driven development to existing code and bug fixes?

Yes. TDD applies to new features, bug fixes, refactoring, and behavior changes. For bug fixes, write a failing test that reproduces the bug, then fix the code to pass it. This ensures the bug stays fixed and documents the expected behavior.

What happens if I write production code without a failing test first?

TDD enforces the Iron Law: no production code without a failing test. This rule prevents untested functionality from entering the codebase. Exceptions require human review to ensure deliberate decisions about test coverage and risk.

How much test coverage do I need in test-driven development?

TDD requires clear test coverage for all new code. You deliver minimal, passing code alongside tests that verify its behavior. Coverage should be sufficient to prevent regressions and document the feature's contract, not necessarily 100%.

What's the difference between test-driven development and writing tests after code?

TDD writes tests first to define requirements, driving design and preventing untested code. Writing tests after code often misses edge cases and may test implementation rather than behavior. TDD ensures tests guide development from the start.