agentleFS
atgreenatgreen/hackinator/skills/naming-as-design/SKILL.md

naming-as-design

Skill1 starsChanged 3 months agoMITView on GitHub

Use when code feels tangled or needs a comment to explain what something is, when reaching for a name and nothing fits, or when a name is vague (data, tmp, handle, process, manager, util, doStuff) and the fuzziness hides a fuzzy design

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:

    When the right name is obvious, the design underneath is sound.

    line 14
  2. Distinctive:

    Let a failure to name change the code, not just the label: If nothing fits, don't force a bad name — split, merge, or reshape until a good …

    line 35

≈ “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

Naming-as-Design

Overview

Core principle: Naming is not decoration applied after the design — naming is the design. A thing you can't name cleanly is usually a thing that isn't cleanly one thing. Use the struggle to name as a signal about the structure, and renaming as a tool to fix it.

When the right name is obvious, the design underneath is sound. When no name fits, the name isn't the problem — the shape is.

The Diagnostic

A hard-to-name thing is telling you something. Read the signal:

Naming symptomWhat it usually meansThe fix
The name needs "and" (parseAndValidate)It does two thingsSplit it into two named things
Only a vague name fits (data, manager, process)Its responsibility is vagueSharpen the responsibility, then name it
The name lies about what it does nowBehavior drifted from intentRename to the truth, or restore the intent
You reach for a comment to say what it isThe name is underperformingMove the comment's content into the name
Same concept, three different names across the fileYou haven't decided what it isPick one true name, use it everywhere

The Practice

  1. Name for the reader, from the outside. A name describes what a thing is or returns, in the caller's vocabulary — not how it's implemented inside. activeUsers, not filteredList.
  2. Make the name carry the weight a comment would. secondsUntilExpiry needs no comment; t plus a comment does the same job worse. Every comment explaining a name is a naming bug.
  3. Let a failure to name change the code, not just the label. If nothing fits, don't force a bad name — split, merge, or reshape until a good name becomes available. The name comes last because it's the design's signature.
  4. One concept, one name; one name, one concept. Synonyms drifting across a codebase (fetch/get/load/retrieve for the same act) make readers hunt for distinctions that aren't there. Consistency is kindness.

Quick Reference

Weak nameWhy it's weakStronger
data, info, objSays nothinginvoice, userProfile
tmp, x, resultNo meaningremainder, parsedDate
handle, process, doItVerb without objectretryFailedJobs, renderInvoice
manager, helper, utilJunk-drawerName the actual job it does
flag, check, isValidWhich flag? valid how?hasUnsavedChanges, isPastDue
getData() returning a filtered subsetHides the filtergetActiveUsers()

Common Mistakes

  • Naming by implementation, not by meaning. sortedList breaks the day you switch to a set; rankedCandidates survives. Name the what, not the how.
  • Renaming the label without re-reading the passage. A name is only better if the code around it reads better. Names live in sentences; read the sentence.
  • Encoding types into names (strName, listUsers) when the language already tracks types. The name should add meaning the type can't.
  • Accepting a bad name because "it's just a local." Locals are where the reader spends the most time. They deserve the most care, not the least.

Relationship to Other Skills

This is the whittler's second pass, after subtraction-first (a good name often deletes a comment or a helper). Renaming for the reader flows directly into reading-like-prose.

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.