What does this skill do?

The C++ Code Standards Skill serves as a normative reference when writing and reviewing modern C++ code (C++17/20/23), derived from the isocpp C++ Core Guidelines. It enforces RAII for all resource management, default immutability, explicit and typed interfaces, and RAII-based concurrency. It includes a final checklist that verifies the absence of bare `new`/`delete`, uninitialized variables, C-style casts, and `using namespace` in header files.

Write new C++ code
Use RAII, smart pointers, enum classes, and constexpr from the very first draft of classes, functions, and templates.
Review and refactor
Detects new/delete without type casting, C-style casts, "using namespace" in headers, and other anti-patterns in existing code.
Architectural Decisions
Choose between `enum` and `enum class`, raw pointers and smart pointers, and pass-by-value and pass-by-reference according to the guidelines.
Standardize team guidelines
Establish a common set of style and quality guidelines for the entire C++ development team.

Usage examples

✍️ New Writing
Write a `ThreadSafeQueue` class in C++20 that complies with the C++ Core Guidelines for concurrency and RAII.
🔍 Code Review
Take a look at this C++ file and tell me which rules in the Core Guidelines it violates, using the final checklist.
🏗️ Design Decision
Should I use `enum` or `enum class` for the states in a state machine? Follow the guidelines.
♻️ Refactoring
Refactor this function so that it uses smart pointers and RAII instead of manual `new`/`delete`.

Features

RAII in All Resource Management It requires the use of std::make_unique, std::make_shared, and standard library containers instead of bare new/delete.
Immutability by default Use `const` and `constexpr` on variables, member functions, and parameters to express intent and prevent accidental mutations.
Explicit and typed interfaces Aplica reglas I.* y F.*: devuelve structs en lugar de parámetros de salida, tipos baratos por valor y caros por const&.
Safe Concurrency with RAII Use `std::lock_guard` and `std::scoped_lock` for locks, along with `condition_variable` and predicate-based waits (CP.20, CP.42).
Integrated Final Checklist Before closing the task, verify that there are no unqualified `new`/`delete` statements, uninitialized variables, C-style casts, or `using namespace` statements in the header files.

Frequently asked questions

It covers C++17, C++20, and C++23. The skill identifies the project's standard version and tailors its recommendations accordingly.
No. This skill is a standard reference that guides implementation decisions. It does not require a compiler or additional MCP, although it can be used in conjunction with static analysis tools.
Yes. If a rule does not apply due to project constraints (embedded, server, etc.), the skill prompts you to document the reason for the exception.
No. It serves as a guide during writing and review. The result is C++ code that complies with the Core Guidelines, not a generated file.
C++ Coding Standards — Modern and Secure Code with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.