Naming Conventions
Ensure consistent, readable naming across the entire codebase.
Demo Purpose: This skill demonstrates the
references/directory — core rules are here in SKILL.md, while the complete per-language guide is loaded on demand fromreferences/.
When to Use
- User creates new variables, functions, classes, or files
- User asks "how should I name this?"
- Reviewing code for naming consistency
Universal Rules
These rules apply regardless of language:
- Be descriptive — Names should reveal intent
- Be consistent — Same concept = same naming pattern everywhere
- Avoid abbreviations — Except widely known ones (
id,url,http) - Use pronounceable names — If you can't say it, rename it
Quick Reference
| Element | Style | Example |
|---|---|---|
| Local variable | camelCase / snake_case | userName / user_name |
| Constant | UPPER_SNAKE_CASE | MAX_RETRIES |
| Function | camelCase / snake_case | getUserById / get_user_by_id |
| Class | PascalCase | UserService |
| Interface | PascalCase (no I prefix) |
Serializable |
| File (component) | PascalCase | UserCard.tsx |
| File (utility) | kebab-case | string-utils.ts |
| Boolean | is/has/should prefix | isActive, hasPermission |
| Event handler | on/handle prefix | onClick, handleSubmit |
Anti-Patterns
# Bad naming examples
x = get_data() # What data?
temp = process(items) # What does process do?
flag = True # What does this flag mean?
data2 = transform(data) # What's different about data2?
# Good naming examples
active_users = fetch_active_users()
sorted_items = sort_by_priority(items)
is_authenticated = True
normalized_input = normalize_whitespace(raw_input)
Language-Specific Guides
For detailed conventions per language (Python, TypeScript, Go, Java, etc.), see LANGUAGES.md.