diagnose
Skill1 starsChanged 4 months agoMITView on GitHub
Structured debugging as a state machine: reproduce, minimize, hypothesize, instrument, fix, regression-test. Use when something is broken, a bug needs fixing, tests are failing unexpectedly, or behavior doesn't match expectations.
193 other projects use a version of this.
Adopted by
Most recently taken up by
- agent-services-at/pluginstheir own version, first seen Nov 8, 2026
- Eclipter/agentstheir own version, first seen Nov 8, 2026
- venhdev/skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- DeevsDeevs/agent-systemtheir own version, first seen Nov 8, 2026
- pedrohcgs/claude-code-my-workflowtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use zoom-out, to-prd and 10 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.
victorgarciaesgiSkillzoom-out
Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.
Also in 61 projects that use this
GoogleSkillto-prd
Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.
Also in 56 projects that use this
GoogleSkillto-issues
Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.
Also in 53 projects that use this
simo97Skilledit-article
The user will invoke this skill to help them edit an article.
Also in 17 projects that use this
simo97Skillwrite-a-skill
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
Also in 44 projects that use this
AnasX7Skillsetup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
Also in 27 projects that use this
- +4 more from simo97
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 193
- github/awesome-copilot★ 41ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- CherryHQ/cherry-studio-app★ 4.1ksame name
- pedrohcgs/claude-code-my-workflow★ 1.7ksame name
- formancehq/ledger★ 1.5ksame name
- getagentseal/founder-playbook★ 745same name
- victorgarciaesgi/regle★ 508same name
- amazingloft999-droid/mattpocock-skills★ 422same name
- openvetta/open-vetta★ 302same 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 repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- antipattern-detectorSkill
- architecture-reviewSkill
- assumption-challengerSkill
- cavemanSkill
- clipSkill
- code-reviewerSkill
- feature-writerSkill
- gemini-advisorSkill
- gemini-reviewerSkill
- grill-meSkill
- image-generatorSkill
- issue-creatorSkill
- paper-bananaSkill
- pr-writerSkill
- publishSkill
- tddSkill
- teach-meSkill
- validatorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 13 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 174 edited versions we read keep these.
13
Distinctive
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
- Distinctive: line 12
Follow the state machine: reproduce -> minimize -> hypothesize -> instrument -> fix -> regression-test.
- Distinctive: line 23
Before anything else, establish a way to trigger the bug on command.
- Distinctive: line 42
Run the feedback loop. Confirm:
- Distinctive: line 52
If reproduction fails entirely: Stop and say so explicitly.
- Distinctive: line 64
Remove unrelated setup code
- Distinctive: line 83
Test your top hypothesis. One variable at a time.
- Distinctive: line 94
If hypothesis #1 is disproven, move to #2.
- Distinctive: line 102
Run the test, confirm it fails
- Distinctive: line 104
Run the regression test, confirm it passes
- Distinctive: line 105
Run the full test suite, confirm nothing else broke
- Distinctive: line 107
The fix should address the root cause, not the symptom: If the bug is "null pointer in function X," the fix isn't a null check in X.
- Very specific: line 113
Remove ALL debug instrumentation (search for your [DEBUG-...] tag)
- Distinctive: line 114
Remove any temporary test harnesses that aren't part of the permanent suite
- Very specific: line 115
If the bug revealed an architectural problem, note it for the user — suggest running /review-architecture
- Distinctive: line 122
All hypotheses are disproven and you have no new theories
“Common” is measured: kept by at least 6 in 10 of the 174 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
Diagnose — Structured Debugging
Debug methodically. No guessing. No "let me try changing this and see." Follow the state machine: reproduce -> minimize -> hypothesize -> instrument -> fix -> regression-test.
The One Rule
If you have a fast, deterministic, agent-runnable pass/fail signal for the bug, you will find the cause. Bisection, hypothesis-testing, and instrumentation all consume that signal. If you don't have one, no amount of staring at code will save you. Spend disproportionate effort building the feedback loop.
Phase 1 — Build a Feedback Loop
Before anything else, establish a way to trigger the bug on command. Try these in order, from best to acceptable:
- Failing test (unit, integration, or e2e) — ideal; fast, isolated, survives the fix
- Curl/HTTP script against a running dev server
- CLI invocation with fixture input, diff against known-good output
- Headless browser script (Playwright/Puppeteer)
- Replay a captured trace (HAR file, recorded request)
- Throwaway harness — minimal script that exercises just the broken path
- Property/fuzz loop — when the trigger is non-obvious
- Bisection harness —
git bisect run <script>to find the breaking commit - Differential loop — compare output of two versions (before/after, branch/main)
- Manual HITL script — bash script that sets up state and tells you what to check (last resort)
Once you have a loop, optimize it: Can it run faster? Is the signal sharper? Is it deterministic?
Phase 2 — Reproduce
Run the feedback loop. Confirm:
- The bug appears
- It matches the user's description
- It's reproducible (runs 3+ times with same result)
If the bug is non-deterministic: Your goal is NOT to fix it yet. Your goal is to raise the reproduction rate until it's debuggable. Try: increase load, tighten timing, add contention, remove caching, pin to a single thread.
If reproduction fails entirely: Stop and say so explicitly. List what you tried. Ask the user for:
- Access to whatever environment reproduces it
- A captured artifact (HAR file, log dump, core dump, screen recording)
- Permission to add temporary instrumentation to the environment that reproduces it
Do not proceed to hypothesize without a working feedback loop.
Phase 3 — Minimize
Shrink the reproduction to the smallest possible case:
- Remove unrelated setup code
- Simplify inputs to the minimal trigger
- Isolate the failing path from the rest of the system
A minimal reproduction makes the cause obvious more often than you'd expect.
Phase 4 — Hypothesize
Generate 3-5 ranked hypotheses BEFORE changing any code. For each:
- State the hypothesis clearly: "The bug is caused by X"
- State a falsifiable prediction: "If X is the cause, then doing Y will make the bug disappear"
- Rank by likelihood based on the evidence so far
Do not skip to fixing. You may be right about hypothesis #1. You may be wrong. Prove it first.
Phase 5 — Instrument
Test your top hypothesis. One variable at a time.
Prefer in this order:
- Debugger breakpoint — inspect state directly
- Targeted log/print — one or two specific values at the suspected failure point
- Assertion — add a runtime check that will fail loudly if your hypothesis is wrong
- Broader logging — only if targeted approaches aren't conclusive
Tag all debug instrumentation with a unique prefix (e.g., [DEBUG-x7f2])
so you can find and remove every piece of it later.
If hypothesis #1 is disproven, move to #2. If all hypotheses are disproven, return to Phase 4 with new information from the instrumentation.
Phase 6 — Fix
Now — and only now — modify production code.
- Write a regression test FIRST — turn the minimal reproduction from Phase 3 into a failing test
- Run the test, confirm it fails
- Apply the fix — the smallest change that addresses the root cause
- Run the regression test, confirm it passes
- Run the full test suite, confirm nothing else broke
The fix should address the root cause, not the symptom. If the bug is "null pointer in function X," the fix isn't a null check in X. It's figuring out why X received null and preventing that upstream.
Phase 7 — Cleanup
- Remove ALL debug instrumentation (search for your
[DEBUG-...]tag) - Remove any temporary test harnesses that aren't part of the permanent suite
- If the bug revealed an architectural problem, note it for the user — suggest running
/review-architecture
When to Escalate
Escalate to the user (don't keep flailing) when:
- Reproduction fails after exhausting Phase 1 options
- All hypotheses are disproven and you have no new theories
- The fix requires changing a system you don't have context for
- The root cause is in a dependency or third-party service
- The bug is environment-specific and you can't reproduce the environment
Escalation is the right move, not a failure. State what you know, what you tried, and what you need.
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.

