test-driven-development

Enforce a red-green-refactor workflow by writing failing tests before production code.

11|2|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/aiaiohhh/claude-skills-library --skill test-driven-development-aiaiohhh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/aiaiohhh/claude-skills-library/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/aiaiohhh/claude-skills-library --skill test-driven-development-aiaiohhh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides developers to adopt Test-Driven Development (TDD) to ensure code correctness by writing tests before implementation.

Core Features & Use Cases

  • Red-Green-Refactor workflow: iterate via failing tests, minimal code, and refactoring.
  • TEST-FIRST discipline: enforce failing tests before production code.
  • Educational guidance: sample patterns, examples, and best practices for TDD.

Quick Start

Begin by writing a failing test, run it to observe the failure, then implement minimal code to pass and refactor while keeping tests green.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow in test-driven development iterates code by writing a failing test, implementing minimal production code to pass it, then refactoring while keeping tests green.

How do I write failing tests before production code for feature development?

To write failing tests before production code, define expected feature behavior with a unit test, run it to observe failure, then implement minimal code to pass.

When should I use test-first discipline for bug fixes?

Use test-first discipline for bug fixes by writing a failing test that reproduces the bug before changing production code, ensuring the fix resolves the specific defect.

Does test-driven development work for refactoring existing software projects?

Test-driven development works for refactoring existing software projects by maintaining green tests while restructuring code, ensuring minimal production code changes preserve functionality.

Why write minimal production code to pass unit testing in TDD?

Writing minimal production code to pass unit testing in TDD prevents over-engineering, ensures every code path is test-covered, and strictly satisfies the failing test requirements.