From git-commit-format
Generate concise, accurate Git commit messages using Conventional Commits format. Use when the user modifies code in a git workflow, after git add, ready to commit, or says "写 commit", "generate commit message", "write commit", "commit message", "提交代码", "commit", "生成提交信息", "帮我提交".
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-commit-format:git-commit-formatThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- 当前分支:!`git branch --show-current`
git branch --show-currentgit remote -vgit status --shortgit diff --cached --statgit diff --cached | head -500git log --oneline -10若上方「暂存区 diff」为空,执行 git add .(仅跟踪文件)后重新读取 git diff --cached。
根据 $ARGUMENTS 决定:
c / commit / --commit:生成 message → 直接执行 git commit(跳过确认)p / push / --push:检查 CI → 生成 message → 直接执行 commit → git push(跳过确认)v / view:仅生成 message 展示预览,不自动执行如果分支名含中文、空格或明显不规范的临时命名,给出一行提醒。
基于上方「暂存区 diff」的实际内容生成。
<type>(<scope>): <imperative summary>
type — 从 feat、fix、refactor、perf、docs、test、chore、build、ci、style、revert 中选择。完整 type 定义和场景说明见 references/commit-types.md。
scope — 从项目结构和变更位置推断。单模块变更用模块目录名(如 api、frontend、backend、db、config、deps),多模块变更可省略 scope。
标题已能说明时跳过正文。仅在以下情况加正文:
Closes #42、Refs #17)正文每行 wrap at 72 chars,正文和标题之间空一行。
add、fix、remove — 不要 added、adds、adding"This commit does"、"I"、"we"、"now"、"currently""Generated with Claude Code" 或任何 AI 署名"As requested by..." — 如需归属改用 Co-authored-by trailerAskUserQuestion 工具询问是否确认提交或提交并推送--commit/自动提交:生成 message 后直接执行 git commit -m "..."(有正文用 heredoc),跳过询问确认,然后 git status 确认--push/提交并推送:生成 message 后直接执行以下步骤,跳过询问确认:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/nullgh CLI,检查 CI 状态:gh run view --branch <branch> --limit 1 --json status,conclusiongit commit → git push严格按以下格式输出,不得添加模板外的任何文本:
提交预览(Committing to <branch>)
提交信息:
<type>(<scope>): <summary>
- <body line 1>
- <body line 2>
变更文件:
• <file> (+N/-N)
• <file> (+N/-N)
格式规则:
<type>(<scope>): <imperative summary>,scope 仅单模块时出现 - 开头(两空格 + 连字符 + 空格),正文与标题空一行,≤3 行• <relative-path> (+N/-N),文件数 >15 时展示前 15 个 + ... 及 N 个其他文件禁止输出: 开头引导语(已为您生成、以下是)、结尾确认语(是否确认提交?)、解释说明、模型署名、emoji
references/commit-types.md — 完整的 type 定义、scope 推断规则和更多示例references/output-format.md — Preview 输出的严格格式约束Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub kanocifer/git-commit-format --plugin gcf