debugging
Skill3 starsChanged 3 months agoMITView on GitHub
MUST USE when fixing a bug, diagnosing an error, stack trace, exception, crash, failing or flaky test, or any 'why is X not working / returning the wrong value' investigation in any language. Enforces root-cause-before-patching: reproduce, trace the failure backward to its origin, test one hypothesis, then fix once — instead of guarding the symptom. Also covers the 3-attempts-then-question-the-design rule.
81 other projects use a version of this.
Adopted by
Most recently taken up by
- JetBrains/intellij-communitytheir own version, first seen Oct 3, 2026
- iliaal/ai-skillstheir own version, first seen Oct 3, 2026
- kapadias/nonnatheir own version, first seen Oct 1, 2026
- JetBrains/MPStheir own version, first seen Oct 1, 2026
- kynn-dev/agent-skillstheir own version, first seen Sep 30, 2026
- geeks-accelerator/in-bed-aitheir own version, first seen Sep 29, 2026
Used with
Projects with it also use media-processing, databases 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.
mrgoonieSkillmedia-processing
Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.
Also in 4 projects that use this
mrgoonieSkilldatabases
Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin). Use when designing database schemas, writing queries and aggregations, optimizing indexes for performance, performing database migrations, configuring replication and sharding, implementing backup and restore strategies, managing database users and permissions, analyzing query performance, or administering production databases.
Also in 5 projects that use this
pproencaSkillrefactoring
Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
Also in 17 projects that use this
ShopifySkillprofiling
Profile Rubydex indexer performance — CPU flamegraphs, memory usage, phase-level timing. Use this skill whenever the user mentions profiling, performance, flamegraphs, benchmarking, "why is X slow", bottlenecks, hot paths, memory usage, or wants to understand where time is spent during indexing/resolution. Also trigger when comparing performance before/after a change.
Also in 3 projects that use this
sarveshtaleleSkilltest-generation
Generate a test strategy and starter test stubs for given modules across unit, integration, and e2e layers (pytest/jest/playwright). Trigger on: generate tests, test plan, test strategy, coverage plan, test scaffolding.
Also in 3 projects that use this
MicrosoftSkillusing-skills
Describes how to use abilities. Read before any conversation.
Also in 3 projects that use this
- +5 more from mrgoonie
Other versions81 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 81
- JetBrains/intellij-community★ 21ksame name
- mrgoonie/claudekit-skills★ 2.2ksame name
- JetBrains/MPS★ 1.7ksame name
- notque/vexjoy-agent★ 424same name
- idavidov13/agentic-playwright★ 222same name
- block/ai-rules★ 137same name
- duongthinh03/portfolio★ 85same name
- matteing/opal★ 61same name
- ratacat/claude-skills★ 56same name
- andreaswasita/copilot-agents-dojo★ 54same name
71 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 repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- code-structureSkill
- docker-best-practicesSkill
- drf-best-practicesSkill
- drizzle-ormSkill
- expressSkill
- fastapiSkill
- git-merge-conflictsSkill
- reactSkill
- researchSkill
- security-practicesSkill
- sqlSkill
- tanstack-querySkill
- tanstack-routerSkill
- testing-best-practicesSkill
- typescript-best-practicesSkill
The file
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 73 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 23
Add logging at component boundaries (function entry, API edge, IPC seam) to see where good input becomes bad.
- Distinctive: line 75
After three failed fix attempts on the same bug, stop patching and question the design.
- Distinctive: line 102
Read the actual stack trace: before theorizing. Start at the failure, trace the data backward to its origin.
- Distinctive: line 107
Never stack speculative changes.
“Common” is measured: kept by at least 6 in 10 of the 73 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
Debugging — Root Cause Before Patching
The law: no fix without a root cause first. A change that makes the symptom disappear without explaining why it appeared is not a fix — it's a second bug hiding the first. If you can't say what was wrong, you haven't fixed it.
The drain most people feel with debugging is thrashing: change something, re-run, hope, repeat. The method below is faster, not more ceremonial — it replaces guessing with tracing.
The Method
- Reproduce — get a reliable, minimal way to trigger the bug. No repro = no evidence your fix worked; you're just guessing in the dark.
- Trace backward — read the actual error and stack trace. Start at the failure point and follow the data backward to where the bad value was born. Add logging at component boundaries (function entry, API edge, IPC seam) to see where good input becomes bad.
- Hypothesize — state it out loud: "I think X is the cause because Y." Then test that one hypothesis with one minimal change.
- Fix once, then verify — fix the origin, re-run the repro, confirm it passes and that you understand why.
Symptom vs Cause
// BAD: guard the symptom — the null is still arriving, now silently
function render(user) {
if (!user) return null; // error gone, root cause untouched
return <Profile name={user.name} />;
}
// GOOD: trace backward — why is user null HERE?
// → useUser() returns null on a 401, and the caller mounts before auth resolves.
// The fix lives at the origin: gate the route on auth, or show a pending state.The guard isn't wrong forever — but adding it without knowing why user was null means you never learn it was an auth race, and the next screen hits it too.
One Change at a Time
BAD: bug is elusive → change the query, add a lock, bump the timeout, reorder
the calls → it works now → ship it
(You fixed nothing you can name. It'll come back and you won't know which
change mattered — or which one added a new bug.)
GOOD: one hypothesis → one change → re-run the repro → didn't help? revert it
before trying the next. Keep the diff minimal and explainable.Reverting failed attempts matters: five stacked "maybe this" changes become their own debugging problem.
Reproduce Before You Touch Code
BAD: "I can't reproduce it, but I think this is the fix" → push → "should be fixed"
GOOD: invest in a repro first — a failing test, a script, exact steps. A bug you
can't trigger is a bug you can't confirm you fixed.Turn the repro into a failing test when you can. It proves the bug exists, then proves the fix works, then guards against regression — three jobs, one artifact.
The 3-Attempt Rule
After three failed fix attempts on the same bug, stop patching and question the design. Persisting past three usually means the bug isn't where you're looking — the architecture is forcing it. Widen the frame: is the data model wrong? Is a boundary in the wrong place? Is an assumption you never checked false?
Red Flags — you've left the method
Language that signals you're guessing, not tracing. Stop when you catch yourself:
- "Let me just try…" / "Maybe if I…" — no hypothesis, just a slot-machine pull.
- "Quick fix for now" — a symptom guard you'll never come back to remove.
- "It works now" (but you can't say why) — the bug is dormant, not gone.
- "One more attempt" past the third — see the 3-attempt rule.
- Blaming the framework/compiler/"flaky" before reading your own stack trace.
When a Mitigation IS Legitimate
Root-cause-first is not "never ship a stopgap." A deliberate mitigation is fine when it's honest and tracked: you know the root cause, the real fix is large, and you ship a guard with a comment and a follow-up naming what's deferred. The anti-pattern is the accidental patch that hides a cause you never diagnosed.
Rules
- Never change code to make an error disappear until you can name why it occurred. Symptom-silencing is not fixing.
- Always reproduce first — no repro, no proof the fix worked.
- Read the actual stack trace before theorizing. Start at the failure, trace the data backward to its origin.
- Instrument at boundaries (function entry, API edge, IPC/runtime seam) to locate where good input becomes bad.
- State one hypothesis, make one change, verify, revert if it didn't help. Never stack speculative changes.
- Fix the origin, not the nearest catch site.
- After 3 failed attempts, stop and question the design — don't attempt a fourth patch in the same spot.
- Turn the repro into a failing test whenever practical.
- A stopgap is only allowed when the root cause is known and shipped with a comment + tracked follow-up. Never patch a cause you haven't diagnosed.
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.

