<< All versions
Skill v1.0.0
currentAutomated scan100/100luovicter-collab/openclaw-docs/debug-pro
──Details
PublishedOctober 3, 2026 at 10:08 PM
Content Hashsha256:88d58b65a81f7dda...
Git SHA
──Files
Files (1 file, 3.3 KB)
SKILL.md3.3 KBactive
SKILL.md · 127 lines · 3.3 KB
version: "1.0.0"
debug-pro
Systematic debugging methodology and language-specific debugging commands.
The 7-Step Debugging Protocol
- Reproduce — Get it to fail consistently. Document exact steps, inputs, and environment.
- Isolate — Narrow scope. Comment out code, use binary search, check recent commits with
git bisect. - Hypothesize — Form a specific, testable theory about the root cause.
- Instrument — Add targeted logging, breakpoints, or assertions.
- Verify — Confirm root cause. If hypothesis was wrong, return to step 3.
- Fix — Apply the minimal correct fix. Resist the urge to refactor while debugging.
- Regression Test — Write a test that catches this bug. Verify it passes.
Language-Specific Debugging
JavaScript / TypeScript
bash
# Node.js debuggernode --inspect-brk app.js# Chrome DevTools: chrome://inspect# Console debuggingconsole.log(JSON.stringify(obj, null, 2))console.trace('Call stack here')console.time('perf'); /* code */ console.timeEnd('perf')# Memory leaksnode --expose-gc --max-old-space-size=4096 app.js
Python
bash
# Built-in debuggerpython -m pdb script.py# Breakpoint in codebreakpoint() # Python 3.7+# Verbose tracingpython -X tracemalloc script.py# Profilepython -m cProfile -s cumulative script.py
Swift
bash
# LLDB debugginglldb ./MyApp(lldb) breakpoint set --name main(lldb) run(lldb) po myVariable# Xcode: Product → Profile (Instruments)
CSS / Layout
css
/* Outline all elements */* { outline: 1px solid red !important; }/* Debug specific element */.debug { background: rgba(255,0,0,0.1) !important; }
Network
bash
# HTTP debuggingcurl -v https://api.example.com/endpointcurl -w "@curl-format.txt" -o /dev/null -s https://example.com# DNSdig example.comnslookup example.com# Portslsof -i :3000netstat -tlnp
Git Bisect
bash
git bisect startgit bisect bad # Current commit is brokengit bisect good abc1234 # Known good commit# Git checks out middle commit — test it, then:git bisect good # or git bisect bad# Repeat until root cause commit is foundgit bisect reset
Common Error Patterns
| Error | Likely Cause | Fix | |
|---|---|---|---|
Cannot read property of undefined | Missing null check or wrong data shape | Add optional chaining (?.) or validate data | |
ENOENT | File/directory doesn't exist | Check path, create directory, use existsSync | |
CORS error | Backend missing CORS headers | Add CORS middleware with correct origins | |
Module not found | Missing dependency or wrong import path | npm install, check tsconfig paths | |
Hydration mismatch (React) | Server/client render different HTML | Ensure consistent rendering, use useEffect for client-only | |
Segmentation fault | Memory corruption, null pointer | Check array bounds, pointer validity | |
Connection refused | Service not running on expected port | Check if service is up, verify port/host | |
Permission denied | File/network permission issue | Check chmod, firewall, sudo |
Quick Diagnostic Commands
bash
# What's using this port?lsof -i :PORT# What's this process doing?ps aux | grep PROCESS# Watch file changesfswatch -r ./src# Disk spacedf -h# System resource usagetop -l 1 | head -10