diagnosing-bugs
Skill127 starsChanged 27 days agoMITView on GitHub
Build a tight, red-capable feedback loop before diagnosing failures, then minimize, test ranked hypotheses, and lock the fix with a regression test.
193 other projects use a version of this.
Adopted by
Most recently taken up by
- ChatbotXIO/ChatbotXtheir own version, first seen Nov 9, 2026
- wowyuarm/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Contexera/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- The-Vibe-Company/quivrtheir own version, first seen Nov 8, 2026
- gaoyu06/harnesstheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use setup-ts-deep-modules, loop-me and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 43 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 55 projects that use this
LesaniSkillwriting-beats
Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
Also in 58 projects that use this
AWSSkillto-questionnaire
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
Also in 88 projects that use this
LesaniSkillwriting-shape
Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.
Also in 56 projects that use this
AWSSkillwizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
Also in 122 projects that use this
- +1 more from Lesani
- +1 more from aws
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 193
- mattpocock/skills★ 309ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- GreyDGL/PentestGPT★ 16ksame name
- ArcReel/ArcReel★ 6.3ksame name
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- withcoral/coral★ 4.9ksame name
- bestofjs/bestofjs★ 3.1ksame name
- getsentry/sentry-react-native★ 1.8ksame name
- ChatbotXIO/ChatbotX★ 1.1ksame name
183 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- wiki/AGENTS.mdAGENTS.md
- wiki/CLAUDE.mdCLAUDE.md
- accountable-engineeringSkill
- adrSkill
- babysit-prSkill
- blindspot-passSkill
- capability-experimentsSkill
- codemapSkill
- code-quality-reviewSkill
- code-reviewSkill
- commit-atomicSkill
- context-discoverySkill
- doc-searchSkill
- docs-updateSkill
- draft-pull-requestSkill
- git-contextSkill
- handoffsSkill
- implementation-loggerSkill
- implement-specSkill
- llm-wikiSkill
- orchestrating-fusionSkill
- pickupSkill
- plannotator-setup-goalSkill
- portless-localSkill
- prdSkill
- pr-reviewSkill
- prSkill
- qmd-knowledgeSkill
- quiz-meSkill
- ralphSkill
- retroSkill
- security-auditSkill
- slopSkill
- spec-interviewSkill
- tddSkill
- tmuxSkill
- visual-prSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 1 is common, 11 are distinctive, and 1 is very specific to this project.
1
Common
Most of the 180 edited versions we read keep these.
11
Distinctive
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
- Distinctive: line 17
Use this workflow for bugs, flaky failures, and performance regressions.
- Distinctive: line 28
Do not claim a diagnosis from code inspection alone when the symptom has not been reproduced or captured.
- Distinctive: line 38
Prefer the smallest unattended command that exercises the real path and asserts the symptom:
- Distinctive: line 51
If no red-capable loop can be built, stop and report what was tried.
- Distinctive: line 55
Run the loop and confirm it fails for the reported reason.
- Distinctive: line 61
Write 3–5 ranked hypotheses.
- Distinctive: line 69
If two attempted fixes share an assumption and fail the same check, pause before a third variation.
- Common: line 76
When a correct seam exists:
- Distinctive: line 79
Run it and observe the expected failure.
- Distinctive: line 81
Run the test and the original, unminimized loop again.
- Distinctive: line 83
Do not add a shallow test that cannot reproduce the call chain or interaction that caused the bug.
- Distinctive: line 87
Before declaring the bug fixed:
- Very specific: line 91
All temporary debug instrumentation is removed (grep the debug prefix).
“Common” is measured: kept by at least 6 in 10 of the 180 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Diagnosing Bugs
Use this workflow for bugs, flaky failures, and performance regressions. The central rule is simple: do not start with a theory. First build a feedback loop that can go red on the user's actual symptom.
When to Use
Use when:
- A test, command, request, or UI flow is failing.
- Behavior is incorrect but the failure is not yet understood.
- A bug is intermittent or timing-sensitive.
- A performance regression needs measurement before optimization.
Do not claim a diagnosis from code inspection alone when the symptom has not been reproduced or captured.
Process
1. Redact and gather context
Redact secrets from commands, logs, screenshots, traces, and environment output before showing or storing them. Read the relevant project instructions, glossary, ADRs, issue, and recent changes. Record the exact user-visible symptom, not a nearby error.
2. Build a tight feedback loop
Prefer the smallest unattended command that exercises the real path and asserts the symptom:
- A failing unit, integration, or end-to-end test at the correct public seam.
- A curl or HTTP script against a running service.
- A CLI fixture and expected-output comparison.
- A browser script asserting DOM, console, or network behavior.
- A replay of a captured request, event, or trace.
- A minimal harness with real collaborators at the failing boundary.
- A property or fuzz loop for input-dependent failures.
- A bisection or differential loop when the regression has a known range.
Tighten the loop: cache setup, narrow assertions to the exact symptom, pin time and randomness, isolate the filesystem, and remove unnecessary network work. A slow or flaky loop is not a sufficient feedback loop until it is made deterministic or its reproduction rate is high enough to debug.
If no red-capable loop can be built, stop and report what was tried. Ask for a redacted trace, log, HAR, core dump, screen recording with timestamps, or access to the reproducing environment rather than guessing.
3. Reproduce and minimize
Run the loop and confirm it fails for the reported reason. For intermittent bugs, repeat or stress the trigger until its reproduction rate is useful. Minimize one input, caller, configuration, or step at a time; keep only elements that are load-bearing for the failure.
Completion condition: removing any remaining element makes the loop pass.
4. Rank falsifiable hypotheses
Write 3–5 ranked hypotheses. Each must predict an observable result:
If
<cause>is responsible, changing<variable>should make the symptom disappear or become worse.
Show the ranked list to the user before testing so they can supply domain evidence or identify hypotheses already ruled out. This is not an approval gate: proceed with the ranking while the user is unavailable.
Probe one prediction at a time. Prefer a debugger or REPL, then targeted logs at boundaries that distinguish hypotheses. Tag temporary logs with a unique prefix such as [DEBUG-1234] so cleanup is mechanical. For performance issues, measure a baseline and use a profiler or timing harness instead of logging everything.
If two attempted fixes share an assumption and fail the same check, pause before a third variation. State the shared assumption in one sentence and test it against the reproduction. For state or resource imbalances, trace which actors create, own, update, and release the resource. Change ownership only when the evidence supports it; a guard that merely hides the crash is not a root-cause fix. Update the ranked hypotheses from the result.
5. Add the regression test before the fix
When a correct seam exists:
- Convert the minimized reproduction into a test at the highest interface that exposes the real bug.
- Run it and observe the expected failure.
- Apply the smallest fix.
- Run the test and the original, unminimized loop again.
Do not add a shallow test that cannot reproduce the call chain or interaction that caused the bug. If no correct seam exists, document that architectural gap and make it a follow-up improvement rather than claiming strong regression coverage.
6. Clean up and verify
Before declaring the bug fixed:
- The original reproduction no longer fails.
- The regression test passes at the correct seam.
- All temporary debug instrumentation is removed (
grepthe debug prefix). - Throwaway harnesses and captured sensitive artifacts are deleted or safely redacted.
- The root cause and the verification commands are recorded in the commit or PR description.
- Broader tests and relevant lint/type checks pass, or their exact blockers are reported.
Common Pitfalls
- Theory before reproduction: reading code until a plausible story appears. Build the red-capable loop first.
- Wrong failure: fixing an adjacent error while the user's symptom remains. Capture the exact symptom before changing code.
- Single hypothesis: anchoring on the first explanation. Rank several predictions and test them independently.
- Debug-log archaeology: leaving untagged instrumentation behind. Use a unique prefix and grep before finishing.
- False regression confidence: testing a helper that cannot exercise the real failure. Move the test to the highest viable seam or record the missing seam.
- Performance guesswork: optimizing before measuring. Establish a baseline and compare before/after results.
Verification Checklist
- Sensitive output is redacted.
- A command that can go red on the exact symptom has been run.
- The reproduction was minimized.
- Multiple falsifiable hypotheses were considered.
- A regression test covers the real behavior or the missing seam is documented.
- The original loop, regression test, and broader checks were run.
- Temporary logs, harnesses, and artifacts were removed.
Attribution
The repeated-fix checkpoint is adapted from Robert C. Martin's
ub-mode — Attack the Premise and Fix Root Causes.
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.

