systematic-debugging
Skill2 starsChanged 7 months agoMITView on GitHub
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
191 other projects use a version of this, 123 of them edited.
Adopted by
Most recently taken up by
- ctaxnagomi/agent-kd-skilltheir own version, first seen Nov 29, 2026
- Dannykkh/skill-olympusedited, first seen Nov 29, 2026
- hybridlabor-api/aosedited, first seen Nov 29, 2026
- autohandai/community-skillsedited, first seen Nov 29, 2026
- MorningStar0709/trae-agent-enhancementstheir own version, first seen Nov 29, 2026
- genfeedai/genfeed.aiedited, first seen Nov 29, 2026
Used with
Projects with it also use chinese-git-workflow, chinese-code-review 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.
Leodorareluctant259Skillchinese-git-workflow
适配国内 Git 平台和团队习惯的工作流规范——Gitee、Coding、极狐 GitLab 全覆盖
Also in 9 projects that use this
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 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 Leodorareluctant259
- +5 more from mjunaidca
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 123
- obra/superpowers★ 314k60% same
- NousResearch/hermes-agent★ 267k25% same
- mdiri-ai/SoduWork★ 9.1k61% same
- openai/plugins★ 8.4k61% same
- farm-fe/farm★ 5.6k60% same
- microsoft/FluidFramework★ 5k57% same
- heyitsnoah/claudesidian★ 2.6k40% same
- lingyired/status-trio★ 2.2k60% same
- pcvelz/superpowers★ 1.3k60% same
- DemonDamon/AgenticX★ 1.3k60% same
113 more not listed
Wrote their own version · 68
- open-metadata/OpenMetadata★ 16ksame name
- jnMetaCode/superpowers-zh★ 8.6ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- compozy/compozy★ 2.9ksame name
- GanyuanRan/Aegis★ 1.5ksame name
- SethGammon/Citadel★ 927same name
- KbWen/agentic-os★ 245same name
- linxuan-sys/opencode-skills-chinese★ 200same name
58 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 repository26 other files it gives its agents.
- api-and-interface-designSkill
- brainstormingSkill
- ci-cd-and-automationSkill
- code-reviewSkill
- code-simplificationSkill
- context-engineeringSkill
- deprecation-and-migrationSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- grill-meSkill
- mentorSkill
- performance-optimizationSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- security-guidanceSkill
- session-synthesisSkill
- shipping-and-launchSkill
- source-driven-developmentSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- verification-before-completionSkill
- verification-phaseSkill
- writing-plansSkill
- writing-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. 3 are common, 20 are distinctive, and 2 are very specific to this project.
3
Common
Most of the 178 edited versions we read keep these.
20
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
- Common: line 14
If you haven't completed Phase 1, you cannot propose fixes.
- Distinctive: line 18
Use for ANY technical issue: test failures, bugs, unexpected behavior, performance problems, build failures, integration issues.
- Distinctive: line 37
Before investigating ANYTHING, build a fast, deterministic reproduction loop.
- Distinctive: line 50
Hard gate: Do NOT proceed to Phase 1 until you have a loop you believe in.
- Distinctive: line 52
If you genuinely cannot build a loop: Stop and say so. List what you tried.
- Distinctive: line 59
Don't skip past errors or warnings
- Distinctive: line 60
Read stack traces completely — they often contain the exact solution
- Common: line 66
If not reproducible → gather more data, don't guess
- Distinctive: line 77
Add diagnostic instrumentation BEFORE proposing fixes:
- Distinctive: line 129
Don't fix multiple things at once
- Distinctive: line 134
DON'T add more fixes on top
- Distinctive: line 138
Don't pretend to know
- Distinctive: line 146
MUST have before fixing
- Very specific: line 147
Use superpowers:test-driven-development for writing proper failing tests
- Distinctive: line 155
Test passes now? No other tests broken?
- Very specific: line 159
Remove all [DEBUG-...] instrumentation (grep the tag prefix — designed for easy cleanup)
- Distinctive: line 160
Ask: what would have prevented this bug?
- Distinctive: line 163
If < 3 attempts: Return to Phase 1, re-analyze with new information
- Distinctive: line 165
DON'T attempt Fix #4 without architectural discussion
- Distinctive: line 177
Should we refactor architecture vs.
- Common: line 183
If you catch yourself thinking:
- Distinctive: line 204
When you see these: STOP. Return to Phase 1.
- Distinctive: line 236
If investigation reveals the issue is truly environmental, timing-dependent, or external:
- Distinctive: line 238
Document what you investigated
- Distinctive: line 240
Add monitoring/logging for future investigation
“Common” is measured: kept by at least 6 in 10 of the 178 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
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRSTIf you haven't completed Phase 1, you cannot propose fixes. Symptom fixes are failure.
When to Use
Use for ANY technical issue: test failures, bugs, unexpected behavior, performance problems, build failures, integration issues.
Use ESPECIALLY when:
- Under time pressure (emergencies make guessing tempting)
- "Just one quick fix" seems obvious
- You've already tried multiple fixes without success
- You don't fully understand the issue
Don't skip when:
- Issue seems simple (simple bugs have root causes too)
- You're in a hurry (rushing guarantees rework)
- Manager wants it fixed NOW (systematic is faster than thrashing)
The Five Phases
Complete each phase before proceeding to the next.
Phase 0: Build a Feedback Loop
Before investigating ANYTHING, build a fast, deterministic reproduction loop.
Priority order:
- Existing test that fails
- New test you write
- Standalone script
- REPL session
- HITL (human-in-the-loop) bash script — see
hitl-loop.template.sh
Treat the loop as a product:
- Can I make it faster? Sharper signal? More deterministic?
- A 30-second flaky loop is barely better than no loop. A 2-second deterministic loop is a debugging superpower.
Hard gate: Do NOT proceed to Phase 1 until you have a loop you believe in.
If you genuinely cannot build a loop: Stop and say so. List what you tried. Ask the user for: (a) access to the reproducing environment, (b) a captured artifact (HAR file, log dump, core dump, screen recording), or (c) permission to add temporary instrumentation.
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
- Read Error Messages Carefully
- Don't skip past errors or warnings
- Read stack traces completely — they often contain the exact solution
- Note line numbers, file paths, error codes
- Reproduce Consistently
- Can you trigger it reliably? What are the exact steps?
- Does it happen every time?
- If not reproducible → gather more data, don't guess
- Check Recent Changes
- What changed that could cause this?
- 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):
Add diagnostic instrumentation BEFORE proposing fixes:
For EACH component boundary: - Log what data enters/exits the component - Verify environment/config propagation - Check state at each layer Run once → analyze evidence → identify failing component → investigate that componentExample (multi-layer system):
# Layer 1: Workflow echo "=== Secrets available: ===" echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}" # Layer 2: Build script env | grep IDENTITY || echo "IDENTITY not in environment" # Layer 3: Signing security find-identity -v # Layer 4: Actual operation codesign --sign "$IDENTITY" --verbose=4 "$APP"Reveals: Which layer fails (secrets → workflow ✓, workflow → build ✗)
Tag every debug log with a unique prefix, e.g.
[DEBUG-a4f2]. Cleanup becomes a single grep. Untagged logs survive; tagged logs die.Trace Data Flow
See
root-cause-tracing.mdfor the complete backward tracing technique.Quick version: Where does the bad value originate? Trace callers upward until you find the source. Fix at source, not at symptom.
Phase 2: Pattern Analysis
- Find Working Examples — Locate similar working code in the same codebase
- Compare Against References — Read reference implementations COMPLETELY, don't skim. Understand the pattern fully before applying.
- Identify Differences — List every difference between working and broken, however small. Don't assume "that can't matter."
- Understand Dependencies — What components, settings, config, environment, assumptions does this need?
Phase 3: Hypothesis and Testing
- Form Single Hypothesis
- State clearly: "I think X is the root cause because Y"
- Be specific, not vague
- Test Minimally
- Make the SMALLEST possible change to test hypothesis
- One variable at a time
- Don't fix multiple things at once
- Verify Before Continuing
- Did it work? Yes → Phase 4
- Didn't work? Form NEW hypothesis
- DON'T add more fixes on top
- When You Don't Know
- Say "I don't understand X"
- Don't pretend to know
- Research more or ask for help
Phase 4: Implementation
- Create Failing Test Case
- Simplest possible reproduction
- Automated test if possible, one-off script if no framework
- MUST have before fixing
- Use
superpowers:test-driven-developmentfor writing proper failing tests
- Implement Single Fix
- Address the root cause identified
- ONE change at a time
- No "while I'm here" improvements or bundled refactoring
- Verify Fix
- Test passes now? No other tests broken? Issue actually resolved?
- Post-mortem: What would have prevented this?
- State the correct hypothesis in the commit/PR message so the next debugger learns
- Remove all
[DEBUG-...]instrumentation (grep the tag prefix — designed for easy cleanup) - Ask: what would have prevented this bug? If the answer involves architectural change, note it but don't act on it now
- If Fix Doesn't Work
- If < 3 attempts: Return to Phase 1, re-analyze with new information
- If ≥ 3 attempts: STOP and question the architecture (step 6)
- DON'T attempt Fix #4 without architectural discussion
If 3+ Fixes Failed: Question Architecture
Pattern indicating architectural problem:
- Each fix reveals new shared state/coupling in a different place
- Fixes require massive refactoring to implement
- Each fix creates new symptoms elsewhere
STOP and question fundamentals:
- Is this pattern fundamentally sound?
- Are we persisting through sheer inertia?
- Should we refactor architecture vs. continue fixing symptoms?
Discuss with your human partner before attempting more fixes. This is a wrong architecture, not a failed hypothesis.
Red Flags — STOP and Return to Phase 1
If you catch yourself thinking:
- "Quick fix for now, investigate later"
- "Just try changing X and see if it works"
- "Add multiple changes, run tests"
- "Skip the test, I'll manually verify"
- "It's probably X, let me fix that"
- "I don't fully understand but this might work"
- "Here are the main problems: [lists fixes without investigation]"
- Proposing solutions before tracing data flow
- "One more fix attempt" (when already tried 2+)
- Each fix reveals new problem in different place
ALL of these mean: STOP. Return to Phase 1.
Human Partner Signals You're Doing It Wrong
- "Is that not happening?" — You assumed without verifying
- "Will it show us...?" — You should have added evidence gathering
- "Stop guessing" — You're proposing fixes without understanding
- "Ultrathink this" — Question fundamentals, not just symptoms
When you see these: STOP. Return to Phase 1.
Anti-Rationalization Table
| Rationalization | 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'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
| "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
| "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
| "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. |
| "I think I know what's wrong" | Thinking is not evidence. Reproduce it first. |
| "The error message tells me exactly what's wrong" | Error messages describe symptoms, not root causes. |
| "I'll add logging everywhere" | Targeted logging from a hypothesis beats shotgun logging. |
| "It works on my machine" | Environment differences ARE the bug. Reproduce in the failing environment. |
| "It's probably a flaky test" | Flaky tests mask real bugs. Prove it's flaky before dismissing. |
Quick Reference
| Phase | Key Activities | Success Criteria |
| 0. Feedback Loop | Build fast repro loop | Deterministic, fast reproduction |
| 1. Root Cause | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
| 2. Pattern | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
| 4. Implementation | Create test, fix, verify, post-mortem | Bug resolved, tests pass |
When Process Reveals "No Root Cause"
If investigation reveals the issue is truly environmental, timing-dependent, or external:
- Document what you investigated
- Implement appropriate handling (retry, timeout, error message)
- Add monitoring/logging for future investigation
But: 95% of "no root cause" cases are incomplete investigation.
Supporting Techniques
Available in this directory:
root-cause-tracing.md— Trace bugs backward through call stack to find original triggerdefense-in-depth.md— Add validation at multiple layers after finding root causecondition-based-waiting.md— Replace arbitrary timeouts with condition polling
Related skills:
- superpowers:test-driven-development — Creating failing test case (Phase 4)
- superpowers:verification-before-completion — Verify fix before claiming success
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.

