OpenHarmony C++ Coding Skills
SkillDocs & knowledgeExpert coding guide for OpenHarmony C++ development. Use this skill when writing, refactoring, or reviewing C++ code for OpenHarmony projects. It enforces strict project-specific conventions (naming, formatting, headers) and critical security requirements (input validation, memory safety).
Use OpenHarmony C++ Coding Skills in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add OpenHarmony C++ Coding Skills and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the OpenHarmony C++ Coding Skills
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
What this skill tells your AI
The instructions your AI receives, as published by openharmonyinsight/openharmony-skills in skills/openharmony-cpp/SKILL.md and read by Ahel’s review.
Core Mandates (Common Pitfalls)
These rules are strictly enforced in OpenHarmony and often differ from general C++ projects.
1. Strict Naming & Formatting
- Extensions: Always use
.cppand.h. - Files: Filenames must match class names (Unix-like, e.g.,
my_class.cpp). - Variables: Global vars must start with
g_(e.g.,g_config). Class members must end with_(e.g.,value_). - Braces: K&R Style is mandatory (opening brace on the same line).
- Details: See naming_formatting.md.
2. Header Management
- Guards: Use
#ifndefguards. #pragma once is FORBIDDEN. - Includes: Prefer
#includeover forward declarations to prevent hidden dependencies. - Details: See headers_scopes.md.
3. Critical Security Requirements
- Input Validation: All external data must be validated before use (indices, sizes, loops).
- Memory Safety: Pointers must be set to
nullptrimmediately after deletion. - Bitwise: Only on unsigned types.
- Details: See secure_coding.md.
Usage Guide
When to use
- New Code: Generating new classes or modules.
- Refactoring: Cleaning up legacy code.
- Review: Checking code against OpenHarmony standards.
Reference Map
- naming_formatting.md: Naming conventions (g_, _), braces (K&R), line length.
- secure_coding.md: Input validation, integer safety, memory management, prohibited functions.
- class_function_design.md: Constructors, inheritance, modern C++ (nullptr, const), function size.
- headers_scopes.md: Header guards, namespaces, include rules.
Signals
- GitHub stars
- 34
- Forks
- 7
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
openharmony-cpp- Source
- github.com/openharmonyinsight/openharmony-skills
github.com/openharmonyinsight/openharmony-skills
More in Docs & knowledge
Skill · mattpocock
More in Docs & knowledgecanvas-design
Skill · anthropics
More in Docs & knowledgedoc-coauthoring
Skill · anthropics
More in Docs & knowledgepopups
Skill · coreyhaines31
More in Docs & knowledgewriting-for-agents
Skill · mattpocock
More in Docs & knowledgespec-driven-development
Skill · addyosmani
More in Docs & knowledge