diagnosing-bugs
Skill8 starsChanged 2 months agoMITView on GitHub
Diagnose hard bugs, intermittent flakes, and performance regressions using a tight feedback loop. Use when the user reports broken behavior, runtime exceptions, failing tests, flaky CI, or says \"debug this\" / \"diagnose this\" — even if no error message is provided. Do NOT use for routine test-driven feature development.
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
4
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 55
Action: Run the loop to confirm reproduction, then systematically remove non-essential config, data, and steps.
- Distinctive: line 56
Key Point: Every remaining line in the repro must be load-bearing (removing it turns the loop green).
- Distinctive: line 61
Key Point: Use format: *"If X is the cause, then changing Y will make the symptom disappear."*
- Distinctive: line 70
Action: Write the regression test, apply the minimal fix, verify the full suite, and purge all debug instrumentation.
“Common” is measured: kept by at least 6 in 10 of the 177 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
A disciplined feedback-loop methodology for diagnosing and resolving hard bugs, intermittent flakes, and performance regressions.
Core Principle
Never guess or hypothesize before establishing a fast, deterministic, automated feedback loop that reliably reproduces the red failure.
Core Invariants
- Mandatory Red Loop Before Theory: Construct a fast, automated repro command and see it fail before formulating or testing any hypotheses.
- Credential Redaction First: Redact all keys, authorization headers, tokens, and secrets with
<REDACTED>before displaying outputs or logs. - Single Variable Instrumentation: Change only one variable at a time when probing hypothesis boundaries.
- Unique Debug Tagging: Tag all temporary diagnostic logs with a unique searchable prefix (e.g.
[DEBUG-trace]) for complete cleanup before commit. - Regression Test at Public Seam: Lock down the fix with a permanent test at a genuine architectural seam before declaring victory.
Architecture & Map of Content (MOC)
[ Build Tight Loop ] ──► [ Reproduce & Minimise ] ──► [ 3–5 Ranked Hypotheses ] ──► [ Targeted Probe ] ──► [ Fix & Regression Test ] ──► [ Clean ]| Phase | Core Objective | Key Deliverable |
| Phase 1: Build Loop | Construct automated pass/fail signal | Single executable command that goes red on this bug |
| Phase 2: Minimise | Shrink failure to essential variables | Minimal load-bearing repro payload |
| Phase 3: Hypothesise | Formulate 3–5 falsifiable predictions | Ranked hypothesis table with testable predictions |
| Phase 4: Instrument | Test predictions with minimal probes | Tagged [DEBUG-...] logs or debugger inspection |
| Phase 5: Fix & Test | Lock down behavior at public seam | Permanent automated regression test |
| Phase 6: Cleanup | Remove diagnostic scaffolding | Verified clean git status & passing test suite |
Step-by-Step Procedure (TWI)
Step 1: Construct a Tight Feedback Loop (Phase 1)
- Action: Build an automated runner (failing test, CLI fixture, curl script, or trace replay) that drives the bug path.
- Key Point: The loop must be fast (< 5s), deterministic, and assert the user's exact symptom.
- Inline Checklist:
- Automated command exists and has been executed
- Command goes red specifically on this bug symptom
- Execution completes in seconds without manual intervention
- Why: Staring at code without a feedback loop leads to guessing and confirmation bias.
Step 2: Reproduce and Minimise (Phase 2)
- Action: Run the loop to confirm reproduction, then systematically remove non-essential config, data, and steps.
- Key Point: Every remaining line in the repro must be load-bearing (removing it turns the loop green).
- Why: Minimal repros shrink the hypothesis space and convert cleanly into permanent regression tests.
Step 3: Formulate Falsifiable Hypotheses (Phase 3)
- Action: Generate 3–5 ranked hypotheses stating the explicit prediction each makes.
- Key Point: Use format: "If X is the cause, then changing Y will make the symptom disappear."
- Why: Single-hypothesis debugging anchors on first impressions and wastes turns.
Step 4: Instrument and Isolate (Phase 4)
- Action: Insert tagged probes (
[DEBUG-xxx]) or inspect values at key boundaries. - Key Point: Change only one variable at a time; measure baselines before tuning performance bugs.
- Why: Changing multiple variables simultaneously confounds cause and effect.
Step 5: Fix, Verify, and Clean (Phases 5 & 6)
- Action: Write the regression test, apply the minimal fix, verify the full suite, and purge all debug instrumentation.
- Inline Checklist:
- Regression test fails without fix and passes with fix
- Original un-minimised repro confirmed green
- All
[DEBUG-...]tags purged from codebase - Root cause documented clearly in commit message
Anti-Rationalization Guardrails
| Tempting Rationalization | Binding Rule | Engineering Rationale |
| "I think I see the bug in the code, let me fix it now." | No edits without an automated red feedback loop. | Fixing code based on inspection often addresses symptoms while missing root causes. |
| "The bug is non-deterministic so we cannot automate a test." | Increase reproduction rate (stress, loops, pinned clocks). | A 50% flake rate is debuggable; raise reproduction frequency until testable. |
| "I'll add logs everywhere and inspect all outputs." | Targeted, tagged probes only. | Untargeted logging floods context and creates cleanup debt. |
| "The fix works in manual testing, skip the regression test." | Mandatory automated regression test at public seam. | Without a regression test, the bug will silently return in future refactors. |
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- mattpocock/skills★ 309ksame name
- QuivrHQ/quivr★ 40ksame name
- GreyDGL/PentestGPT★ 16ksame name
- ArcReel/ArcReel★ 6ksame 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
- epam/ketcher★ 927same name
- getsentry/sentry-dart★ 877same name
182 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.
Used alongsideProjects with it also use loop-me, claude-handoff and 1 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.
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 50 projects that use this
ryotaroh180105Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 37 projects that use this
FabienDehopreSkilldecision-mapping
Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.
Also in 6 projects that use this
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-data-remediationSkill
- ai-engineeringSkill
- codebase-designSkill
- code-reviewSkill
- domain-modelingSkill
- engineering-workflow-guideSkill
- git-safety-guardrailsSkill
- goalSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- j-spaceSkill
- migrate-to-shoehornSkill
- ml-best-practicesSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- retroSkill
- scaffold-exercisesSkill
- setup-engineering-workflowsSkill
- setup-pre-commitSkill
- setup-ts-deep-modulesSkill
- skill-conductorSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- workflow-designerSkill
- writing-beatsSkill
- writing-for-agentsSkill
- writing-fragmentsSkill
- writing-shapeSkill
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.

