C++ Idioms and Patterns
CommunityWrite safer, faster, modern C++.
Authorirahardianto
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps you avoid unsafe, non-idiomatic C++ patterns and instead produce maintainable, deterministic code that leverages modern C++ features for reliability and performance.
Core Features & Use Cases
- Modern ownership and lifetime management: Apply RAII, choose
std::unique_ptrvsstd::shared_ptrcorrectly, and prefer Rule of Zero/Rule of Five where appropriate. - Predictable error handling: Use
std::expected(C++23) or result-style types for expected failures, reserving exceptions for exceptional conditions. - Efficient interfaces and types: Prefer
std::string_view,std::optional, andstd::variantfor clear intent; use Concepts and Ranges for expressive, type-safe designs. - Practical use case: When implementing a C++ service layer that fetches entities, handles “not found” and validation failures, and exposes clean APIs to callers, use these idioms to design correct ownership, robust errors, and allocation-free read-only parameters.
Quick Start
Ask your AI coding agent to refactor your C++ codebase to follow modern C++ idioms by applying RAII, improving ownership with smart pointers, using std::expected-style result handling, and updating interfaces to use std::string_view, std::optional, and std::variant where they fit best.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: C++ Idioms and Patterns Download link: https://github.com/irahardianto/awesome-agv/archive/main.zip#c-idioms-and-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.