tdd

Writes a failing regression test before fixing a bug with a clear test path.

1|Updated Jul 5, 2026
One-click install
npx skills add https://github.com/yersonargotev/packy --skill tdd-yersonargotev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/yersonargotev/packy/tree/main/bundle/skills/tdd
Command: npx skills add https://github.com/yersonargotev/packy --skill tdd-yersonargotev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug fixes often ship without proof that the bug is actually fixed, letting the same defect regress later. This Skill enforces a test-driven bug-fixing workflow: reproduce the bug as a failing test first, then make the smallest production change that turns it green. ## 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 Fallbacks: When a failing test is impractical (broad harness setup, brittle mocks, slow end-to-end infrastructure), it requires an explicit explanation and the closest executable regression check instead of a bad test. - Guardrails Against Bad Tests: Prevents weakening assertions, mirroring broken implementations, or adding tests with weak practical signal. - Use Case: A user reports that a date parser crashes on leap-day input. The Skill writes a focused unit test reproducing the crash, confirms it fails, applies the minimal parser fix, and verifies the test plus nearby suites pass. ## Quick Start Ask the assistant to fix this bug using TDD by writing a failing regression test first, then making the minimal fix.

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?▼

Write the smallest test that reproduces the bug and confirm it fails for the intended reason. Then make the minimal production change so the test passes, and rerun nearby tests, type checks, or lint to catch broader risk.

When should I write a regression test for a bug fix?▼

Write one when the bug has a clear, cheap test target such as an existing unit or integration test for that codepath. Skip it when the test would need broad harness setup, brittle mocks, or slow end-to-end infrastructure.

What should I do if a failing test is impractical to write?▼

Explicitly state why the failing test is not worth the cost before fixing, then use the closest executable check such as a targeted script, manual reproduction command, log assertion, or focused integration check.

Why should the test fail before I fix the bug?▼

A failing-before test proves the test actually captures the bug rather than passing vacuously. If it passes immediately or fails for an unrelated reason, the test or reproduction must be corrected before editing the implementation.

When should I not use TDD for a bug fix?▼

Avoid it when the test path is unclear, expensive, integration-heavy, or would produce a bad test that mostly tests mocks, depends on timing, or encodes current implementation details. Prefer manual or scripted verification and say why.