debug-sop
Skill10 starsChanged 5 months agoMITArchived repositoryView on GitHub
Diagnose errors, failed tests, crashes, hangs, regressions, suspicious outputs, and unexpected experimental results through reproducible hypothesis-driven debugging. Use whenever a script or system behaves incorrectly, even if the user only says it is broken or pastes an error. Respect diagnosis-only requests; implement a fix only when authorized.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bt-tournamentSkill
- preregisterSkill
- prove-sopSkill
- replaySkill
- research-sopSkill
- writeup-sopSkill
- bt-tournamentSkill
- debug-sopSkill
- preregisterSkill
- prove-sopSkill
- replaySkill
- research-sopSkill
- writeup-sopSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Call mcp__memory__match_signatures with the exact error plus the operation that triggered it.
- Distinctive: line 26
Run the smallest safe command that should reproduce the symptom.
- Distinctive: line 29
If reproduction would be destructive, costly, or use reserved data, stop and request the needed authority or choose a non-mutating probe.
- Distinctive: line 31
If the failure cannot be reproduced, compare environment, command, inputs, Git state, and dependency locks before declaring it gone.
- Distinctive: line 56
If multiple causes remain possible, say which evidence is missing instead of choosing the most convenient story.
- Distinctive: line 66
add or update a regression test that failed before the fix.
- Distinctive: line 67
avoid hiding the symptom with broad exception handling or relaxed checks.
- Distinctive: line 71
Run the minimal reproduction first, then the focused regression tests, then the repository-required broader checks.
- Distinctive: line 86
If unresolved, record the diagnostic evidence and surviving hypotheses rather than inventing a root cause.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Debug SOP
Inputs and output
Capture the exact symptom, expected behavior, reproduction command, relevant inputs, environment, first known bad state, and whether fixing is authorized. Return a compact incident report with reproduction, root cause or surviving hypotheses, evidence, changed files if any, verification commands, and the failure-ledger id.
1. Recover history before guessing
- Call
mcp__memory__match_signatureswith the exact error plus the operation that triggered it. Read matching resolutions, but verify they still apply. - Inspect recent relevant changes, logs, configuration, and run manifests.
- Distinguish the visible symptom from a proposed cause. Do not edit merely because a familiar exception suggests an easy fix.
2. Reproduce and bound the failure
- Run the smallest safe command that should reproduce the symptom.
- Record whether it is deterministic, intermittent, machine-specific, data-specific, or dependent on ordering/timing.
- If reproduction would be destructive, costly, or use reserved data, stop and request the needed authority or choose a non-mutating probe.
- If the failure cannot be reproduced, compare environment, command, inputs, Git state, and dependency locks before declaring it gone.
3. Build and eliminate hypotheses
List plausible causes and, for each, the cheapest observation that would distinguish it. Prefer direct evidence in this order:
- exact traceback, exit code, or incorrect output;
- minimal reproduction;
- focused logging or state inspection;
- controlled input/config variation;
- history or non-destructive bisection.
Change one explanatory variable at a time. Do not use destructive Git reset or discard unrelated user work during bisection.
4. Isolate the root cause
Reduce the case until removing one condition removes the failure. For data or statistical failures, also check leakage, seed sensitivity, stale code/config, and baseline-budget mismatch. For integration failures, verify each boundary separately: executable discovery, configuration loading, process startup, protocol exchange, shared workspace/state path, then UI behavior.
If multiple causes remain possible, say which evidence is missing instead of choosing the most convenient story.
5. Fix only when authorized
For a diagnosis request, stop after proving the cause and proposing a scoped fix. For a requested repair:
- make the smallest change that removes the cause;
- preserve compatibility and unrelated user changes;
- add or update a regression test that failed before the fix;
- avoid hiding the symptom with broad exception handling or relaxed checks.
6. Verify proportionally
Run the minimal reproduction first, then the focused regression tests, then the repository-required broader checks. Verify the original user-visible path, not only the helper function. For intermittent failures, repeat enough times to make the remaining uncertainty explicit.
7. Record the failure
Call mcp__memory__record_failure with:
trigger: operation and preconditions;symptom: exact externally visible failure;root_cause: proven mechanism, not a guess;resolution: change and verification command;- appropriate empirical or proof domain.
If unresolved, record the diagnostic evidence and surviving hypotheses rather than inventing a root cause.
Recovery branches
- Cannot reproduce: compare manifests and ask for the missing command/input.
- Flaky: identify timing, ordering, shared-state, or randomness dimensions and run controlled repetitions.
- External dependency failure: prove the local boundary is healthy, record the upstream error, and provide a safe retry or fallback.
- Fix causes a different regression: revert only your scoped change, preserve evidence, and return to the hypothesis list.
- Repeated dead end: stop changing code, summarize tested hypotheses, and state the exact user input or external change needed.
Completion criteria
Debugging is complete when the symptom is reproducible or its absence is explained, the root cause is supported by discriminating evidence, any authorized fix passes the original reproduction and regression checks, and the failure ledger contains enough detail for the next agent to avoid repeating the investigation.
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
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.

