cpp-coding-standards

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

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill cpp-coding-standards-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-coding-standards
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/cpp-coding-standards
Command: npx skills add https://github.com/ibytechaos/claude --skill cpp-coding-standards-ibytechaos

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. This Skill provides a structured, rule-referenced checklist based on the official C++ Core Guidelines so code reviews and refactors enforce consistent, modern, type-safe 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 concrete DO/DON'T code examples for each rule. - Modern C++ Patterns: Enforces RAII, smart pointers, Rule of Zero/Five, const-correctness, concepts-constrained templates, scoped enums, and RAII-based locking for C++17/20/23. - Review Checklist: Ships a quick-reference checklist for verifying completed C++ work, covering ownership, initialization, error handling, concurrency, and naming. - Use Case: When reviewing a pull request that introduces a new class hierarchy, apply the standards to catch missing virtual destructors (C.35), non-explicit single-argument constructors (C.46), and raw pointer ownership transfers (I.11). ## Quick Start Review this C++ file against the C++ Core Guidelines and list every rule violation with suggested fixes.

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 ownership (R.*), classes (C.*), and expressions (ES.*) to each change. Each violation maps to a specific guideline number like R.11 for raw new/delete, making feedback concrete and consistent.

What C++ standards does this coding standard cover?

The standards target modern C++17, C++20, and C++23. C++20 features like concepts for template constraints and std::scoped_lock for multi-mutex locking are included alongside foundational rules.

Should I use unique_ptr or shared_ptr in C++?

Prefer unique_ptr by default per rule R.21, since it expresses sole ownership with zero overhead. Use shared_ptr only when ownership is genuinely shared, and create it with make_shared per R.22.

When should I not apply these C++ guidelines?

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

Why avoid volatile for thread synchronization in C++?

Per rule CP.8, volatile does not provide atomicity or memory ordering guarantees, so it cannot prevent data races. Use std::mutex with RAII locks like scoped_lock or std::atomic for synchronization instead.