cpp
cpp — an Agent Skill from the odjaramillo/custom-rules repository.
Works with
Agent Skills format with YAML frontmatter. Claude Code reads it as-is.
---
name: "cpp"
description: "cpp — an Agent Skill from the odjaramillo/custom-rules repository."
license: "Apache-2.0"
---
## Critical Patterns
### Smart Pointers (REQUIRED)
```cpp
// ✅ ALWAYS: Use smart pointers
auto user = std::make_unique<User>("John");
auto shared = std::make_shared<Config>();
// ❌ NEVER: Raw new/delete
User* user = new User("John");
delete user;
```
### RAII (REQUIRED)
```cpp
// ✅ ALWAYS: Resource management through constructors/destructors
class FileHandle {
std::fstream file_;
public:
FileHandle(const std::string& path) : file_(path) {}
~FileHandle() { if (file_.is_open()) file_.close(); }
};
```
### Modern Patterns (REQUIRED)
```cpp
// ✅ Use auto for type deduction
auto items = std::vector<int>{1, 2, 3};
// ✅ Use range-based for loops
for (const auto& item : items) {
process(item);
}
// ✅ Use structured bindings
auto [name, age] = getPerson();
```
---
## Decision Tree
```
Need unique ownership? → std::unique_ptr
Need shared ownership? → std::shared_ptr
Need optional value? → std::optional
Need multiple types? → std::variant
Need string views? → std::string_view
```
---
## Commands
```bash
g++ -std=c++20 -Wall -Wextra main.cpp -o app
clang++ -std=c++20 main.cpp -o app
cmake -B build && cmake --build build
```More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.

