debug
Skill1 starsChanged 4 months agoMITView on GitHub
Systematic debugging — triage a failure, reproduce it reliably, isolate the cause, then fix the root cause and prove it. Use when something is broken, throwing, flaky, slow, or behaving unexpectedly; when investigating a stack trace, a failing test, a production incident, or "it works on my machine".
192 other projects use a version of this.
Adopted by
Most recently taken up by
- PeanutGT/NutsSkillstheir own version, first seen Nov 8, 2026
- jskswamy/skillstheir own version, first seen Nov 8, 2026
- Firzus/agent-skillstheir own version, first seen Nov 8, 2026
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- microsoft/veronatheir own version, first seen Nov 8, 2026
Used with
Projects with it also use add-discord, add-slack 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.
MicrosoftSkilladd-discord
Add Discord bot channel integration via Chat SDK.
Also in 11 projects that use this
MicrosoftSkilladd-slack
Add Slack channel integration via Chat SDK.
Also in 11 projects that use this
- +10 more from microsoft
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- Yeachan-Heo/oh-my-claude-sisyphus★ 41ksame name
- Yeachan-Heo/oh-my-claudecode★ 41ksame name
- anthropics/knowledge-work-plugins★ 35ksame name
- gavrielc/nanoclaw★ 31ksame name
- nanocoai/nanoclaw★ 31ksame name
- qwibitai/nanoclaw★ 31ksame name
- openai/symphony★ 27ksame name
- FalkorDB/FalkorDB★ 10ksame name
- NVIDIA/TensorRT-Model-Optimizer★ 5.6ksame name
- NVIDIA/Model-Optimizer★ 5.6ksame 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.
In this repository10 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- agent-llmSkill
- dataSkill
- doc-coauthoringSkill
- frontend-designSkill
- git-opsSkill
- loop-verifySkill
- refactorSkill
- securitySkill
- testingSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 175 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Read the stack trace bottom-up to the first line in _your_ code.
- Distinctive: line 36
Use a debugger/breakpoint for complex control flow.
- Distinctive: line 38
Remove all temporary instrumentation before you finish.
- Very specific: line 42
Ask "why" until you hit the real cause.
- Distinctive: line 43
Prefer the fix that makes the whole class of bug impossible (a type, an invariant, a constraint) over patching this one instance.
- Distinctive: line 44
Keep the fix minimal and scoped.
- Distinctive: line 50
If the bug could recur elsewhere, grep for the same pattern and note it.
“Common” is measured: kept by at least 6 in 10 of the 175 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
Debug: Triage + Repro
Debugging is a search, not a guess. The fastest path is almost always: reproduce → isolate → understand → fix → prove. Resist the urge to change code before you can reproduce the failure.
1. Triage — understand the report
- Capture the exact symptom: error message, stack trace, wrong output, or the gap between expected and actual. Quote it verbatim; don't paraphrase.
- Establish the blast radius: one user or all? one route or the app? since when? Correlate with the last deploy, migration, or dependency change.
- Note the environment where it fails (local / CI / prod) and where it doesn't. The difference between them is a clue.
- Severity check: if it's a live incident, mitigate first (roll back, feature-flag off) then debug calmly. Don't debug a fire.
2. Reproduce — make it happen on demand
A bug you can't reproduce, you can't fix — you can only guess. Invest here.
- Find the smallest input/steps that trigger it. Strip away everything that isn't required to reproduce.
- Turn the repro into a failing test (
pnpm test). This is the single highest-leverage move: it pins the bug, becomes the fix's proof, and prevents regression. Write it before touching the fix. - For flaky failures: run it in a loop (
for i in {1..50}; do ...), fix a seed, removeDate.now()/random/timezone/ordering nondeterminism, and check for shared state between tests. - For "works locally, fails in CI/prod": diff the environments — Node version, env vars, timezone, DB state, migration level, case-sensitive filesystem, network.
3. Isolate — bisect toward the cause
- Bisect in time:
git bisect(orgit logon the touched files) to find the commit that introduced it. - Bisect in space: comment out / short-circuit halves of the pipeline until the failure disappears. The boundary is your suspect.
- Read the stack trace bottom-up to the first line in your code; that's usually where to look, not the library frame at the top.
- Form one hypothesis at a time and test it. "I think X is null here" → add an assertion/log → confirm or kill it. Don't change three things at once.
4. Instrument — see the actual state
- Log the real values at the boundary where expected diverges from actual — inputs, the branch taken, the return value. Print types, not just values (
typeof,Array.isArray,nullvsundefined). - Use a debugger/breakpoint for complex control flow; use targeted logging for async, timing, and distributed flows.
- In this stack: check the Network tab for API-route responses, server logs for the actual SQL and its parameters, and whether the failure is client- or server-side (Next.js hydration mismatches masquerade as logic bugs).
- Remove all temporary instrumentation before you finish.
5. Fix the root cause, not the symptom
- Ask "why" until you hit the real cause. A
nullcheck that silences a crash is a bandage if the value should never have been null — fix where it became null. - Prefer the fix that makes the whole class of bug impossible (a type, an invariant, a constraint) over patching this one instance.
- Keep the fix minimal and scoped. Don't refactor while fixing — one concern at a time.
6. Prove it and close out
- The test from step 2 now passes; the full suite still passes (
pnpm test). The harness Stop gate will hold you to this. - Confirm you fixed the reported symptom, not just a plausible-looking nearby thing.
- If the bug could recur elsewhere, grep for the same pattern and note it. If it was a class of mistake, consider whether a lint rule or type prevents the next one.
- State plainly what the cause was and why the fix addresses it — a one-line post-mortem beats a silent commit.
Anti-patterns
- Changing code hoping it helps, without a reproduction or a hypothesis ("shotgun debugging").
- "Fixing" a flaky test by adding
sleepor a retry instead of finding the race. - Swallowing the error (
catch {}) to make the red go away. - Blaming the framework/library first — it's your code until proven otherwise.
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.

