test-driven-development

Enforces Red-Green-Refactor cycles for feature development, bug fixes, refactoring, and behavior changes across codebases.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development (TDD) provides a structured workflow that prevents untested changes and reduces defects by requiring tests to define behavior before code is written.

Core Features & Use Cases

  • Red-Green-Refactor cycle as the default workflow for feature development, bug fixes, and refactors.
  • Clear guidance on when to apply TDD and how to avoid shortcuts that degrade quality.
  • Real-world examples and guardrails to maintain long-term code health.

Quick Start

Write a failing test that states the desired behavior, run it to confirm failure, implement the minimal production code to pass, and refactor for clarity.

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 how does the red-green-refactor cycle work?

Test-driven development enforces test-first workflows by requiring failing tests before implementation. It applies to feature development, bug fixes, refactoring, and behavior changes across codebases to prevent untested changes and reduce defects.

How do I start writing test-first code for a new feature?

To start test-first development, write a failing test stating the desired behavior, run it to confirm the failure, implement minimal production code to pass, and perform a clean refactor to maintain code clarity and health.

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

Use test-driven development for bug fixes, refactoring, and behavior changes across codebases. It provides structured workflows and guardrails that prevent untested changes, ensuring code reliability and maintaining long-term code health.

Does test-driven development work for modifying behavior in existing codebases?

Test-driven development applies to behavior changes across existing codebases. By defining desired behavior with a failing test first, you ensure minimal production code changes are validated, preventing untested modifications and reducing defects.

What are the limitations of test-first development and when should I avoid it?

Test-first development requires strict adherence to the red-green-refactor cycle, meaning you must avoid shortcuts that degrade quality. It may not suit rapid prototyping where immediate behavior validation is prioritized over long-term code health.