Cpp Modules
C++20 modules guide covering named modules, partitions, header units, CMake FILE_SET setup, and Clang/GCC build flags.
- CCM score
- 64 of 100
- skills.sh installs
- 669
- GitHub stars
- 303
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers named module interface units, module partitions, header units, and migrating legacy headers to C++20 modules
- Includes Clang
--precompileand-fmodule-file=workflows, GCC-fmodules-tsbuilds, and a CMake 3.28FILE_SET CXX_MODULESexample - Tabulates common errors such as
module not found, macros unavailable after import, and stale BMI caches, with fixes - Designed for C++ projects adopting modules from headers, including wrapping C libraries through the Global Module Fragment
Install
$ npx -y skills add mohitmishra786/low-level-dev-skills --skill cpp-modules -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
C++20 Modules
Purpose
Guide agents through authoring, building, and debugging C++20 modules: named modules vs header units, module partitions, CMake integration, compiler-specific flags, and interoperability with legacy headers.
Triggers
- "How do I write a C++20 module?"
- "How do I import a module in CMake?"
- "What's the difference between a named module and a header unit?"
- "My module gives 'cannot find module' errors"
- "How do I use C++20 modules with Clang?"
- "How do I migrate from headers to modules?"
Workflow
1. Module concepts overview
C++20 module kinds:
├── Named module interface unit (.cppm / .ixx) — exports declarations
├── Module implementation unit (.cpp) — defines module members
├── Module partition (.cppm) — internal module subdivision
└── Header unit (any header) — import a legacy header as module
Named modules are the primary target. Header units are a bridge for legacy code. Avoid Global Module Fragment unless required for macro access.
2. Named module — minimal example
Details
- Repository
- github.com/mohitmishra786/low-level-dev-skills
- First seen
- Jun 3, 2026
Questions
What does the cpp-modules skill help with?
The cpp-modules skill guides agents through writing, building, and debugging C++20 modules, including named modules, module partitions, and header units. It also covers CMake MODULE_SOURCES setup, Clang -fmodules-ts flags, and BMI caching issues. It is aimed at developers migrating legacy headers to modules.
How do I install the cpp-modules skill?
Run npx -y skills add mohitmishra786/low-level-dev-skills --skill cpp-modules -y in your project. After installing, the agent can write named module interface units and partitions for you. It can also set up CMake FILE_SET CXX_MODULES targets and debug module import errors.
What is the difference between a named module and a header unit in C++20?
A named module is the primary target, declared with export module and imported with import. A header unit lets you import a legacy header such as iostream with import, but it does not pass macros to importers. The skill explains both and when to use the Global Module Fragment for macro access.
Why does my C++ module give a 'cannot find module' error?
That error usually means the BMI file is not in the search path, so the interface unit must be compiled first. The skill checks -fmodule-file= flags and the build order. It also covers stale BMI caches in .pcm and .gcm files.
More from mohitmishra786/low-level-dev-skills
All 54- Hardware Counters666
- Debug Optimized Builds652
- Rustc Basics649
- Cpp Templates648
- Rust Cross642
- Wasm Emscripten628
- Zig Debugging617
- Zig Build System616
- Wasm Wasmtime599
- Zig Cross598
- Zig Cinterop586
- Cmake2K
- Static Analysis1.4K
- Gdb1.3K
- Llvm1K
- Sanitizers1K
- Core Dumps948
- Assembly X86947
- Linux Perf916
- Clang904
- Valgrind851
- Gcc842
- Cross Gcc837
- Flamegraphs837
Similar to Cpp Modules
mesonSkillmohitmishra786/low-level-dev-skills685 installsMeson setup, wrap dependencies, options, and cross-compilation for C/C++ projects, plus CMake migration guidance.
static-analysisSkillmohitmishra786/low-level-dev-skills1.4K installsGuide for running and triaging clang-tidy, cppcheck, and scan-build on C/C++ code with CI integration.
simulink-modelingPluginmatlab/simulink-agentic-toolkit1.4K starsConfigure and integrate C/C++ and Python code into Simulink models via C Function and Python Code blocks
bun-ffiSkillsecondsky/claude-skills409 installsReference guide for calling C/C++ native libraries from Bun through the bun:ffi module.
nginx-c-modulesSkillpproenca/dot-skills384 installsReference guide of 49 rules for writing, reviewing, and refactoring nginx C modules safely.
ue-module-build-systemSkillquodsoler/unreal-engine-skills1.7K installsBuild-system rules for Unreal Engine 5.8 modules, plugins, and build errors, verified against the engine headers.