test-driven-development

Enforce a failing test before production code with RED-GREEN-REFACTOR workflow.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents regressions and accidental bugs by forcing you to write a failing test before any production code is added or modified.

Core Features & Use Cases

  • Enforces the TDD Iron Law: no production code without a failing test first, with a mandatory RED verification step.
  • RED → GREEN → REFACTOR loop: write one failing test, confirm it fails for the expected reason, make the minimal change to pass, then refactor while staying green.
  • Bugfix discipline: every bugfix must include a regression test that reproduces the original failure.

Quick Start

Use test-driven-development when you start implementing or fixing a feature, and ask your agent to write a single failing test first, verify the failure, then write the minimal code to make it pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce test-driven development when writing new software features?

Test-driven development is enforced by requiring a failing test before any production code is written, followed by a strict RED, GREEN, REFACTOR loop with mandatory verification steps and minimal-change rules.

What is the best way to add regression testing to a bugfix workflow?

Regression testing for a bugfix requires writing a test that reproduces the original failure first, verifying it fails for the expected reason, then making the minimal code change to pass it.

How does the red green refactor loop work in TDD?

The red green refactor loop works by writing one failing test, confirming it fails for the expected reason, making the minimal change to pass the test, then refactoring the code while staying green.

Can I use TDD to prevent accidental bugs in existing software development projects?

Yes, test-driven development prevents accidental bugs and regressions by strictly enforcing the TDD Iron Law, ensuring no production code is added or modified without a failing test first.

When do I need to apply quality gates in my testing workflow?

Quality gates are needed when implementing new functionality or fixing defects, ensuring that minimal-change rules and regression-test requirements are satisfied before shipping any production code.