Git 提交信息生成
commit-message
为当前已暂存的 git 变更生成符合约定式提交(Conventional Commits)规范的提交信息。当用户想要提交代码、要求提供提交信息,或询问提交该写什么时使用。
- License 许可
- MIT
- 最近更新
- 2026-05-15
- Stars
- ★ 13
- Forks
- 1
01 前言 Front Matter
- name
- commit-message
- title
- commit-message
- description
- Generate a conventional commit message for the current staged git changes. Use when the user wants to commit, asks for a commit message, or asks what to write for a commit.
- allowed-tools
- Bash(git diff *) Bash(git status *)
03 SKILL.md 正文
Instructions
-
Run
git diff --stagedto see exactly what is staged for the next commit. -
Run
git status --shortto understand the full scope of changes (staged and unstaged) and identify the files involved. -
If nothing is staged, tell the user there is nothing staged and suggest they run
git addfirst. Stop here. -
Choose the correct Conventional Commits type based on the diff:
feat: a new feature or capability visible to users or callersfix: a bug fixdocs: documentation changes onlystyle: formatting, whitespace, missing semicolons — no logic changerefactor: code restructuring with no behavior change and no new featuretest: adding or correcting testschore: build system, dependency updates, tooling, CI config
-
Determine the scope from the changed files. The scope is optional but useful when the change is clearly isolated to one module, package, or layer (for example,
api,auth,db,cli). Omit it if the change is broad. -
Write the subject line:
- Format:
type(scope): descriptionortype: descriptionif no scope - Imperative mood: "add", "fix", "remove" — not "added", "fixes", "removing"
- Maximum 72 characters
- No period at the end
- Format:
-
If the diff is non-trivial (more than one logical change, or a change whose motivation is not obvious from the code), add a body:
- Blank line after the subject
- Bullet points explaining why the change was made, not what it does (the diff already shows what)
- Keep each bullet under 72 characters
-
Output only the commit message text. No surrounding explanation, no markdown code block wrapping.
04 同仓库更多 Skills
版本号升级与 Git 标签
tag-version
升级软件包版本并创建带注释的 git 标签。接受语义化版本号(1.2.0)或升级类型(patch、minor、major)。不执行推送——请使用 publish 技能进行推送。作为发布工作流的一部分使用。
项目完整发布流程
release
运行完整的发布工作流:变更日志条目、版本升级、git 标签和 GitHub Release。依次调用 changelog-entry、tag-version 和 publish。在发布项目新版本时使用。
GitHub 版本发布
publish
将当前分支和所有标签推送到 origin,然后使用最新标签及其 CHANGELOG.md 条目创建 GitHub Release。在 tag-version 之后使用以完成发布。
变更日志条目生成
changelog-entry
按照 Keep a Changelog 格式为所有未发布的提交起草变更日志条目。将提交分组为新增(Added)、变更(Changed)、修复(Fixed)、移除(Removed)和安全(Security)。在发布新版本之前或更新 CHANGELOG.md 时使用。
代码自动格式化
auto-format-on-edit
每次编辑后使用 Prettier 和 ESLint 自动格式化代码文件。当 Claude 编辑文件时在后台激活。格式化是静默的——没有提示,除非格式化程序失败,否则没有输出。当您希望在编码会话期间自动执行一致的格式化时使用。
代码质量审计
code-quality-audit
运行全面的代码质量审计,涵盖安全性、性能和可维护性。用于季度审计、发布前审查或接入大型代码库时。