
cpp-expert
Expert-level C++ development with modern C++20/23, STL, memory management, and performance. Use when the user mentions C++, C++20, C++23, the STL, templates, or performance, or when the task involves Modern C++ Features, Memory Management, Ranges and Views, or Coroutines.
- Installs
- 251
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/personamanagmentlayer/pcl --skill cpp-expert- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads cpp-expert automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
C++ Expert
Expert guidance for modern C++ development including C++20/23 features, STL, templates, memory management, and high-performance programming.
Core Concepts
Modern C++ Features (C++20/23)
- Concepts and constraints
- Ranges and views
- Coroutines
- Modules
- Three-way comparison (spaceship operator)
- std::format
- std::span
- Designated initializers
- consteval and constinit
Memory Management
- RAII (Resource Acquisition Is Initialization)
- Smart pointers (unique_ptr, shared_ptr, weak_ptr)
- Move semantics and perfect forwarding
- Memory allocation strategies
- Custom allocators
- Memory pools
Performance
- Zero-cost abstractions
- Inline optimization
- Template metaprogramming
- Compile-time computation (constexpr)
- Cache-friendly data structures
- SIMD operations
STL Containers
Sequential Containers
#include <vector>
#include <deque>
#include <list>
#include <array>
// vector - dynamic array
std::vector<int> vec = {1, 2, 3, 4, 5};
vec.push_back(6);
vec.emplace_back(7); // Construct in-place
vec.reserve(100); // Pre-allocate capacity
// deque - double-ended queue
std::deque<int> deq = {1, 2, 3};
deq.push_front(0);
deq.push_back(4);
// list - doubly-linked list
std::list<int> lst = {1, 2, 3};
lst.push_front(0);
lst.push_back(4);
lst.remove(2); // Remove all elements with value 2
// array - fixed-size array
std::array<int, 5> arr = {1, 2, 3, 4, 5};
Associative Containers
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
// map - ordered key-value pairs
std::map<std::string, int> ages;
ages["Alice"] = 30;
ages["Bob"] = 25;
ages.insert({"Charlie", 35});
// set - ordered unique elements
std::set<int> numbers = {3, 1, 4, 1, 5, 9};
numbers.insert(2);
// unordered_map - hash table
std::unordered_map<std::string, int> hash_map;
hash_map["key"] = 42;
// unordered_set - hash set
std::unordered_set<int> hash_set = {1, 2, 3};
Algorithms
#include <algorithm>
#include <numeric>
#include <vector>
std::vector<int> numbers = {5, 2, 8, 1, 9, 3, 7};
// Sorting
std::sort(numbers.begin(), numbers.end());
std::sort(numbers.begin(), numbers.end(), std::greater<int>());
// Searching
auto it = std::find(numbers.begin(), numbers.end(), 8);
bool found = std::binary_search(numbers.begin(), numbers.end(), 5);
// Transforming
std::vector<int> doubled(numbers.size());
std::transform(numbers.begin(), numbers.end(), doubled.begin(),
[](int n) { return n * 2; });
// Filtering
std::vector<int> evens;
std::copy_if(numbers.begin(), numbers.end(), std::back_inserter(evens),
[](int n) { return n % 2 == 0; });
// Accumulate
int sum = std::accumulate(numbers.begin(), numbers.end(), 0);
int product = std::accumulate(numbers.begin(), numbers.end(), 1,
std::multiplies<int>());
// Partition
auto pivot = std::partition(numbers.begin(), numbers.end(),
[](int n) { return n < 5; });
// Remove
numbers.erase(std::remove(numbers.begin(), numbers.end(), 5), numbers.end());
// Unique (remove consecutive duplicates)
std::sort(numbers.begin(), numbers.end());
numbers.erase(std::unique(numbers.begin(), numbers.end()), numbers.end());
Concurrency
#include <thread>
#include <mutex>
#include <future>
#include <atomic>
// Thread
void worker(int id) {
std::cout << "Thread " << id << '\n';
}
std::thread t1(worker, 1);
std::thread t2(worker, 2);
t1.join();
t2.join();
// Mutex
std::mutex mtx;
int shared_data = 0;
void increment() {
std::lock_guard<std::mutex> lock(mtx);
++shared_data;
}
// Atomic
std::atomic<int> counter{0};
counter++; // Thread-safe
counter.fetch_add(5);
// Future and promise
std::promise<int> prom;
std::future<int> fut = prom.get_future();
std::thread t([&prom]() {
std::this_thread::sleep_for(std::chrono::seconds(1));
prom.set_value(42);
});
int result = fut.get(); // Blocks until ready
t.join();
// async
auto future = std::async(std::launch::async, []() {
return 42;
});
int value = future.get();
Build Systems
CMake
# CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(MyApp VERSION 1.0.0 LANGUAGES CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Compiler flags
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -O3)
endif()
# Find packages
find_package(Threads REQUIRED)
find_package(Boost 1.75 REQUIRED COMPONENTS system filesystem)
# Add executable
add_executable(myapp
src/main.cpp
src/module.cpp
include/module.h
)
# Include directories
target_include_directories(myapp PRIVATE include)
# Link libraries
target_link_libraries(myapp PRIVATE
Threads::Threads
Boost::system
Boost::filesystem
)
# Install
install(TARGETS myapp DESTINATION bin)
Anti-Patterns to Avoid
❌ Raw pointers for ownership: Use smart pointers
❌ Manual memory management: Use RAII
❌ Using C-style arrays: Use std::array or std::vector
❌ Ignoring const correctness: Mark everything const that can be
❌ Unnecessary copies: Use move semantics and references
❌ Premature optimization: Profile before optimizing
❌ Using new without delete: Use smart pointers
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Best Practices — RAII, Const Correctness, Rule of Zero/Three/Five
- Modern C++ Syntax — Concepts (C++20), Ranges and Views (C++20), Coroutines (C++20), Smart Pointers, Move Semantics, Templates and Metaprogramming, std::format (C++20)
Resources
- C++ Reference: https://en.cppreference.com/
- C++ Core Guidelines: https://isocpp.github.io/CppCoreGuidelines/
- Compiler Explorer: https://godbolt.org/
- CPP Reference: https://cplusplus.com/
FAQ
What does the cpp-expert skill do?
Expert-level C++ development with modern C++20/23, STL, memory management, and performance. Use when the user mentions C++, C++20, C++23, the STL, templates, or performance, or when the task involves Modern C++ Features, Memory Management, Ranges and Views, or Coroutines.
How do I install cpp-expert?
Run npx skills add https://github.com/personamanagmentlayer/pcl --skill cpp-expert in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/cpp-expert/ (personal) or .claude/skills/cpp-expert/ (project).
Which AI agents can use cpp-expert?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is cpp-expert safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains cpp-expert?
It is published by personamanagmentlayer/pcl in personamanagmentlayer/pcl. It has 251 recorded installs.
More from personamanagmentlayer/pcl
finance-expert
personamanagmentlayer/pcl
Designs, reviews, operates and audits systems that hold, move, account for and report money — ledgers, payments, banking and open finance, reconciliation and close, risk, fraud, AML, markets and portfolio accounting, and corporate finance/FP&A. Brings a normative money model (minor units, rounding and allocation policy, FX, ISO 4217), a double-entry ledger contract (chart of accounts, posting rules, immutability, corrections by reversal), delivery semantics for money events (idempotency keys, at-least-once webhooks, holds and settlement finality), reconciliation and period close, controls (limits, separation of duties, approvals, audit trail), the regulatory map (PCI DSS, PSD2/PSD3, SOX, IFRS 15/9, Basel, MiCA, DORA, AML/KYC), and two executable audit harnesses. Use it whenever a task touches an amount of money — a balance, a charge, a refund, a payout, a transfer, an invoice, a fee, a tax, an FX conversion, an interest accrual, a journal entry, a trial balance, a settlement file, a ch
telecommunications-expert
personamanagmentlayer/pcl
Expert-level telecommunications systems, network management, billing, 5G, SDN, and telecom infrastructure. Use when the user mentions telecom, networking, 5G, billing, OSS, or BSS, or when the task involves Telecommunications Systems, Network Technologies, Standards and Protocols, or Network Management.
trading-expert
personamanagmentlayer/pcl
Expert-level algorithmic trading, market systems, quantitative analysis, and trading platforms. Use when the user mentions algorithmic trading, quant, markets, finance, or high-frequency trading, or when the task involves Trading Systems, Market Data, or Execution.
real-estate-expert
personamanagmentlayer/pcl
Expert-level real estate systems, property management, MLS integration, CRM, virtual tours, and market analysis. Use when the user mentions property, MLS, CRM, proptech, or listings, or when the task involves Real Estate Systems, PropTech Solutions, Standards and Regulations, or Listing Management.
banking-expert
personamanagmentlayer/pcl
Expert-level banking systems, core banking, regulations, and banking technology. Use when the user mentions finance, core banking, regulations, or payments, or when the task involves Banking Systems or Key Technologies.
insurance-expert
personamanagmentlayer/pcl
Expert-level insurance systems, underwriting, claims processing, actuarial analysis, risk assessment, and insurtech solutions. Use when the user mentions underwriting, claims, actuarial, risk, or insurtech, or when the task involves Insurance Systems, Insurance Types, Standards and Regulations, or Claims Processing.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.