tdd

Writes failing regression tests before fixing bugs with clear cheap test paths.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/gmackie/agent-skills --skill tdd-gmackie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/gmackie/agent-skills/tree/main/skills/tdd
Command: npx skills add https://github.com/gmackie/agent-skills --skill tdd-gmackie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug fixes often ship without regression coverage, letting the same defect return later. This Skill enforces a disciplined test-driven workflow that reproduces the bug as a failing test before any production code changes, then verifies the fix makes it pass. ## Core Features & Use Cases - Failing-Test-First Workflow: Guides a seven-step process from understanding the bug through writing the failing test, fixing the code, and rerunning validation. - Pragmatic Skip Logic: Explicitly avoids forcing impractical tests when harness setup, brittle mocks, or slow end-to-end infrastructure would outweigh the value, substituting the closest executable regression check instead. - Evidence-Based Reporting: Requires naming the failing-before test, the passing-after run, and nearby validation performed rather than just reporting the outcome. - Use Case: A user reports that a date parser returns the wrong timezone offset. The Skill writes a focused unit test that fails on the current behavior, applies the minimal fix, and confirms the test passes along with adjacent test suites. ## Quick Start Ask the agent to fix this bug using TDD by writing a failing regression test first, then making the minimal code change to make it pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I fix a bug using test-driven development?▼

Identify the intended behavior and smallest reproduction, write a focused test that fails on the current buggy behavior, then make the minimal production change until the test passes. Finish by running adjacent tests, type checks, or lint to catch broader risk.

How to write a regression test for a bug fix?▼

Choose the narrowest existing test type for the affected codepath and encode the intended behavior, not the current implementation. Confirm the test fails for the intended reason before editing production code, then verify it passes after the fix.

When should I skip writing a failing test for a bug?▼

Skip when the test requires broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, or vague reproduction steps. Explicitly explain why, then use the closest executable check such as a targeted script, manual reproduction, or log assertion.

What makes a regression test a bad test?▼

A bad test mostly tests mocks, encodes current implementation details, depends on timing or global state, or needs expensive infrastructure for a small fix. Prefer no new test over a bad one and use manual or scripted verification instead.

Why does my new regression test pass before the fix?▼

A test that passes before the fix is not reproducing the bug. Correct the test or the reproduction so it fails for the intended reason before editing the implementation, otherwise it provides no regression signal.