debug
Skill2 starsChanged 11 months agoMITView on GitHub
Use when encountering any bug, test failure, or unexpected behavior. Enforces systematic root-cause investigation before proposing fixes. Prevents guess-and-check debugging.
We split this skill into the rules it gives an agent
20 rules. 0 are common, 20 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 166 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Core principle: ALWAYS find root cause before attempting fixes.
- Distinctive: line 22
If you haven't completed Phase 1, you cannot propose fixes.
- Distinctive: line 33
Don't skip past errors or warnings
- Distinctive: line 35
Read stack traces completely
- Distinctive: line 42
If not reproducible → gather more data, don't guess
- Distinctive: line 62
Keep tracing up until you find the source
- Distinctive: line 74
If implementing pattern, read reference implementation COMPLETELY
- Distinctive: line 75
Don't skim - read every line
- Distinctive: line 81
Don't assume "that can't matter"
- Distinctive: line 100
Don't fix multiple things at once
- Distinctive: line 105
DON'T add more fixes on top
- Distinctive: line 109
Don't pretend to know
- Distinctive: line 121
MUST have before fixing
- Distinctive: line 132
No other tests broken?
- Distinctive: line 138
If < 3: Return to Phase 1, re-analyze with new information
- Distinctive: line 140
DON'T attempt Fix #4 without architectural discussion
- Distinctive: line 152
Should we refactor architecture vs.
- Distinctive: line 169
If 3+ fixes failed: question the architecture (see Phase 4, step 5).
- Distinctive: line 189
review: - Verify fix worked before claiming success
- Distinctive: line 196
Before declaring a bug fixed:
“Common” is measured: kept by at least 6 in 10 of the 166 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.
Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
Violating the letter of this process is violating the spirit of debugging.
The Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRSTIf you haven't completed Phase 1, you cannot propose fixes.
The Four Phases
You MUST complete each phase before proceeding to the next.
Phase 1: Root Cause Investigation
BEFORE attempting ANY fix:
- Read Error Messages Carefully
- Don't skip past errors or warnings
- They often contain the exact solution
- Read stack traces completely
- Note line numbers, file paths, error codes
- Reproduce Consistently
- Can you trigger it reliably?
- What are the exact steps?
- Does it happen every time?
- If not reproducible → gather more data, don't guess
- Check Recent Changes
- What changed that could cause this?
- Git diff, recent commits
- New dependencies, config changes
- Environmental differences
- Gather Evidence at Component Boundaries For multi-component systems: log what enters and exits each component. Run once to find WHERE it breaks, then investigate that specific component.
Trace Data Flow
WHEN error is deep in call stack:
See
root-cause-tracing.mdin this directory for the complete backward tracing technique.Quick version:
- Where does bad value originate?
- What called this with bad value?
- Keep tracing up until you find the source
- Fix at source, not at symptom
Phase 2: Pattern Analysis
Find the pattern before fixing:
- Find Working Examples
- Locate similar working code in same codebase
- What works that's similar to what's broken?
- Compare Against References
- If implementing pattern, read reference implementation COMPLETELY
- Don't skim - read every line
- Understand the pattern fully before applying
- Identify Differences
- What's different between working and broken?
- List every difference, however small
- Don't assume "that can't matter"
- Understand Dependencies
- What other components does this need?
- What settings, config, environment?
- What assumptions does it make?
Phase 3: Hypothesis and Testing
Scientific method:
- Form Single Hypothesis
- State clearly: "I think X is the root cause because Y"
- Write it down
- Be specific, not vague
- Test Minimally
- Make the SMALLEST possible change to test hypothesis
- One variable at a time
- Don't fix multiple things at once
- Verify Before Continuing
- Did it work? Yes → Phase 4
- Didn't work? Form NEW hypothesis
- DON'T add more fixes on top
- When You Don't Know
- Say "I don't understand X"
- Don't pretend to know
- Ask for help
- Research more
Phase 4: Implementation
Fix the root cause, not the symptom:
- Create Failing Test Case
- Simplest possible reproduction
- Automated test if possible
- One-off test script if no framework
- MUST have before fixing
- TDD is baked into the builder agent — use it
- Implement Single Fix
- Address the root cause identified
- ONE change at a time
- No "while I'm here" improvements
- No bundled refactoring
- Verify Fix
- Test passes now?
- No other tests broken?
- Issue actually resolved?
- If Fix Doesn't Work
- STOP
- Count: How many fixes have you tried?
- If < 3: Return to Phase 1, re-analyze with new information
- If ≥ 3: STOP and question the architecture (step 5 below)
- DON'T attempt Fix #4 without architectural discussion
If 3+ Fixes Failed: Question Architecture
Pattern indicating architectural problem:
- Each fix reveals new shared state/coupling/problem in different place
- Fixes require "massive refactoring" to implement
- Each fix creates new symptoms elsewhere
STOP and question fundamentals:
- Is this pattern fundamentally sound?
- Are we "sticking with it through sheer inertia"?
- Should we refactor architecture vs. continue fixing symptoms?
Discuss with your human partner before attempting more fixes
This is NOT a failed hypothesis - this is a wrong architecture.
Red Flags — STOP and Return to Phase 1
| Thought | Why It's Wrong |
| "Quick fix for now, investigate later" | First fix sets the pattern. Do it right from the start |
| "Just try changing X and see if it works" | Seeing symptoms ≠ understanding root cause |
| "Skip the test, I'll manually verify" | Untested fixes don't stick |
| "Multiple changes at once, run tests" | Can't isolate what worked. Causes new bugs |
| "I don't fully understand but this might work" | Partial understanding guarantees bugs |
| "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again |
If 3+ fixes failed: question the architecture (see Phase 4, step 5).
Quick Reference
| Phase | Key Activities | Success Criteria |
| 1. Root Cause | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
| 2. Pattern | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
| 4. Implementation | Create test, fix, verify | Bug resolved, tests pass |
Integration
Workflow position:
[bug/failure] → debug → build (for fix) → reviewChains to:
- build - For implementing the fix with TDD via builder agent
- review - Verify fix worked before claiming success
Chains from:
- Entry point skill - triggered by any bug, test failure, or unexpected behavior
Verification Checklist
Before declaring a bug fixed:
- Root cause identified (not just symptoms)
- Evidence gathered through systematic investigation
- Failing test case created before fix
- Single fix applied (not multiple changes)
- Fix addresses root cause, not symptom
- All tests pass after fix
- No regressions introduced
Other versions190 projects use a version of this.
Word for word · 1
- nicodiansk/turboflow★ 2100% same
Edited · 5
- jonathanmalkin/jules★ 6548% same
- Kanevry/session-orchestrator★ 5314% same
- ariadoss/superskills★ 1251% same
- Guild-Agents/guild★ 435% same
- azmainadel/devloop-skills★ 151% same
Wrote their own version · 184
- Yeachan-Heo/oh-my-claudecode★ 40ksame name
- Yeachan-Heo/oh-my-claude-sisyphus★ 40ksame name
- anthropics/knowledge-work-plugins★ 34ksame name
- gavrielc/nanoclaw★ 31ksame name
- nanocoai/nanoclaw★ 31ksame name
- qwibitai/nanoclaw★ 31ksame name
- openai/symphony★ 27ksame name
- FalkorDB/FalkorDB★ 11ksame name
- NVIDIA/Model-Optimizer★ 5.5ksame name
- NVIDIA/TensorRT-Model-Optimizer★ 5.3ksame name
174 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.
Used alongsideProjects with it also use add-discord, add-slack 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.
MicrosoftSkilladd-discord
Add Discord bot channel integration via Chat SDK.
Also in 11 projects that use this
MicrosoftSkilladd-slack
Add Slack channel integration via Chat SDK.
Also in 11 projects that use this
- +10 more from microsoft
In this repository10 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- atlasSkill
- brainstormSkill
- buildSkill
- planSkill
- reviewSkill
- setupSkill
- shipSkill
- storySkill
- wrapSkill
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.

