test-driven-development

Enforce a test-first workflow with failing tests before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams prevent defects by enforcing a test-first workflow where a failing test guides the minimal production code implementation.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement the smallest code to pass, then refactor with confidence.
  • Iron Law guardrails: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST to prevent unverified changes.
  • Deterministic, reusable testing patterns for features, bug fixes, and refactors that ensure regressions are caught early.

Quick Start

Write a failing test for the desired behavior, run the test to confirm failure, then implement the minimal production code to pass and repeat.

Frequently Asked Questions about test-driven-development

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

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

To start test-driven development, write a failing test for the desired behavior, run it to confirm failure, implement the minimal production code to pass, then refactor. This Red-Green-Refactor cycle ensures reliable code by validating behavior before implementation.

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

The Red-Green-Refactor cycle is a test-driven development workflow where you write a failing test, implement the smallest code to pass it, then refactor with confidence. It enforces an iron law of no production code without a failing test first to prevent unverified changes.

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

Yes, test-driven development applies to bug fixes and refactors by guiding teams through reproducible cycles. It provides deterministic, reusable testing patterns that ensure regressions are caught early and validates behavior with minimal, real code-driven tests.

What's the best way to prevent defects when adding new code?

The best way to prevent defects is enforcing a test-first workflow where a failing test guides the minimal production code implementation. This quality assurance approach provides clear guardrails and prevents unverified changes from introducing regressions.

Why does test-driven development require a failing test before writing production code?

Test-driven development requires a failing test first as an iron law guardrail to prevent unverified changes. This ensures the test actually validates the desired behavior and confirms that production code implementation is necessary and correct.

Do I need any specific testing frameworks to follow the TDD workflow?

No specific testing frameworks are required. The test-driven development workflow applies deterministic, reusable testing patterns that guide teams through Red-Green-Refactor cycles using minimal, real code-driven tests to validate behavior regardless of framework.