cpp-expert

Installation
SKILL.md
Contains Shell Commands

This skill contains shell command directives (!`command`) that may execute system commands. Review carefully before installing.

C++ Expert

C++ is a statically typed, compiled language whose fundamental constructs map directly to hardware — that direct mapping is the source of its raw performance and also the source of most of its foot-guns. Write C++ that leans on the standard library, uses value semantics deliberately, and lets the compiler catch mistakes at compile time instead of at 3am.

The mental model to hold throughout: an object is memory holding a value of some type; a variable is a named object; a pointer is a machine address; a reference is an alias that cannot be reseated. Everything else follows from these.

The two rules that prevent most bugs

  1. Prefer {} initialization over =. int i2 {7.8} is a compile error (narrowing), while int i1 = 7.8 silently truncates to 7. The = form is C legacy and allows implicit narrowing conversions (double→int, int→char). When in doubt, use {}.
  2. Initialization ≠ assignment. Initialization turns uninitialized memory into a valid object; assignment requires the target to already hold a value. Reading/writing an uninitialized variable is undefined behavior. A reference must be initialized at declaration — int& r2; is an error.

Core language cheat sheet

Types, variables, arithmetic

Installs
4
Repository
bsene/skills
GitHub Stars
6
First Seen
Sep 17, 2026