tdd

Guide users through the Red-Green-Refactor cycle for test-first development.

Updated Feb 18, 2026
One-click install
npx skills add https://github.com/zach-source/claude-plugins --skill tdd-zach-source
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/zach-source/claude-plugins/tree/main/plugins/testing/skills/tdd
Command: npx skills add https://github.com/zach-source/claude-plugins --skill tdd-zach-source

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) methodology, ensuring that code is written to pass predefined tests, thereby preventing bugs and guaranteeing functionality before implementation.

Core Features & Use Cases

  • Mandatory Test-First Approach: Enforces writing tests before any production code.
  • Red-Green-Refactor Cycle: Guides users through the iterative process of writing failing tests, writing minimal code to pass, and then refactoring.
  • Use Case: When developing a new feature, you would first write a test that describes the desired behavior. This test will initially fail. Then, you write the absolute minimum code required to make that test pass. Finally, you clean up the code while ensuring the test still passes.

Quick Start

Use the tdd skill to write a failing test for a new feature.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development for a new feature?

To implement test-driven development, write a failing test defining the desired behavior, write minimal code to pass the test, then refactor while ensuring the test passes. This enforces the Red-Green-Refactor cycle.

What is the Red-Green-Refactor cycle in unit testing?

The Red-Green-Refactor cycle in unit testing mandates writing a failing test, writing minimal production code to pass it, and cleaning up the code. This prevents bugs and guarantees functionality.

How to ensure code quality and prevent regressions during refactoring?

Ensure code quality and prevent regressions by mandating a failing test before writing any production code. This test-first approach guarantees existing functionality remains intact during refactoring.

Can I use test-driven development for bug fixes and refactoring?

Yes, you can use test-driven development for bug fixes and refactoring. It applies to all software development tasks by requiring a failing test prior to writing production code.

Why write tests before writing any production code?

Write tests before production code to enforce the iron law of test-driven development. This methodology prevents bugs and guarantees functionality by ensuring code is written to pass predefined tests.