CtrlK
BlogDocsLog inGet started
Tessl Logo

evilissimo/naming-things

Reviews and improves **names** in code — variables, functions, classes, modules, parameters — for clarity, intent, and consistency with language/team conventions. Triggers when asked to review names, rename things, improve code readability, clean up confusing code, or when examining code with generic/vague names like "data", "info", "manager", "temp", "util". Does NOT trigger for general code review unrelated to naming, architecture design, debugging, or performance optimization. Identifies naming anti-patterns (generic names, misleading names, type-encoding, abbreviations), suggests role-based names that reveal intent, checks consistency with project/domain vocabulary, and flags misalignment with language culture.

91

1.05x
Quality

90%

Does it follow best practices?

Impact

94%

1.05x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

cpp.mdreferences/

C++ Naming Conventions

C++ has more variation in naming conventions than most languages because of its long history, multiple major style guides, and lack of a single official formatter. Always check the project's existing style first.

Major Style Guides

GuideConventionDomains
Google Stylesnake_case for variables/functions, PascalCase for typesChromium, Google projects
LLVM/ClangcamelCase for variables, PascalCase for typesLLVM, Clang, Swift
Boostsnake_case with _t suffix for typesBoost libraries
QtcamelCase methods, PascalCase classes prefixed with QQt framework
MicrosoftPascalCase for public, camelCase for private with m_ prefixWindows, .NET interop
Standard Librarysnake_case, lower-case typesstd::vector, std::sort

Convention Table (Most Common — Standard Library + Google-Influenced)

ThingConventionExample
Variablesnake_caseuser_name, total_count
Function / methodsnake_casecalculate_total(), get_user()
Class / struct / enumPascalCaseCustomerOrder, HttpClient
Template parameterPascalCasetemplate <typename T>
MacroSCREAMING_SNAKE_CASEASSERT_TRUE(x), PI
Constant / constexprkPascalCase or SCREAMING_SNAKEkMaxRetryCount, BUFFER_SIZE
Namespacesnake_caseorder_processing, net::http
Member variablesnake_case_ (trailing _) or m_snake_casename_, m_count
Getter / settersnake_case matching membername(), set_name()
Boolean predicateis_ / has_ / can_ prefixis_empty(), has_next()

Key Points

  • The most important rule: follow the project's existing convention, not your personal preference
  • Private member variables commonly use trailing underscore (name_) or m_ prefix (m_name)
  • Getters usually drop get_: user.name() not user.get_name()
  • Setters use set_ prefix: user.set_name("Alice")
  • Boolean functions use is_, has_, can_: container.is_empty(), socket.has_data()
  • Avoid _ prefix for private members — reserved for implementation by the standard
  • Macros are SCREAMING_SNAKE and should be rare — prefer constexpr or templates
  • Template type parameters: single uppercase for simple cases (T, K, V), PascalCase for descriptive (TEntity, Allocator)
  • No Hungarian notation — modern C++ doesn't use strName, pBuffer prefixes
  • auto type deduction doesn't change naming rules — still name by role

Common Offenses

BadGoodReason
char* pszNamestd::string nameLegacy Hungarian; modern C++ uses types
void DoSomething()void do_something() or void ProcessOrder()Pick one style and stick to it
int tmpint scratch / int buffer_sizetmp doesn't express role
obj / ptritem / node / handleType-encoding without meaning
datarecords, entries, resultsGeneric — what data?
i, j, k outside loopsindex, row, colFine for loops; bad for wider scope

SKILL.md

tile.json