作者:互联网 时间: 2026-08-01 19:40:01
debug-pro 技能提供了一套结构化方法论,旨在消除软件开发生命周期中的盲目猜测。通过将此技能集成到 Openclaw Skills 中,开发者可以采用严谨的 7 步协议:重现、隔离、假设、检测、验证、修复和回归测试,确保 Bug 不仅仅是被修复,而是被深刻理解并防止再次发生。
除了工作流之外,它还是适用于 Node.js、Python、Swift 和 Web 布局调试等多种环境的技术速查表。它使工程师能够使用行业标准的 CLI 工具和诊断命令,解决内存泄漏、水合不匹配和网络瓶颈等复杂问题。
下载入口:https://github.com/openclaw/skills/tree/main/skills/cmanfre7/debug-pro
从源直接安装技能的最快方式。
npx clawhub@latest install debug-pro
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
<project>/skills/
优先级:工作区 > 本地 > 内置
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 debug-pro。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
要在 Openclaw Skills 生态中使用 debug-pro,请确保您的开发环境已安装必要的语言运行时。您可以使用以下诊断命令验证系统状态:
# 检查系统资源使用情况
top -l 1 | head -10
# 验证磁盘空间
df -h
# 在启动调试器前检查端口冲突
lsof -i :3000
该技能根据错误模式和环境类型组织排障数据。下表总结了此技能中常用的错误映射:
| 类别 | 常见错误 | 可能原因 |
|---|---|---|
| 运行时 | Cannot read property | 缺少空值检查或数据结构错误 |
| 系统 | ENOENT | 文件或目录不存在 |
| 网络 | CORS 错误 | 后端缺少 CORS 响应头 |
| 内存 | Segmentation fault | 内存损坏或空指针 |
| React | Hydration mismatch | 服务端和客户端渲染的 HTML 不一致 |
Systematic debugging methodology and language-specific debugging commands.
git bisect.# Node.js debugger
node --inspect-brk app.js
# Chrome DevTools: chrome://inspect
# Console debugging
console.log(JSON.stringify(obj, null, 2))
console.trace('Call stack here')
console.time('perf'); /* code */ console.timeEnd('perf')
# Memory leaks
node --expose-gc --max-old-space-size=4096 app.js
# Built-in debugger
python -m pdb script.py
# Breakpoint in code
breakpoint() # Python 3.7+
# Verbose tracing
python -X tracemalloc script.py
# Profile
python -m cProfile -s cumulative script.py
# LLDB debugging
lldb ./MyApp
(lldb) breakpoint set --name main
(lldb) run
(lldb) po myVariable
# Xcode: Product → Profile (Instruments)
/* Outline all elements */
* { outline: 1px solid red !important; }
/* Debug specific element */
.debug { background: rgba(255,0,0,0.1) !important; }
# HTTP debugging
curl -v https://api.example.com/endpoint
curl -w "@curl-format.txt" -o /dev/null -s https://example.com
# DNS
dig example.com
nslookup example.com
# Ports
lsof -i :3000
netstat -tlnp
git bisect start
git bisect bad # Current commit is broken
git 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 found
git bisect reset
| 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 |
# What's using this port?
lsof -i :PORT
# What's this process doing?
ps aux | grep PROCESS
# Watch file changes
fswatch -r ./src
# Disk space
df -h
# System resource usage
top -l 1 | head -10