cpp-expert

cpp-expert is a skill for Claude Code from Miaoge-Ge/coding-agent-skills. It costs 98 tokens per session (1,051 once invoked), scanned A, original, MIT.

A guide for writing and reviewing modern C++ code, including versions 17, 20, and 23. It covers resource ownership, templates, the standard library, and undefined behavior—code that can fail in unpredictable ways.

In plain words
What is it for?
Use it to implement or review C++, improve memory or runtime performance, and diagnose crashes, leaks, compile errors, or undefined behavior.
Why use it?
It helps prevent memory leaks, dangling pointers, unsafe ownership, and hard-to-understand compiler or runtime errors.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cpp-expert plugin — 1 skill shipped together

Good fit Use it to implement or review C++, improve memory or runtime performance, and diagnose crashes, leaks, compile errors, or undefined behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/miaoge-ge/coding-agent-skills/cpp-expert
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Miaoge-Ge/coding-agent-skills --skill cpp-expert
Clone the repo
git clone --depth 1 https://github.com/Miaoge-Ge/coding-agent-skills

Made for: Claude Code.

Or install cpp-expert, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cpp-expert

README.md
[![agentmods](https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/cpp-expert/github.svg)](https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/cpp-expert)
Your own site
<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/cpp-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/cpp-expert/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cpp-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/cpp-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/cpp-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,051 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00098 $0.01051
Opus 5 $0.00049 $0.00526
Sonnet 5 $0.00020 $0.00210
Haiku 4.5 $0.00010 $0.00105

Measured 9d ago against content hash 1de1bf2e5789, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

cpp-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cpp-expert/skills/cpp-expert/SKILL.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

C++ Expert

RAII owns every resource; values move, don't copy. Make ownership explicit, lean on the STL, and treat undefined behavior as a bug to prevent — not a surprise to debug.

When to Use

  • Writing or reviewing C++.
  • Modern features (C++17/20/23), templates/metaprogramming, STL.
  • Performance/memory tuning; smart pointers and ownership.
  • Compile errors, crashes, leaks, or undefined behavior (UB).

When NOT to Use

  • Another language → relevant language skill.
  • Contest algorithms (language incidental) → competitive-programming-expert.
  • System/architecture design → software-architect.

Core Principles

1. Modern by default

  • Target C++17/20 unless constrained. Prefer auto, range-based for, structured bindings, std::optional/variant/string_view/span.
  • Constrain templates with Concepts (C++20) or static_assert so errors surface at the call site, not deep in instantiation.

2. Ownership & RAII

  • No owning raw pointers. std::unique_ptr for sole ownership, shared_ptr only when ownership is genuinely shared; create with make_unique/make_shared. Raw pointers/references are non-owning observers.
  • Every resource (memory, file, lock, socket) is owned by an object that releases it in its destructor. Locks via std::scoped_lock/lock_guard.
  • Follow the Rule of 0 (no manual special members) — or Rule of 5 if you manage a resource directly.

3. Value semantics & performance

  • Pass const& for read-only, by value + std::move to sink, string_view/span for non-owning views. Rely on (N)RVO — return by value.
  • Avoid premature shared_ptr (atomic refcount cost) and needless copies; emplace_back, reserve. Choose containers deliberately (vector by default). constexpr/consteval for compile-time work. Profile before micro-optimizing.

4. Avoid UB proactively

  • Dangling refs/views, use-after-move, out-of-bounds, signed overflow, uninitialized reads, iterator invalidation, data races. Build with warnings (-Wall -Wextra), sanitizers (ASan/UBSan/TSan), and tools (clang-tidy).

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 85 lines · 98 tokens per session scan A 1de1bf2e5789

Subscribe to this mod's changes

cpp-expert is a skill published in the GitHub repository Miaoge-Ge/coding-agent-skills (5 stars, last pushed 3mo ago), licensed MIT. It adds 98 tokens to every session and 1,051 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

qt-cpp-review

Invoke when the user asks to review, check, audit, or look over Qt6 C++ code — or suggest before committing. Runs deterministic linting (60+ rules) then six parallel deep- analysis agents covering model contracts, ownership, threading, API correctness, error handling, and performance. Reports only high-confidence…

mavlink/qgroundcontrol · 86 tokens

code-review-csharp

Perform structured code reviews of C# source code covering naming conventions, performance, security, readability, and .NET best practices. Trigger phrases include "review this C# code", "check my C# for best practices", "analyze this C# class", "find issues in my C# code".

pnp/copilot-prompts · 66 tokens

unreal-live-coding

Trigger Live Coding compilation via UCP. Use when the user asks to recompile C++ code, trigger live coding, hot reload C++ changes, or check compilation status in Unreal Engine.

Italink/UnrealClientProtocol · 44 tokens

torchtalk-analyzer

Analyze PyTorch internals across Python, C++, and CUDA layers using the TorchTalk MCP server. Use when asked about how PyTorch operators work internally, where functions are implemented, what would break if code is modified, or finding tests for PyTorch operators.

opendatahub-io/ai-helpers · 58 tokens

torchtalk-trace

Trace a PyTorch function's cross-language binding chain (Python -> C++ -> CUDA).

opendatahub-io/ai-helpers · 24 tokens

audit

Audits recent work against its Definition of Done and project patterns. Runs the test suite, compares code against the spec, and reports PASS / PARTIAL / FAIL. Also runs the Critical Gate — a safety scan of the diff for destructive or dangerous operations. Generates an incremental prompt pack for any gaps found. With…

pe-menezes/vibeflow · 93 tokens