systematic-debugging
Skill2 starsChanged 51 days agoMITView on GitHub
Use when debugging any bug, test failure, unexpected behavior, or performance issue before proposing fixes. Don't use for feature additions (use brainstorming), code generation (use executing-plans), or routine refactoring (use codebase-design).
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
- REPOZY/superpowers-optimizedtheir own version, first seen Nov 8, 2026
- lingyired/status-triotheir 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 repository35 other files it gives its agents.
- agent-planningSkill
- brainstormingSkill
- codebase-designSkill
- code-reviewSkill
- conventional-commitSkill
- copy-web-designSkill
- executing-plansSkill
- frontend-designSkill
- i18nSkill
- laravelSkill
- prototypeSkill
- pull-requestSkill
- reactSkill
- recursive-researchSkill
- reflect-to-skillSkill
- review-a-skillSkill
- s13nSkill
- schema-migrationSkill
- security-auditSkill
- skill-testingSkill
- summarizeSkill
- t3-operational-guardrailSkill
- technical-writingSkill
- testing-patternsSkill
- ui-motionSkill
- ui-ux-reviewSkill
- unslopSkill
- upsert-codebase-docsSkill
- verification-before-completionSkill
- vibe-wiseSkill
- web-advisor-promptSkill
- wizardSkill
- workspace-onboardingSkill
- writing-for-agentsSkill
- writing-plansSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 22 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 177 edited versions we read keep these.
22
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 11
Do not write code, edit files, or propose fixes until Phase 1 investigation is complete.
- Distinctive: line 22
Use this workflow for any technical fault:
- Distinctive: line 23
Test failures and regressions
- Distinctive: line 39
Error inspection: Read stack traces, error messages, and logs in full.
- Distinctive: line 44
Keep the loop fast, deterministic, and runnable unattended.
- Distinctive: line 47
If an automated loop cannot be built, stop immediately.
- Distinctive: line 54
Boundary instrumentation: If the fault spans multiple layers or services such as CI workflows, build scripts, API services, or databases, …
- Very specific: line 57
Upstream data flow tracing: If the error originates deep in the call stack, trace bad values backward to their origin.
- Distinctive: line 60
Large-scale scope and context compaction defense: If the investigation requires surveying massive logs, hundreds of database files, or …
- Distinctive: line 81
Test assumptions with isolated probes.
- Distinctive: line 88
Targeted probes and instrumentation: Test hypotheses one variable at a time using the smallest possible probe.
- Distinctive: line 89
Prefer breakpoints or REPL inspection when the runtime allows.
- Distinctive: line 100
Failing regression test and seam audit: Write an automated test reproducing the root cause before changing implementation code.
- Distinctive: line 101
Verify the test exercises the genuine call site seam.
- Very specific: line 102
Follow the test-driven-development skill.
- Distinctive: line 114
Verify all regression tests and suite tests pass.
- Distinctive: line 115
Run grep for the debug tag prefix to remove every temporary probe.
- Distinctive: line 116
Remove throwaway test scripts from scratch storage.
- Distinctive: line 121
If fix 1 or fix 2 fails, return to Phase 1 to re-evaluate evidence.
- Distinctive: line 122
If 3 fixes fail consecutively, stop immediately.
- Distinctive: line 134
When you reach 3 failed fixes:
- Distinctive: line 137
Document the 3 failed approaches and the architectural conflict they revealed.
- Distinctive: line 138
Stop and ask the human partner to discuss redesigning the module boundary or data model.
- Distinctive: line 142
When debugging multi-component systems, log state at each component boundary before proposing changes.
“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
Find the root cause before attempting fixes. Symptom fixes create new bugs and mask underlying flaws.
<HARD-GATE>
Do not write code, edit files, or propose fixes until Phase 1 investigation is complete. Every technical issue requires an identified root cause before implementation.
</HARD-GATE>Modes
Select a debugging mode before Phase 1:
- Diagnosis mode (default). Reproduce errors, inspect stack traces, and isolate root causes without modifying production code.
- Remediation mode. Apply minimal surgical fixes, add regression tests, and verify complete resolution.
When to use
Use this workflow for any technical fault:
- Test failures and regressions
- Production bugs and runtime crashes
- Unexpected behavior or corrupted state
- Performance bottlenecks
- Build failures and configuration faults
Apply this process especially when you feel pressure to apply a fast fix, when a previous fix failed, or when you have already attempted two or more changes.
The four phases
Complete each phase in order before moving to the next.
Phase 1. Root cause investigation
Gather evidence to explain what failed and why before touching production code.
- Error inspection. Read stack traces, error messages, and logs in full. Identify line numbers, file paths, and error codes without skipping warnings.
- Completion criterion. Exact error text, file path, failing line number, and initial call site recorded in
.agents/state/debugging/error.txt.
- Completion criterion. Exact error text, file path, failing line number, and initial call site recorded in
- Reproduction and feedback loop. Build a tight, red-capable command that triggers the failure before reading source code to form theories.
- Assert the user's exact symptom rather than an unrelated crash.
- Keep the loop fast, deterministic, and runnable unattended.
- For non-deterministic bugs, raise the reproduction rate instead of giving up. Loop the trigger 100 times, add concurrency stress, narrow timing windows, or inject sleeps until reproducible above 50 percent.
- Minimize the repro by pruning inputs, callers, and state one by one. The repro is minimal when every remaining element is load-bearing, where removing any single element turns the loop green.
- If an automated loop cannot be built, stop immediately. Ask the user for environment access, redacted trace logs, or permission for temporary production probes. Do not guess without a loop.
- Consult
references/reproduction-and-loops.mdfor test runner patterns, minimization, and credential redaction. - Completion criterion. One verified command executed and confirmed red against the user symptom across consecutive runs, or an explicit escalation blocker sent to the user.
- Change audit. Inspect git history and environment changes. Run
git diffagainst the last known working commit. Check recent dependency updates and configuration changes.- Completion criterion. List of modified files, dependencies, and settings mapped against the failure symptom recorded in
.agents/state/debugging/change-audit.md.
- Completion criterion. List of modified files, dependencies, and settings mapped against the failure symptom recorded in
- Boundary instrumentation. If the fault spans multiple layers or services such as CI workflows, build scripts, API services, or databases, add diagnostic logging at each boundary. Log inputs, outputs, and environment variables across each boundary before running again.
- Completion criterion. Diagnostic output recorded in
.agents/state/debugging/boundary-log.txtisolating the exact boundary where expected state diverges.
- Completion criterion. Diagnostic output recorded in
- Upstream data flow tracing. If the error originates deep in the call stack, trace bad values backward to their origin. Consult
references/root-cause-tracing.mdfor backward tracing instructions.- Completion criterion. Code location that produced the initial invalid value recorded in
.agents/state/debugging/data-flow.md.
- Completion criterion. Code location that produced the initial invalid value recorded in
- Large-scale scope and context compaction defense. If the investigation requires surveying massive logs, hundreds of database files, or multi-repository history:
- Dispatch a dedicated
researchorselfsubagent viainvoke_subagentto isolate heavy tool outputs and prevent context window compaction in the primary agent session. - Persist intermediate findings directly to disk artifacts (
<appDataDir>/brain/<conversation-id>/orscratch/) instead of relying solely on chat memory. - Completion criterion. Heavy data collection delegated to a subagent and key synthesis written to
.agents/state/debugging/phase1-synthesis.md.
- Dispatch a dedicated
Phase 1 exit criterion. The exact line of code, bad input, or environmental discrepancy causing the defect is identified.
Phase 2. Pattern analysis
Analyze the mechanism before designing a fix.
- Reference comparison. Locate similar working code in the same repository or official documentation. Read the reference implementation completely.
- Completion criterion. Working reference implementation identified and reviewed.
- Difference inventory. Compare the working reference against the failing code line by line. Note differences in arguments, types, lifecycle timing, environment dependencies, and caller assumptions.
- Completion criterion. Documented list of differences between working and broken components with zero unverified assumptions.
Phase 2 exit criterion. Structural and contextual differences between broken code and working code are documented.
Phase 3. Hypothesis and testing
Test assumptions with isolated probes.
- Ranked falsifiable hypotheses. Formulate 3 to 5 distinct hypotheses ranked by likelihood before testing any of them. Single hypothesis generation anchors on the first plausible idea and wastes investigation time.
- Format each hypothesis as an explicit prediction like "If [cause] is the root issue, changing [variable] will [outcome]."
- Share the ranked list with the user as a rapid checkpoint. Proceed with testing if the user is away.
- Completion criterion. List of 3 to 5 ranked falsifiable predictions recorded in working notes and presented to the user.
- Targeted probes and instrumentation. Test hypotheses one variable at a time using the smallest possible probe.
- Prefer breakpoints or REPL inspection when the runtime allows.
- Tag every temporary log statement with a unique identifier like
[DEBUG-probe1]. This makes teardown a single grep command. - For performance regressions, establish a baseline measurement with a benchmark script, profiler, or query plan before bisecting. Measure before modifying code.
- Completion criterion. Probe results confirm or disprove the lead hypothesis without touching unrelated code. If refuted, test the next ranked hypothesis.
Phase 3 exit criterion. A single root cause hypothesis confirmed by probe data.
Phase 4. Implementation and verification
Apply the targeted fix at the source.
- Failing regression test and seam audit. Write an automated test reproducing the root cause before changing implementation code.
- Verify the test exercises the genuine call site seam. If available test seams are too shallow and provide false confidence, document the architectural seam limitation as an explicit finding.
- Follow the
test-driven-developmentskill. - Completion criterion. Automated regression test fails against unfixed code at a verified architectural seam, or seam limitation is documented.
- Surgical root cause fix. Modify code strictly at the identified root cause.
- Touch only what must be changed to fix the defect. Match existing indentation and conventions.
- Preserve surrounding style exactly; never reformat, "improve", or refactor adjacent unbroken code or comments.
- Retain all untouched functions; do not delete pre-existing dead code unless explicitly requested.
- Clean up only orphan variables, imports, or functions created by the fix.
- Completion criterion. Code edit confined strictly to the root cause with zero unrelated diff lines.
- Verification and cleanup pass. Validate the fix and purge temporary instrumentation. Follow the
verification-before-completionskill.- Re-run the Phase 1 reproduction loop against the original un-minimised scenario to confirm it passes.
- Verify all regression tests and suite tests pass.
- Run grep for the debug tag prefix to remove every temporary probe.
- Remove throwaway test scripts from scratch storage.
- Record the confirmed root cause hypothesis in the commit message for future maintainers.
- Completion criterion. Regression and suite tests pass, original repro is verified green, and grep confirms zero remaining debug tags.
- Failure loop limit.
- If fix 1 or fix 2 fails, return to Phase 1 to re-evaluate evidence.
- If 3 fixes fail consecutively, stop immediately. Do not attempt a fourth fix. Question the architecture.
- Completion criterion. The minimal surgical patch is applied and all regression tests pass with exit code 0.
Phase 4 exit criterion. Automated tests pass, original repro passes, debug tags are purged, and the root cause fix is verified without regressions.
Escalation for repeated failures
Three consecutive failed fixes signal an architectural flaw rather than a localized bug. Signs of architectural flaws include:
- Each fix introduces a new bug in a different component.
- The fix requires broad refactoring across multiple files.
- The fix requires complex workarounds to bypass existing abstractions.
When you reach 3 failed fixes:
- Halt all code modifications.
- Revert failed attempts to restore a clean state.
- Document the 3 failed approaches and the architectural conflict they revealed.
- Stop and ask the human partner to discuss redesigning the module boundary or data model.
Diagnostic instrumentation
When debugging multi-component systems, log state at each component boundary before proposing changes. Use commands native to the target platform.
Example for a macOS code-signing pipeline:
# Boundary 1: Workflow environment
echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
# Boundary 2: Build environment
env | grep IDENTITY || echo "IDENTITY not in environment"
# Boundary 3: Keychain access
security list-keychains
security find-identity -v
# Boundary 4: Signing invocation
codesign --sign "$IDENTITY" --verbose=4 "$APP"Example for a Linux container boundary:
docker inspect --format '{{json .Config.Env}}' <container-id>For non-signing multi-component systems, log inputs, outputs, and environment variables at each boundary using standard echo or platform logging. Do not run macOS-specific commands like security or codesign on Linux or Windows environments.
Boundary isolation
Confine debugging edits strictly to isolated bug remediation and targeted regression tests. Never execute opportunistic refactoring, rewrite unrelated functions, or delete commented-out code outside the immediate defect scope.
Disclosed reference
Consult these files in references/ for specialized debugging techniques:
references/root-cause-tracing.mdfor backward tracing through call stacks.references/defense-in-depth.mdfor adding multi-layer validation after fixing root causes.references/condition-based-waiting.mdfor replacing arbitrary sleeps with condition polling.
Related skills to invoke during debugging:
test-driven-developmentfor writing red regression tests before fixing code.verification-before-completionfor verifying fixes before claiming resolution.
Quick audit checklist
Audit debugging progress against this table before finalizing:
| Check | Passing condition |
| Reproduction first | Build a deterministic, red-capable reproduction script before modifying code |
| Single-variable testing | Formulate ranked falsifiable hypotheses and change one variable at a time |
| Root-cause confinement | Confine edits strictly to the root cause and add a regression test |
| Probe cleanup | Grep for debug tags and purge all temporary logging probes |
| Escalation threshold | Halt after the third consecutive failed fix and escalate to a human partner for redesign |
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.

