Repro

From jleechanorg/claude-commands · View interactive version

Repro is an AI agent skill from the GitHub repository jleechanorg/claude-commands. Reproduce a bug, then drive a root-cause-classified fix. Use when asked to /repro a bug, file a REPRO issue, or escalate a regression. Triggers on the words: repro, reproduce, regression, root cause, \"what broke\", \"file an issue\".

How to use this skill

Skill file

/repro

Reproduce a bug end-to-end, classify the root cause, file a REPRO issue, then propose (or drive) the minimal fix. Always root-cause-first; never ship a patch on top of an unverified hypothesis.

0. Repo-level skill first — always

Before anything else, look in the active repository for its own repro workflow: .claude/commands/repro.md, .claude/skills/repro*/SKILL.md, .claude/skills/repro*.md, and any repro entry in its AGENTS.md/CLAUDE.md. If one exists, read it and follow it; it wins on every difference within the repository's own scope, subject to the user's explicit instructions and the active permission boundaries, which take precedence over both. This skill applies only where the repository is silent. A repository that routes /repro to its own twin-clone or provider-specific evidence workflow owns that workflow.

0.1 Default comparison: original / control / candidate

Report every repro as original (what the real system actually did) / control (replay without the fix) / candidate (replay with the fix) on the same inputs, as defined in ../repro-evidence/SKILL.md § Default comparison, unless the repository skill says otherwise. Reproducing before any fix exists is normal: report original and control, mark the candidate arm not yet available, and never invent one.

Usage

/repro <bug description or PR/issue ref>
/repro --issue <#N>           # reproduce from a known REPRO issue
/repro --pr <#N>              # reproduce from a known PR (use PR's repro context)

1. Understand the report

2. Try to reproduce (Layer 1 → Layer 4)

Climb the minimal repro ladder. Stop climbing the ladder only when the blocker is conclusively reproduced.

| Layer | Tool | When to use |

|---|---|---|

| 1. Unit | pytest <path>::<test> (mocked/isolated) | Cheap; narrows down the unit. Unit-only evidence is not sufficient for a production-fix claim. |

| 2. End-to-end | pytest <e2e test> | Hits real callstack with mocks only at external API boundaries. |

| 3. MCP / local server | real curl / mcp client against a running local dev server | When the bug needs the real LLM call path. |

| 4. Browser (final) | mcp__playwright-mcp headless against a deployed URL | When the bug is UI/integration-specific or only reproduces in a real browser session. |

If a layer passes but the bug seems environmental, jump to the highest layer to verify full stack behavior. Capture exact log lines, screenshots, and HTTP traces.

3. Capture smoking gun

Mandatory before moving to classification:

If you cannot reproduce, say so explicitly. Do not paper over a non-repro with a "probably X" hypothesis.

4. File the REPRO issue (if not already filed)

Use this exact title pattern:

REPRO: <one-line symptom> — <one-line root-cause hypothesis>

Body must include:

5. Drive the fix (only after root cause is confirmed)

  1. Update the issue's "Root cause candidates" → "Confirmed root cause" section with the evidence.
  2. Branch from origin/main (git fetch origin && git checkout -B <branch> origin/main).
  3. Fix prompt/schema/instruction first before adding backend protection, fallback, clamp, sanitizer, or retry. Backend protection only after documenting why prompt correction is insufficient.
  4. Add tests that would have caught the bug (Layer 1 unit + Layer 2 e2e at minimum).
  5. Open PR with a body that links the REPRO issue, names the root cause, and shows the new test failing on origin/main (RED) and passing on the branch (GREEN).
  6. Drive the PR to green; do not stop at "I made the change locally".

6. Honest reporting

7. Root-cause classification (NEW — 2026-06-16)

Before proposing a fix, classify the root cause into exactly one of these buckets. Pick the most specific bucket that fits; the bucket drives which fix-pattern to apply.

7.1 Prompt / instruction

7.2 Backend / business logic

7.3 External API / provider

7.4 UI / integration

7.5 Environment / config

7.6 Unknown / under-instrumented

7.7 Classification rules (enforced)

8. Output template (always end with this)

## REPRO summary
- Symptom:
- Root cause (bucket 7.x):
- Smoking gun (file:line / log / cdiag id):
- Fix pattern: [prompt | backend | retry+sanitize | UI | config | instrumentation-first]
- Status: [REPRODUCED | NOT_REPRODUCED | UNDER_INSTRUMENTED]
- Next action: [link to issue / PR / next skill]
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.