bug-diagnosis
Skill1 starsChanged 57 days agoMITView on GitHub
Use when something is broken, failing or intermittent. Diagnose before fixing: a command that goes red on this bug first, then falsifiable hypotheses.
7 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- ericwang200608-beep/LANYANT-Skillsedited, first seen Nov 8, 2026
- mariomile/builder-ostheir own version, first seen Nov 1, 2026
- juanitourquiza/shipframeedited, first seen Oct 23, 2026
- gigio1023/agent-skillstheir own version, first seen Oct 13, 2026
- gigio1023/gigio-skillstheir own version, first seen Oct 13, 2026
- karthikrshet/aiskillstheir own version, first seen Aug 20, 2026
Used with
Projects with it also use session-handoff.
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.
wpankSkillsession-handoff
WHAT: Create comprehensive handoff documents that enable fresh AI agents to seamlessly continue work with zero ambiguity. Solves long-running agent context exhaustion problem.
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- juanitourquiza/shipframe★ 439% same
- ericwang200608-beep/LANYANT-Skills★ 235% same
Wrote their own version · 5
- karthikrshet/aiskills★ 4same name
- gigio1023/agent-skills★ 2same name
- gigio1023/gigio-skills★ 2same name
- mariomile/builder-os★ 2same name
- Dizzy-Ten/skills★ 1same name
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 repository67 other files it gives its agents.
- architect-reviewerSkill
- backend-architectSkill
- backend-developerSkill
- code-architectSkill
- codebase-explorerSkill
- code-reviewerSkill
- code-simplifierSkill
- debuggerSkill
- error-detectiveSkill
- fullstack-developerSkill
- git-workflow-managerSkill
- legacy-modernizerSkill
- pragmatic-architectSkill
- prdSkill
- qa-expertSkill
- research-technical-spikeSkill
- sdd-spec-writerSkill
- security-auditorSkill
- supply-chain-securitySkill
- task-decomposition-expertSkill
- technical-debt-managerSkill
- test-engineerSkill
- typescript-proSkill
- architecture-decision-recordsSkill
- hermes-sdd-packagingSkill
- build-craftSkill
- code-healthSkill
- code-review-checklistSkill
- commit-smartSkill
- context-architectureSkill
- design-explorationSkill
- design-to-htmlSkill
- developer-experience-reviewSkill
- diagram-tripletSkill
- dispatching-parallel-agentsSkill
- document-diataxisSkill
- e2e-testing-patternsSkill
- executing-plansSkill
- module-designSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-proposeSkill
- openspec-sync-specsSkill
- openspec-update-changeSkill
- openspec-verify-changeSkill
- plan-scope-reviewSkill
- project-learningsSkill
- qa-test-plannerSkill
- requirements-claritySkill
- review-structuralSkill
- security-evidence-firstSkill
- agency-invocationSkill
- hermes-sdd-orchestrationSkill
- openspec-sddSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
6
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 52
Treat the loop as a product.
- Distinctive: line 67
Stop and say so explicitly.
- Distinctive: line 71
Phase 1 is done: when you can name one command — a script path, a test invocation, a curl — that you have already run at least once (show …
- Distinctive: line 82
Run the loop; watch it go red as the bug appears.
- Distinctive: line 102
If you cannot state the prediction, it is a vibe: discard it or sharpen it.
- Distinctive: line 123
Write the regression test before the fix — but only if there is a correct seam: one where the test exercises the real bug pattern as it …
“Common” is measured: kept by at least 6 in 10 of the 6 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
Bug diagnosis
A discipline for hard bugs: the one that resists a first glance, the intermittent flake, the regression that crept in between two known-known-good states. Skip a phase only when it is explicitly justified in the report.
The failure this skill exists to prevent: reading code to build a theory before any command has gone red on the bug. A fix built that way is a guess, and its regression test — if it exists — passes before and after.
Redact first
You will show commands, outputs and captured artifacts. Redact every secret before it reaches a
report: write <REDACTED> in its place. Build loops against environment variables, so the credential
stays in the environment rather than in what you show. Captured artifacts carry auth headers; quote
only the lines that carry the signal. If the redacted output is not enough to diagnose the bug, say so
and ask — do not unredact.
Phase 1 — Build a feedback loop
This is the skill. Everything else is mechanical. With a tight pass/fail signal for the bug — one that goes red on this bug — you will find the cause; bisection, hypothesis-testing and instrumentation all just consume it. Without one, no amount of staring at code will save you.
Spend disproportionate effort here. Be aggressive; be creative; refuse to give up.
Ways to construct one, roughly in order:
- Failing test at whatever seam reaches the bug: unit, integration, e2e.
- curl / HTTP script against a running dev server.
- CLI invocation with a fixture input, diffing stdout against a known-good snapshot.
- Headless browser script that drives the UI and asserts on DOM/console/network.
- Replay a captured trace — save a real request, payload or event log to disk and replay it through the code path in isolation.
- Throwaway harness — a minimal subset of the system that exercises the bug's code path with one call.
- Property / fuzz loop — for "sometimes wrong output", run a thousand random inputs and look for the failure mode.
- Bisection harness — automate "boot at state X, check, repeat" so a
git bisect runcan drive it. - Differential loop — the same input through old vs new (or two configs), diffing the outputs.
- HITL script — last resort. If a human must click, drive them with a script so the loop stays structured and their output feeds back to you.
Tighten the loop
Treat the loop as a product. Once you have a loop, tighten it:
- Faster? Cache the setup, skip unrelated init, narrow the test scope.
- Sharper? Assert the specific symptom, not "didn't crash".
- More deterministic? Pin time, seed the RNG, isolate the filesystem, freeze the network.
A 30-second flaky loop is barely better than none; a 2-second deterministic one is a debugging superpower.
For non-deterministic bugs the goal is not a clean repro but a higher reproduction rate: loop the trigger a hundred times, parallelise, add stress, narrow timing windows. A 50%-flake bug is debuggable; 1% is not, so keep raising the rate until it is.
When you genuinely cannot build one
Stop and say so explicitly. List what you tried and ask for: access to whatever environment reproduces it, a redacted captured artifact, or permission to add temporary instrumentation. Do not proceed to a hypothesis without a loop.
Phase 1 is done when you can name one command — a script path, a test invocation, a curl — that you have already run at least once (show the invocation and its output, redacted), and that is:
- Red-capable — it drives the bug's code path and asserts the user's exact symptom, so it can go red on this bug and green once fixed.
- Deterministic — the same verdict every run (for a flake: a pinned, high reproduction rate).
- Fast — seconds, not minutes.
- Agent-runnable — you can run it unattended.
Phase 2 — Reproduce and minimise
Run the loop; watch it go red as the bug appears. Confirm the failure mode is the one the user described, not a nearby different failure — wrong bug, wrong fix. Capture the exact symptom so a later phase can verify the fix actually addresses it.
Then minimise: shrink the repro to the smallest scenario that still goes red. Cut inputs, callers, config, data and steps one at a time, re-running after each cut, keeping only what is load-bearing for the failure. A minimal repro shrinks the hypothesis space in Phase 3 and becomes the clean regression test in Phase 5.
Done when every remaining element is load-bearing: removing any one of them makes the loop go green. Do not proceed until you have reproduced and minimised.
Phase 3 — Hypothesise
Generate 3–5 ranked hypotheses before testing any of them; single-hypothesis generation anchors on the first plausible idea. Each must be falsifiable — state the prediction it makes:
If
<X>is the cause, then changing<Y>will make the bug disappear / changing<Z>will make it worse.
If you cannot state the prediction, it is a vibe: discard it or sharpen it. Show the ranked list to the user before testing it. They often have domain knowledge that re-ranks instantly ("we just deployed a change to #3"), or know hypotheses already ruled out. Cheap checkpoint, big time saver — don't block on it if they are away.
Phase 4 — Instrument
Each probe must map to one specific prediction. Change one variable at a time.
Preference order: debugger / REPL inspection if the environment supports it (one breakpoint beats ten logs); then targeted logs at the boundaries that distinguish hypotheses. Never "log everything and grep".
Tag every debug log with a unique prefix (e.g. [DEBUG-a4f2]); cleanup then becomes a single grep.
Untagged logs survive and become sediment.
For a performance regression, logs are usually the wrong instrument: establish a baseline measurement (timing harness, profiler, query plan), then bisect. Measure first, fix second.
Phase 5 — Fix, with a regression test at a seam
Write the regression test before the fix — but only if there is a correct seam: one where the test exercises the real bug pattern as it occurs at the call site. A test at a seam too shallow (a single-caller test when the bug needed several, a unit test that cannot replicate the chain that triggered it) gives false confidence.
If no correct seam exists, that is itself the finding. Note it, and flag it as a candidate for a
design change — the architecture is preventing the bug from being locked down. Consult module-design
for where a better seam would go.
Where a correct seam exists:
- Turn the minimised repro into a failing test at that seam.
- Watch it fail — for the reason the bug fails.
- Apply the fix.
- Watch it pass.
- Re-run the Phase 1 loop against the original, un-minimised scenario.
Phase 6 — Cleanup
Required before declaring done:
- The original repro no longer reproduces (re-run the Phase 1 loop).
- The regression test passes — or the absence of a seam is documented as the finding.
- All
[DEBUG-...]instrumentation removed (grep the prefix). - Throwaway prototypes deleted or moved to a clearly marked debug location.
- The hypothesis that turned out correct stated in the commit or PR message, so the next debugger learns.
Reporting
The stage's evidence is the loop's invocation and its output, redacted — not a description of the bug.
A fix reported without the command that went red before it is a theory, and rules/testing.md treats it
as one.
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.

