返回顶部
d

debugging

Debugging assistant. Analyzes error logs, suggests breakpoints, traces execution flow, and helps identify root causes of issues.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
78
下载量
0
收藏
概述
安装方式
版本历史

debugging

# Debugging Assistant 调试助手,分析错误日志、建议断点、追踪执行流程、帮助识别问题根因。 **Version**: 1.0 **Features**: 错误分析、断点建议、执行追踪、根因分析 --- ## Quick Start ### 1. 分析错误日志 ```bash # 分析 Python 错误 python3 scripts/main.py analyze-error "Traceback (most recent call last):..." # 从文件分析 python3 scripts/main.py analyze-error --file error.log ``` ### 2. 建议断点 ```bash # 为代码建议断点位置 python3 scripts/main.py suggest-breakpoints --file src/main.py # 针对特定函数 python3 scripts/main.py suggest-breakpoints --function process_data ``` ### 3. 追踪执行 ```bash # 追踪函数调用 python3 scripts/main.py trace --file src/app.py --function handle_request ``` --- ## Commands | 命令 | 说明 | 示例 | |------|------|------| | `analyze-error` | 分析错误 | `analyze-error "Traceback..."` | | `suggest-breakpoints` | 建议断点 | `suggest-breakpoints --file src.py` | | `trace` | 追踪执行 | `trace --file src.py --function foo` | --- ## Error Analysis ### Python Traceback 分析 ```bash $ python3 scripts/main.py analyze-error "Traceback (most recent call last): File 'src/auth.py', line 45, in login user = db.get_user(username) File 'src/db.py', line 23, in get_user cursor.execute(query, (username,)) psycopg2.OperationalError: connection closed" 🔍 Error Analysis ================= Type: Database Connection Error Severity: 🔴 High Root Cause: The database connection was closed before executing the query. Possible Causes: 1. Connection pool exhaustion 2. Connection timed out 3. Database server restart Suggested Fixes: 1. Check connection pool settings 2. Implement connection retry logic 3. Add connection health checks File: src/db.py:23 Function: get_user ``` ### 常见错误模式 自动识别: - `ImportError` / `ModuleNotFoundError` - 导入问题 - `AttributeError` - 属性访问错误 - `KeyError` / `IndexError` - 数据访问错误 - `TypeError` - 类型错误 - `ConnectionError` - 网络/连接错误 - `TimeoutError` - 超时错误 --- ## Breakpoint Suggestions ```bash $ python3 scripts/main.py suggest-breakpoints --file src/payment.py 🔍 Breakpoint Suggestions ========================= High Priority: Line 45: process_payment() - Entry point Line 67: validate_card() - Validation logic Line 89: charge_customer() - External API call Medium Priority: Line 34: calculate_total() - Business logic Line 56: apply_discount() - Conditional logic Tips: - Set breakpoints before external API calls - Watch variables: amount, currency, customer_id ``` --- ## Execution Tracing ```bash $ python3 scripts/main.py trace --file src/api.py --function handle_request 🔍 Execution Trace ================== Function: handle_request File: src/api.py:23 Call Graph: handle_request ├── authenticate_user │ └── verify_token ├── validate_request │ └── check_schema ├── process_data │ ├── fetch_from_db │ └── cache_result └── format_response Potential Issues: - No error handling in process_data - External call to fetch_from_db (line 67) ``` --- ## Configuration `.debugging.json`: ```json { "breakpoints": { "before_external_calls": true, "before_conditionals": true, "in_error_handlers": true }, "error_patterns": { "ignore": ["DeprecationWarning"], "highlight": ["SecurityError", "DataLossError"] } } ``` --- ## Examples ### 场景 1:排查崩溃问题 ```bash # 1. 复制错误信息 python3 main.py analyze-error "$(cat error.log)" # 2. 根据分析设置断点 python3 main.py suggest-breakpoints --file src/crash_point.py # 3. 追踪相关函数 python3 main.py trace --function problematic_function ``` ### 场景 2:性能问题排查 ```bash # 追踪执行路径 python3 main.py trace --file src/slow_endpoint.py --function handler # 识别冗余调用 ``` ### 场景 3:API 错误调试 ```bash # 分析 API 错误响应 python3 main.py analyze-error "HTTP 500: Internal Server Error" # 检查 API 处理代码 python3 main.py suggest-breakpoints --file src/api/handlers.py ``` --- ## Files ``` skills/debugging/ ├── SKILL.md # 本文件 └── scripts/ ├── main.py # ⭐ 统一入口 ├── error_analyzer.py # 错误分析器 └── tracer.py # 执行追踪器 ``` --- ## Roadmap - [x] Python error analysis - [ ] JavaScript error analysis - [ ] Interactive debugger integration - [ ] Log file monitoring

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 openclaw-debugger-1775888897 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 openclaw-debugger-1775888897 技能

通过命令行安装

skillhub install openclaw-debugger-1775888897

下载 Zip 包

⬇ 下载 debugging v1.0.0

文件大小: 5.54 KB | 发布时间: 2026-4-12 10:49

v1.0.0 最新 2026-4-12 10:49
Debugging assistant with error analysis, breakpoint suggestions, and execution tracing

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部