← Back to Skills Marketplace
ysy88092144

Debug Companion

by mumu · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
119
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install debug-companion
Description
根据错误信息/traceback 自动分析根因并给出修复建议
README (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)

可选上下文

上下文 说明 示例
语言 指定编程语言 PythonJavaScript
代码片段 相关代码 粘贴出错的代码
环境信息 OS、版本等 Node.js v18Python 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 [];
   }
  1. 确保数据加载完成:使用 await 或检查 Promise 状态
  2. 添加默认值:使用 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搜索+代码搜索双保险
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install debug-companion
  3. After installation, invoke the skill by name or use /debug-companion
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug debug-companion
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Debug Companion?

根据错误信息/traceback 自动分析根因并给出修复建议. It is an AI Agent Skill for Claude Code / OpenClaw, with 119 downloads so far.

How do I install Debug Companion?

Run "/install debug-companion" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Debug Companion free?

Yes, Debug Companion is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Debug Companion support?

Debug Companion is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Debug Companion?

It is built and maintained by mumu (@ysy88092144); the current version is v1.0.0.

💬 Comments