rules-cpp

Enforce C++ coding rules for style, naming, and safety with clang-format and sanitizers.

4|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/NSObjects/specpowers --skill rules-cpp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules-cpp
Source: https://github.com/NSObjects/specpowers/tree/main/skills/rules-cpp
Command: npx skills add https://github.com/NSObjects/specpowers --skill rules-cpp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It keeps C++ teams from producing inconsistent code by extending universal rules with explicit guidance for naming, formatting, resource management, testing, and modern idioms.

Core Features & Use Cases

  • Naming and Style Discipline: Pick and enforce a single C++ naming convention, manage include organization, and rely on clang-format and clang-tidy across the codebase.
  • Modern C++ and Resource Management: Favor smart pointers, RAII, constexpr, and sanitizer-ready test builds while avoiding raw memory and unsafe casting decisions.
  • Testing and Review Workflow: Specify Google Test or Catch2 usage, validate AddressSanitizer and UBSanitizer coverage, and audit reviews for raw new/delete or missing override qualifiers before committing.

Quick Start

Ask the rules-cpp guidance to align your new C++ work with smart pointer RAII practices, clang-format standards, and sanitizer-backed testing.

Frequently Asked Questions about rules-cpp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce RAII and smart pointer usage in C++ code reviews?

Apply consistent C++ coding rules to guide naming conventions, organize includes, and enforce clang-format and clang-tidy standards across the codebase to prevent style fragmentation.

Does this C++ coding rules guidance integrate with clang-format and sanitizer testing builds?

Yes, the C++ coding rules integrate clang-format for formatting, validate AddressSanitizer and UBSanitizer coverage in test builds, and support Google Test or Catch2 for testing hygiene.

What is the best way to standardize C++ naming conventions and include organization across teams?

Standardize C++ naming conventions by enforcing a single style guide that manages include organization and applies clang-format and clang-tidy uniformly across the codebase.

How do I configure explicit C++ inheritance policies and avoid unsafe casting?

Configure explicit C++ inheritance policies by applying coding rules that audit reviews for missing override qualifiers and actively guide decisions to avoid unsafe memory casting.

Can I use these C++ coding rules for modernizing an existing codebase with raw memory?

Yes, you can use these C++ coding rules to modernize existing codebases by replacing raw memory with smart pointers, enforcing RAII practices, and validating sanitizer-backed test builds.