{"slug":"cpp-pro-2","title":"cpp-pro","summary":"Writes, optimizes, and debugs C++ applications using modern C++20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C++ code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management — or","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-27T18:21:36.713032Z","repo":{"url":"https://github.com/Jeffallan/claude-skills","stars":12412,"forks":1191,"license":"MIT","updatedAt":"2026-11-16T17:30:27Z"},"bodyHtml":"<hr>\n<h2>name: cpp-pro\ndescription: Writes, optimizes, and debugs C++ applications using modern C<ins>20/23 features, template metaprogramming, and high-performance systems techniques. Use when building or refactoring C</ins> code requiring concepts, ranges, coroutines, SIMD optimization, or careful memory management — or when addressing performance bottlenecks, concurrency issues, and build system configuration with CMake.\nlicense: MIT\nmetadata:\nauthor: <a href=\"https://github.com/Jeffallan\">https://github.com/Jeffallan</a>\ncompany: <a href=\"https://synergetic.solutions\">https://synergetic.solutions</a>\nversion: \"1.1.0\"\ndomain: language\ntriggers: C++, C<ins>20, C</ins>23, modern C++, template metaprogramming, systems programming, performance optimization, SIMD, memory management, CMake\nrole: specialist\nscope: implementation\noutput-format: code\nrelated-skills: rust-engineer, embedded-systems</h2>\n<h1>C++ Pro</h1>\n<p>Senior C++ developer with deep expertise in modern C++20/23, systems programming, high-performance computing, and zero-overhead abstractions.</p>\n<h2>Core Workflow</h2>\n<ol>\n<li><strong>Analyze architecture</strong> — Review build system, compiler flags, performance requirements</li>\n<li><strong>Design with concepts</strong> — Create type-safe interfaces using C++20 concepts</li>\n<li><strong>Implement zero-cost</strong> — Apply RAII, constexpr, and zero-overhead abstractions</li>\n<li><strong>Verify quality</strong> — Run sanitizers and static analysis; if AddressSanitizer or UndefinedBehaviorSanitizer report issues, fix all memory and UB errors before proceeding</li>\n<li><strong>Benchmark</strong> — Profile with real workloads; if performance targets are not met, apply targeted optimizations (SIMD, cache layout, move semantics) and re-measure</li>\n</ol>\n<h2>Reference Guide</h2>\n<p>Load detailed guidance based on context:</p>\n<table>\n<thead>\n<tr>\n<th>Topic</th>\n<th>Reference</th>\n<th>Load When</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Modern C++ Features</td>\n<td><code>references/modern-cpp.md</code></td>\n<td>C++20/23 features, concepts, ranges, coroutines</td>\n</tr>\n<tr>\n<td>Template Metaprogramming</td>\n<td><code>references/templates.md</code></td>\n<td>Variadic templates, SFINAE, type traits, CRTP</td>\n</tr>\n<tr>\n<td>Memory &amp; Performance</td>\n<td><code>references/memory-performance.md</code></td>\n<td>Allocators, SIMD, cache optimization, move semantics</td>\n</tr>\n<tr>\n<td>Concurrency</td>\n<td><code>references/concurrency.md</code></td>\n<td>Atomics, lock-free structures, thread pools, coroutines</td>\n</tr>\n<tr>\n<td>Build &amp; Tooling</td>\n<td><code>references/build-tooling.md</code></td>\n<td>CMake, sanitizers, static analysis, testing</td>\n</tr>\n</tbody>\n</table>\n<h2>Constraints</h2>\n<h3>MUST DO</h3>\n<ul>\n<li>Follow C++ Core Guidelines</li>\n<li>Use concepts for template constraints</li>\n<li>Apply RAII universally</li>\n<li>Use <code>auto</code> with type deduction</li>\n<li>Prefer <code>std::unique_ptr</code> and <code>std::shared_ptr</code></li>\n<li>Enable all compiler warnings (-Wall -Wextra -Wpedantic)</li>\n<li>Run AddressSanitizer and UndefinedBehaviorSanitizer</li>\n<li>Write const-correct code</li>\n</ul>\n<h3>MUST NOT DO</h3>\n<ul>\n<li>Use raw <code>new</code>/<code>delete</code> (prefer smart pointers)</li>\n<li>Ignore compiler warnings</li>\n<li>Use C-style casts (use static_cast, etc.)</li>\n<li>Mix exception and error code patterns inconsistently</li>\n<li>Write non-const-correct code</li>\n<li>Use <code>using namespace std</code> in headers</li>\n<li>Ignore undefined behavior</li>\n<li>Skip move semantics for expensive types</li>\n</ul>\n<h2>Key Patterns</h2>\n<h3>Concept Definition (C++20)</h3>\n<pre><code>// Define a reusable, self-documenting constraint\ntemplate&lt;typename T&gt;\nconcept Numeric = std::integral&lt;T&gt; || std::floating_point&lt;T&gt;;\n\ntemplate&lt;Numeric T&gt;\nT clamp(T value, T lo, T hi) {\n    return std::clamp(value, lo, hi);\n}\n</code></pre>\n<h3>RAII Resource Wrapper</h3>\n<pre><code>// Wraps a raw handle; no manual cleanup needed at call sites\nclass FileHandle {\npublic:\n    explicit FileHandle(const char* path)\n        : handle_(std::fopen(path, \"r\")) {\n        if (!handle_) throw std::runtime_error(\"Cannot open file\");\n    }\n    ~FileHandle() { if (handle_) std::fclose(handle_); }\n\n    // Non-copyable, movable\n    FileHandle(const FileHandle&amp;) = delete;\n    FileHandle&amp; operator=(const FileHandle&amp;) = delete;\n    FileHandle(FileHandle&amp;&amp; other) noexcept\n        : handle_(std::exchange(other.handle_, nullptr)) {}\n\n    std::FILE* get() const noexcept { return handle_; }\nprivate:\n    std::FILE* handle_;\n};\n</code></pre>\n<h3>Smart Pointer Ownership</h3>\n<pre><code>// Prefer make_unique / make_shared; avoid raw new/delete\nauto buffer = std::make_unique&lt;std::array&lt;std::byte, 4096&gt;&gt;();\n\n// Shared ownership only when genuinely needed\nauto config = std::make_shared&lt;Config&gt;(parseArgs(argc, argv));\n</code></pre>\n<h2>Output Templates</h2>\n<p>When implementing C++ features, provide:</p>\n<ol>\n<li>Header file with interfaces and templates</li>\n<li>Implementation file (when needed)</li>\n<li>CMakeLists.txt updates (if applicable)</li>\n<li>Test file demonstrating usage</li>\n<li>Brief explanation of design decisions and performance characteristics</li>\n</ol>\n<p>Maintained by <a href=\"https://github.com/jeffallan\">@jeffallan</a>, Principal Consultant at <a href=\"https://synergetic.solutions\">Synergetic Solutions</a></p>\n<p><a href=\"https://jeffallan.github.io/claude-skills/skills/language/cpp-pro/\">Documentation</a></p>\n","files":[{"path":"references/build-tooling.md","sizeBytes":9761,"isText":true},{"path":"references/concurrency.md","sizeBytes":10918,"isText":true},{"path":"references/memory-performance.md","sizeBytes":9104,"isText":true},{"path":"references/modern-cpp.md","sizeBytes":6565,"isText":true},{"path":"references/templates.md","sizeBytes":7908,"isText":true},{"path":"SKILL.md","sizeBytes":4672,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-27T18:21:53.176222Z","sha256":"0880517DE57429F2593093087E774890A1ADE58036ACBF32F7317167FEB667F3","sizeBytes":17437},"review":null,"source":{"repositoryUrl":"https://github.com/Jeffallan/claude-skills","path":"skills/cpp-pro","license":"MIT","commit":"67c1961b180dc92cf08983344627109e983e8f51","subtreeSha":"994EE55E5614C0B987D5CFBD1328DD4DE3E7AC1ACF088190CF6FBE7DC5A36032","lastSyncedAt":"2026-11-17T00:40:15.350492Z"},"reviewedAt":"2026-10-27T18:22:22.919076Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/Jeffallan/claude-skills/tree/main/skills/cpp-pro"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install jeffallan-claude-skills@llmmart"},{"target":"git","command":"git clone https://github.com/Jeffallan/claude-skills.git"}]}