systematic-debugging
Skill4 starsChanged 15 days agoMITView on GitHub
Root-cause-first debugging. Use for any bug, failing or flaky test, crash, exception, wrong output, hang, memory leak, performance regression, or "works on my machine" problem, before proposing any fix, and especially after a first fix attempt didn't work. Replaces guess-and-patch with reproduce, isolate, hypothesize, test, fix at the root, and lock it in with a regression test.
191 other projects use a version of this.
Adopted by
Most recently taken up by
- ctaxnagomi/agent-kd-skilltheir own version, first seen Nov 29, 2026
- Dannykkh/skill-olympustheir own version, first seen Nov 29, 2026
- hybridlabor-api/aostheir own version, first seen Nov 29, 2026
- autohandai/community-skillstheir own version, first seen Nov 29, 2026
- MorningStar0709/trae-agent-enhancementstheir own version, first seen Nov 29, 2026
- genfeedai/genfeed.aitheir own version, 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 · 0
None found.
Wrote their own version · 191
- obra/superpowers★ 314ksame name
- NousResearch/hermes-agent★ 267ksame name
- open-metadata/OpenMetadata★ 16ksame name
- mdiri-ai/SoduWork★ 9.1ksame name
- jnMetaCode/superpowers-zh★ 8.6ksame name
- openai/plugins★ 8.4ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- ChrisWiles/claude-code-showcase★ 6.1ksame name
- farm-fe/farm★ 5.6ksame 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 repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-ready-repoSkill
- bug-triageSkill
- ci-auditorSkill
- deep-modulesSkill
- evidence-before-claimsSkill
- finish-the-jobSkill
- parallel-agentsSkill
- plan-before-codeSkill
- prior-art-scoutSkill
- security-auditSkill
- senior-engineerSkill
- staff-reviewSkill
- state-machine-hunterSkill
- test-driven-developmentSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 178 edited versions we read keep these.
7
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
Rule: no fix without (1) a reproduction and (2) a root cause you can explain, including why the code behaves this way and not just where it …
- Distinctive: line 18
Read the entire error: message, stack trace, logs before the failure, exit code.
- Distinctive: line 20
If it doesn't reproduce: compare environments (versions, config, env vars, data, OS, time zone, locale, concurrency).
- Distinctive: line 28
Minimize the input: Remove half the data, config, or steps.
- Distinctive: line 29
Binary-search the code path: Add assertions or logs at the midpoint between "input is right" and "output is wrong".
- Distinctive: line 35
Keep a short hypothesis log.
- Very specific: line 46
Write a failing test that reproduces the bug first (see test-driven-development).
- Very specific: line 48
Search for siblings: the same mistake often exists in other places (rg for the pattern).
- Distinctive: line 49
Run the new test (it passes), then the full relevant suite (nothing else broke).
“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 fastest way to fix a bug is to stop guessing. Each guess-and-patch cycle feels quick but leaves the real cause in place, adds code that hides symptoms, and teaches you nothing. A root cause you can state in one sentence, backed by a reproduction, is the only finish line.
Rule: no fix without (1) a reproduction and (2) a root cause you can explain, including why the code behaves this way and not just where it breaks.
Phase 1: Reproduce
- Read the entire error: message, stack trace, logs before the failure, exit code. The answer is often in the line people skip.
- Get a reliable reproduction, ideally a single command or a failing test. Note the exact inputs, environment, versions, and steps.
- If it doesn't reproduce: compare environments (versions, config, env vars, data, OS, time zone, locale, concurrency). The difference is the clue.
- For flaky failures, loop it (
for i in $(seq 50); do <cmd> || break; done), fix random seeds, and vary timing or parallelism to make it deterministic.
Phase 2: Isolate
Shrink the search space until the cause has nowhere to hide:
- What changed?
git log -p --since=...on the affected files. When there's a known-good commit, bisect:git bisect start <bad> <good>, thengit bisect run <test-cmd>, andgit bisect resetwhen done so the repo returns to your branch. Bisect turns hours of reasoning into minutes of mechanical search. - Minimize the input. Remove half the data, config, or steps; keep the half that still fails.
- Binary-search the code path. Add assertions or logs at the midpoint between "input is right" and "output is wrong".
- Compare working and broken. A similar case that works is a gift: diff the two paths.
- Check assumptions explicitly. Print the actual values, types, versions, and paths instead of believing what they should be.
Phase 3: Hypothesize and test
Keep a short hypothesis log; it stops you from circling:
H1: cache returns stale user after update -> predict: bypassing cache fixes it -> result: still fails -> rejected
H2: update writes to primary, read hits a lagging replica -> predict: reading from primary fixes it -> result: confirmed by query logChange one variable at a time. Prefer experiments that can falsify the hypothesis. A hypothesis that can't fail tells you nothing.
Phase 4: Fix at the root
- Write a failing test that reproduces the bug first (see
test-driven-development). It must fail for the right reason. - Fix the cause, not the symptom. A
try/catch, null check, retry, orsleepthat makes the symptom disappear is a patch over a cause you haven't found; use one only if you can explain why it's the correct behavior. - Search for siblings: the same mistake often exists in other places (
rgfor the pattern). - Run the new test (it passes), then the full relevant suite (nothing else broke).
The three-strikes rule
If three fix attempts have failed, stop patching. Three misses mean your model of the system is wrong. Go back to Phase 1 with fresh eyes: re-read the error, question the assumption you've been most sure about, and consider whether the design itself is the problem. Report this honestly rather than trying a fourth variation.
Debugging report
**Symptom:** what the user saw.
**Root cause:** one or two sentences: what was wrong and why it produced the symptom.
**Evidence:** the reproduction, and the observation that confirmed the cause.
**Fix:** what changed and why it addresses the cause.
**Verified:** regression test (fails before, passes after) and full suite result.
**Related risks:** similar code checked, or worth checking.Anti-patterns
| Tempting move | What to do instead |
| "Let me try changing X and see" | Form a hypothesis that predicts the outcome first |
| Fixing the first suspicious thing you see | Confirm it's the cause with an experiment |
| Adding retries or sleeps to make a flaky test pass | Find the race or ordering dependency |
| Catching and logging the exception | Find why it's thrown |
| Several changes at once | One variable per experiment |
| "Fixed" without re-running the reproduction | Re-run it; see evidence-before-claims |
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.

