Modern C++ (C++23/C++20) specialist for designing, implementing, reviewing, and modernizing performance-sensitive C++ across libraries, CLIs, services, and systems code. Use when working with `.cpp`, `.cc`, `.cxx`, `.hpp`, `.hh`, `.h`, `CMakeLists.txt`, `CMakePresets.json`, `vcpkg.json`, `conanfile.txt`, `conanfile.py`, or requests involving RAII, concepts, ranges, coroutines, template metaprogramming, concurrency, sanitizers, GoogleTest, Catch2, `clang-tidy`, profiling, ABI boundaries, or legacy C++ migration. Trigger for asks like "cpp pro", "modernizar c++", "cmake", "gtest", "catch2", "clang-tidy", "sanitizer", "performance c++", "concepts", "concurrency", or "refatorar c++ legado".
Use this skill to deliver modern C++ with explicit ownership, target-based builds, testable boundaries, and performance decisions backed by toolchain evidence.
Default stance:
Inspect toolchain and runtime constraints.
CMakeLists.txt, CMakePresets.json, package-manager files, and CI before changing structure.Design interfaces around ownership and failure semantics.
std::unique_ptr for transfer of ownership.std::span, std::string_view, and references for non-owning boundaries.std::expected style results.Implement with modern, measurable C++ idioms.
constexpr where they improve clarity or safety.Verify quality before tuning.
clang-tidy, and optional cppcheck when the environment supports them.Optimize from evidence.
Deliver with migration notes.
| Topic | Reference | Load when |
|---|---|---|
| Architecture and API boundaries | references/architecture-and-interfaces.md | Designing headers, ownership contracts, pimpl boundaries, ABI-sensitive APIs |
| Modern C++ features | references/modern-cpp.md | Concepts, ranges, coroutines, modules, and C++20/23 idioms |
| Template metaprogramming | references/templates.md | Concepts, traits, CRTP, variadics, or compile-time dispatch |
| Memory and performance | references/memory-performance.md | Allocators, move semantics, cache locality, SIMD, or data-layout work |
| Concurrency | references/concurrency.md | Atomics, thread pools, lock-free tradeoffs, cancellation, or parallel STL |
| Build and tooling | references/build-tooling.md | CMake, presets, sanitizers, static analysis, package managers, and CI |
| Legacy modernization | references/legacy-modernization.md | Incrementally upgrading raw pointers, old CMake, macros, or pre-modern C++ |
| Consolidated advanced samples | references/advanced-patterns.md | End-to-end examples, testing patterns, concurrency patterns, and production snippets |
scripts/bootstrap_cpp_project.py
library, cli, or service layouts.clang-tidy, and starter tests.scripts/run_cpp_quality_gates.py
clang-format, clang-tidy, and cppcheck steps.scripts/scaffold_cpp_test_template.py
unit, integration, or regression tests.scripts/audit_cpp_project.py
new/delete in normal application code.using namespace std in headers.For non-trivial C++ tasks, provide: