cpp-coding-standards

Enforces C++ Core Guidelines when writing, reviewing, or refactoring modern C++ code.

2|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/adamreger/ecc-antigravity --skill cpp-coding-standards-adamreger
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cpp-coding-standards
Source: https://github.com/adamreger/ecc-antigravity/tree/main/skills/cpp-coding-standards
Command: npx skills add https://github.com/adamreger/ecc-antigravity --skill cpp-coding-standards-adamreger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? C++ codebases often accumulate unsafe patterns like raw new/delete, plain enums, C-style casts, and unconstrained templates that lead to bugs, leaks, and maintenance pain. This Skill provides a consolidated, rule-referenced checklist based on the C++ Core Guidelines so every piece of C++ code follows modern, safe, idiomatic practices. ## Core Features & Use Cases - Rule-Referenced Standards: Covers the full C++ Core Guidelines sections (P, I, F, C, R, ES, E, Con, CP, T, SL, Enum, SF, NL, Per) with DO/DON'T code examples for each rule. - Code Review Checklist: A quick-reference checklist verifies smart pointer usage, const-correctness, enum class, nullptr, explicit constructors, Rule of Zero/Five, RAII locking, and more before work is marked complete. - Use Case: While reviewing a pull request that introduces a new class hierarchy, apply the standards to catch a missing virtual destructor (C.35), a non-explicit single-argument constructor (C.46), and an unnamed lock_guard (CP.44) before merge. ## Quick Start Review this C++ file against the C++ Core Guidelines and list every violation with its rule number and a corrected version.

Frequently Asked Questions about cpp-coding-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce C++ Core Guidelines in code reviews?▼

Apply the rule-referenced checklist covering smart pointers, const-correctness, enum class, nullptr, explicit constructors, and RAII locking. Each violation maps to a specific guideline number like R.11 or C.46 with a corrected code example.

What are the most important C++ Core Guidelines rules to follow?▼

The cross-cutting principles are RAII everywhere, immutability by default, type safety, expressing intent, minimizing complexity, and value semantics over pointer semantics. These map to rules like P.8, P.10, P.4, and R.1.

Does this apply to C++17, C++20, and C++23?▼

Yes, the standards target modern C++ including C++17, C++20, and C++23. C++20-specific features like concepts for constraining templates (T.10) and std::scoped_lock for multi-mutex locking (CP.21) are covered.

When should I use unique_ptr vs shared_ptr in C++?▼

Prefer unique_ptr by default since it expresses exclusive ownership with zero overhead (R.21). Use shared_ptr only when ownership is genuinely shared, and always create it with make_shared (R.22).

When should these C++ guidelines not be applied?▼

Avoid applying them to non-C++ projects, legacy C codebases that cannot adopt modern features, and embedded or bare-metal contexts where specific guidelines conflict with hardware constraints. In those cases, adapt rules selectively.