Apply modern, safe, idiomatic C++ standards for writing, review, and refactoring.
Copy the install command and let the AI configure it · recommended for beginners
Please install the "cpp-coding-standards" skill from askskill: 1. Download https://raw.githubusercontent.com/affaan-m/ECC/main/skills/cpp-coding-standards/SKILL.md 2. Save it as ~/.claude/skills/cpp-coding-standards/SKILL.md 3. Reload skills and tell me it's ready
Review the following C++ code against the C++ Core Guidelines. Identify unsafe, outdated, or non-idiomatic parts, then provide recommendations and an improved version.
A list of issues, guideline-based explanations, and a safer, cleaner refactored version.
Refactor this legacy C++ code into modern C++ style, prioritizing RAII, smart pointers, const correctness, range-based for loops, and standard library facilities. Explain each change.
Modernized C++ code with explanations of improvements in safety, readability, and maintainability.
Create a concise C++ coding standard for my team based on the C++ Core Guidelines, covering naming, resource management, exception handling, interface design, and code review checks.
A structured team standard document ready for development conventions or code review checklists.
Comprehensive coding standards for modern C++ (C++17/20/23) derived from the C++ Core Guidelines. Enforces type safety, resource safety, immutability, and clarity.
enum vs enum class, raw pointer vs smart pointer)These themes recur across the entire guidelines and form the foundation:
const/constexpr; mutability is the exception| 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 |
// P.10 + I.4: Immutable, strongly typed interface
struct Temperature {
double kelvin;
};
Temperature boil(const Temperature& water);
// Weak interface: unclear ownership, unclear units
double boil(double* temp);
// Non-const global variable
int g_counter = 0; // I.2 violation
| 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 |
// 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 parameters
void parse(std::string_view input,
std::string& token, int& pos); // avoid this
// F.4 + F.8: Pure, constexpr where possible
constexpr int factorial(int n) noexcept {
…
Audit Claude skills and commands with quick scans or full stocktakes.
Create iOS liquid glass interfaces with dynamic visuals and interactive morphing.
Record polished web app UI demo videos for walkthroughs, tutorials, and showcases.
Plan demand forecasts, safety stock, and replenishment for multi-location retail inventory.
Unify multi-channel notifications for routing, deduplication, escalation, and inbox consolidation.
Audit, plan, and implement SEO improvements for better search visibility.
Write, review, and refactor C++ with modern, safe, idiomatic standards.
Write and review GC-safe C++ code for the Hermes VM runtime.
Apply consistent Java coding standards for Spring Boot and Quarkus services.
Provides queryable team coding standards and best practices for AI-assisted development.
Apply the right commit prefix, reviewer, and test plan for code changes.
Get idiomatic C# and .NET guidance for architecture, async, and dependency injection.