This is your reference when touching C++20 modules, which are still rough around the edges despite being standardized. It walks through named modules versus header units, module partitions, and the Global Module Fragment trick for preserving macro access. The CMake section is solid (requires 3.28+ with FILE_SET CXX_MODULES) and the compiler flag examples for Clang and GCC will save you from the usual "module not found" spiral. The error table is honest about common gotchas like stale BMI caches and ODR violations across partitions. Use this when migrating from headers or debugging why your build system can't find the precompiled module files.

skills.sh installs
597
GitHub stars
279
last updated
Aug 21, 2026

Install

$ npx -y skills add mohitmishra786/low-level-dev-skills --skill cpp-modules --agent claude-code

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/mohitmishra786/low-level-dev-skills
First seen
Jun 3, 2026

More from mohitmishra786/low-level-dev-skills

All 54

Recommended

1juliusbrussee avatarcavemanjuliusbrussee/cavemanUltra-compressed communication mode. Cuts output tokens 65% (measured) by speaking like caveman while keeping full technical accuracy. Supports intensity levels618.3Kskills.sh installs
2mattpocock avatargrill-memattpocock/skillsA relentless interview to sharpen a plan or design.1.5Mskills.sh installs
3shadcn avatarimproveshadcn/improveSurvey any codebase as a senior advisor and produce prioritized, self-contained implementation plans for OTHER models/agents to execute. Strictly read-only on s40Kskills.sh installs
4obra avatarsystematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes326.7Kskills.sh installs
5forrestchang avatarkarpathy-guidelinesforrestchang/andrej-karpathy-skillsBehavioral guidelines to reduce common LLM coding mistakes through explicit assumptions, simplicity, and verifiable success criteria.17.9Kskills.sh installs
6vercel-labs avatarfind-skillsvercel-labs/skillsHelps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express int4.3Mskills.sh installs