systematic-debugging
Skill5 starsChanged 4 months agoMITView on GitHub
Debug a bug, test failure, crash, or unexpected behaviour by finding the root cause before changing anything, instead of guessing at fixes. Works in any language or stack. Use when something is broken, a test is failing, behaviour is wrong, or a previous fix didn't hold.
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 171 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Do all of this before forming any fix.
- Distinctive: line 27
If you're following a reference or pattern, read it completely before applying it.
- Distinctive: line 33
If it confirms, move on. If it doesn't, form a *new* hypothesis from what you just learned.
- Distinctive: line 34
If you genuinely don't understand something, say so and dig in or ask, rather than pretending and patching.
- Very specific: line 38
Write a failing test that reproduces the bug first, automated if there's a framework, a throwaway script if not.
- Very specific: line 40
Verify: the new test passes, the original symptom is gone, and nothing else broke.
“Common” is measured: kept by at least 6 in 10 of the 171 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
Find the root cause before you touch a line of code. A fix that targets a symptom you don't understand either fails or moves the bug somewhere else, and each blind attempt makes the next one harder to reason about. Investigation first is not the slow path; it is the fast one.
The one rule
No fix before you can name the root cause. If you can't say "the bug happens because X", you are still investigating, not fixing. The moment you feel "let me just try changing this and see": stop. That instinct is the thing this skill exists to interrupt.
This holds hardest exactly when it feels most skippable: under time pressure, when the bug "looks simple", when you've already tried two things. Simple bugs have root causes too, and guess-and-check is slower than it feels because every wrong attempt has to be unwound.
Step 1: Investigate the root cause
Do all of this before forming any fix.
- Read the actual error. The full message, the full stack trace, line numbers, error codes. The answer is often already written there. Don't skim past it to the part you assume is the problem.
- Reproduce it reliably. What exact steps trigger it? Every time, or intermittently? If you can't reproduce it, you can't confirm a fix: gather more data rather than guessing.
- Check what changed.
git diff, recent commits, new dependencies, config or environment differences. A bug that just appeared usually has a recent cause. - Instrument the boundaries when the system has multiple layers (request → service → database, CI → build → sign). Log what enters and what leaves each boundary, run once, and read where the data first goes wrong. Find the failing layer with evidence before you reason about why that layer fails.
- Trace the bad value to its origin. When the error surfaces deep in a call stack, work backward: where did this value come from, what passed it in, and up the chain until you reach the true source. Fix it there, not where it happened to blow up.
Step 2: Compare against what works
- Find similar code in the same codebase that does work. What is different between it and the broken path? List every difference, even ones you're sure don't matter, "that can't be it" is where bugs hide.
- If you're following a reference or pattern, read it completely before applying it. Partial understanding produces confident wrong fixes.
Step 3: Form one hypothesis and test it minimally
- State it explicitly: "I think the cause is X, because Y." Write it down. Be specific.
- Make the smallest possible change that would confirm or refute it. One variable at a time; don't bundle three speculative changes and lose track of which one mattered.
- If it confirms, move on. If it doesn't, form a new hypothesis from what you just learned; don't pile another fix on top of the last.
- If you genuinely don't understand something, say so and dig in or ask, rather than pretending and patching.
Step 4: Fix the cause and prove it
- Write a failing test that reproduces the bug first, automated if there's a framework, a throwaway script if not. A fix without a test that once failed doesn't stay fixed. (Use the
test-driven-developmentskill for the red-green discipline here.) - Make one change addressing the root cause. No "while I'm in here" refactors or bundled improvements; they muddy what actually fixed it.
- Verify: the new test passes, the original symptom is gone, and nothing else broke. Don't claim it's fixed off a code change alone: run it. (The
verify-completionskill covers this gate.)
When fixes keep failing
Count your attempts. If three fixes have failed, stop fixing. Three failures, especially when each one reveals a new problem in a different place, or each "fix" needs a larger refactor to work, is not a run of bad luck. It is a sign the underlying design is wrong. Step back and question the architecture itself with the user before attempting a fourth patch. That is a different conversation, not another guess.
Red flags in your own thinking
These thoughts all mean return to Step 1:
- "Quick fix now, understand it later."
- "It's probably X, let me just change that."
- "Let me change a few things and run the tests."
- "I'll skip the test and check it by hand."
- "I don't fully get it, but this might work."
- Listing fixes before you've traced the data flow.
- "One more attempt", after you've already tried two.
If there really is no single root cause
Occasionally thorough investigation shows the issue is genuinely environmental, timing-dependent, or external. Then: document what you ruled out, implement appropriate handling (retry, timeout, a clear error, monitoring), and move on. But reach this conclusion only after the investigation above, most "no root cause" calls are just incomplete ones.
Attribution
Adapted from the systematic-debugging entry of superpowers by Jesse Vincent (MIT). The structure and the core rules are theirs; the wording, the examples, and the integration with this registry's other items are this repository's.
Other versions187 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 187
- obra/superpowers★ 305ksame name
- NousResearch/hermes-agent★ 259ksame name
- open-metadata/OpenMetadata★ 16ksame name
- jnMetaCode/superpowers-zh★ 8.4ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- openai/plugins★ 7.4ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- farm-fe/farm★ 5.6ksame name
- microsoft/FluidFramework★ 5ksame name
177 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 chinese-code-review, chinese-commit-conventions 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.
GEd520Skillchinese-code-review
中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。
Also in 7 projects that use this
GEd520Skillchinese-commit-conventions
中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。
Also in 7 projects that use this
obraSkilldiagnosing-superpowers
Use when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.
Also in 13 projects that use this
SethGammonSkillascii-diagram
Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.
Also in 4 projects that use this
mjunaidcaSkillbuilding-chatgpt-apps
Guides creation of ChatGPT Apps with interactive widgets using OpenAI Apps SDK and MCP servers. Use when building ChatGPT custom apps with visual UI components, embedded widgets, or rich interactive experiences. Covers widget architecture, MCP server setup with FastMCP, response metadata, and Developer Mode configuration. NOT when building standard MCP servers without widgets (use building-mcp-servers skill instead).
Also in 4 projects that use this
mjunaidcaSkillbuilding-chat-interfaces
Build AI chat interfaces with custom backends, authentication, and context injection. Use when integrating chat UI with AI agents, adding auth to chat, injecting user/page context, or implementing httpOnly cookie proxies. Covers ChatKitServer, useChatKit, and MCP auth patterns. NOT when building simple chatbots without persistence or custom agent integration.
Also in 4 projects that use this
- +2 more from GEd520
- +4 more from mjunaidca
In this repository89 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- site/llms-full.txtllms.txt
- site/llms.txtllms.txt
- improveSkill
- academic-writingSkill
- benchmark-reportingSkill
- bibtex-managerSkill
- citation-graphSkill
- citation-verifierSkill
- design-science-methodologySkill
- docx-thesisSkill
- experiment-reproducibilitySkill
- latex-toolkitSkill
- literature-searchSkill
- lit-review-synthesisSkill
- paper-readerSkill
- proofread-academicSkill
- research-figuresSkill
- research-methodologySkill
- research-questionSkill
- statistics-advisorSkill
- supervisor-updateSkill
- systematic-reviewSkill
- thesis-proposalSkill
- coolify-image-appSkill
- coolify-vps-baselineSkill
- deploy-verificationSkill
- express-prisma-coolify-imageSkill
- ghcr-coolify-pipelineSkill
- live-domain-cutoverSkill
- nextjs-coolify-imageSkill
- proxy-client-addressSkill
- vps-ops-toolkitSkill
- adr-writingSkill
- openapi-specSkill
- readme-writingSkill
- technical-writingSkill
- adversarial-reviewerSkill
- api-design-reviewSkill
- code-review-responseSkill
- create-agentSkill
- create-commandSkill
- create-hookSkill
- create-skillSkill
- db-migration-safetySkill
- dependency-upgradeSkill
- dockerfile-best-practicesSkill
- error-handling-patternsSkill
- executing-plansSkill
- explain-codebaseSkill
- fix-ciSkill
- github-actions-pipelineSkill
- grill-with-docsSkill
- incident-postmortemSkill
- logging-and-observabilitySkill
- parallel-agentsSkill
- performance-optimizationSkill
- refactoring-recipesSkill
- solid-principlesSkill
- test-driven-developmentSkill
- The first 60 shown.
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.

