tdd

Writes a failing regression test before fixing a bug and validates the fix.

1|Updated Aug 26, 2026
One-click install
npx skills add https://github.com/edivad1999/stuc-stack --skill tdd-edivad1999
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/edivad1999/stuc-stack/tree/main/skills/tdd
Command: npx skills add https://github.com/edivad1999/stuc-stack --skill tdd-edivad1999

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Bug fixes often ship without proof that the broken behavior is actually corrected, letting regressions return later. This Skill enforces a test-driven workflow that makes the bug executable as a failing test before any production code changes. ## Core Features & Use Cases - Failing-Test-First Workflow: Guides a seven-step process from understanding the bug to writing a failing regression test, fixing the code, and rerunning validation. - Practicality Guardrails: Skips test creation when the test path is expensive, integration-heavy, or brittle, and requires an explicit explanation plus the closest executable verification instead. - Evidence-Based Reporting: Produces a final response naming the failing-before test, the passing-after run, and any nearby validation performed. - Use Case: A user reports that a discount calculation rounds incorrectly. The Skill writes a focused unit test that fails on the current implementation, applies the minimal fix, and confirms the test passes along with adjacent test suites. ## Quick Start Ask the AI to fix this bug using TDD by writing a failing regression test first, then making the minimal code change until the test 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?▼

Write the smallest test that encodes the intended behavior and confirm it fails for the right reason before changing production code. Then make the minimal fix, rerun the regression test until it passes, and run nearby validation such as adjacent tests, type checks, or lint.

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

Skip when the test requires broad harness setup, brittle mocks, slow end-to-end infrastructure, or production-only state. Explicitly explain why the test is impractical and 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, mirrors current implementation details, depends on timing or unrelated 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.

How do I write a test for a flaky bug?▼

Make the test deterministic where possible by removing timing dependencies and shared global state, and document the signal being locked down. If the bug exposes a broader failure class, land the focused regression test first, then consider sibling coverage.

What evidence should a TDD bug fix report include?▼

Report the failing-before test name and the failure it produced, the passing-after test run, and any nearby validation performed. If failing-before evidence was impossible, state why and describe the closest regression check used instead.