skillfed

cpp-coding-standards

This skill guides developers through modern C++ best practices rooted in the C++ Core Guidelines, covering type safety, resource management via RAII, immutability, and clear interfaces. Apply it when writing, reviewing, or refactoring C++ code to maintain consistency and prevent common errors across your codebase.

C++ Coding Standards enforces type-safe and resource-safe practices aligned with the C++ Core Guidelines.

AI-generated summary based on this skill's SKILL.md

234,207 35,692 MIT updated by affaan-m

Install

affaan-m/ECC/cpp-coding-standards · repository language: JavaScript

CLI (skillfed)coming soon
git clone https://github.com/affaan-m/ECC
cp -r ECC/skills/cpp-coding-standards ~/.claude/skills/cpp-coding-standards

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What are C++ Core Guidelines and how does cpp-coding-standards apply them?

cpp-coding-standards teaches modern C++ best practices rooted in the C++ Core Guidelines, emphasizing type-safe, resource-safe coding. The skill guides you through enforcing these guidelines when writing new code or reviewing existing implementations, helping maintain consistency and prevent common errors across your codebase.

How do I learn RAII, smart pointers, and memory management best practices?

cpp-coding-standards covers RAII (Resource Acquisition Is Initialization), smart pointers like unique_ptr and shared_ptr, and modern memory management patterns. The skill teaches you to use these mechanisms to achieve resource safety and eliminate manual memory leaks, making your C++ code more reliable and maintainable.

What modern C++ best practices does this skill cover for C++17 and C++20?

cpp-coding-standards addresses modern C++ best practices including C++17 and C++20 coding style, const correctness, template concepts, and type safety guidelines. Apply this skill when adopting newer language features to write cleaner, safer code that leverages the latest standard improvements.

How can cpp-coding-standards help me avoid C++ anti-patterns?

cpp-coding-standards identifies common C++ anti-patterns and unsafe coding idioms to help you recognize and eliminate them. The skill teaches safer alternatives and design patterns, supporting your code review process and refactoring efforts to modernize legacy C++ code.

How do I use const correctness and immutability in C++ architectural decisions?

cpp-coding-standards guides you through const-correctness principles and immutability patterns to inform your architectural choices. By making const the default and designing interfaces that enforce immutability where appropriate, you create clearer contracts and prevent accidental mutations in your codebase.

Can cpp-coding-standards help me review or refactor existing C++ code?

Yes. cpp-coding-standards is designed to help you review and refactor existing C++ code for modern standards compliance. Use it to assess code against Core Guidelines, identify opportunities to adopt RAII and smart pointers, improve type safety, and modernize your codebase to current best practices.

SKILL.md

rendered from the published skill — quoted content, verbatim

C++ Coding Standards (C++ Core Guidelines)

Comprehensive coding standards for modern C++ (C++17/20/23) derived from the C++ Core Guidelines. 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,

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
skills/cpp-coding-standards/SKILL.md

Related skills

Tags

resource-safety type-system memory-management modern-cpp code-quality design-patterns best-practices static-analysis immutability-first compile-time-safety