Analyzes bugs, test failures, and error logs to identify root causes and generate minimal diff patches with regression tests.
Ships in external-gitcode-ascend-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
通过结构化的错误分析和根因定位流程,自动生成最小化diff格式修复补丁和防回归测试用例,实现从错误现象到完整修复方案的端到端自动化处理。
| 场景 | 定位方法 | 适用条件 |
|---|---|---|
| 通用bug分析 | 自顶向下追踪法 | 无明确代码变更/PR信息 |
| 代码变更引入bug | Git二分法 | 有code_change_info,需定位具体PR/提交 |
| 错误码 | 含义 | 处理方式 |
|---|---|---|
| E001 | 输入信息缺失或无法解析 | 补充必填输入(error_phenomenon/reproduce_steps) |
| E002 | 根因模糊无法准确定位 | 提供更多上下文信息或代码变更信息 |
| E003 | 补丁生成失败 | 确认根因已锁定,检查代码上下文 |
| E004 | 测试用例生成失败 | 确认修复补丁有效,指定测试框架 |
✅ 校验点:检查必填输入(error_phenomenon/reproduce_steps)是否完整、可识别 ❌ 中断条件:缺失必填输入 / 错误现象无法解析(如乱码、不完整)→ 抛出错误码E001并中断 📝 反馈:输出「信息收集完成,可进入根因分析阶段 / 缺失必填输入,错误码E001」
✅ 校验点:根因可复现,且精准锁定至具体代码行/文件/PR/提交记录 ❌ 中断条件:信息不足导致根因模糊,无法准确定位 → 抛出错误码E002并中断 📝 反馈:输出「根因已定位:XXX(关联PR/提交:XXX) / 根因模糊,错误码E002」
git bisect start → git bisect bad [异常版本/提交哈希] → git bisect good [正常版本/提交哈希]✅ 校验点:补丁为标准diff格式、修改粒度最小、语法无错误、仅针对根因修复 ❌ 中断条件:根因未锁定 / 无有效代码上下文 → 抛出错误码E003并中断 📝 反馈:输出「Diff格式修复补丁已生成,共X处修改 / 补丁生成失败,错误码E003」
✅ 校验点:测试用例可直接执行、覆盖根因相关核心场景、匹配项目实际使用的测试框架 ❌ 中断条件:无有效修复补丁 / 未指定测试框架 → 抛出错误码E004并中断 📝 反馈:输出「防回归测试用例已生成,共X个(适配XXX框架) / 测试用例生成失败,错误码E004」
[标准diff格式,包含文件路径、行号、修改内容,关键修复点添加注释说明]
diff --git a/.github/workflows/nightly_benchmarks.yaml b/.github/workflows/nightly_benchmarks.yaml
index 123456..789abc 100644
--- a/.github/workflows/nightly_benchmarks.yaml
+++ b/.github/workflows/nightly_benchmarks.yaml
@@ -15,6 +15,10 @@
- name: Install dependencies
run: |
pip install -e .
+ # 安装msprobe相关依赖(修复根因:PR#4241引入的msprobe功能需要这些依赖)
+ pip install mindstudio-probe==8.3.0 || echo "msprobe installation skipped"
+ pip install tb_graph_ascend || echo "tb_graph_ascend installation skipped"
[可执行的测试代码,适配项目实际使用的测试框架,覆盖正常/边界/异常场景]
# 示例:pytest框架测试用例
def test_bug_fix_reproduction():
"""复现原始bug(修复前执行失败)"""
# 测试代码...
assert result == expected
def test_bug_fix_validation():
"""验证修复效果(修复后执行通过)"""
# 测试代码...
assert fixed_result == expected
def test_edge_cases():
"""边界场景测试"""
# 测试代码...
pass
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/external-gitcode-ascend-skills:external-gitcode-ascend-auto-bug-fixerfrom external-gitcode-ascend-skills
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin external-gitcode-ascend-skills91 skills in this plugin
/external-gitcode-ascend-analyse-coverage分析测试覆盖率盲区,生成覆盖率分析报告/external-gitcode-ascend-arxiv-recommendation-npu自动化推荐系统论文发现流水线。抓取 arxiv 推荐论文,检测源码,生成待迁移任务清单,由 npu-model-migration skill 完成 NPU 适配。/external-gitcode-ascend-ascendc-operator-code-gen根据设计文档生成 AscendC 算子完整代码实现并完成框架适配。TRIGGER when: 设计文档已完成,需要生成 op_host/op_kernel 代码、注册到 PyTorch 框架、编译测试。关键词:代码生成、op_host、op_kernel、tiling、kernel、框架适配、算子注册。Other plugins' skills for the same job