Naming
This skill is mandatory. Follow these rules whenever naming anything in code.
Hierarchy of Authority
- •These rules - non-negotiable baseline (e.g., no ALL_CAPS)
- •Project conventions - existing patterns in the codebase
- •Language/framework conventions - ecosystem standards
Always check the project first. Consistency within the project trumps external standards.
Core Rules
- •
Never ALL_CAPS for names - use language features (
const,final,readonly) to express immutability. Exception: PHPdefine()constants follow WordPress convention. Note: Claude Code metadata files use capital case (Skill.md, Claude.md). - •
Avoid abbreviations - spell words out. Exception: universally understood shortenings of long words (
info,max,min,config). - •
Market-defined acronyms are fine -
Url,Http,Api,Html,Css,Idare acceptable. Don't invent project-specific acronyms users must learn. - •
Context informs naming - the container (class, folder, namespace) provides context.
user.isValid()notuser.isUserValid().utils/dates.tsnotdate-utils.ts. - •
No redundant suffixes -
usersnotuserList. The type system or structure already tells you. - •
Hide implementation details - name the interface, not the mechanism.
getUsernotfetchAndCacheUser. - •
Simple but complete - don't over-shorten, but don't add words that don't add context.
Semantic Patterns
Booleans: Use is, has, can, should prefixes. isLoggedIn, hasPermission, canEdit.
Event handlers vs callbacks:
- •Handler (internal):
handle+ event →handleSubmit - •Callback (prop):
on+ event →onSubmit
Hooks: use + what it provides → useProducts, useAuth
Collections: Simple plurals → users, orders. Not userList, orderArray.
Transformers: Method on the source object → user.toJson(), order.toResponse()
The Naming Test (Boundary Detection)
Use when naming functions, services, or handlers. If you can't name it with one verb, the function is doing too many things.
For each function:
- •Who is the caller? Identify who uses this
- •What is the step-level effect? What does THIS function do — not the downstream chain, just its direct effect
- •Name it with ONE idiomatic verb
| Signal | Meaning |
|---|---|
| One verb covers all code paths | Boundary is correct |
| Need "or" to connect two verbs | Likely two operations bundled — split them |
| Name doesn't feel idiomatic | Boundary is wrong |
| Name matches a downstream effect, not this step | You're naming the chain, not the step |
Step-level vs chain-level: Name what THIS function does, not what its callees achieve. An orchestrator that calls validate → find → extract → insert is a handler, not an adder. The adding happens downstream.
Caller perspective: Names reflect what the caller achieves. A tool exposed externally: placeLocale (what the caller wants). The internal handler: handlePlaceLocale (what it does).
Naming resistance as a signal: If resolveLocale either pops from a list OR creates a new dict — "take" fits one path, "create" fits the other, need "or" → split into extractLocale and createLocale.
Checklist
- • Checked project conventions first
- • No ALL_CAPS (except PHP define())
- • No abbreviations (except ultra common & universal ones like info/max/min/config)
- • Context not repeated (user.isValid not user.isUserValid)
- • No redundant suffixes (users not userList)
- • Booleans use is/has/can/should prefix
References
- •reference.md - Ecosystem casing conventions
- •examples.md - Good/bad examples with rationale