Develops Ascend C operator unit tests and improves coverage by analyzing test gaps in op_host/op_api/op_kernel, generating or supplementing UT cases, and producing coverage reports.
Ships in ops-direct-invoke-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.
Read when SKILL.md points to them.
| 参数名 | 含义 | 取值约束 | 初值推断 |
|---|---|---|---|
| op_name | 算子名 | 采用下划线命名法 | 驼峰命名自动转换,无法推断时询问 |
| repo_type | 仓库类型 | 枚举值["ops-math", "ops-nn", "ops-transformer", "ops-cv", "custom"] | 根据工作目录推断,无法推断时询问 |
| soc_type | 芯片架构 | 枚举值列表["ascend310p", "ascend910b", "ascend910_93", "ascend950"] | 用户没有提及则默认全选 |
| test_model | 测试模块 | 枚举值列表["opapi", "ophost", "opkernel"] | 用户没有提及则默认全选 |
| interactive_mode | 使用模式 | 枚举值["auto", "interactive"],auto 为自动模式不向用户问询,interactive 为交互模式允许向用户问询 | 默认 "auto" |
格式约定:整个 skill 里的所有文档中,入口参数使用 ${参数名} 标记,需替换为真实值后再理解。
调用方式:必须以 repo_type=custom 模式调用本技能(跳过问卷,走 0.1.2 自定义工程快速通道)。
- 这是强制步骤,必须在执行主流程前完成!
- 在此步骤完成前,禁止阅读任何 references/ 目录下的文档和当前工作目录下的文件!
- 子步骤必须逐一执行,不允许同时执行或跳步!
根据"初值推断"规则,尝试获取所有入口参数的值(仅根据已有上下文简单推断,不阅读具体代码和子目录)。
在执行问卷前,必须先确定项目路径,然后检测仓名:
pwd 获取当前工作目录检查路径的目录组件(以 / 分隔的路径段)是否完全等于以下标准仓名之一:ops-math、ops-nn、ops-transformer、ops-cv
⚠️ 必须是精确的目录名匹配,禁止子串匹配。 例如路径
/home/user/ops-math-utils中的ops-math-utils不等于ops-math,应判定为 custom。
判断逻辑:
| 检测结果 | repo_type | interactive_mode | 后续行为 |
|---|---|---|---|
| 路径中存在完全等于标准仓名的目录段 | 匹配到的仓名 | 按默认值 "auto" | 进入 0.1.1 标准确认流程 |
| 路径中不存在完全等于标准仓名的目录段 | "custom" | "auto" | 进入 0.1.2 自定义工程快速通道 |
立即使用 question 工具,向用户确认入口参数是否正确,问卷内容使用 assets/question.json,在推断出的选项的 label 后加上 "【推荐】",除此之外不得有任何修改
收到用户答复后,根据变量的"含义"理解用户真实需求。
跳过所有问卷,从用户消息和上下文中推断所有入口参数,禁止使用 question 工具:
| 参数 | 取值 |
|---|---|
| repo_type | "custom" |
| interactive_mode | "auto" |
| soc_type | 从用户消息或上下文推断。无法推断时从算子的 _def.cpp 文件中提取:在 ${op_path}/op_host/ 下查找 *_def.cpp,解析所有 AddConfig("xxx", ...) 调用中的芯片名(如 "ascend910b"、"ascend950"),作为 soc_type 取值;若有多个则全部使用 |
| test_model | ["opapi", "ophost"](custom 工程不支持 opkernel) |
| op_name | 从用户消息或上下文推断(如用户提及的算子名、目录名等) |
设定完成后,直接进入 Step 0.2。
立即使用 todowrite 工具创建 Todos,内容使用 assets/todo.json,不允许进行任何修改。
创建 /tmp/cannbot_${op_name}/ 目录,用于存放所有中间文件:
mkdir -p /tmp/cannbot_${op_name}
重要规则:
params.json 中用户所有可能的需求都已经被抽象到主流程中,主流程的步骤在不同的需求下会重写为不同实现,你必须严格遵守以下规则:
todowrite 工具更新 TODO.md,将其标记为 [x]${interactive_mode} == "interactive" 时,必须在每个询问点使用 question 工具与用户确认,禁止绕过用户自行决策。Step 4.4a 的询问步骤是交互模式的核心特征,跳过即违背用户意图。assets/coverage_files_question.json (opens in a new tab)assets/csv-refactor/template_cmake.txt (opens in a new tab)assets/csv-refactor/template_inferdtype.cpp (opens in a new tab)assets/csv-refactor/template_inferdtype.csv (opens in a new tab)assets/csv-refactor/template_infershape.cpp (opens in a new tab)assets/csv-refactor/template_infershape.csv (opens in a new tab)assets/csv-refactor/template_param.h (opens in a new tab)assets/csv-refactor/template_tiling.cpp (opens in a new tab)assets/csv-refactor/template_tiling.csv (opens in a new tab)assets/question.json (opens in a new tab)assets/template_report.md (opens in a new tab)assets/todo.json (opens in a new tab)evals/evals.json (opens in a new tab)references/coverage-guide/coverage-extraction.md (opens in a new tab)references/coverage-guide/test-implementation.md (opens in a new tab)references/custom/custom.md (opens in a new tab)references/ops-transformer/csv-format-spec.md (opens in a new tab)references/ops-transformer/csv-refactor-workflow.md (opens in a new tab)references/ops-transformer/legacy-code-extraction.md (opens in a new tab)references/ops-transformer/ops-transformer.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ops-direct-invoke-skills:ascendc-ut-developfrom ops-direct-invoke-skills
npx claudepluginhub catman626/cannbot-skills --plugin ops-direct-invoke-skills24 skills in this plugin
/ascendc-api-best-practicesAscend C API 使用最佳实践。提供算术、归约、数据搬运、Buffer管理、精度转换、通信接口等 API 的正确用法和限制说明。触发:用户询问具体 API 用法(如"DataCopy 怎么用"、"ReadNbi 怎么用")、遇到 API 参数错误或限制报错(如 repeatTimes、对齐问题)、需要查看 API 最佳实践或避坑指南时。/ascendc-blaze-best-practice在 Ascend 950 / DAV_3510 平台上,基于 Blaze/tensor_api 开发 Basic、Batch、Grouped、Quantized、MX 等 MatMul 类算子或相关的融合算子时使用。不适用于纯 Vector 算子或 A2/A3 平台。/ascendc-blaze-migration评估并将 ops-nn、ops-transformer 等仓中 Ascend 950 / DAV_3510 的 AscendC Kernel 分支等价迁移到 ops-tensor Blaze/Tensor API。适用于 CMCT、CGMCT、单体或自定义分层 Kernel,以及 Cube、Vector、MIX、高阶 Matmul、手工 Buffer、数据搬运、自定义调度、VF 和同步路径;在隔离迁移工程中串行完成迁移合同冻结、Blaze 开发、验证资产生成、原始基线、Blaze 验收和双仓本地提交交付。/ascendc-code-reviewAscend C 代码检视技能。触发:检视代码、检视 PR、检查是否有问题、快速检视。支持文件检视、PR 检视、快速定向检视、设计一致性检查。自动识别代码侧别、提取适用条例、执行假设检验驱动的逐条检视。/ascendc-crash-debugAscend C 算子卡死/崩溃/内存错误调试路由技能。用于处理程序无法运行完或执行异常崩溃的场景:(1) 程序卡死/挂起/超时,Kernel 无响应,(2) 程序崩溃(Segmentation Fault、Abort),(3) Buffer 冲突/死锁导致的核心挂起,(4) 需要解析 plog 日志定位卡死/崩溃位置,(5) 偶发崩溃/结果异常(怀疑内存越界踩踏),需要主动检测内存错误。触发关键词:卡死、挂起、超时、崩溃、hang、crash、deadlock、Segmentation Fault、Abort、Kernel hang、内存越界、plog、memcheck、内存检查、内存错误、偶发崩溃、aic error、非法读写。/ascendc-direct-invoke-templateKernel直调工程模板,用于创建 Ascend C Kernel 直调工程项目。提供经过验证的 Vector 样例工程(add_custom)、Blaze Matmul 工程模板(纯 Matmul / 融合 / MX 量化 / GroupMatmul)和 Kirin Vector 模板。触发:当用户需要创建 Kernel 直调工程、学习 Ascend C 编程、快速原型验证、或提及"Kernel直调"、"<<<>>>内核调用"、"Blaze Matmul"、"matmul 模板"时使用本 skill。2 plugins ship this exact skill · first indexed Oct 20, 2026
Other plugins' skills for the same job