cpp-modules

cpp-modules is a skill for Codex from OutlineDriven/outline-driven-development. It costs 50 tokens per session (1,418 once invoked), scanned A, original, Apache-2.0.

A guide to C++20 modules, a way to organise and compile C++ code without relying only on traditional header files. It covers module layouts, partitions, header units, and CMake build setup.

In plain words
What is it for?
Use it to design a module layout, choose compiler commands, connect modules to CMake, and diagnose module-build failures.
Why use it?
It explains module-related compiler and build errors, including missing modules, redefinitions, and stale compiled module data.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to design a module layout, choose compiler commands, connect modules to CMake, and diagnose module-build failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/outlinedriven/outline-driven-development/cpp-modules
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 OutlineDriven/outline-driven-development --skill cpp-modules
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/outline-driven-development

Made for: Codex.

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-modules

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/outlinedriven/outline-driven-development/cpp-modules"><img src="https://agentmods.dev/badge/skills/outlinedriven/outline-driven-development/cpp-modules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,418 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.00050 $0.01418
Opus 5 $0.00025 $0.00709
Sonnet 5 $0.00010 $0.00284
Haiku 4.5 $0.00005 $0.00142

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

Security

Grade A, and why

cpp-modules 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 3d 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.

.devin/skills/cpp-modules/SKILL.md · 71 lines

How it starts

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

C++20 modules

Contract

Field Bound contract
Trigger The user writes or builds export module code, asks how named modules differ from header units, needs the CMake wiring for module interface units, or gets a module-not-found, redefinition, or stale-BMI error.
Authority Read-only. The skill emits module source shapes, compiler invocations, and CMake snippets to chat; the user applies them. Rollback is not needed. No remote mutation.
Side effect Chat output. Any scratch build to confirm a flag runs on scratch files.
Done The module layout, the per-compiler build commands, and the CMake wiring are reported for the user's compiler and CMake version, and every error in the request maps to a cause and fix.

Inputs

  • Compiler and version: required. Clang 23.1.0 and GCC 16.2 are current stable; both accept the commands below.
  • CMake version when CMake is in use: required. Current stable is 4.4.3; the stable CXX_MODULES file set needs 3.28 or later.
  • Generator: required with CMake. Ninja 1.11 or later, Ninja Multi-Config, or Visual Studio; Makefile generators do not support modules.
  • Module layout the user has or wants: required. Primary interface, partitions, implementation units, and any legacy headers with macros.

Procedure

  1. Classify each translation unit. Primary interface unit: export module m; in a .cppm (or .ixx) file. Partition interface: export module m:part;, re-exported from the primary with export import :part;. Implementation unit: module m; with no exports. Header unit: import <vector>; or import "local.h";, a bridge for legacy headers. Prefer named modules; use header units only to bridge. Done when: every file has one classification.
  2. Handle macros. Macros do not cross import. Code that needs a header's macros puts #include in the global module fragment: a file that opens with module;, then the includes, then export module m;. Wrap a C library the same way and re-export with export using ::name;. Done when: every macro dependency is in a global module fragment.
  3. Build with Clang. Precompile the interface: clang++ -std=c++20 --precompile math.cppm -o math.pcm. Compile users against it: clang++ -std=c++20 -fmodule-file=math=math.pcm -c main.cpp -o main.o. Link the interface's object as well: clang++ -std=c++20 -fmodule-file=math=math.pcm math.pcm main.o -o prog. Done when: the three commands are given in dependency order.
  4. Build with GCC. g++ -std=c++20 -fmodules-ts -c math.cppm -o math.o writes math.gcm under gcm.cache/ in the working directory, and g++ -std=c++20 -fmodules-ts main.cpp math.o -o prog finds it there. GCC 16 also accepts -fmodules; both spellings compile on the installed 16 line. Done when: the interface is compiled before its importers and the cache directory is named.
  5. Wire CMake 3.28 or later:

Read the full file on GitHub · 71 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 71 lines · 50 tokens per session scan A 825c1139b492

Subscribe to this mod's changes

cpp-modules is a skill published in the GitHub repository OutlineDriven/outline-driven-development (52 stars, last pushed 4d ago), licensed Apache-2.0. It adds 50 tokens to every session and 1,418 once invoked, about $0.0003 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-09-06.

Related

Other skills, from other repositories

bounded-model-checking-c

Use when C or C++ code needs memory-safety or undefined-behavior guarantees proved with CBMC, or ACSL contracts checked with Frama-C Eva or WP. Not for choosing the proof policy: use proof-driven.

OutlineDriven/odin-claude-plugin · 52 tokens

cpp-modules

C++20 modules skill for modern C++ projects. Use when working with named modules, module partitions, header units, CMake MODULESOURCES, Clang -fmodules-ts, BMI caching issues, or migrating from headers to modules. Activates on queries about C++20 modules, import statements, module interface units, header units, or BMI…

mohitmishra786/low-level-dev-skills · 76 tokens

openmp

OpenMP skill for shared-memory parallel programming. Use when writing parallel for loops, reductions, task parallelism, SIMD directives, GPU offloading, or profiling with Score-P/TAU. Activates on queries about OpenMP, pragma omp, schedule static dynamic, reduction, false sharing, or OMPNUMTHREADS.

mohitmishra786/low-level-dev-skills · 67 tokens

cpp

Use when writing modern C++ (17/20/23). Covers RAII, smart-pointer ownership, move semantics, ranges, concepts, and eliminating undefined behavior with sanitizers.

nimadorostkar/Claude-Skills-collection · 38 tokens

arduino-code-generator

Generate Arduino and embedded C++ snippets for sensors, actuators, buses, state machines, timing, data logging, and hardware abstraction. Use when a user requests implementation code and provide the exact board, framework, toolchain, pins, voltage, memory, and library versions first. Bundled templates target UNO…

wedsamuel1230/arduino-skills · 86 tokens

unreal-gas

Expert guide for Unreal Engine 5.x Gameplay Ability System (GAS) C++ development. Covers AbilitySystemComponent, GameplayAbilities, GameplayEffects, Attributes/AttributeSets, GameplayTags, GameplayCues, AbilityTasks, prediction/replication, and common patterns. Use when the user asks about GAS, gameplay abilities…

maystudios/claude-skills · 149 tokens