cpp-guide

Installation
SKILL.md

C/C++ Guide

Applies to: C++20, Systems Programming, Embedded, Game Engines, High-Performance Computing

Core Principles

  1. RAII Everywhere: Every resource (memory, files, locks, sockets) is owned by an object whose destructor releases it
  2. Zero Raw Ownership: Never use new/delete directly; use smart pointers and containers for all heap allocation
  3. Value Semantics by Default: Pass and return by value; rely on move semantics and copy elision for performance
  4. Compile-Time over Run-Time: Use constexpr, static_assert, concepts, and templates to catch errors at compile time
  5. Warnings Are Errors: Build with -Wall -Wextra -Wpedantic -Werror; every warning is a latent bug

Guardrails

Standard & Compiler

  • Use C++20 as the minimum standard (-std=c++20 / CMAKE_CXX_STANDARD 20)
  • Compile with at least -Wall -Wextra -Wpedantic; treat warnings as errors (-Werror)
  • Enable sanitizers in debug builds: -fsanitize=address,undefined
Related skills
Installs
8
Repository
ar4mirez/samuel
First Seen
Mar 1, 2026