Modern C++ steers the agent toward current C++ when it writes or modernizes code. It maps legacy patterns to safer replacements: smart pointers for new and delete, std::span for pointer plus length, std::format and std::print for printf, concepts for SFINAE, std::expected for error codes and std::variant for unions.
It also covers deployment steps that need no standard bump, namely hardening flags, hardened libc++ and sanitizers in CI, and ranks features by how usable they are today.
What You Get
- A table of legacy patterns and their modern replacements with the reason for each
- A hardening flag set for GCC and Clang, plus the hardened libc++ mode
- A tiered view of C++20 to C++26 features by practical usability
- A best-practices checklist for ownership, errors, templates and initialization
- Reference files on feature sets, hardening and safe idioms by vulnerability class
Common Use Cases
- Writing a new C++ library with modern defaults
- Modernizing pre-C++20 code in priority order, memory first
- Hardening build flags for security-critical code
- Reviewing C++ for use of old idioms
What Makes It Unique
The security emphasis sets it apart: replacements are chosen because they remove classes of memory and type errors, and the skill separates changes that need a newer standard from hardening that works on any standard. It includes a list of rationalizations to reject, for example the claim that smart pointers are slower, and a frank view of which C++26 features are worth adopting now.
Under The Hood
The skill is prose and reference files with no scripts. It shapes the code the agent writes and reviews and recommends compiler flags and sanitizer settings for you to put in your build. It runs no commands itself, calls no services and writes nothing beyond the code you ask for. Build system setup is explicitly out of scope.