TestDrivenDevelopment

Enforce the red-green-refactor cycle with failing tests before production code.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/vdemeester/home --skill testdrivendevelopment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: TestDrivenDevelopment
Source: https://github.com/vdemeester/home/tree/main/dots/.config/claude/skills/TestDrivenDevelopment
Command: npx skills add https://github.com/vdemeester/home --skill testdrivendevelopment

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a disciplined test-driven development workflow (red-green-refactor) and prevents production code without failing tests first.

Core Features & Use Cases

  • Iron Law: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.
  • Red-Green-Refactor cycle guidance with language-agnostic examples.
  • Clear steps to write a failing test, verify failure, implement minimal code, and refactor with tests.
  • Quick-start prompts to initiate TDD in any language and framework.

Quick Start

Example: start a Red phase by writing a failing test for a new function, then run tests to observe failure.

Frequently Asked Questions about TestDrivenDevelopment

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

FAQPage Schema
How do I implement test-driven development to ensure code quality?

Test-driven development enforces writing a failing test before any production code, following the red-green-refactor cycle. Write a test that fails, implement minimal code to pass it, then refactor while tests remain green. This discipline ensures every line of production code has test coverage and satisfies the core requirement: no production code without a failing test first.

What is the red-green-refactor cycle and why does it matter?

Red-green-refactor is the TDD workflow: write a failing test (red), implement minimal code to pass it (green), then improve the code without breaking tests (refactor). This cycle prevents untested code, catches bugs early, and maintains a safety net as you evolve the codebase across any language or framework.

Can I use test-driven development to fix bugs more reliably?

Yes. Write a failing test that reproduces the bug, verify the test fails, then implement the fix to make it pass. This approach ensures the bug is actually fixed and prevents regression, as the test becomes permanent coverage for that specific issue.

How do I start writing tests first for a new feature?

Begin the red phase: write a failing test that describes the feature's expected behavior in your language and framework. Run it to confirm failure, then implement the minimal code needed to pass. Finally, refactor for clarity while keeping tests green throughout.

Does test-driven development work with any programming language or framework?

Yes. TDD is language-agnostic and framework-independent. The red-green-refactor discipline applies whether you're working with Java, Python, JavaScript, Go, or any other language; the core principle—no production code without a failing test—remains constant.

What happens if I write production code without a failing test first?

You violate TDD's iron law and lose its quality guarantees. Code written without a failing test lacks immediate test coverage, increases the risk of untested edge cases, and breaks the discipline that ensures every feature and fix is validated before deployment.