Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add margelo/react-native-skills --skill cpp -a claude-code
Open on GitHub

What 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::optional fields with a std::variant, model the states as types.
  • Remove std::mutex from 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-code

2Manually: put the files in place

~/.claude/skills/cpp/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cpp/

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.

cpp Mindrally cpp is a Claude Code skill that guides modern C++17 and C++20 coding, enforcing memory-safe practices without raw pointers, leaks, or outdated C constructs. CX Codex +1 829installs cpp-pro davila7 cpp-pro guides Claude Code to write modern C++ using RAII, smart pointers, and STL algorithms. Useful when building high-performance applications. CX Codex +1 70installs modern-cpp trailofbits modern-cpp directs C++ development toward C++20/23/26 idioms, replacing dangerous raw pointers, legacy macros, and SFINAE boilerplate with memory-safe patterns. CX Codex +1 1,800installs cpp-expert 0xfurai cpp-expert — a subagent for modern C++ development focused on RAII, C++ Core Guidelines, CMake builds, and sanitizer-clean code. CX Codex ★ 1,029repo stars memory-safety-patterns Seth Hobson memory-safety-patterns — a Claude Code skill covering memory-safe patterns in Rust, C++ and C. It kicks in for systems code, resource handling and hunting down memory bugs. CX Codex +1 11,746installs build-acceleration mohitmishra786 build-acceleration — a Claude Code skill that teaches the agent how to cut C/C++ compile times. Kicks in on slow builds and walks through caching, distributed compilation, and link time fixes. CX Codex +1 597installs qt-cpp-docs qt-ai-skills The qt-cpp-docs skill reads your C++ headers and sources in a Qt project and writes standalone Markdown reference pages from them. Handy when an API needs documenting instead of hand-written notes. CX Codex +1 897installs

From the same set9

build-nitro-modules build-nitro-modules walks through building a React Native Nitro Module: HybridObject TypeScript specs, nitrogen codegen, native Swift, Kotlin and C++ implementations. CX Codex +1 1,700installs react-native-mmkv Works in Codex, Cursor, Copilot, Gemini CLI and OpenCode too. It keeps AI assistants on the real react-native-mmkv API — a synchronous key-value store built on the MMKV engine. CX Codex +1 1,700installs api-design The api-design skill shapes and reviews public APIs for TypeScript, JavaScript, React, and React Native libraries before implementation. CX Codex +1 1,400installs kotlin A skill for Kotlin and Android API work: it pushes typed state modeling, explicit async boundaries, and keeps blocking calls out of properties. Useful when you touch .kt files or a Nitro Module wrapper. CX Codex +1 1,300installs swift A skill for Swift work: type-safe API design, concurrency choices, Apple-platform integration. Fires when edits touch .swift files, async/await, DispatchQueue, or Nitro Modules. CX Codex +1 1,300installs react-native-vision-camera react-native-vision-camera — a routing skill for VisionCamera v5 in React Native: it tells the agent which reference to load for the task and which v5 rules to respect. CX Codex +1 776installs nitro-fetch Points AI assistants at the real react-native-nitro-fetch APIs instead of invented ones: fetch, WebSocket, TextDecoder, prefetching. CX Codex +1 668installs react-native-vision-camera-realtime react-native-vision-camera-realtime guides low-latency VisionCamera v5 architecture for real-time video processing. It helps implement zero-copy GPU paths, Nitro plugins, and Skia or WebGPU overlays. CX Codex +1 147installs

Project sponsors

Companies that keep this analytics open