agentleFS
KcAnomKcAnom/pi-fairy-tales-chains/skills/bughunt-repro/SKILL.md

bughunt-repro

Skill0 starsChanged 4 months agoMITView on GitHub

Phase 1 of 4 in the bughunt chain — the human-in-the-loop bug-fixing pipeline (repro → diagnose → fix → verify). Captures a reliable reproduction of a bug: the exact failing command or test, expected vs. actual behavior, error output, and environment. This phase starts the durable chain run (state tracked by the chain tool). Trigger whenever the user reports a bug, pastes an error/stack trace, or wants to start the bughunt chain: "bughunt-repro", "start a bughunt", "reproduce this bug", "capture a repro", "begin the bughunt chain", or standalone "bughunt".

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

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

    All chain state is managed by the chain tool: authoritative JSON at .pi/fairy-tales/chains/bughunt/state.json with a human-readable …

    line 27
  2. Very specific:

    Call the chain tool with action: "status", chain: "bughunt":

    line 36
  3. Very specific:

    If an active run exists, a bughunt run is already mid-flight (the status shows its current phase — a legacy .bughunt-state.md from an older …

    line 38
  4. Very specific:

    If the tool reports the chain is locked by another session, abort and tell the user.

    line 43
  5. Very specific:

    If there is no run, or the last run is complete/abandoned, start fresh: action: "start", chain: "bughunt", task: "<short description of the …

    line 45
  6. Distinctive:

    Run it. Capture the raw error output (stack trace, assertion diff, exit code).

    line 59
  7. Distinctive:

    Run it again to confirm it fails consistently (flaky failures need to be noted as such rather than treated as a clean repro — record the …

    line 60
  8. Distinctive:

    If the failure cannot be reproduced with the information available, do NOT fabricate a repro — report exactly what's missing (e.g.

    line 67
  9. Distinctive:

    Call the chain tool:

    line 74
  10. Distinctive:

    After completing this phase, output exactly:

    line 93
  11. Distinctive:

    Do not start the next phase.

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Bughunt: Repro

Chain version: 2 (durable state contract — see docs/STATE-CONTRACT.md)

Phase 1 of 4: bughunt-repro → bughunt-diagnose → bughunt-fix → bughunt-verify

Overview

Entry point of the bughunt chain. Turns a bug report into a reliable, reproducible failure: the exact command or test that fails, what should happen, what actually happens, the raw error output, and the environment it fails in. A fix built on a repro that isn't actually reliable is worthless, so this phase does not proceed until the failure has been reproduced and observed directly — not just described secondhand.

All chain state is managed by the chain tool: authoritative JSON at .pi/fairy-tales/chains/bughunt/state.json with a human-readable state.md projection beside it. Never create or edit state files by hand, and never create lock files — the tool locks for you.

Workflow

Step 1 — Start the run (entry phase)

Call the chain tool with action: "status", chain: "bughunt":

  • If an active run exists, a bughunt run is already mid-flight (the status shows its current phase — a legacy .bughunt-state.md from an older version is imported automatically). Show the user the status and ask whether to resume from the current phase (run that phase's skill) or discard it (action: "abandon") and start over. Do not silently overwrite.
  • If the tool reports the chain is locked by another session, abort and tell the user; a dead session's lock can be cleared with action: "unlock".
  • If there is no run, or the last run is complete/abandoned, start fresh: action: "start", chain: "bughunt", task: "<short description of the bug>". Note the runId in the response — it keys this run's quest dedupe keys.

Step 2 — Capture the bug report

Gather from the user (or the conversation that triggered this phase): what's broken, where it was observed, and any command, test name, stack trace, or screenshot already provided. Do not invent details that weren't given.

Step 3 — Reproduce it directly

  • Identify the exact failing command or test (e.g. npm test -- path/to.spec.ts, pytest tests/test_x.py::test_y, a specific curl/CLI invocation).
  • Run it. Capture the raw error output (stack trace, assertion diff, exit code).
  • Run it again to confirm it fails consistently (flaky failures need to be noted as such rather than treated as a clean repro — record the failure rate observed).
  • Record expected behavior (what should happen — from docs, tests, or the user's description) versus actual behavior (what happens now).
  • Capture environment: OS, language/runtime version, current git branch and commit (git rev-parse HEAD), and any dependency versions relevant to the failure.

If the failure cannot be reproduced with the information available, do NOT fabricate a repro — report exactly what's missing (e.g. "need the input file that triggers this", "need a way to hit this endpoint locally") and stop before completing the phase.

Step 4 — Complete the phase

Call the chain tool:

action: "complete-phase", chain: "bughunt", phase: "repro",
summary: "reliable reproduction captured for \"<short description>\"; reproduced <N>/<N> runs; environment <os/runtime summary>",
data: {
  "reproCommand": "<exact failing command/test>",
  "expectedBehavior": "<what should happen>",
  "actualBehavior": "<what happens instead>",
  "errorOutput": "<raw stack trace / assertion diff / error text>",
  "environment": "<OS>, <runtime + version>, branch `<branch>` @ `<commit sha>`, <relevant dependency versions>"
}

The tool validates this is the current phase, advances the run to diagnose, and rewrites the JSON + markdown projection atomically.

Handoff

After completing this phase, output exactly:

Phase 1 complete. Chain state updated (.pi/fairy-tales/chains/bughunt/state.json). Run /bughunt-diagnose to begin Phase 2.

Do not start the next phase. Do not offer to continue. Output only the handoff line and stop.

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.