naming-conventions
Installation
SKILL.md
Naming Conventions
Coverage
- Identifier morphology: verb-noun selection (
getvsfetchvsload), plural vs singular for collections, prefix/suffix conventions (is/has/shouldfor booleans,usefor React hooks) - Casing per artifact kind: kebab-case (file names, URL paths, CLI flags), camelCase (JavaScript/TypeScript variables and functions), PascalCase (types, classes, components, React JSX), snake_case (Python, SQL columns, environment variables when convention demands), SCREAMING_SNAKE_CASE (constants, env-var keys)
- Abbreviation rules: when an abbreviation is universally known (
url,id,api), when it requires expansion (cust→customer), and when team-internal jargon must be avoided in public-facing names - Name-vs-path semantics: the difference between what an artifact is called and where it lives; when name and path agree (file system) vs when they diverge (TypeScript module re-exports, npm-published package paths)
- Rename coordination: how to update every reference in the same commit, when to ship a deprecation alias, and how to detect missed call sites with grep
- Names that lie: identifiers whose words promise a behaviour the code does not deliver, and how to detect them (the function called
getXthat also writes; the boolean calledisReadythat means "should be ready"; the column calledcreatedthat stores the ship date) - Cross-cutting consistency: when a naming choice in one part of the codebase forces a related choice elsewhere (table column
customer_idand TypeScript typeCustomer.id)
Philosophy
Names are the most-read part of any codebase. Every reader pays the cost of a bad name; only the author pays the cost of choosing well. The single most valuable property of a name is truthfulness: a name that lies — about what an artifact does, returns, or means — is more harmful than a name that is merely unclear. The second-most-valuable property is consistency with sibling names: a function called getOrders should sit alongside getCustomers, not loadCustomers. The third is brevity, and only the third — short names that mislead are not a virtue.
When a name does not fit, the answer is almost always to rename, not to add a comment explaining what the name "really" means. Comments rot; renames travel with the code.