원클릭으로
ascendc-code-review
Ascend C 代码检视技能。基于假设检验方法论对代码进行安全规范检视。当用户提供代码片段和检视规则描述时,可使用此技能进行代码检视,使用时必须明确提供:代码片段和检视规则描述。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Ascend C 代码检视技能。基于假设检验方法论对代码进行安全规范检视。当用户提供代码片段和检视规则描述时,可使用此技能进行代码检视,使用时必须明确提供:代码片段和检视规则描述。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Profile PyPTO kernels in-core with the Ascend msprof op-simulator — cycle-accurate per-kernel traces. Use when the user wants to profile a built case, inspect kernel timing or instruction streams, or generate MindStudio Insight traces.
Tune cube/matmul tile sizes (row tile, N fragment, K fragment) for a PyPTO kernel — analytic hints, an on-chip buffer constraint model, and an empirical device sweep. Use when optimizing a matmul/cube's throughput, sizing the row / N / K tiles, resolving Mat (L1) / L0C / UB buffer overflows, or trading one tile dim for another.
Locate which pypto commit introduced a precision regression. Only pypto and its corresponding simpler (submodule) are tracked — ptoas and pto-isa versions are not part of the bisect. If the culprit is a simpler submodule bump, performs a second-level bisect within simpler.
Reproduce a reported problem, collect dependency versions, and create a GitHub issue. Use when the user wants to file a bug, request a feature, or create any GitHub issue.
Ascend C 开发资源索引(本地+在线)。提供:(1) 本地 API 文档索引、示例代码映射,(2) 在线文档搜索功能,(3) 资源查找优先级,(4) Explore Agent 使用指南。优先使用本地资源,仅在本地检索不到时使用在线搜索。
Complete git commit workflow including pre-commit checks, staging, message generation, and verification. Use when creating commits or preparing changes for commit.
| name | ascendc-code-review |
| description | Ascend C 代码检视技能。基于假设检验方法论对代码进行安全规范检视。当用户提供代码片段和检视规则描述时,可使用此技能进行代码检视,使用时必须明确提供:代码片段和检视规则描述。 |
调用此技能时,必须明确提供以下参数:
参数1:代码片段
参数2:检视规则描述
检查整数溢出、检查内存泄漏、检查空指针解引用等参数3:规范文件路径(可选)
references/C++SecureCoding.md(安全编码规范)如果缺少任何一个必需参数,应:
C++ 安全编码规范 references/C++SecureCoding.md
| 属性 | 说明 |
|---|---|
| 性质 | 安全编码核心条款 |
| 内容 | 总体原则、数值运算安全、内存与指针安全、输入验证、资源管理、文件IO安全、并发安全、安全函数使用、类与对象安全、标准库安全 |
| 适用场景 | C++ 代码安全性检视 |
条款分类:
Python 安全编码规范 references/PythonSecureCoding.md
| 属性 | 说明 |
|---|---|
| 性质 | Python 安全编码规范 |
| 内容 | 数值安全、异常处理、文件操作、序列化、命令执行、网络安全 |
| 适用场景 | Python 代码安全性检视 |
C++ 代码风格规范 references/C++CodeStyle.md
| 属性 | 说明 |
|---|---|
| 性质 | 代码风格规范 |
| 内容 | 命名规则、格式规范、注释规范 |
| 适用场景 | 代码风格、可读性检视 |
C++ 通用编码规范 references/C++GeneralCoding.md
| 属性 | 说明 |
|---|---|
| 性质 | 通用编码规范 |
| 内容 | 代码设计、数据类型、函数设计等 15 类规范 |
| 适用场景 | 代码质量、可维护性检视 |
安全设计规范 references/SecureDesign.md
| 属性 | 说明 |
|---|---|
| 性质 | 安全设计规范 |
| 内容 | 认证/鉴权/传输/加密/密钥管理 |
| 适用场景 | 架构设计、模块设计检视 |
安全编译规范 references/SecureCompilation.md
| 属性 | 说明 |
|---|---|
| 性质 | 安全编译规范 |
| 内容 | ASLR/栈保护/GOT只读/立即绑定/堆栈不可执行 |
| 适用场景 | 编译配置、构建脚本检视 |
C++SecureCoding.mdPythonSecureCoding.mdC++CodeStyle.md 或 C++GeneralCoding.mdSecureDesign.mdSecureCompilation.md步骤1:代码段识别
将目标代码划分为独立的代码段(函数、语句块、逻辑单元)
步骤2:假设建立
对每个代码段建立假设:
步骤3:证据收集与评估
按维度系统性寻找证据:
| 证据类型 | 分析动作 | 分值规则 |
|---|---|---|
| 规范违反 | 对照规范条款识别违规点 | 有效证据 +40% |
| 上下文防御缺失 | 检查作用域内是否有防御代码 | 无防御 +30% |
| 函数调用链风险 | LSP/Grep 分析调用函数内部逻辑 | 发现风险 +25% |
| 数据流追踪风险 | 分析变量来源、运算过程 | 发现风险 +25% |
分析要求:
步骤4:证据有效性校验
排除误报:
步骤5:决策判断
计算自信值并决策:
/home/developer/Ascend/cann/ 中,请在该目录下搜索 Ascend C 基础 API 实现详见:agents/ascendc-ops-reviewer/style/code_review_summary_style.txt