commit-message-writer
Skill1 starsChanged 3 months agoMITView on GitHub
提交信息规范。根据暂存区改动生成符合 Conventional Commits 的提交信息,支持中文描述,自动处理类型、范围、破坏性变更。Use to write standardized commit messages from staged git changes.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- Lethe044/agentskill-kittheir own version, first seen Nov 1, 2026
- bestdeejay-design/agent-skillstheir own version, first seen Aug 9, 2026
- michaelm7456/claude-skillstheir own version, first seen Jul 19, 2026
- bilals2008/bilal-skillstheir own version, first seen Jul 4, 2026
- RandyRawgust/ai-knowledge-base-templatetheir own version, first seen May 22, 2026
- sujithq/skillstheir own version, first seen May 20, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- Lethe044/agentskill-kit★ 48same name
- bestdeejay-design/agent-skills★ 6same name
- RandyRawgust/ai-knowledge-base-template★ 1same name
- bilals2008/bilal-skills★ 0same name
- kakarot-oncloud/claude-dev-skills★ 0same name
- michaelm7456/claude-skills★ 0same name
- sujithq/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- api-contract-designerSkill
- api-testerSkill
- bug-diagnoserSkill
- cache-governorSkill
- ci-cd-setupSkill
- code-migratorSkill
- code-reviewerSkill
- db-migration-reviewerSkill
- db-schema-designerSkill
- dev-env-troubleshooterSkill
- frontend-debugSkill
- git-workflowSkill
- log-analysisSkill
- meeting-minutesSkill
- natural-chinese-writerSkill
- performance-profilerSkill
- release-note-writerSkill
- requirement-clarifierSkill
- requirements-reviewerSkill
- security-reviewerSkill
- skill-creator-cnSkill
- skill-style-guideSkill
- sql-reviewerSkill
- task-decomposerSkill
- tdd-workflowSkill
- tech-design-writerSkill
- tech-doc-writerSkill
- weekly-reportSkill
The file
Files
提交信息规范
何时使用
- 用户说"写个 commit message""帮我提交";
- 提交信息不规范(整段废话、不写类型、一句"update");
- 需要为改动生成规范且可检索的提交信息。
使用步骤
第 1 步:查看改动
执行并分析:
git status
git diff --cached --stat # 暂存区的改动概况
git diff --cached # 具体改动若暂存区为空,提示用户先 git add,或询问是否查看工作区改动。
第 2 步:确定类型与范围
类型(必选):
| 类型 | 含义 |
| feat | 新功能 |
| fix | 修复 Bug |
| docs | 文档 |
| style | 格式(不影响逻辑) |
| refactor | 重构(不改变行为) |
| perf | 性能优化 |
| test | 测试 |
| build | 构建/依赖 |
| chore | 杂项 |
| revert | 回滚 |
范围(可选):模块名,如 feat(auth): 增加登录接口。
第 3 步:生成提交信息
格式:
<type>(<scope>): <subject>
<body(可选)>
<footer(可选,如 BREAKING CHANGE)>规则:
- subject 一句话概括,≤ 72 字符;
- subject 用祈使句:动词开头(增加、修复、重构);
- 中文描述为主,类型用英文约定词;
- 一个 commit 只做一件事;
- 破坏性变更必须写
BREAKING CHANGE:说明。
第 4 步:输出并应用
输出完整提交信息供用户确认,确认后执行:
git commit -m "<subject>" -m "<body>"速查表
详细的类型列表、写法对比和模板见 references/CHEATSHEET.md。
输入与输出
- 输入:git 暂存区改动(或用户描述的改动);
- 输出:规范化的提交信息(可含正文)。
示例
git add src/login.py tests/test_login.py生成:
feat(auth): 增加用户名密码登录接口
- 使用 bcrypt 校验密码
- 登录成功返回 JWT,失败返回 401
- 补充登录接口单元测试修复示例:
fix(cart): 修复购物车满减金额计算错误
满减在四舍五入后多算了 1 分钱。
改为先计算再取整。破坏性变更示例:
feat(api): 移除 v1 登录接口
BREAKING CHANGE: v1 /login 接口移除,请迁移到 v2 /login。辅助脚本
scripts/commit_message_gen.py 根据暂存区改动生成提交信息草稿(推断类型和范围),不执行 commit:
git add -A
python scripts/commit_message_gen.py生成的草稿需要人工完善 subject。
注意事项
- 不要用"update""修复了一些东西"这类无信息提交;
- 如果一次改动混杂多个类型,提示用户拆分成多个 commit;
- 未确认前不直接执行
git commit(先给用户看); - 若仓库已有约定(如必须带 issue 号),遵循仓库约定并加入 footer。
不适用场景
- 用户要的是提交策略建议(用 git-workflow);
- 改动尚未发生、纯设想场景;
- 用户明确指定了要写的内容。
验证方式
- 触发:"写个 commit message";
- 检查:格式为
<type>: <subject>,subject ≤ 72 字符且动词开头; - 抽查:对照
git diff,确认描述与改动一致。
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
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.

