test-driven-development

Apply red-green-refactor cycles to implement features from failing tests.

60|9|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/mvschwarz/openrig --skill test-driven-development-mvschwarz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/mvschwarz/openrig/tree/main/packages/daemon/specs/agents/shared/skills/process/test-driven-development
Command: npx skills add https://github.com/mvschwarz/openrig --skill test-driven-development-mvschwarz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development enforces writing tests before code to prevent regressions and to guide design through immediate feedback from failing tests.

Core Features & Use Cases

  • Red-Green-Refactor cycle drives development from failing tests to passing code.
  • Early validation helps catch regressions during features, bug fixes, and refactors across unit, integration, and system levels.
  • Encourages code quality and safer architectures by basing implementation on concrete test outcomes.

Quick Start

Write a failing test, implement minimal code to pass, and then 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 the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle in test-driven development means writing a failing test, implementing minimal code to pass it, and then refactoring for clarity. This workflow enforces immediate feedback to guide design and prevent regressions.

How do I start coding with a test-driven development workflow?

To start test-driven development, write a failing test that defines the desired behavior, implement the minimal code required to make it pass, and then refactor the implementation for clarity while keeping the test green.

Can I use mocks when applying test-driven development for bug fixes?

Test-driven development in this workflow requires real tests rather than mocks to verify correct behavior. It applies to bug fixes and refactors across unit, integration, and system levels where actual outcomes must be validated.

Why use test-driven development for software refactoring?

Test-driven development guards code quality during refactoring by basing implementation on concrete test outcomes. Starting with failing tests provides early validation that catches regressions and encourages safer architecture changes.

Does test-driven development work for system-level integration testing?

Test-driven development works across unit, integration, and system levels to verify correct behavior before coding. It enforces the red-green-refactor cycle to ensure features and refactors are validated through real tests.

When should I not use a test-first coding approach?

A test-first coding approach may not suit contexts where correct behavior cannot be clearly specified in advance or where rapid prototyping without regression guards is prioritized over enforced test-driven design and quality validation.