chinese-commit

A guide for writing Git commit messages in a shared format: an English change type followed by a short Chinese summary. Git commits are saved descriptions of changes to a codebase.

In plain words
What is it for?
Use it before creating a commit, when reviewing or rewriting commit messages, or when teaching a team how to describe changes consistently.
Why use it?
It keeps commit history easy to search and prevents commit-checking tools or automatic changelog generation from misclassifying entries.

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/wade-devcode/awesome-coding-skills-cn/chinese-commit
Any agent
npx skills add Wade-DevCode/awesome-coding-skills-cn --skill chinese-commit
Clone the repo
git clone --depth 1 https://github.com/Wade-DevCode/awesome-coding-skills-cn

Made for: Claude Code, Codex.

Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,175 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.00028 $0.02175
Opus 5 $0.00014 $0.01087
Sonnet 5 $0.00006 $0.00435
Haiku 4.5 $0.00003 $0.00217

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

Security

Grade A, and why

chinese-commit 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 2d 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.

skills/chinese-commit/SKILL.md · 154 lines

How it starts

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

中文 commit 规范

何时用

  • 准备执行 git commit 前,需要撰写 commit message 时。
  • 对已有 commit message 做 review 或修改时。
  • 在 PR 描述中引用 commit 列表,需要判断某条消息是否清晰时。
  • 给团队新成员讲解项目提交规范时。

核心规则

1. 格式 = type(scope): 中文主题

规则: type 必须用英文关键字(feat / fix / docs / refactor / test / chore / perf),冒号后的主题用中文,且不超过 50 个字。

为什么: AI 最常见的错误有两种:一是整行全写中文(新增功能:用户登录),导致 CI 的 commit-lint 规则直接报错;二是 type 用中文近义词(特性修复)或随意缩写(fupd),让 git log --oneline 的过滤脚本无法识别。格式不统一还会导致自动生成 CHANGELOG 时分类错误,把 bug 修复误放进"新功能"节。

怎么做:

  • type 只从以下七个中选一个:feat(新功能)、fix(缺陷修复)、docs(文档)、refactor(重构,不改行为)、test(测试)、chore(构建/工具链)、perf(性能优化)。
  • scope 写在圆括号内,可省略,但存在时必须用真实模块名(见规则 5)。
  • 冒号后面跟一个空格,然后是中文主题,不加句号。

2. 主题写"做了什么",用祈使句

规则: 主题用一句祈使句描述本次变更的核心动作,不写流水账,不写"修改了一些文件"之类的废话。

为什么: AI 极容易生成这种主题:更新了登录模块的相关代码——这句话在任何 commit 上都成立,完全没有信息量。另一类错误是记流水账:修改了 auth.py,删除了多余的注释,调整了变量名,顺便加了一个空行。主题不是 diff 摘要,是对"本次提交解决了什么问题"的一句话答案。读 git log --oneline 时,好的主题应当让人一眼知道"要不要点进这个 commit 看细节"。

怎么做:

  • 问自己:「这个 commit 的目的是什么?」把答案压缩成一句话。
  • 动词放句首,例如:修复新增删除提取替换禁用
  • 不带末尾句号;不用被动句(不写"被修复了")。
  • 超过 50 字说明你在一次 commit 里做了多件事,应当拆分(见规则 4)。

3. 正文只在"为什么"不显然时写

规则: commit 正文(body)用来解释动机与权衡,而不是复述 diff 的内容。若改动理由一眼即明,正文可省略。

为什么: AI 倾向于把 diff 内容逐行翻译成正文,例如:将 token_expiry < now 改为 token_expiry <= now——这完全没有价值,读者直接看 diff 就能得到这个信息。真正有用的正文是:旧逻辑在 token 恰好等于当前时间时不视为过期,导致极少数请求绕过鉴权;改为 <= 后临界情况被正确拦截。 这类信息只存在于作者脑子里,不写下来就永久丢失。

怎么做:

  • 主题行与正文之间空一行(git 规范要求)。
  • 正文用自然段落,每行不超过 72 字,方便 git log 展示。
  • 只写"为什么这样改"和"考虑过哪些替代方案、为何放弃",不复述 diff。
  • 如果有关联的 issue 或 PR,在正文末尾用 Closes #123 / Refs #456 标注。

4. 一次只提一件事

规则: 一个 commit 只做一件逻辑上内聚的事;功能、修复、格式整理混在一起时,必须拆成多个 commit。

为什么: AI 在帮用户完成任务时容易"顺手"把格式清理、变量重命名、无关 bug 修复一并提交。这类混合 commit 带来三个具体问题:① git bisect 时无法精确定位引入 bug 的节点;② cherry-pick 到其他分支时会带入不需要的副作用;③ code review 时 reviewer 不知道应该关注功能正确性还是格式合规,两件事互相干扰。

怎么做:

  • 在提交前用 git diff --staged 扫描暂存区:确认每一处修改都服务于同一个目的。
  • 发现夹带了无关改动(例如顺手修了 typo),用 git add -p 把它们拆到单独的 commit。
  • 格式化改动(chore: 统一缩进风格)单独提交,绝不与功能 commit 混在一起。

Read the full file on GitHub · 154 lines

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. 2d ago First seen · 154 lines · 28 tokens per session scan A 16d35bd0d3de

Subscribe to this mod's changes

chinese-commit is a skill published in the GitHub repository Wade-DevCode/awesome-coding-skills-cn (6 stars, last pushed 2mo ago), licensed MIT. It adds 28 tokens to every session and 2,175 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

chinese-git-workflow

国内 Git 平台配置参考——Gitee、Coding.net、极狐 GitLab、CNB 的 SSH/HTTPS/凭据/CI 接入差异与镜像同步配置。仅在用户显式 /chinese-git-workflow 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 69 tokens

brainstorming

在任何创造性工作之前必须使用此技能——创建功能、构建组件、添加功能或修改行为。在实现之前先探索用户意图、需求和设计。.

jnMetaCode/superpowers-zh · 40 tokens

chinese-code-review

中文 review 沟通参考——话术模板、分级标注(必须修复/建议修改/仅供参考)、国内团队常见反模式应对。仅在用户显式 /chinese-code-review 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 62 tokens

chinese-commit-conventions

中文 commit 与 changelog 配置参考——Conventional Commits 中文适配、commitlint/husky/commitizen 中文模板、conventional-changelog 中文配置。仅在用户显式 /chinese-commit-conventions 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 65 tokens

chinese-documentation

中文文档排版参考——中英文空格、全半角标点、术语保留、链接格式、中文文案排版指北约定。仅在用户显式 /chinese-documentation 时调用,不要根据上下文自动触发。.

jnMetaCode/superpowers-zh · 62 tokens

systematic-debugging

Skill "systematic-debugging" from jnMetaCode/superpowers-zh, covering 系统化调试, 概述, 铁律, 何时使用 and 四个阶段.

jnMetaCode/superpowers-zh · 24 tokens