cpp-coding-standards
C++ coding standards based on the C++ Core Guidelines (isocpp.github.io). Use when writing, reviewing, or refactoring C++ code to enforce modern, safe, and idiomatic practices.
npx skills add mturac/everything-openai-codex --skill cpp-coding-standards --agent codex
Same command for any agent — swap --agent for claude-code, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Describes a comprehensive set of C++ coding standards derived from the C++ Core Guidelines. It targets modern C++ (C++17/20/23) to enforce type safety, resource safety, immutability, and expressiveness. It covers when to use the guidelines, situations to avoid, cross-cutting principles, and concrete rules across several areas.
How it works
The skill outlines the areas and concrete rules to follow:
- When to use: for writing new C++ code, reviewing/refactoring, architectural decisions, and enforcing consistent style.
- Cross-Cutting Principles: RAII, immutability by default, type safety, express intent, minimize complexity, value semantics over pointers.
- Sections by topic, each with key rules and examples, including:
- Philosophy & Interfaces (I.*): explicit interfaces, strong typing, avoid raw ownership transfers.
- Functions (F.*): package operations, single responsibility, constexpr when possible, noexcept if no-throw, returning values when possible.
- Classes & Class Hierarchies (C.*): Rule of Zero/Five, proper destructors, explicit constructors, virtuals usage.
- Resource Management (R.*): RAII, smart pointers for ownership, avoid naked new/delete, ownership semantics.
- Expressions & Statements (ES.*): initialize objects, const/cxx17 syntax, avoid magic constants, nullptr usage, avoid casts.
- Error Handling (E.*): early error strategy, throw by value, catch by reference, no leaks.
- Constants & Immutability (Con.*): immutable by default, const-correctness, constexpr.
- Concurrency & Parallelism (CP.*): avoid data races, RAII locks, named lock guards, multi-mutex handling, proper synchronization.
- Templates & Generic Programming (T.*): use templates for abstraction, specify concepts, prefer using over typedef, template metaprogramming sparingly.
When to use it
The skill specifies use cases:
- 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)
What it can touch
Declared tools include: codex, copilot, cursor. The skill references standard C++ language constructs and guideline rules; it does not specify external systems beyond these tools.
Caveats
License: MIT. The material emphasizes adherence to guidelines and provides examples of code patterns; no explicit risk or limitations beyond standard guideline applicability and the need for selective adaptation in constrained contexts.
# 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 t
- When to Use
- When NOT to Use
- Cross-Cutting Principles
- Philosophy & Interfaces (P., I.)
- Key Rules
- DO
- DON'T
- Functions (F.)
- Parameter Passing
- Pure Functions and constexpr
- Anti-Patterns
- Classes & Class Hierarchies (C.)
- Rule of Zero
- Rule of Five
What does the cpp-coding-standards skill do?
C++ coding standards based on the C++ Core Guidelines (isocpp.github.io). Use when writing, reviewing, or refactoring C++ code to enforce modern, safe, and idiomatic practices.
How do I install it?
Run `npx skills add mturac/everything-openai-codex --skill cpp-coding-standards --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
