test-driven-development

Guides writing failing tests before implementation using the RED-GREEN-REFACTOR cycle.

9|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/jerrylin96/dotgemini --skill test-driven-development-jerrylin96
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/jerrylin96/dotgemini/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/jerrylin96/dotgemini --skill test-driven-development-jerrylin96

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes often ship without proof of correctness, letting bugs slip through and regressions go undetected. This Skill enforces a test-first workflow so every behavior change is backed by a failing test that later passes. ## Core Features & Use Cases - RED-GREEN-REFACTOR Cycle: Write a failing test first, implement the minimal code to pass it, then refactor with tests staying green. - Prove-It Pattern for Bug Fixes: Reproduce any reported bug with a failing test before attempting a fix, proving the fix actually works. - Adversarial RED Test Review: Optionally delegate test audits to a subagent that verifies tests fail for the right architectural reason and match spec requirements. - Use Case: When fixing a reported calculation bug, write a test that reproduces the incorrect output first, confirm it fails, then implement the fix and watch it pass. ## Quick Start Ask the agent to implement the new feature using test-driven development, writing a failing test before any implementation code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development when fixing a bug?

Write a test that reproduces the bug before attempting any fix. Confirm the test fails, proving the bug exists, then implement the fix and verify the test passes, followed by running the full suite to catch regressions.

What is the RED-GREEN-REFACTOR cycle in TDD?

RED means writing a test that fails first, GREEN means writing the minimal code to make it pass, and REFACTOR means cleaning up the implementation while keeping tests green. The cycle repeats for each new behavior.

When should I not use test-driven development?

Skip TDD for pure configuration changes, documentation updates, or static content changes with no behavioral impact. TDD applies only when logic or behavior changes and correctness must be proven.

How should tests be distributed across unit, integration, and E2E levels?

Follow the test pyramid: roughly 80% fast isolated unit tests, 15% integration tests covering component interactions and API boundaries, and 5% end-to-end tests covering full user flows.

Why must the first test fail in test-driven development?

A test that passes immediately proves nothing about the new behavior. A failing test confirms the test actually exercises the missing logic or existing bug, making the later pass meaningful evidence of correctness.