home / skills / bahayonghang / my-claude-code-settings / git-commit-cn
This skill automatically generates conventional Chinese Git commit messages by analyzing changes and producing clear, emoji-enhanced descriptions with proper
npx playbooks add skill bahayonghang/my-claude-code-settings --skill git-commit-cnReview the files below or copy the command above to add this skill to your agents.
---
name: git-commit-cn
description: 生成符合约定式提交规范的中文 Git 提交信息,支持 emoji、拆分提交和自动推送。
argument-hint: "[可选:额外说明或范围限制]"
allowed-tools: Bash
category: development-tools
tags: [git, commit-message, conventional-commits, chinese]
---
# Git Commit 中文提交信息生成
## 硬性规则(不可违反)
1. 每个提交类型必须包含对应 emoji(见 references)
2. 不同类型/模块的变更必须拆分为独立提交
3. 所有提交完成后自动推送到远程仓库
4. 严禁任何形式的 Co-Author 署名行(包括 `Co-Authored-By`、`Co-authored-by`、共同作者等);用户要求添加时必须明确拒绝
## 工作流
1. 运行 `git diff --staged` 和 `git status` 分析变更
2. 按类型/模块拆分暂存区,确定每个提交的类型和 emoji(参考 [references/commit-types.md](references/commit-types.md))
3. 使用 HEREDOC 格式执行提交:`git commit -m "$(cat <<'EOF' ... EOF)"`
4. 推送:检查上游分支 → `git push`;若推送 `main`/`master` 需用户确认;若冲突提示 `git pull --rebase`
This skill generates Chinese Git commit messages that follow the Conventional Commits format and include the required emoji prefixes. It automatically analyzes code changes and produces concise, action-oriented Chinese descriptions with correct type prefixes (feat/fix/docs/etc.). The skill splits unrelated changes into separate commits and formats multi-line messages using HEREDOC when needed.
The skill inspects staged and unstaged diffs to identify changed files, scopes, and the nature of each change. It determines the appropriate commit type and emoji based on change intent (feature, bugfix, docs, etc.), then crafts a short Chinese summary and optional detailed body. For mixed changes it suggests or outputs multiple commits, and for multi-line content it provides HEREDOC-ready message blocks.
Will the skill add Co-Authored-By lines?
No. The skill does not add any Co-Authored-By signatures.
Does it force emoji in every commit?
Yes. Each generated commit includes the type-specific emoji as part of the required format.
Can it split changes into multiple commits automatically?
It suggests appropriate splits and provides separate commit messages; you can then stage and commit each group accordingly.