重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
cpp-core-guidelines-review by openharmonyinsight/openharmony-skills
npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill cpp-core-guidelines-review通过启动并行子代理来审查 C++ 代码是否符合 C++ 核心准则,每个子代理根据特定的准则章节分析代码。此技能确保全面覆盖,同时在识别违规时保持高置信度。
在启动任何子代理之前,与用户澄清审查范围:
.cpp、.h、.hpp)重要:在范围明确定义且无歧义之前,请勿继续。
关键要求:
references/Content/ 中的每个文件启动一个子代理。不要跳过任何文件。每个准则章节都需要其自己专用的子代理。agents/guideline-section-reviewer.md 的 代理。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
并行启动策略:为了最大化性能,通过在单个响应消息中发送多个 Task 工具调用来并行启动所有子代理。Task 工具文档明确指出:“当用户指定他们希望您‘并行’运行代理时,您必须发送一条包含多个 Task 工具使用内容块的消息。”
每个准则章节启动一个子代理。每个子代理:
<current-working-directory>/review/<SectionName>.md代理调用过程:
agents/guideline-section-reviewer.md 读取代理定义{{SECTION_NAME}}:章节的显示名称(例如,“Functions”){{SECTION_FILE}}:references/Content/ 中章节的文件名(例如,“Functions.md”){{TARGET_FILES_PATTERN}}:要审查的文件/目录(例如,“src/**/*.cpp” 或特定文件路径){{OUTPUT_DIR}}:输出目录(通常为 <current-working-directory>/review){{DATE}}:当前日期,格式为 YYYY-MM-DD{{FILES_COUNT}}:正在审查的文件数量{{VIOLATION_COUNT}}:占位符,将由代理填充subagent_type=general,并将替换后的提示作为代理的指令调用示例:
For section "Functions":
- Read agent template from agents/guideline-section-reviewer.md
- Substitute: SECTION_NAME="Functions", SECTION_FILE="Functions.md", etc.
- Launch guideline-section-reviewer agent with substituted prompt
代理将:
references/Content/ 目录读取准则章节<OUTPUT_DIR>/<SECTION_NAME>.md启动所有子代理后,收集它们的任务 ID 并等待完成:
等待过程:
TaskOutput,参数如下:
task_id:子代理启动时返回的任务 IDblock=true:等待直到子代理完成timeout=600000(10 分钟):每个代理的最大等待时间<current-working-directory>/review/<SectionName>.md 创建了其输出文件错误处理:
验证清单:
所有子代理完成后,在 <current-working-directory>/review/Summary.md 中创建一个包含所有发现的综合分析。
过程:
<current-working-directory>/review/*.md 读取所有章节审查文件(不包括 Summary.md 本身)Summary.md 模板:
# C++ 核心准则审查摘要
## 概述
**日期**: YYYY-MM-DD
**审查范围**: <已审查的文件/目录>
**已审查章节总数**: <已完成的章节数量>
**发现的违规总数**: <所有章节的总计数>
## 按章节摘要
| 章节 | 违规数 | 最常违反的规则 |
|---------|------------|-------------------|
| Functions | N | F.15, ... |
| Classes and Class Hierarchies | N | C.7, ... |
| Resource Management | N | R.1, ... |
| [所有章节继续] | | |
## 按文件摘要
| 文件 | 总违规数 | 主要违规类别 |
|------|------------------|--------------------------|
| path/to/file1.cpp | N | Resource Management, Error Handling |
| path/to/file2.h | M | Const Correctness, Interfaces |
| [受影响的文件继续] | | |
## 按频率排序的顶级违规
| 排名 | 规则 ID | 规则摘要 | 计数 |
|------|---------|--------------|-------|
| 1 | F.15 | Prefer simple and default constructs | N |
| 2 | R.3 | Raw pointers should not be used | M |
| [继续] | | | |
## 关键发现
### 高优先级问题
<列出具有高影响或安全影响的违规>
### 最常见模式
<识别代码库中重复出现的违规模式>
## 详细章节细分
### Functions (N 个违规)
<本节关键违规的简要摘要>
参见: [Functions.md](Functions.md)
### Classes and Class Hierarchies (N 个违规)
<本节关键违规的简要摘要>
参见: [Classes and Class Hierarchies.md](Classes%20and%20Class%20Hierarchies.md)
### [所有存在违规的章节继续]
## 建议
1. **立即行动**: <应尽快解决的关键违规>
2. **流程改进**: <避免常见违规的建议>
3. **培训主题**: <团队教育可能有所帮助的领域>
## 审查元数据
- **已完成的章节**: <已完成章节的列表>
- **跳过/失败的章节**: <存在问题的章节列表>
- **已审查文件总数**: <计数>
- **已审查代码行数**: <如果可用>
摘要的关键要求:
<current-working-directory>/review/ 目录。C++ 核心准则参考文件捆绑在此技能的 references/ 目录中:
Introduction.md - 概述和术语表Content/ - 各个准则章节每个章节包含多个规则,具有:
示例 1:审查特定文件
User: "Review src/transaction.cpp and src/account.h against C++ Core Guidelines"
→ 澄清范围,然后为这些文件启动子代理。
示例 2:审查目录
User: "Review all C++ files in the services/ directory"
→ 澄清文件模式和排除项,然后启动子代理。
示例 3:根据特定章节审查
User: "Review using only Resource Management and Error Handling guidelines"
→ 仅启动这两个子代理。
每周安装次数
47
仓库
GitHub 星标数
7
首次出现
2026年2月12日
安全审计
安装于
opencode46
amp41
github-copilot41
codex41
kimi-cli41
gemini-cli41
Review C++ code against the C++ Core Guidelines by launching parallel sub-agents, each analyzing code against a specific guideline section. This skill ensures comprehensive coverage while maintaining high confidence in violation identification.
Before launching any sub-agents, clarify the review scope with the user:
.cpp, .h, .hpp)Important : Do not proceed until the scope is clearly defined and unambiguous.
CRITICAL REQUIREMENTS :
references/Content/. Do not skip any files. Each guideline section requires its own dedicated sub-agent.agents/guideline-section-reviewer.md from this plugin for each sub-agent.Parallel launch strategy : To maximize performance, launch all sub-agents in parallel by sending multiple Task tool calls in a single response message. The Task tool documentation explicitly states: "When the user specifies that they want you to run agents 'in parallel', you MUST send a single message with multiple Task tool use content blocks."
Launch one sub-agent per guideline section. Each sub-agent:
<current-working-directory>/review/<SectionName>.mdAgent invocation process :
agents/guideline-section-reviewer.md{{SECTION_NAME}}: The display name of the section (e.g., "Functions"){{SECTION_FILE}}: The filename of the section in references/Content/ (e.g., "Functions.md"){{TARGET_FILES_PATTERN}}: The files/directories to review (e.g., "src/**/*.cpp" or specific file paths){{OUTPUT_DIR}}: The output directory (typically <current-working-directory>/review){{DATE}}: Current date in YYYY-MM-DD formatExample invocation :
For section "Functions":
- Read agent template from agents/guideline-section-reviewer.md
- Substitute: SECTION_NAME="Functions", SECTION_FILE="Functions.md", etc.
- Launch guideline-section-reviewer agent with substituted prompt
The agent will:
references/Content/ directory<OUTPUT_DIR>/<SECTION_NAME>.mdAfter launching all sub-agents, collect their task IDs and wait for completion:
Waiting process :
TaskOutput with:
task_id: The task ID from the sub-agent launchblock=true: Wait until the sub-agent completestimeout=600000 (10 minutes): Maximum wait time per agent<current-working-directory>/review/<SectionName>.mdError handling :
Verification checklist :
After all sub-agents complete, create <current-working-directory>/review/Summary.md with a comprehensive analysis of all findings.
Process :
<current-working-directory>/review/*.md (excluding Summary.md itself)Summary.md template :
# C++ Core Guidelines Review Summary
## Overview
**Date**: YYYY-MM-DD
**Review Scope**: <Files/directories reviewed>
**Total Sections Reviewed**: <Number of sections completed>
**Total Violations Found**: <Total count across all sections>
## Summary by Section
| Section | Violations | Most Violated Rule |
|---------|------------|-------------------|
| Functions | N | F.15, ... |
| Classes and Class Hierarchies | N | C.7, ... |
| Resource Management | N | R.1, ... |
| [Continue for all sections] | | |
## Summary by File
| File | Total Violations | Top Violation Categories |
|------|------------------|--------------------------|
| path/to/file1.cpp | N | Resource Management, Error Handling |
| path/to/file2.h | M | Const Correctness, Interfaces |
| [Continue for affected files] | | |
## Top Violations by Frequency
| Rank | Rule ID | Rule Summary | Count |
|------|---------|--------------|-------|
| 1 | F.15 | Prefer simple and default constructs | N |
| 2 | R.3 | Raw pointers should not be used | M |
| [Continue] | | | |
## Critical Findings
### High-Priority Issues
<List violations with high impact or security implications>
### Most Common Patterns
<Identify recurring violation patterns across the codebase>
## Detailed Section Breakdown
### Functions (N violations)
<Brief summary of key violations in this section>
See: [Functions.md](Functions.md)
### Classes and Class Hierarchies (N violations)
<Brief summary of key violations in this section>
See: [Classes and Class Hierarchies.md](Classes%20and%20Class%20Hierarchies.md)
### [Continue for all sections with violations]
## Recommendations
1. **Immediate Actions**: <Critical violations that should be addressed soon>
2. **Process Improvements**: <Suggestions to avoid common violations>
3. **Training Topics**: <Areas where team education may help>
## Review Metadata
- **Sections Completed**: <List of sections that completed>
- **Sections Skipped/Failed**: <List of sections that had issues>
- **Total Files Reviewed**: <Count>
- **Lines of Code Reviewed**: <If available>
Key requirements for summary :
<current-working-directory>/review/ directory.The C++ Core Guidelines reference files are bundled in this skill's references/ directory:
Introduction.md - Overview and glossaryContent/ - Individual guideline sectionsEach section contains multiple rules with:
Example 1 : Review specific files
User: "Review src/transaction.cpp and src/account.h against C++ Core Guidelines"
→ Clarify scope, then launch sub-agents for those files.
Example 2 : Review directory
User: "Review all C++ files in the services/ directory"
→ Clarify file patterns and exclusions, then launch sub-agents.
Example 3 : Review against specific sections
User: "Review using only Resource Management and Error Handling guidelines"
→ Launch only those two sub-agents.
Weekly Installs
47
Repository
GitHub Stars
7
First Seen
Feb 12, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode46
amp41
github-copilot41
codex41
kimi-cli41
gemini-cli41
Flutter/Dart代码审查最佳实践:提升应用性能与质量的完整检查清单
1,200 周安装
{{FILES_COUNT}}: Number of files being reviewed{{VIOLATION_COUNT}}: Placeholder, will be filled by agentsubagent_type=general and the substituted prompt as the agent's instruction