diagnose
Skill0 starsChanged 14 days agoMITView on GitHub
Debug a bug or a flaky failure by building a fast, deterministic pass/fail loop first, then testing one hypothesis at a time, then fixing and keeping the loop as a regression test. Use when the user says "debug this", "diagnose", "it's broken", "this test fails sometimes", "why does this fail", "find the root cause", "it works on my machine" or reports an error, a wrong result or a regression. Stops and asks when no loop can be built. Not for a failing chunk inside a plan-split-dispatch run (its bounded fix loop covers that) and not for new features.
195 other projects use a version of this.
Adopted by
Most recently taken up by
- theishandubey/dotclaudetheir own version, first seen Nov 29, 2026
- gregale-dev/gregale-cursor-plugintheir own version, first seen Nov 29, 2026
- hcb2019/claude-code-skillstheir own version, first seen Nov 29, 2026
- Uniterra-Solutions/tidy-up-your-thoughtstheir own version, first seen Nov 29, 2026
- jiuyang5354/skillstheir own version, first seen Nov 29, 2026
- openwizdev/WizSkillstheir own version, first seen Nov 29, 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 66 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 63 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 56 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 49 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
kennethkeimSkillubiquitous-language
Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to UBIQUITOUS_LANGUAGE.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions "domain model" or "DDD".
Also in 17 projects that use this
- +4 more from simo97
- +1 more from google
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 195
- github/awesome-copilot★ 42ksame 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★ 517same name
- openvetta/open-vetta★ 515same name
- amazingloft999-droid/mattpocock-skills★ 422same name
- InditexTech/weavejs★ 277same name
- letehaha/moneymatter★ 271same name
185 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 repository34 other files it gives its agents.
- corpus/CLAUDE.mdCLAUDE.md
- architectSkill
- base-uiSkill
- bootstrap-vps-deploySkill
- codegraphSkill
- code-structureSkill
- corpus-docs-siteSkill
- corpus-flowSkill
- design-md-librarySkill
- design-pipelineSkill
- design-taste-frontendSkill
- diagram-designSkill
- grill-meSkill
- hallmarkSkill
- high-end-visual-designSkill
- house-styleSkill
- impeccableSkill
- improveSkill
- industrial-brutalist-uiSkill
- minimalist-uiSkill
- no-commentsSkill
- orchestrateSkill
- plan-split-dispatchSkill
- poteto-modeSkill
- readme-docsSkill
- security-auditSkill
- stocktakeSkill
- thermo-nuclear-reviewSkill
- ui-test-plansSkill
- unslopSkill
- web-design-guidelinesSkill
- web-platformSkill
- whySkill
- writing-guidelinesSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 178 edited versions we read keep these.
4
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
- Very specific: line 35
A human-in-the-loop script: when only a person can see the symptom, scripts/hitl-loop.template.sh asks them one question per run and exits …
- Very specific: line 59
Write the hypothesis in one sentence, with a prediction the loop can check: "if the cache returns a stale row, then logging the row's …
- Distinctive: line 62
Test only that: add the one log, assertion or breakpoint, run the loop, read the result.
- Distinctive: line 68
After three refuted hypotheses, stop and re-read the failing path end to end, or ask the owner.
- Distinctive: line 76
Run the loop: green. Run the repo's checks: still green.
- Distinctive: line 81
Remove every temporary log, flag and harness you added.
“Common” is measured: kept by at least 6 in 10 of the 178 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: the feedback loop is the skill
A bug is fixed when a signal that was red goes green and stays green. Without that signal every fix is a guess. So the work has three phases, in order, and no fix is proposed before phase 1 is done.
Phase 1: build the loop
A loop is a command that exits non-zero on this bug and zero without it, fast enough to run dozens of times, and the same answer each run. Pick the first of these that fits the bug and the repo:
- A failing test (
vitest, ornode --test): the cheapest, and the one to keep. Write the smallest test that goes red. - A script against the running service:
curl(orfetch) against a server started withtsx watch, asserting on the status and the body. - A CLI run on a fixture: the tool, a saved input, a diff against the expected output.
- A headless browser: a Playwright script (see
ui-test-plans) that drives the page and checks the DOM or the console. - Replay a captured trace: a saved request, log line or event stream fed back through the code.
- A throwaway harness: a 20-line script that calls the one function with the bad input, outside the app.
- A fuzz loop: random or exhaustive inputs against an invariant, when the bug depends on data you can't name.
- A bisection harness:
git bisect run <loop>when it worked before. - A differential run: the same input through the old and new code, or two environments, diffing the output.
- A human-in-the-loop script: when only a person can see the symptom,
scripts/hitl-loop.template.shasks them one question per run and exits on the answer.
Make it deterministic. A flaky failure gets its source pinned first: a fixed seed, a frozen clock, a stubbed network, one worker, a repeat count high enough that it fails every time (run it 50 times and count).
Make it fast. Cut the loop until one run takes seconds: a narrower test path, a smaller fixture, no build step it doesn't need.
Redact. Everything you show or write down (logs, requests, fixtures, the finding) has secrets, tokens, cookies and personal data removed first.
When no loop can be built, stop. List what you tried and why each failed, and ask for exactly what is missing: access to the environment, a captured artifact, the failing input, a reproduction from the person who saw it. Do not move to phase 2 on a guess.
Done when: one command goes red on the bug, and you have seen it go red more than once.
Phase 2: one hypothesis at a time
- Write the hypothesis in one sentence, with a prediction the loop can
check: "if the cache returns a stale row, then logging the row's
updated_atshows a value older than the write". - Test only that: add the one log, assertion or breakpoint, run the loop, read the result.
- Confirmed: go to phase 3. Refuted: remove the instrumentation, write down what you ruled out, and form the next hypothesis from what the result showed. Never change two things between runs.
After three refuted hypotheses, stop and re-read the failing path end to end, or ask the owner; don't widen the search by trying fixes.
Done when: the root cause is named, with the run that showed it.
Phase 3: fix, and keep the loop
- Make the smallest change that fixes the root cause (not the symptom). Run the loop: green. Run the repo's checks: still green.
- Keep the loop as a regression test where the repo's test decisions allow it. Some repos decide against it (Shelfmark's "nothing boots the app" is one); there, keep the loop's assertion as a unit test of the function, or say in the finding that no test was added and why.
- Remove every temporary log, flag and harness you added.
Phase 4: the finding goes in the corpus
- A
log.mdentry of kindincident: the symptom, the root cause, the fix's commit, and the loop that proves it. - The wiki page for the area gets the lesson if it changes how the code
should be read or changed (
corpus-flow§4 says how).
Credit
The loop-first method follows mattpocock/skills' diagnosing-bugs and
obra/superpowers' systematic-debugging (root cause before any fix, one
hypothesis at a time). Written fresh, no text copied; see ATTRIBUTION.md.
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.

