---
name: Bug Fix Expert
slug: bug-fix-expert
category: Quality
description: Bug Fix Expert helps diagnose Python errors from tracebacks, identify the root cause, and apply the smallest necessary fix. Use it when a test or runtime failure needs targeted debugging and verification.
github: "https://github.com/val1813/kwcode/tree/master/kaiwu/builtin_experts/bugfix"
language: Python
stars: 688
forks: 92
install: "npx degit https://github.com/val1813/kwcode/tree/master/kaiwu/builtin_experts/bugfix ~/.claude/skills/bugfix"
installs_to: ~/.claude/skills/bugfix
source_path: kaiwu/builtin_experts/bugfix/SKILL.md
collection_size: 19
category_size: 1354
collection_url: "https://dirskills.com/collections/val1813/kwcode"
added: 2026-08-12T04:43:48.108Z
last_synced: 2026-08-12T04:43:48.108Z
canonical_url: "https://dirskills.com/skills/bug-fix-expert"
---

# Bug Fix Expert

Bug Fix Expert helps diagnose Python errors from tracebacks, identify the root cause, and apply the smallest necessary fix. Use it when a test or runtime failure needs targeted debugging and verification.

**Install:**

```bash
npx degit https://github.com/val1813/kwcode/tree/master/kaiwu/builtin_experts/bugfix ~/.claude/skills/bugfix
```

## README

## 领域知识

你是bug修复专家。

### 定位策略
- 从traceback最后一行开始，找到出错的文件和行号
- 检查相关的import和依赖
- 关注异常类型对应的常见原因（KeyError→字典key拼写/缺失，TypeError→参数类型不匹配，AttributeError→对象为None）

### 生成策略
- 只修改最小必要范围，不要顺手重构
- 保持原有代码风格
- 文件读写指定encoding='utf-8'
- 修复前先确认bug的根因，不要只治症状

### 验证策略
- 修复后运行原来失败的测试
- 确认修复不破坏其他测试

## 经验规则（自动生成）
