systematic-debugging
Skill4 starsChanged 4 months agoMITView on GitHub
Trigger this AUTOMATICALLY anytime you encounter a stack trace, test failure, production bug, or unexpected behavior. Do NOT guess the fix or propose code changes before explicitly triggering this skill. This skill mandates a strict data-gathering and hypothesis phase before you are permitted to edit ANY source code.
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 repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- ast-code-graphSkill
- ast-grepSkill
- self-reflectionSkill
- structural-refactorSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 1 is common, 11 are distinctive, and 3 are very specific to this project.
1
Common
Most of the 173 edited versions we read keep these.
11
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
- Common: line 12
Core principle: ALWAYS find the root cause before attempting fixes.
- Distinctive: line 13
The Iron Law: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
- Distinctive: line 17
Use for ANY technical issue:
- Distinctive: line 37
Read the error message and stack trace completely.
- Very specific: line 38
Use view_file to read the surrounding code where the error occurred.
- Very specific: line 39
Use grep_search to find definitions, usages, or configurations related to the failing components.
- Distinctive: line 44
If you cannot reproduce it locally, you must gather more data.
- Distinctive: line 47
If the system has multiple layers (e.g., Frontend → API → Database), do not guess which layer failed.
- Very specific: line 48
Inject telemetry temporarily: Use replace_file_content to add console.log, print(), or logger statements at the boundary of each component.
- Distinctive: line 49
Run the system once to see exactly what data entered and exited each layer.
- Distinctive: line 63
Do not bundle formatting refactoring, "cleanups," or unrelated typo fixes into this bug fix.
- Distinctive: line 66
Run the failing test case or the reproduction script you built in Phase 1.
- Distinctive: line 67
If it passes *without* breaking adjacent tests, you have proven resolution.
- Distinctive: line 82
If you have attempted 3 different fixes and the system is still failing, STOP CHANGING CODE IMMEDIATELY.
- Distinctive: line 90
If you catch yourself doing any of the following, you are violating the systematic debugging protocol.
“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
Overview
Random fixes waste time and create new bugs. Quick patches mask underlying issues. As an AI agent, it is tempting to rapidly guess the solution based on symptoms because it is fast. You must resist this temptation.
Core principle: ALWAYS find the root cause before attempting fixes. The Iron Law: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
When to Use
Use for ANY technical issue:
- Test failures
- Bugs in production or local development
- Build or CI pipeline failures
- Unexplained performance issues
Do not skip this process even if:
- The issue seems "simple" or "obvious"
- You are under time pressure
- The user asks for a "quick fix"
Phase 1: Planning (Root Cause Investigation)
BEFORE attempting ANY code modification or fix:
- Information Gathering (Do Not Guess)
- Read the error message and stack trace completely. Note the exact file paths and line numbers.
- Use
view_fileto read the surrounding code where the error occurred. - Use
grep_searchto find definitions, usages, or configurations related to the failing components. - Never assume you know what a file contains without checking or listing its directory.
- Reproduce and Isolate
- Can you trigger the bug reliably? If there isn't an existing test, write a minimal, standalone reproduction script (e.g.,
repro.pyor.jsin/tmp/) usingwrite_to_fileand then execute it viarun_command. - If you cannot reproduce it locally, you must gather more data. Do not guess the fix.
- Can you trigger the bug reliably? If there isn't an existing test, write a minimal, standalone reproduction script (e.g.,
- Map the Boundaries (Multi-Component Systems)
- If the system has multiple layers (e.g., Frontend → API → Database), do not guess which layer failed.
- Inject telemetry temporarily: Use
replace_file_contentto addconsole.log,print(), or logger statements at the boundary of each component. - Run the system once to see exactly what data entered and exited each layer.
Phase 2: Execution (Hypothesis & Minimal Fix)
Once the root cause is proven (not guessed):
- Form a Single Hypothesis
- You must explicitly state your hypothesis before editing code. (e.g., "I hypothesize the root cause is that
user_idis being passed as a string from the API layer, but the database ORM requires an integer.")
- You must explicitly state your hypothesis before editing code. (e.g., "I hypothesize the root cause is that
- Test Minimally
- Make the SMALLEST possible change to test your hypothesis.
- Change exactly one variable at a time using
replace_file_content. - Do not bundle formatting refactoring, "cleanups," or unrelated typo fixes into this bug fix.
- Verify the Fix Against the Reproduction Script
- Run the failing test case or the reproduction script you built in Phase 1.
- If it passes without breaking adjacent tests, you have proven resolution.
Phase 3: Verification (The "3 Strikes" Rule)
- Verify the Fix
- Did your minimal change resolve the issue?
- Did it break any adjacent tests in the suite?
- If the Fix Failed: REVERT & STOP
- Undo your change immediately. Do not stack fixes on top of failed fixes.
- Re-evaluate your hypothesis based on the new failure.
- The 3 Strikes Rule (CRITICAL)
- If you have attempted 3 different fixes and the system is still failing, STOP CHANGING CODE IMMEDIATELY.
- You are likely fighting a fundamental architectural flaw, an incorrect underlying assumption, or a hallucinated dependency.
- You must write a summary of the failure modes (e.g., in a
/tmp/bug-report.md) and notify the user for an architectural alignment discussion. Do not keep guessing silently.
Red Flags (When to STOP and Restart Phase 1)
If you catch yourself doing any of the following, you are violating the systematic debugging protocol. STOP and return to Phase 1:
- "Quick fix for now, investigate later"
- "Let me just try changing X and see if it works"
- Proposing solutions without having read the file contents where the error originated.
- Applying 3 or more unrelated changes in a single fix attempt.
- Encountering a new, completely unrelated bug every time you fix the previous one (indicates fundamental architectural rot).
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.

