agentleFS
smileynetsmileynet/code-spice/skills/code-naming/SKILL.md

code-naming

Skill0 starsChanged 9 months agoMITView on GitHub

Naming decisions for variables, functions, classes, constants, and APIs. Use when choosing names, reviewing naming quality, refactoring unclear names, or establishing naming conventions. Covers descriptive naming, naming as documentation, language-specific conventions, and common naming antipatterns.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before committing to a name, verify it answers all three:

    line 23
  2. Distinctive:

    If a name requires a comment to be understood, the name is wrong.

    line 29

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Naming

The Naming Decision Table

You're naming a...It should read like...FormExamples
Class / TypeA noun or noun phrasePascalCase (most langs)UserProfile, HttpClient, InvoiceParser
Function / MethodA verb or verb phrasecamelCase or snake_casevalidateEmail, send_invoice, calculateTotal
BooleanA yes/no questionis/has/can/should prefixisActive, hasPermission, canRetry
CollectionA plural nounPlural formusers, pendingOrders, activeConnections
ConstantA named factUPPER_SNAKE_CASE (most langs)MAX_RETRY_COUNT, DEFAULT_TIMEOUT_MS
InterfaceA capability or contractLanguage-specificSerializable, IDisposable, Reader
EnumA set of named optionsPascalCase valuesColor.Red, RetryPolicy.ALLOW_RETRY
Event / CallbackWhat happened or will happenPast/present tenseonClick, onUserCreated, handleSubmit

The Three Questions Test

Before committing to a name, verify it answers all three:

  1. What is it? — The name identifies what the thing represents
  2. What does it do? — For functions: the action is clear from the name alone
  3. What are the boundaries? — The name hints at scope, lifetime, or constraints

If a name requires a comment to be understood, the name is wrong.

Naming Antipatterns

Names That Lie

AntipatternProblemFix
accountList when it's a SetWrong data structure in nameaccounts (just use plural)
processData_v2Version control in namesUse version control, not naming
getUser() that also logs and cachesName doesn't reveal side effectsfetchAndCacheUser() or split
isEnabled that modifies stateQuery name hides a commandSeparate query from mutation

Names That Don't Try

AntipatternProblemFix
data, info, item, thingGeneric to the point of meaninglessUse domain-specific terms
tmp, val, x beyond tiny scopeForces reader to track mentallycurrentTemperature, retryCount
manager, handler, processorVague role descriptionsDescribe what it manages
utils, helpers, miscGrab-bag namespacesGroup by domain or operation

Names That Mislead

AntipatternProblemFix
Inconsistent casingReaders assume variables are lowercaseFollow language conventions exactly
Abbreviations (usrRepo, passwd)Ambiguous unless universally knownSpell it out: userRepository, password
Noise words (UserData vs UserInfo)Indistinguishable without reading codePick one and be consistent
Negated booleans (isNotActive)Double negatives in conditionsUse positive: isActive

Names That Over-Specify

AntipatternProblemFix
Hungarian notation (strName, iCount)Type system already encodes typesJust name, count
Gratuitous prefix (GSDAccountService)Every class in app has same prefixUse namespaces/packages
AbstractBase + Impl suffixNaming the pattern not the conceptUserService + DefaultUserService

Decision Checklist

  • Name reveals intent without needing a comment
  • Name uses domain vocabulary where applicable
  • Name follows language/project conventions
  • Name is distinguishable from similar names nearby
  • Boolean names read as yes/no questions
  • Function names describe the action (verb phrases)
  • Class names describe the thing (noun phrases)
  • No abbreviations unless universally understood (URL, HTTP, API)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.