ai-generated-business-code-review
AI Business Code Review
Overview
Review AI-generated business/application code for correctness, robustness, maintainability, performance, and security. Output a 0-10 score, a risk level, and a must-fix checklist. For C++ code, REQUIRED: use openharmony-cpp and openharmony-security-review as hard constraints.
When to Use
- AI-generated business/app code review or quality evaluation
- Need scoring, risk level, or must-fix checklist
- C++ business code must meet OpenHarmony coding/security requirements
Workflow
- Identify language and code type (business vs test). If test code, use
ai-generated-ut-code-reviewinstead. - For C++: load and apply
openharmony-cpp+openharmony-security-reviewas mandatory constraints. - Inspect behavior vs requirements, edge cases, error handling, resource management, and security.
- Score by rubric, assign risk level, list must-fix items with concrete evidence (file/line or snippet).
Scoring (0-10)
Each dimension 0-2 points. Sum = total score.
| Dimension | 0 | 1 | 2 |
|---|---|---|---|
| Correctness | Wrong/missing key behavior | Partial/assumptions | Meets requirements |
| Robustness | Crashes/leaks/unchecked errors | Some edge handling | Solid edge/error handling |
| Maintainability | Hard to read/modify | Mixed quality | Clear structure & naming |
| Performance | Inefficient hot paths | Acceptable but improvable | Efficient for expected load |
| Security | Clear vulnerabilities | Weak validation/unsafe | Safe-by-default, validated |
Risk Levels
- Blocker: security漏洞、严重逻辑错误、或违反 C++ 强制规范
- High: 关键路径缺失、异常处理不完整、明显资源泄漏
- Medium: 维护性或性能风险显著
- Low: 轻微问题或风格一致性
Must-Fix Checklist
- 外部输入有明确校验与错误反馈
- 关键异常路径可达且可观测(日志/错误码/异常)
- 资源释放或 RAII 保证(C++)
- C++ 场景满足
openharmony-cpp与openharmony-security-review
AI-Generated Code Pitfalls (Check Explicitly)
- 需求误解、隐含前提错误
- 只覆盖 happy-path,忽略异常/边界
- 吞异常或默认值不合理
- 复制粘贴造成重复与不一致
- 过度复杂化或抽象错误
Output Format (Required, Semi-fixed)
Score: x/10 — Correctness x, Robustness x, Maintainability x, Performance x, Security xRisk: Low/Medium/High/Blocker — 简述风险原因(1 行)Must-fix:- [动作 + 证据]
- [动作 + 证据]
Key Evidence:- 引用具体函数/类/路径(1-2 条)
Notes:- 最小修复建议或替代方案(1-2 行)
Rules:
- C++ 必须在
Key Evidence或Must-fix中明确指出违反openharmony-cpp/openharmony-security-review的点 - 至少 2 条证据;证据不足需说明并降分
- 禁止只给总体评价
Common Mistakes
- 只给总体评价,不给证据
- 忽略 C++ 强制规范
- 将风格问题当作阻断风险
Example (Concise)
Score: 6/10 (Correctness 1, Robustness 1, Maintainability 1, Performance 1, Security 2) Risk: High Must-fix:
- Missing input validation in
createUser()(null/empty, length, format) - Error path swallows exceptions without logging Key Evidence:
createUser()accepts raw input without checkscatchblock is empty inpersistUser()Notes:- Add explicit validation and return structured errors.
More from openharmonyinsight/openharmony-skills
openharmony-security-review
Use when reviewing OpenHarmony C++ system service code for security vulnerabilities, particularly IPC handlers, multithreaded components, or code handling sensitive user data
77ohos-chromium-security-review
|
55cpp-include-sorter
Automatically sorts C/C++ header files (#include statements) with full support for conditional compilation blocks. Use when Claude needs to organize #include statements in .cpp/.h files. Handles: (1) Corresponding header placement first (e.g., file.cpp includes file.h), (2) System headers (<>) sorted alphabetically, (3) Local headers ("") sorted alphabetically, (4) Conditional compilation blocks (#ifdef/#ifndef/#if defined) where headers participate in global sort while preserving block structure. Key features: prefers longer paths for duplicate includes, preserves inline/preceding comments, handles #elif/#else blocks, validates no headers are lost.
47oh-distributed-security-design-review
OpenHarmony分布式系统安全代码检视专用技能。当用户要求"检视代码安全实现"、"代码安全审查"、"安全代码review"或类似的分布式系统代码安全检视请求时触发。此技能提供18条OpenHarmony分布式业务安全设计规则的详细检视指导,涵盖授权控制、状态机、数据传输、权限管理、可信关系等安全领域。使用此技能可在通用网络安全规则基础上,针对OpenHarmony分布式系统进行专项安全检视。
42oh-pdd-design-doc-generator
基于 PRD 文档自动生成鸿蒙系统设计文档,包括架构设计文档和功能设计文档。生成前会分析 OpenHarmony 存量代码结构,确保与现有架构兼容。架构设计文档第2章必须为竞品方案分析,位于需求背景之后。适用于用户请求:(1) 生成架构设计文档, (2) 生成功能设计文档, (3) 从 PRD 生成设计文档, (4) 创建系统架构设计, (5) 编写功能规格说明, (6) 分析 OH 代码结构。关键词:architecture design, functional design, design doc, 竞品方案分析, OpenHarmony code analysis, 架构设计, 功能设计, 设计文档生成, OH代码分析, analyze codebase, competitor analysis
42oh-xts-build-run
OpenHarmony XTS 编译和运行组合命令。一站式完成 XTS 测试项目的编译和运行。当用户需要执行完整的 XTS 测试流程时使用此 Skill: (1) 编译 XTS 测试项目生成 HAP 文件,(2) 运行 XTS 测试并展示结果。支持 --package 和 --api 参数传递给运行阶段。
41