Debugging discipline. Reproduce the reported bug, ideally as a failing test, BEFORE proposing or applying any fix. Use whenever someone reports a bug, unexpected behaviour, an error, a crash or a regression, or asks "why is X broken, not working, wrong". Prevents fixing problems that do not exist.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Reproduce First?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/trampo-framework-reproduce-first)
---
name: reproduce-first
description: Debugging discipline. Reproduce the reported bug, ideally as a failing test, BEFORE proposing or applying any fix. Use whenever someone reports a bug, unexpected behaviour, an error, a crash or a regression, or asks "why is X broken, not working, wrong". Prevents fixing problems that do not exist.
---
# reproduce-first
Fixing a bug starts with making it reproducible (*The Pragmatic Programmer*).
Skipping straight to a theory-based fix is the biggest cause of wasted debugging, and of "fixing" bugs that do not
exist. This skill enforces a proof-first workflow.
## Decision tree
```
Bug reported
+- 0. Is this even a code defect? Classify before editing:
| (a) code does the wrong thing -> fix the code
| (b) stale or wrong expectation -> fix the TEST or assertion, not the code (check git log and blame)
| (c) environment, config, setup -> fix the ENVIRONMENT, not the code
| (d) already fixed on main -> reproduce on a clean checkout first
+- 1. Can I run the failing scenario now?
| yes -> reproduce (failing test over failing command), confirm the symptom matches
| no -> climb the confidence ladder as high as you can, and SAY which rung
+- 2. Fix -> 3. Re-run and re-verify (red, then green)
```
## The rule
**No fix without a reproduction, or an explicit statement of why you could not get one and at what confidence you
proceed.** If you cannot reproduce at all, stop, report, and ask. Never guess.
## Step 0: triage the premise (is it a bug?)
Classify the report before touching code. Misclassifying (b) or (c) as (a) is the classic "fixed a bug that did not
exist":
- **(a) Genuine code defect:** reproduce and fix the code.
- **(b) Stale or wrong expectation:** the code is correct; a test or the person's mental model encodes old or removed
behaviour (a test asserting a hard-coded response a recent commit removed on purpose). Run `git log` and `git blame`
on the lines first; fix the expectation.
- **(c) Environment, config or setup:** a missing environment variable, unbuilt dependencies, a stale dev server that
needs a restart, credentials not configured. The code may be fine; fix the environment, do not patch code to paper
over it.
- **(d) Already fixed:** reproduce on a clean current checkout; it may exist only on a stale branch.
## Reproduction confidence ladder
Climb as high as you can and state the rung you reached. Never present a lower rung as a confirmed proof.
1. **Full repro:** a test or command that fails for the reported reason on current code. (gold)
2. **Proxy repro:** the full scenario cannot run (no database, production only, needs a restart), so exercise the
suspect unit directly, or trace the exact failing input by hand to the line where it diverges. (good, label it
"proxy")
3. **Static trace:** you point to the precise line producing the symptom but ran nothing. (weak; only for mechanically
obvious faults, and say so)
4. **None:** stop, report, ask.
A fix justified by rung 2 or 3 must be verified again once the environment is available: say so explicitly.
## Workflow
1. **Understand:** read the report literally, observed against expected. Unclear? Ask one question, do not assume.
2. **Triage:** step 0, classify (a), (b), (c) or (d).
3. **Reproduce:** on current code, before changing anything; climb the ladder; confirm the failure matches the
*reported reason* (a missing-import failure is not a reproduction of a logic bug).
4. **Fix:** only now. Scope strictly to what the reproduction demands; no drive-by refactors. Fix whatever step 0
identified (code, expectation or environment).
5. **Prove:** re-run the reproduction (it must pass) and the surrounding tests for regressions. If you were on rung 2
or 3, state that final confirmation still needs the real environment.
6. **Keep the test:** a new failing-then-passing test is a regression test; leave it in place.
## When the rule bends
- **Obvious one-line errors** on reading (a wrong variable, an off-by-one): rung 3 may substitute; say so.
- **The person says "just apply this fix":** follow it, and note you skipped reproduction.
- **Production only, no test layer:** rung 2 (a logged command, a request, a manual step).
## Anti-patterns this prevents
- Theory, edit, "done", without ever running the broken scenario.
- "Added a null check that should fix it" when nulls were never involved.
- Patching application code to satisfy a test that asserts behaviour the code intentionally no longer has.
- Patching code to paper over a setup or environment failure unrelated to the code.
- Presenting a static read as a confirmed reproduction.
- Fixing a bug already fixed on main, or present only on a stale branch.
- Refactoring nearby code under the banner of a bug fix.
## References
- *The Pragmatic Programmer*: start fixing a bug by making it reproducible.
- *Debug It!*: the reproduce, diagnose, fix, reflect loop.
- Regression testing: keep a test that exposes a fixed bug and run it on every change.