commit-message
Skill0 starsChanged 32 days agoApache-2.0View on GitHub
根据当前目录暂存区(git diff --staged)自动生成一条符合 Conventional Commits 规范的 commit message(中文描述), 确认后执行提交,不满意可重新生成。当用户说"帮我写 commit"、"生成提交信息"、"帮我提交"、"提交一下"、"写个 commit"、粘贴 git diff 内容,或使用斜杠命令 /commit-message 时,必须触发此 skill。
- Commits and pushes
62 other projects use a version of this.
Adopted by
Most recently taken up by
- AcademySoftwareFoundation/OpenImageIOtheir own version, first seen Nov 9, 2026
- haiderstudio/commit-message-skilltheir own version, first seen Nov 8, 2026
- mab-go/xmind-mcptheir own version, first seen Nov 8, 2026
- danielvm-git/bigpowerstheir own version, first seen Nov 6, 2026
- drinkspiller/skillstheir own version, first seen Nov 6, 2026
- mattiacerutti/supernovatheir own version, first seen Nov 2, 2026
Used with
Projects with it also use pr-description, changelog and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillpr-description
Draft Nacelle PR titles, pull request descriptions, commit titles, commit descriptions, and squash commit messages. Use when asked for PR or commit wording, a branch summary, or a PR description that can be used in a commit. Omit validation sections from commit bodies and remove filler.
Also in 9 projects that use this
HashiCorpSkillchangelog
Add a `.changelog/<PR_NUMBER>.txt` entry for a GitHub Pull Request, commit, and push.
Also in 3 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 7 projects that use this
GoogleSkillgrilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
Also in 3 projects that use this
OpenAISkillbrainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Also in 3 projects that use this
- +2 more from google
Other versions62 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 62
- zulip/zulip★ 26ksame name
- mergisi/awesome-openclaw-agents★ 4.1ksame name
- AltraMayor/f3★ 3.4ksame name
- github/copilot-cli-for-beginners★ 2.9ksame name
- AcademySoftwareFoundation/OpenImageIO★ 2.4ksame name
- sheshbabu/zen★ 1.2ksame name
- s-kostyaev/ellama★ 963same name
- tektoncd/operator★ 606same name
- danielvm-git/bigpowers★ 288same name
- rshdhere/vibecheck★ 213same name
52 more not listed
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 repository17 other files it gives its agents.
- bilibili-researchSkill
- chatgpt-share-downloadSkill
- claude-upgradeSkill
- docx-to-markdownSkill
- domain-availability-checkSkill
- embedded-lintSkill
- embedded-test-sopSkill
- laodao-upgradeSkill
- matt-pocock-upgradeSkill
- pdf-to-markdownSkill
- standards-initSkill
- tagSkill
- trademark-basic-searchSkill
- xlsx-to-csvSkill
- x-researchSkill
- youtube-researchSkill
- zhihu-researchSkill
The file
Files
Commit Message Generator
目标
自动读取暂存区变更,生成一条最优的 Conventional Commits 格式 commit message(中文描述), 经用户确认后执行提交。不满意可反复修改,直到满意为止。
工作流程
第一步:确认 diff 范围
若用户未明确指定范围,先询问:
请问要基于哪些变更生成 commit message?
1. 仅暂存区(git diff --staged)— 默认推荐
2. 全部未提交变更(git diff HEAD)- 用户选 1 或直接回车 → 运行
git diff --staged - 用户选 2 或说"全部"/"所有变更" → 运行
git diff HEAD - 若用户已粘贴 diff 内容 → 直接使用,跳过此步
- 若用户在触发时已说明范围(如"staged 的变更"、"暂存的变更"、"所有改动")→ 直接按其意图执行,无需再问
获取 diff 后:
- 若 diff 为空:提示"没有检测到变更,请确认文件已修改或已
git add",流程结束 - diff 较长时:抓住关键变更即可,无需逐行分析
第二步:判断是否需要分批提交
扫描所有变更文件,按模块路径 + 变更性质双维度评估:
- 单批:所有文件属于同一模块,或虽跨模块但属于同一次整体改动(如全局重构、统一升级依赖)
- 多批:文件跨多个无关模块,且各模块的变更性质不同(如同时有新功能和 bug 修复)
若判断为多批,展示分组方案:
检测到变更跨多个模块,建议分批提交:
批次 1:internal/auth/(新增登录接口)
批次 2:internal/order/(修复库存扣减 bug)
批次 3:docs/(更新 API 文档)
选择方式:
输入批次编号(如 1)→ 先提交该批次
输入 all → 合并为一条 commit 一次提交- 用户选择某批次 → 运行
git add <该批次的文件>暂存,然后继续第三步生成该批次的 message - 用户选 all → 直接进入第三步,生成一条概括性 message
- 若原本已是暂存区 diff 且已有明确的 add 范围,尊重用户已有的暂存状态,不强制拆分
第三步:分析变更,生成 commit message
按以下顺序思考:
- 扫描文件路径 → 确定 scope(模块名)
- 识别变更性质 → 新增 / 删除 / 修改了什么
- 判断 type → 参考下方类型表
- 提炼一句话描述 → 聚焦最核心改动,忽略次要细节
- 判断是否需要 body → 原因不明显时补充说明
第四步:展示并等待确认
用以下格式展示结果,清晰简洁:
已生成 commit message:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
feat(user): 新增用户注册接口
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
直接回车或输入 y → 确认提交
输入修改意见 → 重新生成第四步:根据用户反馈处理
用户确认(y / 回车 / "好" / "可以" / "提交"):
- 执行
git commit -m "<message>",记录返回的 commit hash 执行
git push,根据结果处理:push 成功 → 告知提交完成,附上 commit hash 和远端分支名
push 失败:新分支无上游(stderr 含
--set-upstream或no upstream):- 自动改用
git push -u origin <当前分支名>重试 - 成功则告知;仍失败则提示错误信息让用户处理
push 失败:远端有新提交(stderr 含
rejected或fetch first):- 提示用户:"远端有新提交,需要先同步。建议运行
git pull --rebase,完成后重新 push。" - 询问是否自动执行
git pull --rebase && git push
其他 push 失败 → 原样输出错误信息,告知 commit 已成功但 push 失败,用户可手动处理
- 自动改用
用户提出修改意见:
- 有具体意见(如"scope 改成 api"、"描述太长了")→ 针对性调整后重新生成
- 只说"不好"或"重新来"→ 换角度重新分析 diff,生成不同表达的 message
- 回到第四步,再次展示并等待确认
循环:反复执行直到用户确认提交,或明确表示放弃。
输出格式
<type>(<scope>): <中文简短描述>
[可选 body:每行不超过 72 字,说明"做了什么"和"为什么"]类型(type)选择规则
| type | 使用场景 |
feat | 新增功能、新接口、新字段 |
fix | 修复 bug、异常、逻辑错误 |
refactor | 重构代码,不改变功能 |
perf | 性能优化 |
docs | 仅修改注释或文档 |
test | 新增或修改测试 |
chore | 构建脚本、依赖更新、配置变更 |
style | 代码格式调整(不影响逻辑) |
scope 提取规则
- 从 diff 文件路径推断,取最能代表变更的模块名
- 例:
internal/auth/handler.go→ scope 为auth - 若变更跨多个无关模块,scope 可省略
描述写作规则
- 中文,动词开头("新增"、"修复"、"优化"、"重构")
- 不超过 50 字
- 不写"代码"、"逻辑"等废话,直接说做了什么
- 不以句号结尾
Body 写作规则(可选)
- 仅当改动较复杂、原因不显而易见时才写
- 说明"为什么这样改",不是逐行复述 diff
- 中文,每行 ≤ 72 字
示例
示例 1:新增 API 接口
diff 摘要:internal/user/handler.go 新增 CreateUser 函数及路由注册
输出:
feat(user): 新增创建用户接口示例 2:修复 bug + 需要解释原因
diff 摘要:internal/order/service.go 修复并发场景下的库存扣减问题
输出:
fix(order): 修复并发扣减库存时的数据竞争问题
高并发场景下多个 goroutine 同时读写库存字段,导致超卖。
改用 SELECT FOR UPDATE 加行锁确保原子性。示例 3:重构
diff 摘要:将 pkg/db 中多处重复的事务处理代码抽取为公共函数
输出:
refactor(db): 抽取事务处理为公共辅助函数注意事项
- 优先自动运行
git diff --staged;若用户已粘贴 diff 则使用用户提供的内容 - diff 为空时直接告知,不瞎猜
- 只输出一条最优结果,不提供多个候选
- 执行
git commit前必须获得用户明确确认 - 结果展示时不要加多余的解释文字,用户只需要能直接确认的 message
- 若用户明确指定了 scope 或 type,优先尊重用户意图
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.

