# Naming Conventions

> Enforce consistent naming conventions for variables, functions, files, and classes. Use when the user asks about naming, creates new code, or mentions naming conventions or coding standards.

- Skill: `yinuo-136/naming-conventions` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add yinuo-136/naming-conventions`
- Raw SKILL.md: https://api.skillmd.com/api/skills/yinuo-136/naming-conventions/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: yinuo-136 (https://skillmd.com/u/yinuo-136)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/yinuo-136/naming-conventions

---


# 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 from `references/`.

## 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:

1. **Be descriptive** — Names should reveal intent
2. **Be consistent** — Same concept = same naming pattern everywhere
3. **Avoid abbreviations** — Except widely known ones (`id`, `url`, `http`)
4. **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](references/LANGUAGES.md).

