style

A set of rules for formatting and writing C++ code, including indentation, line length, headers, names, and comments. C++ is a programming language used for applications and systems software.

In plain words
What is it for?
Use it when creating or editing C++ files under these style guidelines.
Why use it?
It gives the coding agent consistent decisions about how C++ code should look and be organized.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/git-hulk/instructions/style
Clone the repo
git clone --depth 1 https://github.com/git-hulk/instructions
Per session 991 This file is loaded in full into every session.
When invoked 991 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00991 $0.00991
Opus 5 $0.00495 $0.00495
Sonnet 5 $0.00198 $0.00198
Haiku 4.5 $0.00099 $0.00099

Measured yesterday against content hash 0025f5511aaf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

style scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Cursor/C++/style.mdc · 57 lines

How it starts

The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor C++ Style Rules

Formatting

  • Use only spaces for indentation; indent 2 spaces at a time. Do not use tabs.
  • Each line should be at most 80 characters long, except for certain cases (e.g., long URLs, include statements).
  • Function declarations: return type on the same line as the function name if possible; wrap parameters as needed, indenting wrapped lines by 4 spaces.
  • Function calls: arguments may be on the same line or wrapped and aligned; use a 4 space indent for wrapped arguments.
  • Braced initializer lists are formatted like function calls.
  • Place the opening curly brace at the end of the function declaration line; closing brace on its own line or with the opening brace if short.
  • Use spaces around assignment and most binary operators; no spaces around period or arrow for member access.
  • Minimize vertical whitespace; do not use more than one or two blank lines between functions.
  • Do not introduce trailing whitespace; remove it if editing a line.
  • Do not indent within namespaces; namespace contents are not indented.

Header Files

  • Header files should be self-contained and end in .h. Use .inc only for non-header files meant for inclusion at specific points.
  • All header files must have #define guards in the format H.
  • Include what you use: if a file refers to a symbol, it must directly include the header that provides it.
  • Avoid forward declarations; prefer including the needed headers.
  • Only define short functions inline in headers; longer functions should be in .cc files unless required for templates or performance.
  • Include headers in this order: related header, C system headers, C++ standard library headers, other libraries' headers, your project's headers. Separate groups with a blank line and order alphabetically within each group.

Naming

  • Use descriptive names that make intent clear to new readers, even those outside your team.
  • Filenames: all lowercase, use underscores or dashes, and be specific (e.g., my_class.cc, my_class.h).
  • Type names (classes, structs, enums, type aliases, concepts): use UpperCamelCase (e.g., MyClass, MyEnum).
  • Variable names (including function parameters): use snake_case (e.g., my_variable). Class data members have a trailing underscore (e.g., value_); struct members do not.
  • Constant names: use a leading 'k' and UpperCamelCase (e.g., kMaxValue).
  • Function names: use UpperCamelCase (e.g., AddEntry). Accessors/mutators may be named like variables.
  • Namespace names: use snake_case.
  • Enumerator names: use constant-style naming (e.g., kEnumValue).
  • Macro names: use ALL_CAPS with a project-specific prefix (e.g., MYPROJECT_MACRO_NAME).
  • Template parameters: type parameters use UpperCamelCase; non-type parameters use variable/constant rules.
  • Avoid abbreviations unless widely known; do not delete letters within words.

Read the full file on GitHub · 57 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 57 lines · 991 tokens per session scan A 0025f5511aaf

Subscribe to this mod's changes

style is a cursor rule published in the GitHub repository git-hulk/instructions (1 stars, last pushed 1y ago), licensed Apache-2.0. It adds 991 tokens to every session, about $0.0050 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.