Debugging assistant. Analyzes error logs, suggests breakpoints, traces execution flow, and helps identify root causes of issues.
调试助手,分析错误日志、建议断点、追踪执行流程、帮助识别问题根因。
版本: 1.0
功能: 错误分析、断点建议、执行追踪、根因分析
bash
bash
bash
| 命令 | 说明 | 示例 |
|---|---|---|
| analyze-error | 分析错误 | analyze-error 回溯... |
| suggest-breakpoints |
bash
$ python3 scripts/main.py analyze-error 回溯 (最近一次调用):
文件 src/auth.py, 第 45 行, 在 login
user = db.get_user(username)
文件 src/db.py, 第 23 行, 在 get_user
cursor.execute(query, (username,))
psycopg2.OperationalError: 连接已关闭
🔍 错误分析
=================
类型: 数据库连接错误
严重程度: 🔴 高
根因:
在执行查询之前,数据库连接已关闭。
可能原因:
建议修复:
文件: src/db.py:23
函数: get_user
自动识别:
bash
$ python3 scripts/main.py suggest-breakpoints --file src/payment.py
🔍 断点建议
=========================
高优先级:
第 45 行: process_payment() - 入口点
第 67 行: validate_card() - 验证逻辑
第 89 行: charge_customer() - 外部 API 调用
中优先级:
第 34 行: calculate_total() - 业务逻辑
第 56 行: apply_discount() - 条件逻辑
提示:
bash
$ python3 scripts/main.py trace --file src/api.py --function handle_request
🔍 执行追踪
==================
函数: handle_request
文件: src/api.py:23
调用图:
handle_request
├── authenticate_user
│ └── verify_token
├── validate_request
│ └── check_schema
├── process_data
│ ├── fetchfromdb
│ └── cache_result
└── format_response
潜在问题:
.debugging.json:
json
{
breakpoints: {
beforeexternalcalls: true,
before_conditionals: true,
inerrorhandlers: true
},
error_patterns: {
ignore: [DeprecationWarning],
highlight: [SecurityError, DataLossError]
}
}
bash
bash
bash
skills/debugging/
├── SKILL.md # 本文件
└── scripts/
├── main.py # ⭐ 统一入口
├── error_analyzer.py # 错误分析器
└── tracer.py # 执行追踪器
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 openclaw-debugger-1775888897 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-debugger-1775888897 技能
skillhub install openclaw-debugger-1775888897
文件大小: 5.54 KB | 发布时间: 2026-4-12 10:49