Naming Variables
Choose names that fully and accurately describe what the variable represents
Install
npx skills add obra/clank --skill Naming Variablesgit clone --depth 1 https://github.com/obra/clank.git /tmp/clank
mkdir -p ~/.claude/skills
cp -r /tmp/clank/skills/coding/naming-variables ~/.claude/skills/Naming-VariablesPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Naming Variables ## Overview The most important consideration in naming a variable is that the name fully and accurately describes the entity the variable represents. **Core principle:** A variable and its name are essentially the same thing. The goodness or badness of a variable is largely determined by its name. **Name quality = Design quality.** If you struggle to name something well, that's a warning sign about the design. ## When to Use **Always use when:** - Naming any variable, function, class, parameter, constant - Reviewing code with unclear names - Struggling to understand what a variable does **Warning signs you need better names:** - Variables named `x`, `x1`, `x2`, `temp`, `data`, `info`, `val` - Can't remember what a variable does - Need to search back to find variable's purpose - Abbreviations that aren't obvious - Names that could mean multiple things - Struggling to name something (indicates design problem) ## Naming Principles ### 1. Describe What, Not How **Problem-oriented** (what it represents) not **solution-oriented** (how it's implemented): ✅ **Good:** `employeeData`, `printerReady`, `totalRevenue` ❌ **Bad:** `inputRec`, `bitFlag`, `calcVal` The bad names describe computing concepts (input, record, bit, calculation). Good names describe the problem domain (employee, printer, revenue). ### 2. Use Optimal Name Length **Optimal: 10-16 characters average** - Too short: doesn't convey meaning - Too long: hard to type, obscures structure
Details
- Skill name
Naming Variables- Repository
- obra/clank
- Path
skills/coding/naming-variables/SKILL.md- Repo updated
- 9 October 2025
FAQ
What does the Naming Variables skill do?
Choose names that fully and accurately describe what the variable represents
How do I install the Naming Variables skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add obra/clank --skill Naming Variables. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Naming Variables popular?
It lives in obra/clank, which has 43 GitHub stars and 26 forks.
Related skills
Gardening Skills Wiki
43obra/clank
Maintain skills wiki health - check links, naming, cross-references, and coverage
Remembering Conversations
43obra/clank
Search previous Claude Code conversations for facts, patterns, decisions, and context using semantic or text search
Brainstorming Ideas Into Designs
43obra/clank
Interactive idea refinement using Socratic method to develop fully-formed designs
Pair Mode
62ElliotJLT/Claude-Skill-Potions
When activated, Claude becomes a pair programming partner rather than a code-generation tool. Explains reasoning, teaches patterns, asks questions that build understanding, and adjusts depth based on the person's goals. Balances getting work done with building lasting knowledge. Activate with "let's pair on this" or by setting a learning focus at session start.
Maintaining Consistent Abstractions
43obra/clank
Class interfaces present one cohesive abstraction - don't mix domain logic with serialization, persistence, or unrelated concerns
Pre Mortem
62ElliotJLT/Claude-Skill-Potions
Before starting ANY significant task (feature build, refactor, integration, migration, or architectural change), first imagine the project has failed. Generate 3-5 specific failure scenarios, assess risk levels, identify mitigations, then adjust the implementation plan to address high-risk items FIRST. Do not start coding until the pre-mortem is acknowledged.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.