tdd

Writes a failing regression test before fixing a bug, then verifies the fix.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug fixes often ship without proof that the broken behavior is actually corrected, letting the same bug regress later. This Skill enforces a disciplined test-driven workflow that makes the broken behavior executable before any production code changes. ## Core Features & Use Cases - Failing-Test-First Workflow: Guides a seven-step process from understanding the bug through writing a failing regression test, fixing the code, and rerunning validation. - Practicality Guardrails: Explicitly skips test creation when the test path is expensive, integration-heavy, or brittle, and requires an explanation plus the closest executable verification instead. - Evidence-Based Reporting: Requires the final response to name the failing-before test, the passing-after run, and any nearby validation performed. - Use Case: A user reports that a date parser returns the wrong day for leap years. The Skill writes a focused unit test that fails on the leap-year input, applies the minimal fix, and confirms the test now passes alongside adjacent tests. ## Quick Start Ask the AI to fix this bug using TDD with a failing regression test first, then verify the fix passes.

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 smallest observable reproduction, write a focused test that encodes the intended behavior, and confirm it fails before editing production code. Then apply the minimal fix and rerun the test to confirm it passes.

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

Choose the narrowest existing test path for the affected code, such as a unit or component test, and encode the intended behavior rather than mirroring the current implementation. Keep the test focused on the bug without broad fixture churn.

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

Skip when the test requires broad harness setup, brittle mocks, slow end-to-end infrastructure, or production-only state. Explain why the test is impractical and use the closest executable check, such as a targeted script or manual reproduction command.

What should I do if the new test passes before the fix?▼

A passing test means it does not reproduce the bug, so correct the test or the reproduction before editing the implementation. The test must fail for the intended reason to prove it captures the broken behavior.

How do I handle a flaky bug with a regression test?▼

Make the test deterministic where possible by removing timing dependencies and unrelated global state. Document the specific signal being locked down so the regression coverage remains meaningful.