
Cpp Coding Standards
Apply C++ Core Guidelines when writing, reviewing, or refactoring modern C++ so agents enforce RAII, const-correctness, and type-safe idioms.
Overview
Cpp Coding Standards is an agent skill most often used in Ship review (also Build backend) that enforces modern C++ Core Guidelines when writing, reviewing, or refactoring C++ code.
Install
npx skills add https://github.com/affaan-m/everything-claude-code --skill cpp-coding-standardsWhat is this skill?
- Grounded in isocpp C++ Core Guidelines for C++17/20/23
- Cross-cutting rules: RAII, immutability by default, type safety, express intent
- Covers writing classes, functions, templates, and architectural choices
- Smart-pointer and enum-class guidance vs. legacy raw-pointer patterns
- Explicit When NOT to Use: non-C++, legacy C-only, and selective embedded exceptions
- Four cross-cutting themes: RAII, immutability by default, type safety, express intent
- Targets modern C++17/20/23 practice from C++ Core Guidelines
Adoption & trust: 5.2k installs on skills.sh; 210k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your C++ drifts toward raw pointers, unclear ownership, and pre-modern patterns that are hard for agents or teammates to review safely.
Who is it for?
Solo builders shipping modern C++17+ services, CLIs, or engine modules who want agent reviews aligned with isocpp guidance.
Skip if: Non-C++ projects, legacy C-only codebases, or embedded firmware where hardware constraints override standard guidelines without adaptation.
When should I use this skill?
Use when writing, reviewing, or refactoring C++ code to enforce modern, safe, and idiomatic practices.
What do I get? / Deliverables
New and touched code follows Core Guidelines themes—RAII, const defaults, type-safe enums, and clear interfaces—ready for consistent review and merge.
- Review feedback aligned to Core Guidelines categories
- Refactored or newly authored C++ matching RAII and type-safety conventions
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Standards shine at Ship review, but the same rules apply while authoring code—canonical shelf is review-grade quality gates before merge. Review subphase captures refactor and PR enforcement; the skill’s explicit review/refactor triggers align with pre-ship quality work.
Where it fits
Scaffold a new C++ service module with explicit ownership and interface boundaries before merging feature work.
Run a PR pass that flags raw pointers, missing const, and non-enum-class enumerations against Core Guidelines themes.
Refactor a hot-path library for safer resource handling after production incidents tied to lifetime bugs.
How it compares
A C++-specific quality skill from the ECC pack—not a generic linter config and not an MCP static-analysis server.
Common Questions / FAQ
Who is cpp-coding-standards for?
Developers using Claude Code or similar agents on modern C++ codebases who want Core Guidelines baked into generation and review prompts.
When should I use cpp-coding-standards?
Use it while writing new C++ in Build, during Ship code review or refactors, and when making architectural choices about pointers, enums, and templates.
Is cpp-coding-standards safe to install?
Review the Security Audits panel on this Prism page and the everything-claude-code repository; the skill advises on code style rather than executing network or shell operations by itself.
SKILL.md
READMESKILL.md - Cpp Coding Standards
# C++ Coding Standards (C++ Core Guidelines) Comprehensive coding standards for modern C++ (C++17/20/23) derived from the [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines). Enforces type safety, resource safety, immutability, and clarity. ## When to Use - Writing new C++ code (classes, functions, templates) - Reviewing or refactoring existing C++ code - Making architectural decisions in C++ projects - Enforcing consistent style across a C++ codebase - Choosing between language features (e.g., `enum` vs `enum class`, raw pointer vs smart pointer) ### When NOT to Use - Non-C++ projects - Legacy C codebases that cannot adopt modern C++ features - Embedded/bare-metal contexts where specific guidelines conflict with hardware constraints (adapt selectively) ## Cross-Cutting Principles These themes recur across the entire guidelines and form the foundation: 1. **RAII everywhere** (P.8, R.1, E.6, CP.20): Bind resource lifetime to object lifetime 2. **Immutability by default** (P.10, Con.1-5, ES.25): Start with `const`/`constexpr`; mutability is the exception 3. **Type safety** (P.4, I.4, ES.46-49, Enum.3): Use the type system to prevent errors at compile time 4. **Express intent** (P.3, F.1, NL.1-2, T.10): Names, types, and concepts should communicate purpose 5. **Minimize complexity** (F.2-3, ES.5, Per.4-5): Simple code is correct code 6. **Value semantics over pointer semantics** (C.10, R.3-5, F.20, CP.31): Prefer returning by value and scoped objects ## Philosophy & Interfaces (P.*, I.*) ### Key Rules | Rule | Summary | |------|---------| | **P.1** | Express ideas directly in code | | **P.3** | Express intent | | **P.4** | Ideally, a program should be statically type safe | | **P.5** | Prefer compile-time checking to run-time checking | | **P.8** | Don't leak any resources | | **P.10** | Prefer immutable data to mutable data | | **I.1** | Make interfaces explicit | | **I.2** | Avoid non-const global variables | | **I.4** | Make interfaces precisely and strongly typed | | **I.11** | Never transfer ownership by a raw pointer or reference | | **I.23** | Keep the number of function arguments low | ### DO ```cpp // P.10 + I.4: Immutable, strongly typed interface struct Temperature { double kelvin; }; Temperature boil(const Temperature& water); ``` ### DON'T ```cpp // Weak interface: unclear ownership, unclear units double boil(double* temp); // Non-const global variable int g_counter = 0; // I.2 violation ``` ## Functions (F.*) ### Key Rules | Rule | Summary | |------|---------| | **F.1** | Package meaningful operations as carefully named functions | | **F.2** | A function should perform a single logical operation | | **F.3** | Keep functions short and simple | | **F.4** | If a function might be evaluated at compile time, declare it `constexpr` | | **F.6** | If your function must not throw, declare it `noexcept` | | **F.8** | Prefer pure functions | | **F.16** | For "in" parameters, pass cheaply-copied types by value and others by `const&` | | **F.20** | For "out" values, prefer return values to output parameters | | **F.21** | To return multiple "out" values, prefer returning a struct | | **F.43** | Never return a pointer or reference to a local object | ### Parameter Passing ```cpp // F.16: Cheap types by value, others by const& void print(int x); // cheap: by value void analyze(const std::string& data); // expensive: by const& void transform(std::string s); // sink: by value (will move) // F.20 + F.21: Return values, not output parameters struct ParseResult { std::string token; int position; }; ParseResult parse(std::string_view input); // GOOD: return struct // BAD: output paramete