reproduce-reduce-regress
Guides developers through a TDD-based debugging cycle: reproduce the bug, minimize the test case, and verify the fix.
Install
mkdir -p .claude/skills/reproduce-reduce-regress && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5297" && unzip -o skill.zip -d .claude/skills/reproduce-reduce-regress && rm skill.zipInstalls to .claude/skills/reproduce-reduce-regress
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Systematic workflow for debugging by reproducing bugs with real data, reducing test cases to minimal examples, and adding regression testsKey capabilities
- →Reproduce bugs with real data
- →Isolate minimal failing test cases
- →Implement regression tests
- →Binary search for bug triggers
- →Document expected behavior with passing tests
How it works
The workflow mandates using real data to reproduce a bug, then iteratively reducing the input to find the smallest failing case, and finally preserving all tests as regression suites.
Inputs & outputs
When to use reproduce-reduce-regress
- →Debugging production issues
- →Creating minimal reproduction cases
- →Writing regression tests
About this skill
Reproduce, Reduce, Regress
When debugging a bug, follow this workflow:
1. Reproduce
Goal: Get a failing test that demonstrates the bug using REAL data.
- Copy the EXACT input that triggers the bug (don't paraphrase or simplify yet)
- Use the EXACT types/structs from the failing code
- Verify the test actually fails with the same error message
2. Reduce
Goal: Find the MINIMAL input that still triggers the bug.
- Create MULTIPLE test variants, don't comment things in/out
- Name them descriptively:
test_minimal_one_field,test_with_queries, etc. - Binary search: remove half the input, see if it still fails
- Keep narrowing until you find the smallest failing case
- Also find a PASSING case that's as close as possible to the failing one
The difference between your minimal failing case and your minimal passing case IS the bug.
3. Regress (Regression Tests)
Goal: Ensure the bug never comes back.
- Keep ALL your test variants - both passing and failing
- The failing ones become regression tests after the fix
- The passing ones document expected behavior
- Name tests after the issue number:
test_issue_1356_*
Anti-patterns
❌ Commenting code in/out to test different scenarios ❌ Modifying a single test repeatedly ❌ "Simplifying" input without verifying the bug still reproduces ❌ Deleting test variants after finding the bug ❌ Theorizing about what MIGHT cause the bug before reproducing
Example Structure
// Minimal failing case
#[test]
fn test_issue_1356_fails_without_queries_default() { ... }
// Minimal passing case (shows the workaround)
#[test]
fn test_issue_1356_passes_with_queries_default() { ... }
// Original reproduction from user's code
#[test]
fn test_issue_1356_full_reproduction() { ... }
When not to use it
- →Theorizing about causes before reproduction
- →Deleting test variants after finding the bug
Limitations
- →Requires maintaining multiple test variants
How it compares
This approach enforces a strict, systematic test-driven isolation process instead of ad-hoc debugging.
Compared to similar skills
reproduce-reduce-regress side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| reproduce-reduce-regress (this skill) | 1 | 7mo | No flags | Intermediate |
| check-bounds-safety | 1 | 2mo | No flags | Intermediate |
| debug-with-valgrind | 2 | 7mo | Review | Intermediate |
| cts-triage | 1 | 4mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by facet-rs
View all by facet-rs →You might also like
check-bounds-safety
r3bl-org
Apply type-safe bounds checking patterns using Index/Length types instead of usize. Use when working with arrays, buffers, cursors, viewports, or any code that handles indices and lengths.
debug-with-valgrind
facet-rs
Debug crashes, segfaults, and memory errors using valgrind integration with nextest through pre-configured profiles
cts-triage
gfx-rs
Run CTS test suites and investigate failures
fix-bug
ovaar
Debug and fix issues in VaultMark. Use when asked to fix bug, debug this, something is broken, not working, diagnose issue, troubleshoot, or investigate an error.
rtco-tdd
quangdang46
>
tui-smoke-test
usak1i
Smoke-test a Rust TUI binary headlessly using `script` to provide a PTY, verifying the binary builds, opens an alt screen, runs the event loop, and exits cleanly on `q` without leaving the terminal in raw mode. Use after edits that touch the event loop, terminal setup/teardown, panic hook, or any re