cpp · margelo — Claude Code skill for C++ API design and native code
A skill that sets rules for C++ design: type modeling, ownership, file boundaries and async. Fits .cpp, .hpp, CMake and C++-backed Nitro modules.
no license 1,300 installs ★ 181 updated 2026-08-21
npx skills add margelo/react-native-skills --skill cpp -a claude-codeWhat cpp does
This skill covers C++ code that needs explicit ownership and predictable native integration. It tells the agent to read generated headers and local ownership patterns first, then model valid states with types before touching behavior.
Rules cover RAII, std::variant, std::optional and smart pointers. Variants should be expressed through std::variant, inheritance or separate concrete types, not one struct with many optional fields. Raw owning pointers are off the table, and std::mutex is a last resort.
File names act as scope contracts. HybridDataScanner.cpp implements only HybridDataScanner; geometry conversions and UI helpers belong in their own files. Files under roughly 300 lines are usually fine. For Nitro modules, the skill requires inheriting from the generated Hybrid*Spec and using std::shared_ptr<Promise<T>> in async methods. Pair it with build-nitro-modules for generated specs and CMake setup.
What it helps with
- design a C++ API with explicit ownership and types
- split a large .cpp file by responsibility
- remove race fixes that rely on sleep_for or extra mutexes
- set async boundaries without blocking caller threads
- match generated HybridObject specs exactly
Example prompts for the agent
- Review
HybridDataScanner.cpp: what does not belong to this class and where should it move? - Replace these
std::optionalfields with astd::variant, model the states as types. - Remove
std::mutexfrom the callbacks and propose a thread owner for this code.
How to install cpp
1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill cpp -a claude-code2Manually: put the files in place
~/.claude/skills/cpp/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/cpp/
1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill cpp -a codex2Manually: put the files in place
.agents/skills/cpp/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill cpp -a cursor2Manually: put the files in place
.cursor/skills/cpp/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install margelo/react-native-skills skills/cpp2Manually: put the files in place
.github/skills/cpp/SKILL.md1Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill cpp -a gemini-cli2Platform CLI
gemini skills install https://github.com/margelo/react-native-skills --path skills/cppManually: put the files in place
.devin/skills/cpp/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add margelo/react-native-skills --skill cpp -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about cpp
How do I install cpp in Claude Code?
Run npx skills add margelo/react-native-skills --skill cpp -a claude-code. The skill ends up at ~/.claude/skills/cpp/SKILL.md.
What does the cpp skill do?
It defines rules for modern C++: type-safe state modeling, file organization, RAII ownership and async boundaries. It also spells out requirements for C++-backed Nitro modules.
Does it fit C++ inside React Native Nitro modules?
Yes. The skill describes HybridObject work: inheriting from the generated Hybrid*Spec, copying signatures exactly, and using std::shared_ptr<Promise<T>> for async methods. Pair it with build-nitro-modules for spec generation and CMake.
Similar skills
All skills for Programming languages →cpp by other authors comes first.