Sign in
Explore
Prompts · RulesEveryday codingReviewed

cpp

Modern C++ and CMake: clear structure, RAII, const-correctness and safe error handling.

Kind
Rules
Works with
Cursor
Languages
C / C++
Source
Awesome Cursor Rules @ b044f956f021
Path
rules/cpp.mdc
Jobs
Implementation

Credit

Made by
PatrickJS
Original
github.com/PatrickJS/awesome-cursorrules/blob/b044f956f021b6e…
License
CC0-1.0

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • Text to merge into your CLAUDE.md or AGENTS.md (no new files)
Runs scripts
None found
Uses the network
None found
Needs secrets
None found
Source revision
b044f956f021
Licence
CC0-1.0
Last activity
30 May 2026
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

# C++ Programming Guidelines

## Basic Principles

- Use English for all code and documentation.
- Always declare the type of each variable and function (parameters and return value).
- Create necessary types and classes.
- Use Doxygen style comments to document public classes and methods.
- Don't leave blank lines within a function.
- Follow the one-definition rule (ODR).

## Nomenclature

- Use PascalCase for classes and structures.
- Use camelCase for variables, functions, and methods.
- Use ALL_CAPS for constants and macros.
- Use snake_case for file and directory names.
- Use UPPERCASE for environment variables.
- Avoid magic numbers and define constants.
- Start each function with a verb.
- Use verbs for boolean variables. Example: isLoading, hasError, canDelete, etc.
- Use complete words instead of abbreviations and ensure correct spelling.
  - Except for standard abbreviations like API, URL, etc.
  - Except for well-known abbreviations:
    - i, j, k for loops
    - err for errors
    - ctx for contexts
    - req, res for request/response parameters

## Functions

- Write short functions with a single purpose. Less than 20 instructions.
…