naming
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNaming
命名
One list, synced from the hub. The CI gate checks what a machine can check; the rest is your judgement. references/lint.md draws the line.
namingBefore you name anything, run and read its output as the current rules: it prints references/naming.json merged with the project's overrides.
node .agents/skills/naming/scripts/config.mjs一份从中心同步的清单。CI 门禁 检查机器能检查的部分;其余部分由你的判断决定。references/lint.md 划定了界限。
naming在命名任何东西之前,运行 并阅读其输出,作为当前规则:它打印 references/naming.json 与项目覆盖合并后的结果。
node .agents/skills/naming/scripts/config.mjsRules
规则
-
One word per thing, and the word comes from. Look there first, then in existing types, DB tables and API routes. The repo's word beats the request's word.
CONTEXT.mdGood Bad Why testimonialcustomerQuotethe request said "customer quotes", the repo says testimonialtype,Testimonialtable,testimonials/api/testimonialstype,Testimonialtablereviewsone word per thing, everywhere orderbesidepurchaseordertwo words for one thing splits the search -
No word yet? Run term-check, show the result to the user, get sign-off, then add the word tothrough domain-modeling, which owns that file.
CONTEXT.mdGood Bad Why , term-checked, incarryOverCONTEXT.md, invented in the PRcarryOvera new word needs the user's sign-off recorded with pluralcaseStudycaseStudieswith no entrycaseStudythe next agent picks a different word added to the role listgridused, list unchangedGrida role outside the closed list is a new word -
Name by role, not by type. Noor
Iprefix, no Hungarian, no noise word (seeTin naming.json).noiseWordsGood Bad Why UserIUserno prefixIcountnCountno Hungarian accounts,accountListaccountDatano noise word, the plural already says many -
Full words only, no single-letter name, no magic number. The banned short words arein naming.json.
shortWordsGood Bad Why optionsoptsfull word error,eerrno single letter, no abbreviation const MAX_RETRIES = 3a bare 3a number needs a name -
Say nothing the call site already says.
Good Bad Why user.nameuser.userNamethe object says usertestimonials.add(item)testimonials.addTestimonial(item)the collection says testimonialfield in tablenametestimonialsfield testimonial_namethe table says testimonial -
An action starts with a verb fromin naming.json, one verb per meaning. A pure derived value may be a noun.
prefixesGood Bad Why fetchTestimonialsbeside itloadTestimonialsone verb per meaning, is over the networkfetchlistUsersgetAllUsersmeans manylistbranchShagetBranchShaa pure derived value may be a noun A prefix promises its meaning:only reads,getreturns nothing,setreturns a boolean,ismay return nothing whilefindmay not. A name withgetin it (and) is two functions.saveAndNotify -
Stored boolean state is a bare adjective; a check is,
is,hasorcan; nevershould.notXGood Bad Why archivedisArchivedstored state is a bare adjective ,isEmptycanRetry,empty()retryAlloweda check carries the prefix enablednotDisabledpositive names only -
Entity singular, collection plural. Record an irregular plural innext to the word.
CONTEXT.mdGood Bad Why type , fileTestimonialtestimonial.tstype Testimonialsone entity is singular table, path, folder testimonialstable testimoniala collection is plural , plural recorded incase_studiesCONTEXT.mdcase_studysan irregular plural is written down once -
No. Use a string-literal union or an
enumobject. The discriminant key isas constin naming.json (discriminant). Own values are kebab-case; values mirrored from an external API stay verbatim.kindGood Bad Why type Status = 'open' | 'in-progress'enum Status { Open }no enum{ kind: 'pull-request' }{ type: 'pull-request' }the discriminant key is kindfrom the GitHub API'MERGED''merged'a mirrored value stays verbatim -
Build every name fromin naming.json, big to small:
parts. Take the parts you need, keep their order. Eachproject · area · entity · role · action · attribute · consumerentry lists parts, case and examples.artifactsis a closed list per repo (role,artifacts.component.roles). Env vars followartifacts.env.roles. Payload CMS: collection slug = API path = table; the slug is kebab-case and plural (artifacts.env.shape), the table replaces the hyphen with an underscore (case-studies).case_studiesGood Bad Why COLIN_SYNC_KEY_FOR_TWENTYTWENTY_API_KEYissuer first, then what the key is for, then who holds it TestimonialGridGridTestimonialentity first, then role testimonial.addedaddTestimonialan event is a fact in the past, not a command -
Casing follows the language guide and the repo's linter. Files and folders are lowercase kebab-case. An existing repo convention wins over this line: set it inand
artifacts.file.case, one case or a list (artifacts.folder.casefor React components and hooks).["kebab", "PascalCase", "camelCase"]Good Bad Why render-pr-body.mjsrenderPrBody.mjsfiles are kebab-case src/components/case-studies/src/components/case_studies/folders are kebab-case in a repo that usesloadUsereverywhereloadbeside itfetchUserthe existing convention wins -
Meaning changed? Rename everywhere in the same change, rule 204 in writing-rules.
Good Bad Why renamed todraftin code, docs and DB in one PRproposalcode renamed, docs still say drafttwo words for one thing after the value stopped being a limitretryCountkeptmaxRetriesthe name lies rename plus a updateCONTEXT.mdrename only the glossary is the source
-
每个事物一个词,且该词来自。先在那里查找,然后再在现有类型、数据库表和 API 路由中查找。仓库的用词优先于请求的用词。
CONTEXT.md好 坏 原因 testimonialcustomerQuote请求说“客户评价”,仓库说 testimonial类型、Testimonial表、testimonials/api/testimonials类型、Testimonial表reviews每个事物一个词,处处如此 order与purchase并存order一个事物两个词会分裂搜索 -
还没有词?运行 term-check,向用户展示结果,获得批准,然后通过 domain-modeling 将该词添加到,该文件由它管理。
CONTEXT.md好 坏 原因 ,经过 term-check,在carryOver中CONTEXT.md,在 PR 中发明carryOver新词需要用户批准 记录为复数caseStudycaseStudies无条目caseStudy下一个 agent 会选择不同的词 添加到角色列表grid使用 ,列表未改变Grid封闭列表之外的角色是新词 -
按角色命名,而非按类型。不要或
I前缀,不要匈牙利命名法,不要噪音词(见 naming.json 中的T)。noiseWords好 坏 原因 UserIUser无 前缀IcountnCount无匈牙利命名法 accounts,accountListaccountData无噪音词,复数已经表示多个 -
只用完整单词,无单字母名称,无魔法数字。被禁止的短词是 naming.json 中的。
shortWords好 坏 原因 optionsopts完整单词 error,eerr无单字母,无缩写 const MAX_RETRIES = 3孤零零的 3数字需要名字 -
不说调用点已经说过的内容。
好 坏 原因 user.nameuser.userName对象已经表明是 usertestimonials.add(item)testimonials.addTestimonial(item)集合已经表明是 testimonial表中的字段testimonialsname字段 testimonial_name表已经表明是 testimonial -
动作以 naming.json 中里的动词开头,每个含义一个动词。纯粹派生值可以是名词。
prefixes好 坏 原因 fetchTestimonials(旁边已有)loadTestimonials每个含义一个动词, 表示通过网络fetchlistUsersgetAllUsers表示多个listbranchShagetBranchSha纯粹派生值可以是名词 前缀承诺其含义:只读取,get不返回任何内容,set返回布尔值,is可能不返回任何内容而find不能。名字中含get(如and)的是两个函数。saveAndNotify -
存储的布尔状态是裸形容词;检查用、
is、has或can;绝不使用should。notX好 坏 原因 archivedisArchived存储的状态是裸形容词 ,isEmptycanRetry,empty()retryAllowed检查带有前缀 enablednotDisabled只用正面名称 -
实体单数,集合复数。在中记录不规则复数,紧跟该词。
CONTEXT.md好 坏 原因 类型 ,文件Testimonialtestimonial.ts类型 Testimonials一个实体是单数 表、路径、文件夹 testimonials表 testimonial集合是复数 ,复数记录在case_studies中CONTEXT.mdcase_studys不规则复数只需写一次 -
不用。使用字符串字面量联合或
enum对象。判别键是 naming.json 中的as const(discriminant)。自有值是 kebab-case;从外部 API 镜像的值保持原样。kind好 坏 原因 type Status = 'open' | 'in-progress'enum Status { Open }不用 enum{ kind: 'pull-request' }{ type: 'pull-request' }判别键是 kindGitHub API 的 'MERGED''merged'镜像值保持原样 -
用 naming.json 中的构建每个名称,从大到小:
parts。取你需要的部分,保持其顺序。每个project · area · entity · role · action · attribute · consumer条目列出部分、大小写和示例。artifacts是每个仓库的封闭列表(role、artifacts.component.roles)。环境变量遵循artifacts.env.roles。Payload CMS:集合 slug = API 路径 = 表;slug 是 kebab-case 和复数(artifacts.env.shape),表将连字符替换为下划线(case-studies)。case_studies好 坏 原因 COLIN_SYNC_KEY_FOR_TWENTYTWENTY_API_KEY先发行方,然后密钥用途,最后持有者 TestimonialGridGridTestimonial先实体,后角色 testimonial.addedaddTestimonial事件是过去的实事,不是命令 -
大小写遵循语言指南和仓库的 linter。文件和文件夹是小写 kebab-case。现有仓库约定优先于此行:在和
artifacts.file.case中设置,一个大小写或列表(artifacts.folder.case用于 React 组件和 hooks)。["kebab", "PascalCase", "camelCase"]好 坏 原因 render-pr-body.mjsrenderPrBody.mjs文件是 kebab-case src/components/case-studies/src/components/case_studies/文件夹是 kebab-case 在到处使用 的仓库中loadloadUser旁边用 fetchUser现有约定优先 -
含义变了?在同一变更中处处重命名,writing-rules 中的规则 204。
好 坏 原因 在代码、文档和数据库中一个 PR 内重命名为draftproposal代码重命名,文档仍说 draft一个事物两个词 值不再是限制后改为 retryCount保留 maxRetries名字撒谎 重命名并更新 CONTEXT.md只重命名 词汇表是源头
Per-project overrides
项目级覆盖
Override file: , same shape as references/naming.json, only the keys you change. An old is read only while is missing: move it to .
.skilly/naming.jsondocs/agents/naming.json.skilly/naming.json.skilly/naming.json- Objects merge by key. drops a key.
null - Arrays append and dedupe. drops the default
"-Data".Data - Scalars override.
json
{
"prefixes": { "sync": { "meaning": "mirror to a remote system", "not": ["push", "mirror"] } },
"noiseWords": ["-Data"],
"allow": ["^ctx_"]
}allow覆盖文件:,形状与 references/naming.json 相同,只包含你更改的键。旧的 仅在缺少 时被读取:将其移动到 。
.skilly/naming.jsondocs/agents/naming.json.skilly/naming.json.skilly/naming.json- 对象按键合并。删除键。
null - 数组追加并去重。删除默认的
"-Data"。Data - 标量覆盖。
json
{
"prefixes": { "sync": { "meaning": "镜像到远程系统", "not": ["push", "mirror"] } },
"noiseWords": ["-Data"],
"allow": ["^ctx_"]
}allowReferences
参考
- references/naming.json: prefixes, parts, artifacts, short words, noise words, synonyms, discriminant, allow
- references/lint.md: what the CI gate checks, what you judge, per-repo exceptions
- references/biome.json: opt-in Biome block for consumers
- scripts/config.mjs: prints the merged config
- references/naming.json:前缀、部分、构件、短词、噪音词、同义词、判别键、允许
- references/lint.md:CI 门禁检查什么、你判断什么、每仓库例外
- references/biome.json:供使用者选择加入的 Biome 块
- scripts/config.mjs:打印合并后的配置