diagnosing-bugs
Skill878 starsChanged 32 days agoMITView on GitHub
A discipline for hard bugs, flaky tests, CI hangs, and performance regressions in this SDK. Use when the user says "diagnose" or "debug this", reports something broken/throwing/failing/hanging/slow, or a test is flaky. Builds a tight, red-capable feedback loop before hypothesizing.
193 other projects use a version of this, 152 of them edited.
Adopted by
Most recently taken up by
- ChatbotXIO/ChatbotXedited, first seen Nov 9, 2026
- wowyuarm/dsh-agent-teamedited, first seen Nov 8, 2026
- Contexera/dsh-agent-teamedited, first seen Nov 8, 2026
- The-Vibe-Company/quivredited, first seen Nov 8, 2026
- gaoyu06/harnessedited, first seen Nov 8, 2026
- DnsQueen/orcinus-skillsedited, first seen Nov 8, 2026
Used with
Projects with it also use setup-ts-deep-modules, loop-me 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.
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
- +2 more from aws
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 152
- mattpocock/skills★ 309k16% same
- QuivrHQ/quivr★ 40k16% same
- The-Vibe-Company/quivr★ 40k16% same
- GreyDGL/PentestGPT★ 16k18% same
- ArcReel/ArcReel★ 6.3k16% same
- withcoral/coral★ 4.9k16% same
- bestofjs/bestofjs★ 3.1k17% same
- getsentry/sentry-react-native★ 1.8k55% same
- ChatbotXIO/ChatbotX★ 1.1k10% same
- epam/ketcher★ 93216% same
142 more not listed
Wrote their own version · 41
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- nodetool-ai/nodetool★ 615same name
- stevesolun/ctx★ 583same name
- devcxl/mattpocock-skills-zh★ 522same name
- OyadotAI/oya-browser★ 348same name
- jellydn/my-ai-tools★ 127same name
- WenWuZhiDao/mattpocock-skills-zh★ 27same name
- rafaelob/pragmatic-agent-skills★ 24same name
- svyatov/supermatt★ 20same name
- mxrsv/agents-skills★ 11same name
31 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 repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- packages/dart/AGENTS.mdAGENTS.md
- packages/flutter/AGENTS.mdAGENTS.md
- code-guidelinesSkill
- design-firstSkill
- reviewSkill
- specSkill
- test-guidelinesSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 181 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
No red-capable command, no Phase 2.
- Distinctive: line 64
Prefer a debugger / breakpoint over logs where the env supports it.
“Common” is measured: kept by at least 6 in 10 of the 181 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
A discipline for hard bugs. Skip a phase only when you can say why.
The whole skill is Phase 1: get a loop that goes red on this bug. Everything after is mechanical once you have it. If you catch yourself reading code to form a theory before that loop exists, stop — jumping to a hypothesis without a red-capable loop is the exact failure this prevents.
For trivial bugs with an obvious fix and an obvious test, skip this and just write the failing test — this skill is for the bugs that resist.
Phase 1 — Build a feedback loop
A tight loop is fast, deterministic, and goes red on this bug. Build one and the bug is 90% solved; bisection, hypothesis-testing, and instrumentation all just consume it. Be aggressive and creative here — spend disproportionate effort.
Ways to construct one — try roughly in this order
- Failing test at the seam —
dart test path/to/test.dartorflutter test, unit or widget, at whatever seam reaches the bug. Tightest loop there is. fakeAsyncharness — for timer, microtask, and timing-dependent bugs (most flakes). Pin the clock viaoptions.clock, elapse time deterministically.testWidgetsharness — for Flutter UI bugs: pump the widget tree, drive the gesture, assert on the tree (e.g. a hit-test or navigation regression).- Integration test —
flutter test integration_test/...when the bug crosses the native (JNI/FFI) boundary, which cannot be faked (seepackages/flutter/AGENTS.md). - Replay a captured payload — save a real envelope / event / span / network payload to disk and replay it through the code path in isolation.
- Throwaway harness — a minimal
void main()that exercises the bug path with one call and mocked deps. - Stress/repetition loop — for non-deterministic bugs: run the trigger 100×, parallelise, narrow timing windows, inject delays. The goal is a higher reproduction rate, not a clean repro.
- Differential loop — run the same input through two versions or two configs (e.g. before/after a dependency bump) and diff the output. For regressions that "appeared after X".
- Bisection harness — if it appeared between two commits, script the red/green check and
git bisect runit.
Tighten the loop
Once you have a loop, treat it as a product and tighten it:
- Faster — narrow the test scope, skip unrelated init.
- Sharper — assert the exact symptom the user described, not "didn't crash".
- More deterministic — pin the clock (
options.clock), usefakeAsync, seed any randomness, avoid real network/filesystem (per test-guidelines). A 2-second deterministic loop beats a 30-second flaky one.
For non-deterministic bugs the goal is a high enough reproduction rate to debug against — a 50% flake is debuggable, 1% is not. Keep raising the rate.
Completion criterion
Phase 1 is done when you can name one command — a test invocation or script path — that you have already run at least once (paste the invocation and its output), and that is:
- Red-capable — drives the actual bug path and asserts the user's exact symptom, so it goes red now and green once fixed
- Deterministic — same verdict every run (flaky bugs: a pinned, high reproduction rate)
- Fast — seconds, not minutes
No red-capable command, no Phase 2.
When you genuinely cannot build a loop
Say so explicitly, list what you tried, and ask the user for: access to an environment that reproduces it, a captured artifact (envelope dump, log, CI run, screen recording with timestamps), or permission for temporary instrumentation. Do not hypothesise without a loop.
Phase 2 — Reproduce and minimise
Run the loop, watch it go red. Confirm it produces the failure mode the user described — not a nearby one (wrong bug = wrong fix). Then shrink the repro to the smallest scenario that still goes red: cut inputs, callers, config, and steps one at a time, re-running after each cut. Done when every remaining element is load-bearing — removing any one turns it green. The minimal repro shrinks the hypothesis space and becomes the regression test.
Phase 3 — Hypothesise
Generate 3–5 ranked, falsifiable hypotheses before testing any — a single hypothesis anchors you on the first plausible idea. Each must state its prediction: "If X is the cause, then changing Y makes the bug vanish." If you can't state the prediction, it's a vibe — sharpen or discard it. Show the ranked list to the user before testing; they often re-rank it instantly ("we just changed #3"). Don't block on it if they're away.
Phase 4 — Instrument
Each probe maps to one prediction from Phase 3. Change one variable at a time.
- Prefer a debugger / breakpoint over logs where the env supports it. One breakpoint beats ten logs.
- Otherwise add targeted logs at the boundaries that distinguish hypotheses — never "log everything and grep".
- Tag every debug log with a unique prefix like
[DEBUG-a4f2]so cleanup is one grep. - Performance regressions: logs are the wrong tool. Establish a baseline measurement (
Stopwatch, a timing harness, DevTools, the observatory), then bisect. Measure first, fix second.
Phase 5 — Fix and regression test
Write the regression test before the fix — but only at a correct seam, one that exercises the real bug pattern as it occurs at the call site (per test-guidelines). A too-shallow seam (a unit test that can't replicate the chain that triggered it) gives false confidence. If no correct seam exists, that is itself the finding — note it; the architecture is preventing the bug from being locked down.
With a correct seam: turn the minimised repro into a failing test, watch it fail, apply the fix, watch it pass, then re-run the Phase 1 loop against the original un-minimised scenario.
Phase 6 — Cleanup and post-mortem
Before declaring done:
- Original repro no longer reproduces (re-run the Phase 1 loop)
- Regression test passes (or the absence of a seam is documented)
- All
[DEBUG-…]instrumentation removed (grep the prefix) - Throwaway harnesses deleted
- The correct hypothesis is stated in the commit / PR message, so the next debugger learns
Then ask: what would have prevented this bug? If the answer is architectural — no good test seam, tangled callers, a shallow module hiding the real bug behind it — hand off to the design-first skill with the specifics. Make that call after the fix is in, when you know the most.
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.

