From craft
Names and comments are the primary channel through which code communicates intent to the next engineer. Use when choosing an identifier ("what should I call this", "rename this", "is this name clear"), deciding whether to add a comment ("should I comment this", "does this need explaining"), or auditing existing prose ("clean up the comments", "too many comments", "comment slop"). Also fires when a name is hard to pick — that difficulty is a design smell, not a vocabulary problem (Ousterhout: Hard to Pick Name).
How this skill is triggered — by the user, by Claude, or both
Slash command
/craft:naming-and-commentsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Purpose**: names and comments are where code either communicates or hides its
Purpose: names and comments are where code either communicates or hides its
intent. AI agents produce vague names (data, result, handle, manager,
temp, item, process) and comment slop that restates the line below it.
Both are noise; noise degrades every engineer who reads the code after you.
The workspace rule is explicit: the diff is the comment — a comment that only describes what the code does is banned. Comments must carry why: rationale, units, invariants, non-obvious trade-offs, links to tickets or requirements. If the what is unclear, fix the name; don't add a comment to compensate.
A name that is hard to pick signals unclear design (Ousterhout's red flag: Hard to Pick Name). Don't push through; investigate the abstraction.
expireStaleSessionsOlderThan not processData).i is fine; a module-level
export needs a full, unambiguous name. The wider the scope, the higher the
naming bar.Manager / Helper / Util / Processor / Handler / Info / Data / Object / temp / obj add syllables and no information. Cut them
or replace them with the actual concept.sesExp is not a name. sessionExpiryMs
is. Exception: universally understood acronyms (http, url, id).isActive, hasAccess, canRetry — not
active, access, retry (those read as nouns or verbs, not conditions).expireSession() not
sessionExpiry(); SessionCache not ManageSession.fetch / get / load / retrieve for the same operation and stick to it. Mixed vocabulary
forces readers to wonder if they're different things.SESSION_EXPIRY_MS = 30 * 60 * 1000
not a bare 1800000. The name is the documentation.# this is a hack because... → fix the hack, or open a ticket and link it.Manager / Helper / Util / Processor / data / result / temp / obj / item in
any identifier that crosses a function boundary.# increment i above
i += 1).active instead of isActive).Vague Name (Ousterhout): too imprecise to convey useful information
(handle, process, do).For each new identifier:
For each comment:
# TODO or # hack, either fix it now or convert it
to a tracked ticket and link the ticket number.When a name is hard to pick: stop naming and investigate the abstraction. A
module with one clear responsibility names itself; one that does two things
can't be named without an And.
# BEFORE — vague name, comment restates the code
def proc(d):
# loop through data
for item in d:
if item["ts"] < time.time() - 1800:
del_item(item)
# AFTER — intention-revealing name, comment carries WHY
# 30-minute threshold per §AUTH-112: tokens issued before this window
# cannot be rotated without a full re-auth, so we purge them proactively
# rather than let them accumulate and slow the next gc sweep.
SESSION_EXPIRY_SECS = 30 * 60
def expire_stale_sessions(sessions: list[Session]) -> None:
cutoff = time.time() - SESSION_EXPIRY_SECS
for session in sessions:
if session.issued_at < cutoff:
session_store.delete(session)
Changes: proc → expire_stale_sessions (verb + domain noun); d →
sessions (type-and-domain); item → session; 1800 → SESSION_EXPIRY_SECS
(named constant); comment deleted (restated the loop) and replaced with one that
explains the why — the requirement reference and the gc motivation.
For each identifier: state whether a stranger could infer its purpose from the name alone. For each comment: state whether it adds information the code doesn't carry. Recommend rename or delete as appropriate. Tag findings:
[naming-and-comments · vague-name · SEV]
[naming-and-comments · comment-repeats-code · SEV]
[naming-and-comments · hard-to-pick-name · SEV]
hard-to-pick-name findings should also trigger a design investigation —
recommend the caller open a right-sized-design review on the surrounding
abstraction.
../../references/PRINCIPLES.md §B (Ousterhout red flags table)../../RULES.md../../RULES.md Definition
of Done../right-sized-design/SKILL.mdnpx claudepluginhub manutej/craftProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.