cpp
Skill15 starsChanged 41 days agoMITView on GitHub
Expert modern C++ (C++17/C++20/C++23) assistance covering RAII, smart pointers, template metaprogramming, STL containers, move semantics, and memory profiling. Use when developing high-performance native systems, low-latency algorithms, game engines, or embedded C++ codebases.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- testdino-hq/google-styleguides-skillstheir own version, first seen Nov 8, 2026
- its-ash/skillstheir own version, first seen Nov 1, 2026
- nimadorostkar/Claude-Skills-collectiontheir own version, first seen Oct 13, 2026
- Mindrally/skillstheir own version, first seen Oct 8, 2026
- mordechai30/cpp_skillstheir own version, first seen Oct 8, 2026
- kimtth/agent-skill-100-lines-or-lesstheir own version, first seen Jun 26, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- Mindrally/skills★ 275same name
- margelo/react-native-skills★ 172same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- testdino-hq/google-styleguides-skills★ 15same name
- kimtth/agent-skill-100-lines-or-less★ 2same name
- its-ash/skills★ 0same name
- mordechai30/cpp_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- llamaSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 0 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 163
Use Smart Pointers (std::unique_ptr, std::shared_ptr): Completely avoid raw new and delete expressions.
- Very specific: line 165
Use std::string_view and std::span: Reference continuous memory without copying or allocating heap strings.
- Very specific: line 170
Use C-style casts ((int)x): Use explicit C++ casts (static_cast, reinterpret_cast) to retain compiler safety checks.
- Very specific: line 172
Use macros (#define) for constants: Use constexpr or inline constexpr variables.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C++
Modern C++ development with smart pointers, RAII, and performance optimization.
When to Use
- High-Performance Game Engine & Graphics Development: Unreal Engine, Vulkan, DirectX 12, and real-time ray tracing pipelines.
- Low-Latency Quantitative Finance: Writing high-frequency trading (HFT) engines with microsecond and nanosecond execution SLAs.
- Systems & Database Infrastructure: Building foundational engines (Chromium, ClickHouse, RocksDB, MongoDB).
- Embedded & Autonomous Robotics: ROS 2, computer vision pipelines, and self-driving automotive control systems.
Quick Start
#include <memory>
#include <string>
#include <vector>
class User {
public:
User(std::string name, std::string email)
: name_(std::move(name)), email_(std::move(email)) {}
const std::string& name() const { return name_; }
const std::string& email() const { return email_; }
private:
std::string name_;
std::string email_;
};
auto user = std::make_unique<User>("John", "john@example.com");Core Concepts
RAII & Modern Smart Pointers (C++20/C++23)
Resource Acquisition Is Initialization (RAII) ties resource management directly to object lifetime:
#include <iostream>
#include <memory>
#include <string>
class DatabaseConnection {
public:
explicit DatabaseConnection(std::string conn_str) { std::cout << "Connected
"; }
~DatabaseConnection() { std::cout << "Closed connection safely
"; }
void query(std::string sql) { std::cout << "Executing: " << sql << "
"; }
};
void execute_task() {
// std::unique_ptr automatically destructs and frees resource when exiting scope
auto conn = std::make_unique<DatabaseConnection>("postgres://localhost");
conn->query("SELECT 1;");
} // conn goes out of scope here; destructor executes automaticallyMove Semantics & std::move
Transfers ownership of heavy heap resources without expensive deep memory copying:
#include <vector>
std::vector<int> generate_data() {
std::vector<int> large_vector(1'000'000, 42);
return large_vector; // Move semantics (or RVO) avoids copying 1M integers
}C++20 Concepts & Constexpr Metaprogramming
Constrains template arguments with readable compile-time predicates:
#include <concepts>
template<typename T>
concept Numeric = std::integral<T> || std::floating_point<T>;
template<Numeric T>
T calculate_mean(T a, T b) {
return (a + b) / 2;
}Common Patterns
Structured Bindings & Optional Returns
Problem: Returning multiple values safely without error-prone output pointers or boilerplate structs.
Solution:
// Structured bindings (C++17)
auto [name, age] = std::make_pair("John", 25);
for (const auto& [key, value] : map) { /* ... */ }
// std::optional (C++17)
std::optional<User> findUser(int id) {
if (exists) return User{...};
return std::nullopt;
}
// Concepts (C++20)
template<typename T>
concept Numeric = std::is_arithmetic_v<T>;
template<Numeric T>
T add(T a, T b) { return a + b; }
// Ranges (C++20)
auto result = numbers
| std::views::filter([](int n) { return n % 2 == 0; })
| std::views::transform([](int n) { return n * 2; });RAII Pattern
Problem: Manual resource management risks leaks when exceptions interrupt execution flow.
Solution:
class FileHandle {
public:
explicit FileHandle(const char* path)
: file_(std::fopen(path, "r")) {
if (!file_) throw std::runtime_error("Cannot open file");
}
~FileHandle() { if (file_) std::fclose(file_); }
// Delete copy
FileHandle(const FileHandle&) = delete;
FileHandle& operator=(const FileHandle&) = delete;
// Allow move
FileHandle(FileHandle&& other) noexcept : file_(other.file_) {
other.file_ = nullptr;
}
private:
FILE* file_;
};Best Practices
Do:
- Use Smart Pointers (
std::unique_ptr,std::shared_ptr): Completely avoid rawnewanddeleteexpressions. - Pass Heavy Read-Only Objects by
const&: Prevent accidental copy overhead (void process(const std::string& data)). - Use
std::string_viewandstd::span: Reference continuous memory without copying or allocating heap strings. - Enable Clang-Tidy & AddressSanitizer in CI: Enforce modern standards and catch memory leaks automatically.
Don't:
- Use C-style casts (
(int)x): Use explicit C++ casts (static_cast,reinterpret_cast) to retain compiler safety checks. - Return references to local stack variables: Returning local references causes dangling pointers and immediate undefined behavior.
- Use macros (
#define) for constants: Useconstexprorinline constexprvariables.
Troubleshooting
| Error | Cause | Solution |
| Segmentation fault | Null pointer or buffer overflow | Use sanitizers, smart pointers |
| Memory leak | Missing delete | Use RAII, smart pointers |
| Undefined behavior | Dangling reference | Ensure lifetime validity |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

