z-cpp-core
Installation
SKILL.md
C++ core
RAII owns every resource — if a type manages one without it, that's the bug to fix before anything else.
Baseline standard
- Use the project's standard; C++20 is the house baseline for new code. Check compiler and standard-library support for each required feature.
- For C++23, inspect the toolchain pin and CMake presets, then compile a representative use (
-std=c++23on GCC/Clang). A language-mode flag alone does not prove library completeness. - C++26 completed its technical work in March 2026; that is not final ISO publication. Check the current standard status and compiler feature tables before adopting reflection or contracts.
RAII and ownership
- RAII everywhere: every resource (memory, file handle, lock, socket) gets a type whose destructor releases it — no manual cleanup path a
return/throwcan skip - rule of zero: if a type doesn't manage a resource directly, don't write any of the five special members — let the compiler generate them from members that already follow rule of zero
unique_ptris the default for owned heap allocation;shared_ptronly as a documented decision (who else holds it, why it must outlive a single owner), not a default reached for out of uncertaintyspan/string_viewat API boundaries to avoid copies, but track lifetimes carefully — astring_viewthat outlives the buffer it points into is a dangling reference the type system won't catch