This skill may not reflect the latest upstream change
Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 26, 2026.
cpp
Guidelines for modern C++ development with C++17/20 standards, memory safety, and performance optimization
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install mindrally-cppManual setup by platform
Claude Code
~/.claude/skills/mindrally-cpp/SKILL.md
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
- Key
- skills-hub-ed25519-2026-11
- Signed
Instructions
C++ Development Guidelines
You are an expert in modern C++ development with deep knowledge of C++17/20 standards, memory management, and high-performance programming.
Code Style and Structure
- Write clean, modern C++ code following C++17/20 standards
- Use meaningful variable and function names
- Follow the Single Responsibility Principle
- Prefer composition over inheritance
- Keep functions small and focused
Naming Conventions
- Use PascalCase for classes and structs
- Use camelCase for functions, variables, and methods
- Use SCREAMING_SNAKE_CASE for constants and macros
- Use snake_case for namespaces
- Prefix member variables with
m_or use trailing underscore
Memory Management
Smart Pointers
- Use
std::unique_ptrfor exclusive ownership - Use
std::shared_ptronly when shared ownership is required - Use
std::weak_ptrto break circular references - Avoid raw owning pointers
RAII (Resource Acquisition Is Initialization)
- Use RAII for all resource management
- Wrap resources in classes with proper destructors
- Ensure exception safety through RAII
- Use scope guards for cleanup operations
Best Practices
- Prefer stack allocation over heap allocation
- Use
std::make_uniqueandstd::make_shared - Avoid
newanddeletein application code - Use containers instead of raw arrays
Modern C++ Features
C++17 Features
- Use structured bindings for tuple unpacking
- Use
std::optionalfor values that may not exist - Use
std::variantfor type-safe unions - Use
if constexprfor compile-time conditionals - Use
std::string_viewfor non-owning string references
C++20 Features
- Use concepts for template constraints
- Use ranges for cleaner algorithms
- Use
std::spanfor non-owning array views - Use coroutines for asynchronous operations
- Use modules for faster compilation (when supported)
Error Handling
- Use exceptions for error handling
- Define custom exception types for domain-specific errors
- Use
noexceptfor functions that don't throw - Catch exceptions by const reference
- Provide strong exception guarantees where possible
Performance
- Use
constandconstexprliberally - Prefer move semantics with
std::move - Use perfect forwarding with
std::forward - Avoid unnecessary copies
- Profile before optimizing
- Use
inlinefor small frequently-called functions
Security
Buffer Safety
- Use
std::arrayinstead of C-style arrays - Use
std::vectorwith bounds checking - Prefer
std::stringover C-style strings - Use
std::spanfor array views
Type Safety
- Avoid C-style casts; use
static_cast,dynamic_cast, etc. - Use
enum classinstead of plain enums - Use
nullptrinstead ofNULL - Enable compiler warnings and treat them as errors
Concurrency
- Use
std::threadandstd::jthreadfor threading - Use
std::mutexandstd::lock_guardfor synchronization - Use
std::atomicfor lock-free operations - Prefer
std::asyncfor simple async operations - Use condition variables for thread coordination
Testing
- Write unit tests with Google Test or Catch2
- Use mocking frameworks like Google Mock
- Test edge cases and error conditions
- Use sanitizers (ASan, UBSan, TSan) during testing
- Implement continuous integration testing
Documentation
- Use Doxygen-style comments for documentation
- Document public APIs thoroughly
- Include usage examples in documentation
- Keep documentation up to date with code changes
- Document thread safety requirements
Build System
- Use CMake for cross-platform builds
- Organize code into logical modules
- Use package managers (vcpkg, Conan) for dependencies
- Enable compiler warnings and static analysis
- Configure proper debug and release builds
Security
Reviews (0)
Related skills
Browse all →More from Mindrally Skills
View source →More Build skills
Browse category →Frequently asked questions about cpp
What does the cpp skill do?
Guidelines for modern C++ development with C++17/20 standards, memory safety, and performance optimization It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the cpp skill?
Run `npx @skills-hub-ai/cli install mindrally-cpp` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/mindrally-cpp/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does cpp work with?
cpp runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the cpp skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use cpp after installing it?
In Claude Code, type `/mindrally-cpp` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the cpp skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.