agentleFS
ame589ame589/Claude_skill/skills/stack-to-repro/SKILL.md

stack-to-repro

Skill0 starsChanged 4 months agoMITView on GitHub

Turn a production or CI stack trace into a minimal failing test that reproduces the crash, then fix it. Locates the exact culprit frame inside the repo, extracts the failing function, scaffolds a red test, and drives it to green. Use this whenever the user pastes a stack trace, exception, traceback, panic, or error log and wants it debugged/reproduced/fixed, or asks "why is this crashing / where does this error come from / write a test for this bug". Triggers on: "stack trace", "traceback", "exception", "this is crashing", "reproduce this bug", "repro", "panic:", "NullPointerException", "unhandled rejection", "why does this fail in prod".

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Only now change the production code.

    line 68
  2. Very specific:

    Keep the reproduction test in the suite — it is now a regression guard.

    line 75
  3. Distinctive:

    If no in-repo frame is found, the crash originates in a dependency.

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Stack-to-Repro

What this does

The slowest part of fixing a production bug is reproducing it: reading the trace, finding the real culprit among library noise, understanding the failing function, and writing a test that goes red for the right reason. This skill does the mechanical part in one shot — trace in, red test out — so you spend your time on the fix, not the archaeology. A reproduced bug is a fixed bug; an unreproduced one is a guess.

When to use it

  • The user pastes a stack trace, traceback, exception, panic, or error log.
  • The user asks to reproduce, debug, or "write a failing test for" a crash.
  • A CI failure or Sentry/Rollbar-style report needs to become a local red test.

Workflow

1. Capture the trace, then parse it

Save the trace the user gave you to a file (or pipe it in) and run:

python3 skills/stack-to-repro/scripts/parse_trace.py trace.txt --md repro-brief.md
# or inline:
python3 skills/stack-to-repro/scripts/parse_trace.py --text "<the trace>"
# or piped:
cat trace.txt | python3 skills/stack-to-repro/scripts/parse_trace.py -

The parser supports Python, JS/TS/Node, Java/Kotlin, Ruby, Go, and PHP. It needs only Python 3 and git.

2. Confirm the culprit

The brief names the culprit frame — the deepest application frame (it skips library frames) — with file:line, the enclosing function, and its source. Sanity-check it: does that function plausibly raise the reported exception? If the deepest in-repo frame is flagged as outside the repo, the bug is likely in how your code calls a library — inspect the nearest 🏠 in-repo frame instead.

3. Turn the skeleton into a real red test

The brief includes a suggested test-file path and a language-appropriate skeleton. Replace the .../TODO inputs with the actual arguments and state from the failing call site (read the culprit function and its callers to recover them). The goal is a test that fails with the same exception type and message as the trace. Run it and confirm it is red for the right reason — a test that fails for a different reason is not a reproduction.

4. Fix, then confirm green

Only now change the production code. Re-run the test: it must go green. Then run the surrounding suite so the fix didn't break a neighbor. If the project also has the blast-radius skill, run it on your fix to see what else the change touches.

5. Leave the test behind

Keep the reproduction test in the suite — it is now a regression guard. Name it so its origin is obvious (e.g. test_repro_<bug>), and reference the original error in a comment.

Notes & limits

  • Frame parsing and function extraction are heuristic. Always eyeball the culprit before trusting it; minified/obfuscated JS and deeply async traces can mislead the "deepest frame" pick.
  • The tool is read-only — it never edits code. Steps 3–5 are your normal edits.
  • If no in-repo frame is found, the crash originates in a dependency; focus on the boundary where your code hands data to that dependency.
  • See references/trace-formats.md for the exact frame grammars supported.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.