readable-cpp

readable-cpp is a skill for Claude Code from crazyguitar/cppcheatsheet. It costs 63 tokens per session (6,348 once invoked), scanned A, original, MIT.

A set of readability rules for C, C++, Rust, and CUDA code. It emphasizes short functions, clear names, simple structure, and shallow nesting.

In plain words
What is it for?
Writing, reviewing, or refactoring C, C++, Rust, and CUDA code with clearer functions, flatter control flow, and more descriptive names.
Why use it?
Dense or deeply nested code takes longer to understand and maintain. These rules give developers a consistent way to make such code easier to read.

Skill for Claude Code

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

Part of the cppcheatsheet plugin — 2 skills shipped together

Good fit Writing, reviewing, or refactoring C, C++, Rust, and CUDA code with clearer functions, flatter control flow, and more descriptive names.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/crazyguitar/cppcheatsheet/readable-cpp
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 crazyguitar/cppcheatsheet --skill readable-cpp
Clone the repo
git clone --depth 1 https://github.com/crazyguitar/cppcheatsheet

Made for: Claude Code.

Or install cppcheatsheet, the plugin that ships this one along with the rest of its 2 skills.

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 readable-cpp

README.md
[![agentmods](https://agentmods.dev/badge/skills/crazyguitar/cppcheatsheet/readable-cpp/github.svg)](https://agentmods.dev/skills/crazyguitar/cppcheatsheet/readable-cpp)
Your own site
<a href="https://agentmods.dev/skills/crazyguitar/cppcheatsheet/readable-cpp"><img src="https://agentmods.dev/badge/skills/crazyguitar/cppcheatsheet/readable-cpp/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 readable-cpp

Your own site · 80×15
<a href="https://agentmods.dev/skills/crazyguitar/cppcheatsheet/readable-cpp"><img src="https://agentmods.dev/badge/skills/crazyguitar/cppcheatsheet/readable-cpp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,348 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00063 $0.06348
Opus 5.5 $0.00025 $0.02539
Sonnet 5.5 $0.00013 $0.01270
Haiku 4.5 $0.00006 $0.00635

Measured 1mo ago against content hash 1ce297be798a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

readable-cpp 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 1mo 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.

skills/readable-cpp/SKILL.md · 597 lines

How it starts

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

Readable C/C++/Rust/CUDA Rules (/readable-cpp)

Apply these rules when writing, reviewing, or refactoring C, C++, Rust, or CUDA code. Inspired by The Art of Readable Code by Dustin Boswell and Trevor Foucher.

Core principle: Code should be easy to understand. The time it takes someone else (or future you) to understand the code is the ultimate metric.

1. Keep Functions Short and Focused

  • A function should do one thing. If you can describe what it does with "and", split it.
  • Aim for functions that fit on one screen (~15-25 lines). If it's longer, extract sub-tasks.
  • Each function should operate at a single level of abstraction — don't mix high-level logic with low-level details in the same function.

2. Flatten Control Flow — No Deep Nesting

  • Never nest more than 2 levels deep. If you have a loop inside a loop, or an if inside a loop inside an if, extract the inner block into a helper function with a descriptive name.
  • Use early returns / guard clauses to handle edge cases at the top, keeping the main logic flat.
  • Prefer continue or break to skip iterations rather than wrapping the body in a conditional.
  • Replace complex conditionals with well-named helper functions or variables that explain the intent.
// Bad: nested and hard to follow
for (auto& user : users) {
    if (user.is_active()) {
        for (auto& order : user.orders()) {
            if (order.is_pending()) {
                process(order);
            }
        }
    }
}

// Good: flat, each function name explains what it does
auto active_users = get_active_users(users);
for (auto& user : active_users) {
    process_pending_orders(user.orders());
}

3. Name Things Clearly

  • Pack information into names. Use specific, concrete words — fetch_page not get, num_retries not n.
  • Avoid generic names like tmp, data, result, val, info, handle — unless the scope is tiny (2-3 lines).
  • Use names that can't be misconstrued. If a range is inclusive, say max_items not limit. If a boolean, use is_, has_, should_, can_ prefixes.
  • Match the name length to the scope. Short names for small scopes, descriptive names for wide scopes.
  • Don't use abbreviations unless they're universally understood (num, max, min, err are fine; svc_mgr_cfg is not).

Read the full file on GitHub · 597 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. 1mo ago First seen · 597 lines · 63 tokens per session scan A 1ce297be798a

Subscribe to this mod's changes

readable-cpp is a skill published in the GitHub repository crazyguitar/cppcheatsheet (293 stars, last pushed 6d ago), licensed MIT. It adds 63 tokens to every session and 6,348 once invoked, about $0.0003 per session on Opus 5.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-30.

Related

Other skills, from other repositories

cuopt-developer

Modify, build, test, debug, and contribute to NVIDIA cuOpt (C++/CUDA, Python, server, CI). Use for solver internals, PRs, DCO, and code conventions.

NVIDIA/cuopt · 47 tokens

c-code-style

Write, edit, or review C (and C-compatible header) code according to C coding style rules, then check and run clang-format to enforce formatting. Trigger on "write C code", "edit a .c/.h file", "review C code style", "format C code", "run clang-format", "check clang-format", "apply the C style guide".

MaJerle/c-code-style · 79 tokens

cutedsl_megamoe

Skill "cutedsl_megamoe" from flashinfer-ai/flashinfer, covering updating the cutedsl megamoe kernel src, layout, when the kernel team drops a new version of src/ and what not to update here.

flashinfer-ai/flashinfer · 0 tokens

swapab_cutedsl_megakernel

Skill "swapab_cutedsl_megakernel" from flashinfer-ai/flashinfer, covering updating the sm120 swap-ab cutedsl megamoe kernel src, layout, when the kernel team drops a new version of src/ and what not to update here.

flashinfer-ai/flashinfer · 0 tokens

cpp-expert

Expert-level C++ development with modern C++20/23, STL, memory management, and performance. Use when the user mentions C++, C++20, C++23, the STL, templates, or performance, or when the task involves Modern C++ Features, Memory Management, Ranges and Views, or Coroutines.

personamanagmentlayer/pcl · 70 tokens

write-cuda-reduction-kernel

Guide the agent through designing and implementing a correct, efficient CUDA reduction kernel for a given operator (sum, max, min, or custom binary associative op), covering warp-level primitives, block-level reduction, multi-block strategies, and when to use CUB instead.

tensormux/kernel-skills · 0 tokens