Agent skill

Cpp Best Practices

by 2SSK in 2SSK/dot-files

C++ development best practices. An agent skill from 2SSK/dot-files.

MITAuto-check passed

Install Cpp Best Practices

skills CLI
$ npx skills add 2SSK/dot-files --skill cpp-best-practices -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 2SSK/dot-files cpp-best-practices --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/2SSK/dot-files.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/cpp-best-practices .claude/skills/cpp-best-practices && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cpp-best-practices
GitHub stars
247
Token cost
~489 tokens
SKILL.md length
64 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

C++ development best practices. An agent skill from 2SSK/dot-files.

  • Writing C++ code
  • SKILL.md covers Core Principles, Memory Management, Modern C++ Features and Concurrency, plus 3 more sections
  • Calls cmake

What it does

Cpp Best Practices is an agent skill from 2SSK/dot-files. C++ development best practices. Modern C++20/23, RAII, zero-overhead abstractions, safety. Use when writing C++ code.

Its SKILL.md is about 490 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: opencode

It works with C++. The licence is MIT.

When your agent uses it

  • Writing C++ code

Example prompts

  • “/cpp-best-practices”

Requirements

  • Compatibility (from SKILL.md): opencode

What it can do on your machine

Read from SKILL.md and the folder at commit 5cab3b1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cmake

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

Cpp Best Practices loads about 489 tokens when it runs. Until then it costs about 34 tokens; SKILL.md has 64 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~34
When it runs · the whole SKILL.md, loaded when a task matches
~489

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from 2SSK/dot-files at commit 5cab3b1, republished under its MIT licence (© 2SSK). 64 words, ~489 tokens.

Download SKILL.mdSave it as .claude/skills/cpp-best-practices/SKILL.md (or your agent's skills folder).
name
cpp-best-practices
description
C++ development best practices. Modern C++20/23, RAII, zero-overhead abstractions, safety. Use when writing C++ code.
compatibility
opencode

C++ Best Practices

Modern C++20/23 with zero-overhead abstractions and safety.

Core Principles

  • RAII: Resource Acquisition Is Initialization — always
  • Zero-cost: Don't pay for what you don't use
  • Safety: Memory safety without garbage collection
  • Modern: Use C++20/23 features

Memory Management

cpp
// Smart pointers — always
auto ptr = std::make_unique<Resource>();
auto shared = std::make_shared<Cache>();

// No raw new/delete
// std::vector for dynamic arrays
// std::string for strings

Modern C++ Features

cpp
// Concepts (C++20)
template<typename T>
concept Hashable = requires(T a) {
    { std::hash<T>{}(a) } -> std::convertible_to<std::size_t>;
};

// Ranges (C++20)
auto results = range | std::views::filter(pred)
                   | std::views::transform(func)
                   | std::views::take(10);

// std::expected (C++23)
std::expected<int, Error> divide(int a, int b) {
    if (b == 0) return std::unexpected{DivisionByZero{}};
    return a / b;
}

Concurrency

cpp
// std::jthread for cancellation
std::jthread worker([](stop_token) {
    while (!stop_token.stop_requested()) {
        // work
    }
});

Error Handling

cpp
// Exceptions for exceptional cases
// noexcept for functions that shouldn't throw
// std::expected for fallible operations

Build Commands

bash
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined"
ctest --output-on-failure

Quality Gates

  • clang-tidy passes
  • Cppcheck passes
  • Zero warnings with -Wall -Wextra -Wpedantic
  • AddressSanitizer clean
  • UndefinedBehaviorSanitizer clean
  • Coverage ≥ 80%

© 2SSK, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/cpp-best-practices of 2SSK/dot-files.

Open the folder on GitHubat commit 5cab3b1

Compare with similar skills

Cpp Best Practices next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cpp Best Practices compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cpp Best Practices this skill2SSK/dot-files247—~489Automated safety check: PassMIT
Paddle BuildPaddlePaddle/Paddle24k—~1kAutomated safety check: PassApache-2.0
Fory Releaseapache/fory4.6k—~2.9kAutomated safety check: PassApache-2.0
ONNX Runtime Shape Inference Safety Auditmicrosoft/onnxruntime22k—~3.3kAutomated safety check: PassMIT
Code Audit3stoneBrother/code-audit8931 repos~2.7kAutomated safety check: PassNone
Qt C++ Code Reviewx-tools-author/x-tools1.1k2 repos~4.3kAutomated safety check: PassBSD-3-Clause

Similar skills

  • Paddle Build

    PaddlePaddle/Paddle

    A skill your agent uses when needing to compile, rebuild, or install Paddle from source after code changes.

    24k GitHub stars~1k tokensUpdated 7 days ago
    AI & LLM EngineeringAuto-check passed
  • Fory Release

    apache/fory

    Prepare an Apache Fory release candidate from a clean release branch, including the version bump, RC tag, JVM staging, ASF source artifacts, SVN upload, and vote email.

    4.6k GitHub stars~2.9k tokensUpdated today
    Auto-check passed
  • Official

    Finds and fixes out-of-range output writes in ONNX Runtime operator shape-inference functions where a getNumOutputs guard admits too few outputs.

    22k GitHub stars~3.3k tokensUpdated today
    SecurityAuto-check passed
  • Code Audit

    3stoneBrother/code-audit

    Professional code security audit skill covering 55+ vulnerability types.

    893 GitHub starsUsed in 1 repo~2.7k tokens
    SecurityAuto-check passed
  • Qt C++ Code Review

    x-tools-author/x-tools

    Read-only review of Qt6 C++ code that combines a deterministic lint script with six parallel analysis agents and reports only high-confidence issues.

    1.1k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • Translation

    doxygen/doxygen

    Keeps all Doxygen and Doxywizard translations up to date across three mechanisms: translator C++ classes (src/translatorxx.h), Qt .ts locale files for the Doxywizard GUI (addon/doxywizard/i18n/)…

    6.6k GitHub stars~5.2k tokensUpdated 7 days ago
    Writing & ContentAuto-check passed

More from 2SSK/dot-files

  • Docker and container best practices. An agent skill from 2SSK/dot-files.

    247 GitHub stars~438 tokensUpdated 25 days ago
    Auto-check passed
  • Go Best Practices

    2SSK/dot-files

    Go development best practices. An agent skill from 2SSK/dot-files.

    247 GitHub stars~467 tokensUpdated 25 days ago
    Auto-check passed
  • Observability

    2SSK/dot-files

    Observability best practices. An agent skill from 2SSK/dot-files.

    247 GitHub stars~676 tokensUpdated 25 days ago
    Auto-check passed
  • React Native development. An agent skill from 2SSK/dot-files.

    247 GitHub stars~570 tokensUpdated 25 days ago
    Auto-check passed
  • Ship

    2SSK/dot-files

    A skill your agent uses when the user wants to commit, push, and open a pull request for the current changes.

    247 GitHub stars~808 tokensUpdated 25 days ago
    Auto-check: notes
  • TDD

    2SSK/dot-files

    Test-Driven Development workflow. An agent skill from 2SSK/dot-files.

    247 GitHub stars~444 tokensUpdated 25 days ago
    Auto-check passed

Works with

Questions about Cpp Best Practices

What does Cpp Best Practices do?

C++ development best practices. An agent skill from 2SSK/dot-files. Cpp Best Practices is an agent skill from 2SSK/dot-files. C++ development best practices.

When should I use Cpp Best Practices?

Cpp Best Practices fits situations like: writing C++ code.

How do I install Cpp Best Practices in Claude Code?

Run `npx skills add 2SSK/dot-files --skill cpp-best-practices -a claude-code`. Or copy the skill folder (.claude/skills/cpp-best-practices in 2SSK/dot-files) into .claude/skills/cpp-best-practices in your project. Claude Code loads it when a task matches its description.

How do I install Cpp Best Practices in Codex?

Run `npx skills add 2SSK/dot-files --skill cpp-best-practices -a codex`. Or copy the skill folder (.claude/skills/cpp-best-practices in 2SSK/dot-files) into .agents/skills/cpp-best-practices in your project. Codex loads it when a task matches its description.

Can I use Cpp Best Practices in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 2SSK/dot-files --skill cpp-best-practices -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cpp-best-practices, .gemini/skills/cpp-best-practices, .github/skills/cpp-best-practices and .opencode/skills/cpp-best-practices in your project.

What does Cpp Best Practices need to run?

Going by SKILL.md and its folder, Cpp Best Practices needs the command-line tools its instructions call (cmake). Compatibility (from SKILL.md): opencode.

Does Cpp Best Practices access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Cpp Best Practices safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cpp Best Practices use?

Cpp Best Practices is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cpp Best Practices use?

About 489 tokens (SKILL.md is roughly 2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cpp Best Practices?

Skills that share tags, products or a category with Cpp Best Practices: Paddle Build (PaddlePaddle/Paddle, 24k stars), Fory Release (apache/fory, 4.6k stars), ONNX Runtime Shape Inference Safety Audit (microsoft/onnxruntime, 22k stars) and Code Audit (3stoneBrother/code-audit, 893 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cpp Best Practices?

2SSK (a GitHub user) maintains it in 2SSK/dot-files, which has 247 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 12, 2026.

Source: 2SSK/dot-files on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.