naming

A guide for choosing clear names for code elements such as variables, functions, classes, files, APIs, and database fields.

In plain words
What is it for?
Use it when naming new code, renaming unclear identifiers, designing APIs or data fields, and aligning terminology across a project.
Why use it?
It helps code explain itself and prevents confusion caused by vague, inconsistent, misleading, or unnecessary abbreviations.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lion-1209/coderio/naming
Any agent
npx skills add Lion-1209/coderio --skill naming
Clone the repo
git clone --depth 1 https://github.com/Lion-1209/coderio

Made for: Claude Code, Codex.

Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,406 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00025 $0.01406
Opus 5 $0.00013 $0.00703
Sonnet 5 $0.00005 $0.00281
Haiku 4.5 $0.00003 $0.00141

Measured 3d ago against content hash 6ba13cfb6f6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

naming scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • naming — 100% identical, 0 lines differ
src/coderio/skills/lion-skills/skills/naming/SKILL.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Naming

概述

名字要回答"它是什么/它做什么",而不是"它在哪/什么类型"。好名字让代码自解释,坏名字逼读者来回跳转确认含义。

何时使用

  • 写代码时卡在取某个名字上
  • 觉得现有名字不准、误导,想改
  • 设计 API/接口,定资源和字段名
  • 想统一一个模块的命名风格

不该用:已在用团队既定规范(遵循即可);纯格式问题(用 linter)。

核心内容

取名前先搞清四件事

套快速规则前先回答这四个问题,否则会在错的对象上取名。前两个是定性(决定名字的形态),后两个是收口(决定用哪个词):

  1. 它是对象还是动作? 数据/状态/实体 → 名词;行为/操作 → 动词。(这是最根本的一刀,定错了后面全错。)
  2. 一个职责还是两个? 像"转换 + 校验"这种复合,先问该不该拆成两个名字——能独立复用/测试就拆,再各自取名。别把两件事塞进一个名字(如 parseAndValidateCsv 不如 parseCsv + validateRecords)。
  3. 信息够不够? 用户只甩"flag 叫啥"不给语义时,先反问"它具体表示什么状态",别凭猜取名。
  4. 有歧义吗? 同名异义/异名同义(项目里既有 login 又有 auth),先定以谁为基准——通常以领域模型/核心资源名为准,全项目统一。

问题 1 的答案同时决定了下面「快速规则」第一条该走名词还是动词那一支。

快速规则

  • 函数/方法用动词fetchUservalidateEmail
  • 变量/属性用名词useremailAddress
  • 布尔用 is/has/can/shouldisLoggedInhasPermission
  • 避免否定isEmpty 优于 isNotEmpty
  • 避免无意义词:名词 data/info/helper/manager/util,动词 process/handle/do——都说不清做啥
  • 少缩写:除非领域通用(idurlhttp,以及 csvjsonxml 这类格式名);usrcfgtmp 别用
  • 范围越窄越具体:模块内可简短,全局/API 要自解释
  • 一致:同一概念全项目用同一个词(别 user/account/member 混用)

before / after

不好 原因
processData(d) parseCsvToRecords(text) 说清做什么、入参是啥
flag isLoggedIn 布尔用 is,表意明确
userList users 复数即集合,去冗余类型后缀
strName name 去掉匈牙利记法前缀
handleStuff() sendInvoice() 动词具体,不抽象
UserInfoManager UserProfile 去掉无意义 Manager

转换类动词按数据流向选

"把 A 变成 B"这类操作最容易被塞进万能的 process/handle,丢掉数据流向信息。按输入→输出的形态变化选最贴切的动词:

动词 数据流向 例子
parse 文本 → 结构化对象 parseCsv(text)Record[]
serialize 结构 → 文本/字节 serializeOrder(order) → JSON 字符串
convert / transform 结构 → 结构(同层级换形态) convertMsToSecondstransformUserToDto
format 结构 → 展示用文本 formatDate(date)"2026-06-22"
map / reduce 集合 → 集合/标量 mapToIds(users)reduceToTotal(items)

选名时问自己:**读者看到动词,能不能猜出输入和输出分别是什么形态?**猜不出(如 processData)就换。

Read the full file on GitHub · 86 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 86 lines · 25 tokens per session scan A 6ba13cfb6f6f

Subscribe to this mod's changes

naming is a skill published in the GitHub repository Lion-1209/coderio (9 stars, last pushed 5d ago), licensed MIT. It adds 25 tokens to every session and 1,406 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

blog-writer

Peri 项目博客写作风格指南。当用户说"写博客"、"写文章"、"出稿"、 "按风格写"、"博客"时触发。也适用于用户丢过来素材说"帮我写篇博客"的场景。 覆盖项目介绍、技术复盘、架构讨论、性能优化、架构设计等类型。.

KonghaYao/peri · 90 tokens

auto-devflow

Use when starting an issue, bugfix, feature, or refactor that benefits from an adaptive development workflow. Select lite, normal, pro, max, or ultra from task complexity and risk, then use only the coordination, review, and verification phases that the task actually needs.

KonghaYao/peri · 60 tokens

langfuse

Interact with Langfuse and access its documentation. Use when needing to (1) query or modify Langfuse data programmatically via the CLI — traces, prompts, datasets, scores, sessions, and any other API resource, (2) look up Langfuse documentation, concepts, integration guides, or SDK usage, or (3) understand how any…

KonghaYao/peri · 100 tokens

self-build

Builds isolated npm capability packages that operate on real project code and connects them to Peri through MCP/MCPP and MetaHarness. Use when adding tools, resources, remote skills or agents, creating a Bun/Node.js stdio server, linking .mcp.json, or changing the active prompt and middleware set.

KonghaYao/peri · 66 tokens

project-maturity

对任意项目进行全面的成熟度评估扫描。当用户说"检查项目成熟度"、"项目评估"、 "maturity assessment"、"代码质量扫描"、"项目健康度"、"项目体检"、 "scan project maturity"、"项目有多成熟"时触发。适用场景:接手新项目前的摸底、 发布前的质量审查、技术尽调、团队内部代码健康度盘点。.

KonghaYao/peri · 105 tokens

auto-issue-fixer

Issue 全生命周期管理——从创建到归档。当用户描述技术问题、提 bug、"帮我记录"、 "修一下 X issue"、"验证一下"、"归档 issue"时立即触发。单入口自动分发, 替代旧 issue-create/fix-issue/issue-verify/issue-archive 四个技能。 即使用户没有用"issue"这个词,只要在描述值得追踪的技术问题就应触发。.

KonghaYao/peri · 106 tokens