systematic-debugging
Skill146 starsChanged 7 months agoMITView on GitHub
Invoke BEFORE attempting any fix when a bug, test failure, error, warning, unexpected behavior, or performance regression appears. Enforces hypothesis-driven root cause analysis — no fix without evidence. Triggers on: error messages, stack traces, "it's broken", "not working", "bug", test failures, blank/white screens, "works locally but not in production", performance degradation, console warnings, "can't figure out why". Also routed by using-superpowers for debugging tasks.
190 other projects use a version of this.
Adopted by
Most recently taken up by
- DemonDamon/AgenticXtheir own version, first seen Nov 9, 2026
- chrysogonus/power-agentstheir own version, first seen Nov 8, 2026
- willy92wins/DayZ-Modding-Knowledge-Packtheir own version, first seen Nov 8, 2026
- roundpilot/superpowers-antigravitytheir own version, first seen Nov 8, 2026
- lingyired/status-triotheir own version, first seen Nov 8, 2026
- HeteroCat/heterocat-skillstheir own version, first seen Nov 8, 2026
Used with
Projects 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.
Leodorareluctant259Skillchinese-code-review
中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
Also in 8 projects that use this
Leodorareluctant259Skillchinese-commit-conventions
中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
Also in 8 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 20 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 versions190 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 190
- obra/superpowers★ 314ksame name
- NousResearch/hermes-agent★ 262ksame 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.8ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- farm-fe/farm★ 5.6ksame name
- microsoft/FluidFramework★ 4.9ksame name
180 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 repository23 other files it gives its agents.
- brainstormingSkill
- claude-md-creatorSkill
- context-managementSkill
- deliberationSkill
- dependency-managementSkill
- dispatching-parallel-agentsSkill
- error-recoverySkill
- executing-plansSkill
- finishing-a-development-branchSkill
- frontend-designSkill
- performance-investigationSkill
- premise-checkSkill
- receiving-code-reviewSkill
- refactoringSkill
- requesting-code-reviewSkill
- self-consistency-reasonerSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- token-efficiencySkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. 0 are common, 14 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
14
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 14
Do root-cause investigation before proposing fixes.
- Very specific: line 25
If known-issues.md exists at the project root, search it for the error message, error code, or failing test name.
- Distinctive: line 26
If a match is found, try the documented solution first.
- Distinctive: line 27
If no match or the documented solution doesn't work, proceed to Phase 1.
- Distinctive: line 30
Read the full error output — not just the last line.
- Distinctive: line 39
Check recent changes — what changed since it last worked?
- Very specific: line 40
If context-snapshot.json exists at the project root: read it.
- Distinctive: line 42
Add instrumentation (logging, breakpoints) at component boundaries.
- Distinctive: line 43
Multi-component systems: When the system has multiple components (CI → build → signing, API → service → database), add diagnostic logging …
- Distinctive: line 87
Unanimous: test the majority hypothesis.
- Distinctive: line 94
Run the smallest possible test/change to validate or disprove it.
- Distinctive: line 95
If disproven, discard it entirely and form a new hypothesis.
- Distinctive: line 99
Add a failing regression test that reproduces the bug first.
- Distinctive: line 118
If 3 fix attempts fail, stop.
- Distinctive: line 122
If you catch yourself doing any of these, restart from Phase 1:
- Distinctive: line 139
After resolving a bug:
“Common” is measured: kept by at least 6 in 10 of the 177 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
Do root-cause investigation before proposing fixes.
Iron Law
No fix without evidence for root cause.
This is non-negotiable. Every fix must trace back to a proven root cause. A fix applied without understanding why it works is not a fix — it is a mask.
Four Phases
Phase 0: Check Known Issues
- If
known-issues.mdexists at the project root, search it for the error message, error code, or failing test name. - If a match is found, try the documented solution first. If it resolves the issue, stop — no further investigation needed.
- If no match or the documented solution doesn't work, proceed to Phase 1.
Phase 1: Investigate
- Read the full error output — not just the last line.
Reproduce the bug reliably. If you cannot reproduce, you cannot fix. For tests that fail only in certain orderings (test pollution), run
bash find-polluter.sh <marker> <test-pattern>from this skill's directory to identify which test is corrupting shared state. Read its exit code — they are not interchangeable:Exit Meaning 0 Every matched test ran and none created the marker. A real clean result. 1 Polluter found; it is named in the output. 2 The pattern matched no test files. Nothing ran, so nothing was proven — fix the pattern and re-run. Never report this as clean. 3 The marker already existed before the run. Reset it first; no test can be blamed until you do. - Check recent changes — what changed since it last worked?
- If
context-snapshot.jsonexists at the project root: read it. Thechanged_filesandrecent_commitsfields answer this immediately without additional git commands. - Otherwise: run
git log --oneline -10andgit diff HEAD~1..HEAD --name-only.
- If
- Add instrumentation (logging, breakpoints) at component boundaries.
- Multi-component systems: When the system has multiple components (CI → build → signing, API → service → database), add diagnostic logging at EACH component boundary before proposing fixes:
Example (multi-layer system):For EACH component boundary: - Log what data enters the component - Log what data exits the component - Verify environment/config propagation - Check state at each layer Run once to gather evidence showing WHERE it breaks THEN analyze evidence to identify the failing component THEN investigate that specific component
This reveals which layer fails (e.g., secrets → workflow OK, workflow → build FAILS).# Layer 1: Workflow echo "=== Secrets available in workflow: ===" echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}" # Layer 2: Build script echo "=== Env vars in build script: ===" env | grep IDENTITY || echo "IDENTITY not in environment" # Layer 3: Signing script echo "=== Keychain state: ===" security list-keychains security find-identity -v # Layer 4: Actual signing codesign --sign "$IDENTITY" --verbose=4 "$APP" - Trace data/control flow backward from the error to its source.
Phase 2: Compare Patterns
- Find a known-good implementation in the repo that does something similar.
- Compare: behavior, config, assumptions, environment.
- List concrete differences — these are your investigation leads.
Phase 3: Hypothesize and Test
Self-Consistency Gate — Before committing to a hypothesis, apply multi-path reasoning (see self-consistency-reasoner):
- Make 3-5 attempts at the root cause, each from a different starting point: trace forward from inputs, backward from the error, from recent changes, from similar past bugs. Each attempt names the one cause it arrives at — you are not brainstorming alternatives, you are checking whether different routes converge.
- Group attempts that name the same cause, then take the majority. Report agreement as a count (e.g. 4/5):
- Unanimous: test the majority hypothesis.
- Majority (more than half, not all): test the majority hypothesis; name the minority one and test it next if the majority fails.
- No majority (half or fewer): STOP. Do not pick a hypothesis. The bug is ambiguous or multi-causal. Gather more evidence (add logging, reproduce under different conditions) before choosing a direction.
- These attempts share your context and your blind spots, so agreement is weak evidence and disagreement is strong evidence. The smallest test below — not the vote — is what proves the hypothesis.
Then for the selected hypothesis:
- State it clearly before testing it.
- Run the smallest possible test/change to validate or disprove it.
- If disproven, discard it entirely and form a new hypothesis.
- Never stack guesses. One hypothesis at a time, tested in isolation.
Phase 4: Fix and Verify
- Add a failing regression test that reproduces the bug first.
- Apply one focused fix — never bundle multiple changes.
- Re-run the tests that cover the fix and confirm the issue is resolved. Scope per
verification-before-completion— a root cause that spanned subsystems earns the full suite; a one-module fix earns that module's suite.
Rationalization Table — Do Not Skip Investigation
| Temptation | Why it fails |
| "I know what the bug is" | You had a hypothesis, not proof. Test it. |
| "Quick fix, investigate later" | Later never comes. The mask becomes permanent debt. |
| "It's obviously this one line" | Obvious bugs get fixed in 5 minutes. If it were obvious, it would be fixed already. |
| "Let me try a few things" | Shotgun debugging creates new bugs and wastes time. |
| "The error message tells me exactly what's wrong" | Error messages describe symptoms, not causes. |
| "I'll just revert to a known-good state" | Reverts don't teach you what broke or prevent recurrence. |
Escalation Rule
If 3 fix attempts fail, stop. Do not attempt a fourth. Discuss architecture with the user before continuing. The bug may indicate a design flaw, not a code defect.
Red Flags
If you catch yourself doing any of these, restart from Phase 1:
- "Quick fix now, investigate later"
- Changing multiple things in one attempt
- Proposing a fix without reproduction evidence
- Claiming success without re-running verification
- "It should work now" without running the test
- Copy-pasting a fix from elsewhere without understanding why it works
Supporting References
root-cause-tracing.md— trace bugs backward through the call stackdefense-in-depth.md— validation at every data layercondition-based-waiting.md— replace timeouts with condition polling
Post-Fix: Update Knowledge Base
After resolving a bug:
- Recurring error? (environment-dependent, configuration, platform-specific, external-state) → offer to add the error→solution mapping to
known-issues.mdusing the format defined inerror-recovery. - Permanent constraint discovered? (API limitation, platform behavior, library quirk that will never change) → offer to add it to
project-map.mdCritical Constraints section viacontext-management. These are facts every future session needs, not just error→fix mappings.
Related Skills
self-consistency-reasoner— multi-path reasoning for root cause diagnosistest-driven-development— write the regression test before the fixverification-before-completion— prove the fix with fresh evidenceerror-recovery— consult and update project-specific known issues
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

