Xiaobai Systematic Debugging
Skill by aptratcn
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aptratcn/xiaobai-systematic-debuggingname: systematic-debugging version: 2.0.0 description: 4-phase root cause debugging. Never guess, find the cause. Based on real production debugging methodology. Trigger on: 'bug', 'error', 'not working', 'broken', 'debug', 'fix this'. emoji: š
Systematic Debugging š
4 phases. No guessing. Find root cause.
The 4 Phases
Phase 1: OBSERVE ā What exactly is wrong? (Gather evidence)
Phase 2: ISOLATE ā Where does it go wrong? (Narrow scope)
Phase 3: HYPOTHESIZE ā Why does it go wrong? (Form theory)
Phase 4: VERIFY ā Is it actually fixed? (Prove it)
Phase 1: OBSERVE (Don't Skip This)
Before touching any code, answer these:
ā” What is the expected behavior?
ā” What is the actual behavior?
ā” When did it start? (What changed?)
ā” Is it reproducible? (100%? Intermittent?)
ā” What's the exact error message / log output?
ā” What environment? (OS, version, dependencies)
Common mistake: Jumping to "I think it's because..." without observing first.
What to do:
- Read the actual error (copy-paste, don't paraphrase)
- Check logs (recent ones first)
- Reproduce the issue (if possible)
- Document what you see
Phase 2: ISOLATE (Narrow the Scope)
Binary search for the bug:
1. Is the problem in my code or external?
ā Comment out my code. Still broken? External.
2. Is it in the input, processing, or output?
ā Print/log at each stage.
3. Is it in one specific file/function?
ā Remove files/functions one by one.
ā Bug disappears? That's where it is.
4. Is it a specific condition?
ā Test with different inputs.
ā Pattern emerges? Root cause narrows.
Techniques:
git bisectā Find the commit that introduced the bug- Print statements at boundaries
- Comment out code sections
- Test with minimal reproduction
Phase 3: HYPOTHESIZE (Form a Theory)
Write your hypothesis BEFORE fixing:
I believe [X] is broken because [Y].
Evidence supporting:
- [Observation 1]
- [Observation 2]
Evidence against:
- [Observation 3]
If I change [Z], the fix should:
- Make [test case] pass
- Not break [other thing]
Common mistake: Fixing without understanding. You might "fix" the symptom, not the cause.
Anti-patterns:
- ā "Let me try changing this..." (random fixing)
- ā "This usually works..." (cargo cult debugging)
- ā "It's probably a race condition" (vague guess)
Phase 4: VERIFY (Prove It)
Before claiming "fixed":
ā” Original test case now passes
ā” Edge cases tested
ā” No new regressions introduced
ā” Error no longer appears in logs
ā” Fix makes sense given the hypothesis
Verification checklist:
# Run the failing test
npm test -- --grep "failing test"
# Check logs for errors
tail -f /var/log/app.log
# Test edge cases
[try empty input, huge input, unicode, etc.]
# Run full test suite
npm test
Real Example
Bug: "User login sometimes fails"
Metadata
Not sure this is the right skill?
Describe what you want to build ā we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aptratcn-xiaobai-systematic-debugging": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
xiaobai-workflow-enforcer
Xiaobai Workflow Enforcer - Mandatory workflows for AI Agents. Design before code. Test before implement. Verify before claim. Inspired by Superpowers (161K stars).
Aptratcn Prompt Guard
Skill by aptratcn
cognitive-debt-guard
Cognitive Debt Guard - Prevent the 23.5% incident spike from AI-generated code. Comprehension gates, review frameworks, and AI-free zones. Based on 2026 research.
deep-research-suite
Deep Research Suite - One command to aggregate, analyze, and synthesize research from multiple sources. Search ā Extract ā Summarize ā Report.
deep-research-suite
Deep Research Suite - One command to aggregate, analyze, and synthesize research from multiple sources. Search ā Extract ā Summarize ā Report.