openharmonyinsight/openharmony-skills

openharmony-cpp

Expert coding guide for OpenHarmony C++ development.

First seen Feb 1, 2026

Installation

$ npx skills add openharmonyinsight/openharmony-skills --skill openharmony-cpp

Summary

  • Expert 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).

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from openharmonyinsight/openharmony-skills · top by installs.

npx skills add openharmonyinsight/openharmony-skills

Browse all from openharmonyinsight/openharmony-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 33
Default branch main
Open issues 2
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,217 B
  • docs SUMMARY.md 313 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 124 installs

SKILL.md

OpenHarmony C++ Coding Skills

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 .cpp and .h.
  • Files: Filenames must match class names (Unix-like, e.g., my_class.cpp).
  • Variables: Global vars must start with g (e.g., gconfig). Class members must end with (e.g., value).
  • Braces: K&R Style is mandatory (opening brace on the same line).
  • Details: See [namingformatting.md](references/namingformatting.md).

2. Header Management

  • Guards: Use #ifndef guards. #pragma once is FORBIDDEN.
  • Includes: Prefer #include over forward declarations to prevent hidden dependencies.
  • Details: See [headersscopes.md](references/headersscopes.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 nullptr immediately after deletion.
  • Bitwise: Only on unsigned types.
  • Details: See [securecoding.md](references/securecoding.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

  • [namingformatting.md](references/namingformatting.md): Naming conventions (g, ), braces (K&R), line length.
  • [securecoding.md](references/securecoding.md): Input validation, integer safety, memory management, prohibited functions.
  • [classfunctiondesign.md](references/classfunctiondesign.md): Constructors, inheritance, modern C++ (nullptr, const), function size.
  • [headersscopes.md](references/headersscopes.md): Header guards, namespaces, include rules.