skills/cpp-core-guidelines-review/SKILL.md
Parallel C++ Core Guidelines code review using multiple specialized sub-agents. Use when reviewing C++ code, modules, or files against C++ Core Guidelines to identify violations. Each sub-agent reviews against a specific guideline section (Functions, Classes, Resource Management, etc.) and outputs findings to separate markdown files in the review/ directory, followed by a consolidated summary.
npx skillsauth add openharmonyinsight/openharmony-skills cpp-core-guidelines-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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 format{{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 instructionExample 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.
development
Run local code quality checks covering a subset of OpenHarmony gate CI (copyright, CodeArts C/C++) plus additional local checks (pylint/flake8, shellcheck/bashate, gn format). Use before committing to reduce gate failures. Triggers on: /oh-precommit-codecheck, "门禁检查", "门禁预检", "检查代码", "run codecheck", "check code quality", "lint my code", "代码检查", or after completing code implementation. WHEN to use: before git commit, before creating PR, after modifying C/C++/Python/Shell/GN files, when gate CI fails with codecheck defects, or when you want to preview what gate will flag.
development
OpenHarmony PR full lifecycle workflow. Five modes: - Commit: standardized commit with DCO sign-off and Issue linking - Create PR: commit + push to fork + create Issue + create PR on upstream - Fix Codecheck: fetch gate CI codecheck defects from a PR and auto-fix them - Review PR: fetch a PR's changes to local for code review - Fix Review: fetch unresolved review comments from a PR and auto-fix them Triggers on: /oh-pr-workflow, "提交代码", "创建PR", "提个PR", "commit", "修复告警", "修复门禁", "修复codecheck", "fix codecheck", "review pr", "review这个pr", "看下这个pr", "检视pr", "修复review", "修复检视意见", "fix review", or a GitCode PR URL with fix/review intent.
testing
分析 HM Desktop PRD 文档,提取需求信息、验证完整性、检查章节顺序(需求来源→需求背景→需求价值分析→竞品分析→需求描述)、检查 KEP 定义、检测需求冲突并生成结构化分析报告。适用于用户请求:(1) 分析或审查 PRD 文档, (2) 从需求中提取 KEP 列表, (3) 检查 PRD 完整性或一致性, (4) 将需求映射到模块架构, (5) 验证 PRD 格式合规性, (6) 验证竞品分析章节完整性。关键词:PRD分析, requirement extraction, KEP验证, completeness check, chapter order validation, 竞品分析检查, analyze PRD, 需求提取, 完整性检查, 章节顺序验证
development
基于 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