systematic-debugging
Skill1 starsChanged 9 months agoMITView on GitHub
Use when encountering any bug, test failure, or unexpected behavior. Provides a structured 4-step cycle and ACH methodology for complex bugs. Replaces random guessing with evidence-based investigation.
191 other projects use a version of this.
Adopted by
Most recently taken up by
- NousResearch/hermes-agenttheir own version, 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-dshtheir own version, first seen Oct 3, 2026
Used with
Projects with it also use diagnosing-superpowers, building-chatgpt-apps 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.
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
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
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
- +8 more from mjunaidca
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- obra/superpowers★ 314ksame name
- NousResearch/hermes-agent★ 267ksame name
- open-metadata/OpenMetadata★ 15ksame name
- jnMetaCode/superpowers-zh★ 8.3ksame name
- openai/plugins★ 7.3ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- microsoft/FluidFramework★ 4.9ksame name
- compozy/compozy★ 2.8ksame name
- GanyuanRan/Aegis★ 1.3ksame name
- SethGammon/Citadel★ 922same name
181 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 repository4 other files it gives its agents.
- code-reviewSkill
- config-architectSkill
- smart-delegationSkill
- plan-and-executeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 16 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 173 edited versions we read keep these.
16
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Stop guessing. Start investigating.
- Distinctive: line 17
Reproduce it: Run the failing command. See the exact output.
- Distinctive: line 20
If these 3 steps solve it, you're done.
- Distinctive: line 28
Run the exact command or action that triggers the bug
- Distinctive: line 31
Check: is the bug consistent or intermittent?
- Distinctive: line 39
Read the relevant code. Don't guess what it does - read it.
- Distinctive: line 50
Rule: Observe before editing: If you haven't read the code, you don't understand the bug.
- Distinctive: line 69
Run the reproduction case - does it pass now?
- Distinctive: line 70
Run the full test suite - did you break anything else?
- Distinctive: line 73
Done: If the fix doesn't work, go back to Phase 2 with new evidence.
- Distinctive: line 77
When a bug survives the 4-phase cycle, use Analysis of Competing Hypotheses:
- Distinctive: line 81
Write down every possible explanation, including ones that seem unlikely:
- Distinctive: line 101
Remove hypotheses that are inconsistent with the evidence.
- Distinctive: line 116
Test fails and you don't immediately know why
- Distinctive: line 176
If you have the Starter System installed:
- Very specific: line 177
Use /remember failure: [description] to log bugs you've seen before
- Very specific: line 178
Check /remember at the start of debugging - the bug might be a known pattern
- Very specific: line 179
Use /handoff to pass debugging context when you run out of session time
- Distinctive: line 183
When Kairn is configured, debugging gains:
“Common” is measured: kept by at least 6 in 10 of the 173 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
Stop guessing. Start investigating. Every bug follows a pattern - find the pattern, find the fix.
Announce: "Using systematic-debugging to investigate this issue."
Quick Start (3 Steps)
For straightforward bugs, this is often enough:
- Read the error. Actually read it. File, line, message. Don't skip this.
- Reproduce it. Run the failing command. See the exact output. No assumptions.
- Trace backward. From the error line, follow the data. Where did the wrong value come from?
If these 3 steps solve it, you're done. If not, use the full system below.
The Full System: 4-Phase Cycle
Phase 1: Reproduce
Goal: See the bug happen with your own eyes.
- Run the exact command or action that triggers the bug
- Record the full error output (not a summary - the actual output)
- Note what you expected vs what you got
- Check: is the bug consistent or intermittent?
If you can't reproduce it, you can't fix it. Gather more context first.
Phase 2: Gather Evidence
Goal: Collect facts, not theories.
Read the relevant code. Don't guess what it does - read it.
Evidence Checklist:
- [ ] Full error message and stack trace
- [ ] The source code at the error location
- [ ] Recent changes to related files (git log --oneline -10 -- <file>)
- [ ] Input data that triggers the bug
- [ ] What the code should do vs what it actually doesRule: Observe before editing. If you haven't read the code, you don't understand the bug. If you don't understand the bug, your fix will create the next bug.
Phase 3: Form Hypotheses
Goal: Generate 2-3 possible explanations. Then test them.
For each hypothesis:
- State it clearly: "I think X fails because Y"
- Define a test: "If this hypothesis is correct, then Z should be true"
- Run the test
- Record the result: confirmed, refuted, or inconclusive
Don't stop at the first hypothesis that feels right. The most obvious explanation is wrong about 40% of the time.
Phase 4: Fix and Verify
Goal: Make the smallest change that fixes the bug. Verify it works.
- Make the fix
- Run the reproduction case - does it pass now?
- Run the full test suite - did you break anything else?
- Explain why the fix works (if you can't explain it, you didn't fix it)
Done. If the fix doesn't work, go back to Phase 2 with new evidence.
ACH Method (Complex Bugs)
When a bug survives the 4-phase cycle, use Analysis of Competing Hypotheses:
Step 1: List All Hypotheses
Write down every possible explanation, including ones that seem unlikely:
H1: The database query returns stale cached data
H2: The auth token expires between request and response
H3: A race condition in the async handler
H4: The input validation silently drops a required fieldStep 2: Build an Evidence Matrix
| Evidence | H1 (Cache) | H2 (Token) | H3 (Race) | H4 (Validation) |
| Bug is intermittent | Consistent | Consistent | Supports | Inconsistent |
| Only happens under load | Neutral | Neutral | Supports | Inconsistent |
| Error log shows timeout | Inconsistent | Supports | Supports | Inconsistent |
| Fresh deploy doesn't fix | Supports | Neutral | Neutral | Supports |
Step 3: Eliminate
Remove hypotheses that are inconsistent with the evidence. The survivor is your best lead.
In the example above, H4 is inconsistent with two pieces of evidence - eliminate it first. H1 is inconsistent with one - it's less likely. H2 and H3 both survive - investigate the one that's easier to test first.
When to Use ACH vs Quick Debug
| Situation | Method |
| Clear error message, obvious location | Quick Start (3 steps) |
| Known area, unclear cause | 4-Phase Cycle |
| Multiple possible causes, intermittent | ACH Method |
| Bug persists after 2+ fix attempts | ACH Method |
When to Use This Skill
- Test fails and you don't immediately know why
- An error message appears in logs or console
- Code behaves differently than expected
- A previously working feature breaks
- Performance degrades without obvious cause
When NOT to Use
- You already know the exact fix (just fix it)
- It's a typo or syntax error (your linter already told you)
- The "bug" is actually a missing feature (use planning instead)
Delegation Pattern
Complex bugs benefit from delegation. Score: Exploration (+3) + 3+ files (+2) = 5+. Delegate the investigation, keep the fix.
## 1. TASK
Investigate why [SYMPTOM] occurs when [TRIGGER].
## 2. EXPECTED OUTCOME
Root cause analysis: error location (file:line), why it fails, suggested fix.
## 3. REQUIRED TOOLS
Read, Grep, Glob, Bash (read-only: test output, git log)
## 4. MUST DO
- Reproduce the error by running: [COMMAND]
- Read the source at the error location
- Check git log for recent changes
- Form at least 2 hypotheses and test each
## 5. MUST NOT DO
- Don't modify any files
- Don't run the application in production mode
- Don't access external services
## 6. CONTEXT
Error: [FULL_ERROR_MESSAGE]
Relevant files: [FILE_LIST]
Last working state: [COMMIT_OR_DATE]Agent: debugger | Model: Sonnet | Effort: Medium (6 turns)
Anti-Patterns
| Pattern | Problem | Fix |
| "Let me just try this..." | Random changes without understanding | Phase 2 first - gather evidence |
| Fixing the symptom | Suppressing the error instead of the cause | Trace to the root, not the surface |
| Changing multiple things at once | Can't tell which change fixed it | One change, one test, one commit |
| Ignoring the stack trace | The answer is literally in the output | Read the error. All of it. |
| "It works on my machine" | Environment assumptions | Reproduce in the failing environment |
| Debugging in production | Risk of data loss or downtime | Reproduce locally first |
For the extended guide with recovery protocols, see references/anti-patterns.md.
With Starter System
If you have the Starter System installed:
- Use
/remember failure: [description]to log bugs you've seen before - Check
/rememberat the start of debugging - the bug might be a known pattern - Use
/handoffto pass debugging context when you run out of session time
With Kairn (Course)
When Kairn is configured, debugging gains:
- Recall before investigating: "Have I seen this error pattern before?" - automatic lookup across past sessions
- Learn after resolution: captures root cause + fix for future sessions automatically
- Pattern recognition across past bugs - "This looks like the auth timeout issue from 3 weeks ago"
Without Kairn: each debugging session starts fresh. The 4-phase cycle still works, you just can't learn from past sessions automatically.
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.

