From external-gitcode-ascend-skills
Reviews Ascend C operator code for safety and compliance using hypothesis-driven methodology. Checks for memory leaks, integer overflows, null pointers, and coding standard violations.
How this skill is triggered — by the user, by Claude, or both
Slash command
/external-gitcode-ascend-skills:ascendc-operator-code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
1. **合规优先** - 所有检视动作映射至编码规范具体条款,100%覆盖无遗漏
调用此技能时,必须明确提供以下参数:
参数1:代码片段
参数2:检视规则描述
检查整数溢出、检查内存泄漏、检查空指针解引用等参数3:规范文件路径(可选)
如果缺少任何一个必需参数,应:
当用户指定检视规则描述时,按以下规则匹配规范文件:
数值运算、溢出、除零 → references/01_numeric_operations.md内存、指针、越界 → references/02_memory_pointer_safety.md资源、泄漏 → references/03_resource_management.md输入、验证 → references/04_input_validation.md并发、线程 → references/05_concurrency_safety.md算子接口、Runtime、Tiling、动态Shape → references/06_operator_interface.md接口兼容性、ABI → references/07_interface_compatibility.md步骤1:代码段识别
将目标代码划分为独立的代码段(函数、语句块、逻辑单元)
步骤2:假设建立
对每个代码段建立假设:
步骤3:证据收集与评估
按维度系统性寻找证据:
| 证据类型 | 分析动作 | 分值规则 |
|---|---|---|
| 红线规范违反 | 对照红线规范条款识别严重违规点 | 有效证据 +40% |
| 一般规范违反 | 对照一般规范条款识别违规点 | 有效证据 +20% |
| 上下文防御缺失 | 检查作用域内是否有防御代码 | 无防御 +30% |
| 函数调用链风险 | LSP/Grep 分析调用函数内部逻辑 | 发现风险 +25% |
| 数据流追踪风险 | 分析变量来源、运算过程 | 发现风险 +25% |
分析要求:
步骤4:证据有效性校验
排除误报:
步骤5:决策判断
计算自信值并决策:
详见:agents/ascendc-ops-reviewer/style/code_review_summary_style.txt
npx claudepluginhub ascend-ai-coding/awesome-ascend-skills --plugin remote-npu-testDetects memory issues in Ascend C operators (illegal access, leaks, UB overruns) using mssanitizer. Auto-selects Python or C++ mode based on project type and generates problem reports.
Use AddressSanitizer to detect memory safety bugs in C/C++ programs. Identifies use-after-free, buffer overflow, memory leaks, and other memory errors.
Reviews code quality, security, performance, and maintainability using AI tools and static analysis. Provides checklists and best practices for modern code review workflows.