systematic-debugging
Skill12 starsChanged 2 months agoMITView on GitHub
Systematic methodology for debugging bugs, test failures, and unexpected behavior. Use when encountering any technical issue before proposing fixes. Covers root cause investigation, pattern analysis, hypothesis testing, and fix implementation. Use ESPECIALLY when under time pressure, "just one quick fix" seems obvious, or you've already tried multiple fixes. NOT for exploratory code reading.
191 other projects use a version of this, 106 of them edited.
Adopted by
Most recently taken up by
- NousResearch/hermes-agentedited, first seen Nov 13, 2026
- andreymudri/fleetmatestheir own version, first seen Oct 5, 2026
- fmind/dottheir own version, first seen Oct 5, 2026
- Integralist/agent-skillstheir own version, first seen Oct 4, 2026
- asta-nguyen/kamehadbtheir own version, first seen Oct 4, 2026
- LayneChai/superpowers-dshedited, first seen Oct 3, 2026
Used with
Projects with it also use diagnosing-superpowers and chinese-git-workflow.
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.
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 6 projects that use this
MorningStar0709Skillchinese-git-workflow
Configure Git for domestic platforms and manage branching strategies suitable for Chinese teams. Use when the user asks to configure remotes, set up SSH, or manage Git workflows for Gitee, Coding, Jihu GitLab, or CNB, including requests like "配置国内 Git", "设置 Gitee 远程仓库", "推荐适合小团队的 Git 流程".
Also in 4 projects that use this
Other versions191 projects use a version of this.
Word for word · 3
- mjunaidca/mjs-agent-skills★ 27100% same
- AbdullahMalik17/Hacathan_5★ 9100% same
- AbdullahMalik17/My_skills★ 9100% same
Edited · 106
- obra/superpowers★ 314k23% same
- NousResearch/hermes-agent★ 267k12% same
- openai/plugins★ 7.3k23% same
- microsoft/FluidFramework★ 4.9k24% same
- pedronauck/skills★ 63323% same
- coco-research/coco★ 43723% same
- Ibrahim-3d/orchestrator-supaconductor★ 38020% same
- maslennikov-ig/claude-code-orchestrator-kit★ 25923% same
- aivrar/portable-hermes-agent★ 23212% same
- graniet/kheish★ 22117% same
96 more not listed
Wrote their own version · 82
- open-metadata/OpenMetadata★ 15ksame name
- jnMetaCode/superpowers-zh★ 8.3ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- compozy/compozy★ 2.8ksame name
- GanyuanRan/Aegis★ 1.3ksame name
- SethGammon/Citadel★ 922same name
- sangrokjung/claude-forge★ 847same name
- taracodlabs/aiden★ 846same name
- Archive228/loopkit★ 756same name
- KbWen/agentic-os★ 206same name
72 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 repository60 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- browser-useSkill
- browsing-with-playwrightSkill
- building-chatgpt-appsSkill
- building-chat-interfacesSkill
- building-chat-widgetsSkill
- building-mcp-serversSkill
- building-nextjs-appsSkill
- building-rag-systemsSkill
- configuring-better-authSkill
- configuring-dapr-pubsubSkill
- containerizing-applicationsSkill
- context7-efficientSkill
- context-degradationSkill
- context-fundamentalsSkill
- context-optimizationSkill
- creating-skillsSkill
- deploying-cloud-k8sSkill
- deploying-kafka-k8sSkill
- deploying-postgres-k8sSkill
- designing-nextjs-uiSkill
- digital-fte-orchestratorSkill
- doc-coauthoringSkill
- docxSkill
- evaluationSkill
- fetching-library-docsSkill
- generating-ceo-briefingSkill
- installing-skill-trackerSkill
- internal-commsSkill
- managing-calendarSkill
- managing-odooSkill
- managing-servicesSkill
- memory-systemsSkill
- multi-agent-patternsSkill
- nextjs-devtoolsSkill
- nx-monorepoSkill
- operating-k8s-localSkill
- operating-production-servicesSkill
- pdfSkill
- posting-facebookSkill
- posting-instagramSkill
- posting-linkedinSkill
- posting-twitterSkill
- pptxSkill
- project-designerSkill
- researching-with-deepwikiSkill
- scaffolding-fastapi-daprSkill
- scaffolding-openai-agentsSkill
- sending-emailsSkill
- skill-creatorSkill
- streaming-llm-responsesSkill
- styling-with-shadcnSkill
- theme-factorySkill
- tool-designSkill
- watching-filesystemSkill
- watching-gmailSkill
- watching-whatsappSkill
- working-with-documentsSkill
- working-with-spreadsheetsSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
11 rules. 3 are common, 8 are distinctive, and 0 are very specific to this project.
3
Common
Most of the 170 edited versions we read keep these.
8
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
- Common: line 15
Core principle: ALWAYS find root cause before attempting fixes.
- Distinctive: line 23
If you haven't completed Phase 1, you cannot propose fixes.
- Distinctive: line 34
Don't skip past errors or warnings
- Distinctive: line 35
Read stack traces completely
- Common: line 41
If not reproducible, gather more data - don't guess
- Distinctive: line 50
When system has multiple components (CI -> build -> signing, API -> service -> database):
- Distinctive: line 71
Compare Against References: - Read reference implementations COMPLETELY, don't skim
- Distinctive: line 85
Verify Fix: - Test passes? No regressions?
- Distinctive: line 89
If < 3: Return to Phase 1, re-analyze
- Common: line 105
If you catch yourself thinking:
- Distinctive: line 121
When you fix a bug, validate at EVERY layer:
“Common” is measured: kept by at least 6 in 10 of the 170 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
Systematic Debugging
Random fixes waste time and create new bugs. Quick patches mask underlying issues.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRSTIf you haven't completed Phase 1, you cannot propose fixes.
The Four Phases
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
- Read Error Messages Carefully
- Don't skip past errors or warnings
- Read stack traces completely
- Note line numbers, file paths, error codes
- Reproduce Consistently
- Can you trigger it reliably?
- What are the exact steps?
- If not reproducible, gather more data - don't guess
- Check Recent Changes
- Git diff, recent commits
- New dependencies, config changes
- Environmental differences
Gather Evidence in Multi-Component Systems
When system has multiple components (CI -> build -> signing, API -> service -> database):
For EACH component boundary: - Log what data enters component - Log what data exits component - Verify environment/config propagation Run once to gather evidence showing WHERE it breaks THEN analyze to identify failing componentTrace Data Flow
See references/root-cause-tracing.md for backward tracing technique.
Quick version: Where does bad value originate? Keep tracing up until you find the source. Fix at source, not symptom.
Phase 2: Pattern Analysis
- Find Working Examples - Locate similar working code in same codebase
- Compare Against References - Read reference implementations COMPLETELY, don't skim
- Identify Differences - List every difference between working and broken
- Understand Dependencies - What settings, config, environment assumptions?
Phase 3: Hypothesis and Testing
- Form Single Hypothesis - "I think X is the root cause because Y"
- Test Minimally - SMALLEST possible change, one variable at a time
- Verify Before Continuing - Worked? Phase 4. Didn't? NEW hypothesis, don't stack fixes
Phase 4: Implementation
- Create Failing Test Case - Simplest reproduction, automated if possible
- Implement Single Fix - ONE change, no "while I'm here" improvements
- Verify Fix - Test passes? No regressions?
- If Fix Doesn't Work:
- Count: How many fixes have you tried?
- If < 3: Return to Phase 1, re-analyze
- If >= 3: STOP and question the architecture
If 3+ Fixes Failed: Question Architecture
Pattern indicating architectural problem:
- Each fix reveals new shared state/coupling
- Fixes require "massive refactoring"
- Each fix creates new symptoms elsewhere
STOP. Discuss with user before attempting more fixes.
Red Flags - STOP and Follow Process
If you catch yourself thinking:
- "Quick fix for now, investigate later"
- "Just try changing X and see"
- "Add multiple changes, run tests"
- "I'm confident it's X, let me fix that"
- "One more fix attempt" (when already tried 2+)
- Proposing solutions before tracing data flow
ALL of these mean: STOP. Return to Phase 1.
Supporting Techniques
Defense-in-Depth
When you fix a bug, validate at EVERY layer:
| Layer | Purpose | Example |
| Entry Point | Reject invalid input at API boundary | if (!dir) throw new Error('dir required') |
| Business Logic | Ensure data makes sense for operation | Validate before processing |
| Environment Guards | Prevent dangerous ops in specific contexts | Refuse git init outside tmpdir in tests |
| Debug Instrumentation | Capture context for forensics | Log with stack trace before dangerous ops |
Single validation feels sufficient, but different code paths bypass it. Make bugs structurally impossible.
Condition-Based Waiting
Flaky tests guess at timing. Wait for actual conditions instead:
# BAD: Guessing at timing
await asyncio.sleep(0.05)
result = get_result()
# GOOD: Wait for condition
await wait_for(lambda: get_result() is not None)
result = get_result()Pattern:
async def wait_for(condition, timeout_ms=5000):
start = time.time()
while True:
if condition():
return
if (time.time() - start) * 1000 > timeout_ms:
raise TimeoutError("Condition not met")
await asyncio.sleep(0.01) # Poll every 10msCommon Rationalizations
| Excuse | Reality |
| "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
| "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
| "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
| "I see the problem, let me fix it" | Seeing symptoms != understanding root cause. |
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
Verification
Run: python scripts/verify.py
References
- references/root-cause-tracing.md - Trace bugs backward through call stack
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.

