test-driven-development

Enforce Test-Driven Development through the Red-Green-Refactor cycle.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) methodology to ensure code is robust, reliable, and meets requirements before implementation, preventing bugs and regressions.

Core Features & Use Cases

  • Mandatory Test-First Approach: Guarantees that no production code is written without a preceding failing test.
  • Red-Green-Refactor Cycle: Guides users through the iterative process of writing failing tests, minimal code to pass, and then refactoring.
  • Use Case: When developing a new user authentication feature, you would first write a test that fails because the feature doesn't exist, then write the minimal code to make that test pass, and finally refactor the code while ensuring all tests remain green.

Quick Start

Always write a failing test before writing any implementation code for new features or bug fixes.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the Test-Driven Development Red-Green-Refactor cycle and how does it work?

The Test-Driven Development (TDD) Red-Green-Refactor cycle involves writing a failing test, creating minimal code to pass it, and then refactoring. This iterative process ensures all production code is preceded by a failing test to guarantee robustness and prevent regressions.

How do I start writing code for a new feature using Test-Driven Development?

To start writing code for a new feature using Test-Driven Development, always write a failing test first that defines the expected behavior. Then write the minimal implementation code required to make that specific test pass before proceeding to the refactoring stage.

Can I use Test-Driven Development for bug fixes and refactoring existing code?

Yes, Test-Driven Development is fully applicable to both bug fixes and refactoring existing code. It requires writing a failing test that reproduces the bug or validates the refactored behavior, ensuring changes do not introduce regressions and maintain strict code quality.

Why should I write a failing test before writing any production code?

You should write a failing test before production code to enforce a strict test-first approach. This guarantees the code meets requirements immediately, prevents bugs, and stops unnecessary implementation code from being written without a prior failing test to validate its purpose.

What happens to implementation code written without a prior failing test?

Implementation code written without a prior failing test violates strict Test-Driven Development protocols. The methodology requires adherence to this testing discipline and mandates the deletion of any production code written without a preceding failing test to ensure quality.