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

rust.mdreferences/

Rust Naming Conventions

Based on Rust API Guidelines (RFC 430) and common ecosystem conventions.

Convention Table

ThingConventionExample
Variablesnake_caseuser_name, total_count
Function / methodsnake_casecalculate_total(), get_user()
Type (struct, enum, trait)PascalCaseCustomerOrder, HttpClient
Modulesnake_caseorder_processing/
ConstantSCREAMING_SNAKE_CASEMAX_RETRY_COUNT
StaticSCREAMING_SNAKE_CASEGLOBAL_CONFIG
Enum variantPascalCaseOption::Some, Result::Ok
Type parameterSingle uppercase or PascalCase<T>, <E>, <TEntity>
Lifetime parameterSingle lowercase'a, 'b, 'ctx
Macrosnake_caseprintln!, vec!
Attributesnake_case#[derive(Debug)]
Cratesnake_case (single word preferred)serde, tokio, reqwest
Feature flagsnake_caseasync, serde-support
Constructornew() or from_*() or with_*()Config::new(), from_str()
Conversionas_*() (borrowed), to_*() (owned), into_*() (consuming)as_str(), to_string(), into_inner()

Key Points

  • Getter methods don't need a get_ prefix: user.name() not user.get_name() (exception: if there's also a set_name())
  • Return type hints in names: into_iter() (consuming), as_slice() (borrowed)
  • Error types should end in Error: ValidationError, NotFoundError
  • Result type aliases use Result<T> (already in std) — don't create MyResult
  • Boolean predicates use is_ prefix: is_empty(), is_some(), has_permission()
  • Iterator methods use iter(), iter_mut(), into_iter() conventions
  • Builder pattern methods use .with_*() or .set_*() returning Self
  • Avoid unsafe in names — unsafe blocks are already marked with unsafe keyword
  • Module-level docs prefer //! inner doc comments explaining the module's purpose

Trait Naming

  • Behavioral traits: verbs or verb phrases: Display, Clone, Read, Write, IntoIterator
  • Structural traits: adjectives or nouns: Sized, Unpin, Eq
  • Marker traits: PascalCase, typically single word: Send, Sync, Copy
  • Trait bounds use where clause for complex bounds rather than inline

Common Offenses

BadGoodReason
get_name()name()Rust idiom: getters drop get_
convert_to_string()to_string()Follow standard conversion naming
MyStruct::new(x: i32)MyStruct::from(x) or with_x(x)new() takes no args by convention
do_thing()process_order(), send_request()Too generic
data / inforecords, users, configName by role, not catch-all
err (as Result)Name the success variantMatch on meaningful names, not err

SKILL.md

tile.json