← 返回 Skills 市场
119
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install debug-companion
功能描述
根据错误信息/traceback 自动分析根因并给出修复建议
使用说明 (SKILL.md)
调试伴侣 SKILL.md
你的专属调试助手 —— 粘贴错误信息,立即得到根因分析和修复方案
技能简介
调试伴侣(Debug Companion)是一个 OpenClaw 技能,专门帮助开发者快速定位和修复代码错误。
核心能力
- 🔍 智能解析:自动识别错误类型、文件位置、行号
- 🎯 根因分析:用大白话解释"为什么会出错"
- ✅ 修复建议:给出具体操作步骤,甚至直接生成补丁
- 📚 参考资料:附赠类似问题的解决方案链接
支持语言
| 语言 | 状态 |
|---|---|
| Python | ✅ |
| JavaScript / Node.js | ✅ |
| TypeScript | ✅ |
| Go | ✅ |
| Java | ✅ |
| C++ | ✅ |
| Rust | ✅ |
| PHP | ✅ |
| Ruby | ✅ |
工作流程
用户发送错误信息/traceback
↓
错误信息解析
(提取错误类型、文件、行号)
↓
智能搜索
(Tavily + Code Search)
↓
根因分析 + 修复建议
↓
结构化输出
使用方式
触发词
用户发送以下内容时会激活技能:
调试 + 错误信息报错 + traceback出了个bug这个错误怎么修- 直接粘贴错误信息/traceback
输入格式
推荐格式:
[错误类型]: [错误描述]
File "[文件]", line [行号], in [函数名]
[代码]
[更多堆栈信息]
示例:
TypeError: Cannot read property 'map' of undefined
at processData (/app/utils.js:15:20)
at handleRequest (/app/server.js:42:10)
可选上下文
| 上下文 | 说明 | 示例 |
|---|---|---|
| 语言 | 指定编程语言 | Python、JavaScript |
| 代码片段 | 相关代码 | 粘贴出错的代码 |
| 环境信息 | OS、版本等 | Node.js v18、Python 3.11 |
输出格式
## 🔍 错误解析
**错误类型**:TypeError
**问题文件**:/app/utils.js:15
**问题描述**:在 `processData` 函数中尝试调用 `.map()`,但数据是 `undefined`
## 🎯 根因分析
你正在对 `data` 变量调用 `.map()` 方法,但这个变量是 `undefined`。这通常是因为:
1. API 返回的数据结构不符合预期
2. 异步操作尚未完成就开始处理
3. 数据获取函数出错返回了空值
## ✅ 修复建议
1. **添加防御性检查**:在使用 `.map()` 前检查 `data` 是否存在
```javascript
if (!data) {
console.error('数据不存在:', data);
return [];
}
- 确保数据加载完成:使用
await或检查 Promise 状态 - 添加默认值:使用
data ?? []防止 undefined
📚 参考资料
---
## 错误类型速查表
| 错误类型 | 常见原因 |
|----------|----------|
| `TypeError: Cannot read property 'X' of undefined` | 访问了 undefined/null 的属性 |
| `ReferenceError: X is not defined` | 变量未定义或拼写错误 |
| `SyntaxError` | 语法错误,缺少括号/引号等 |
| `IndexError: list index out of range` | 数组索引越界 |
| `KeyError: 'X'` | 字典/对象没有这个键 |
| `NullPointerException` | 空指针调用 |
| `ENOENT: No such file or directory` | 文件路径错误 |
| `Permission denied` | 权限不足 |
---
## 工具调用
技能内部使用以下工具:
| 工具 | 用途 |
|------|------|
| `tavily_search` | 搜索类似问题的解决方案 |
| `code_search` | 搜索官方文档和权威教程 |
| `web_fetch` | 抓取详细修复方案页面 |
---
## 注意事项
1. **隐私安全**:如果错误信息包含敏感路径或密钥,会自动脱敏处理
2. **上下文重要**:提供更多代码上下文能获得更准确的建议
3. **版本相关**:某些错误在不同版本语言中处理方式不同,请提供版本信息
4. **二次确认**:涉及代码修改时,建议先在测试环境验证
---
## 示例对话
**用户**:
js报错:TypeError: Cannot read property 'map' of undefined at processData (utils.js:15:20) at handleRequest (server.js:42:10)
**调试伴侣**:
(按上方输出格式返回完整分析)
---
## 更新日志
- 2026-03-27:v1.0.0 初始版本
- 支持8种主流语言
- 错误解析+根因分析+修复建议
- Tavily搜索+代码搜索双保险
安全使用建议
This skill appears to do what it says: parse pasted error stacks and return analysis and remediation tips. Before installing, consider: (1) only paste non-sensitive logs/error text (avoid API keys, full file paths or stack traces containing secrets); (2) the skill references external search tools in its docs — confirm your OpenClaw environment controls network access for skills if you want to limit outbound searches; (3) treat generated code suggestions as templates and test them in a safe environment before applying to production.
功能分析
Type: OpenClaw Skill
Name: debug-companion
Version: 1.0.0
The 'Debug Companion' skill is a legitimate developer tool designed to parse error tracebacks and provide root cause analysis. The implementation in `debug-companion.js` uses standard regular expressions to extract error types and file paths, providing helpful code snippets and explanations for common programming errors. There is no evidence of data exfiltration, unauthorized execution, or malicious instructions in the `SKILL.md` or `README.md` files.
能力评估
Purpose & Capability
Name/description (debugging error tracebacks) match the included SKILL.md and the shipped JavaScript: parsing errors, producing root-cause analysis and remediation suggestions. The declared capabilities (searching for solutions, formatting output, multi-language support) are implemented in the code as parsing, suggestion generation and mock search results.
Instruction Scope
Runtime instructions only ask users to paste error/traceback text and optional context; SKILL.md does not instruct reading unrelated files, environment variables, or system secrets. It mentions using internal tools (tavily_search, code_search, web_fetch) to find references, which is coherent with the stated purpose.
Install Mechanism
No install spec is provided and the skill is instruction+code only; there are no external downloads or installers. README suggests copying files into a skills directory which is a normal manual install method.
Credentials
The skill declares no required environment variables, credentials, or config paths. The SKILL.md and code do not attempt to read undeclared secrets or request unrelated credentials.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request persistent/privileged presence or modify other skills or system-wide config.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install debug-companion - 安装完成后,直接呼叫该 Skill 的名称或使用
/debug-companion触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Debug Companion v1.0.0 – Initial Release
- Supports error analysis and fix suggestions for 8 major languages, including Python, JavaScript, and Java.
- Automatically extracts error type, file, and line number from error messages or tracebacks.
- Provides clear root cause explanations and actionable repair steps.
- Integrates search tools (Tavily, code search) for relevant documentation and community solutions.
- Automatically redacts sensitive information in error messages.
- Activates via natural-language triggers or direct paste of error details.
元数据
常见问题
Debug Companion 是什么?
根据错误信息/traceback 自动分析根因并给出修复建议. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 119 次。
如何安装 Debug Companion?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install debug-companion」即可一键安装,无需额外配置。
Debug Companion 是免费的吗?
是的,Debug Companion 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Debug Companion 支持哪些平台?
Debug Companion 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Debug Companion?
由 mumu(@ysy88092144)开发并维护,当前版本 v1.0.0。
推荐 Skills