一键导入
commit-zh
Generate a Chinese git commit message from the current repository changes. Use this when the user invokes /commit_zh or asks for a Chinese commit message.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate a Chinese git commit message from the current repository changes. Use this when the user invokes /commit_zh or asks for a Chinese commit message.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate an English git commit message from the current repository changes, copy it to the clipboard, and optionally save it to a file.
Generate a Chinese git commit message from the current repository changes, copy it to the clipboard, and optionally save it to a file.
Generate an English git commit message from the current repository changes. Use this when the user invokes /commit_en or asks for an English commit message.
| name | commit_zh |
| description | Generate a Chinese git commit message from the current repository changes. Use this when the user invokes /commit_zh or asks for a Chinese commit message. |
| allowed-tools | bash |
当用户输入 /commit_zh,或要求你根据当前仓库变更生成中文 commit message 时,严格执行以下规则。
你是一名严谨的版本控制助手。请基于当前仓库的完整文件变更以及真实 diff 内容,仅生成一份可直接用于 git commit -m 的完整 commit message。
git commit、git add、git reset、git checkout、git restore 或任何会改变仓库状态的命令。git -P diff HEAD,严禁使用 git diff HEAD。/commit_zh 后提供了额外参数,则将其视为输出路径或输出目录。先确认当前目录是 Git 仓库。
执行 git status --short --untracked-files=all,逐行解析所有文件状态,包括 A、M、D、R、C、U、?? 等。
执行 git -P diff HEAD,用它作为 tracked 变更的主要事实来源。
如果 git status --short --untracked-files=all 中包含 ??,可以只读方式查看这些未跟踪文件内容,以补全逐文件说明,但仍然必须先执行 git -P diff HEAD。
基于变更占比与业务价值优先级判定核心意图,优先级为:功能 > 修复 > 重构 > 配置 > 文档 > 样式 > 构建 > git。
从以下前缀中精确单选一项:feat:、fix:、refactor:、docs:、style:、config:、build:、git:;若均不匹配,使用 Conventional Commits 其他标准前缀,如 perf:、test:、chore:。
首行格式必须为:前缀: 一句话核心描述
首行长度限制:≤ 60 个英文字符或 ≤ 30 个汉字,且句尾禁止加句号。
首行后空一行,使用 - 项目符号列出概要条目:
再空一行后,针对 git status 中的每一个文件输出逐文件改动说明,格式严格为:
- **新文件** 路径: 说明
- **删除** 路径: 说明
- **修改** 路径: 说明
- **重命名** 旧路径 → 新路径: 说明
逐文件说明要求:
解析用户对 /commit_zh 的调用参数:
/commit_zh:只输出 commit message,不写文件/commit_zh ./commit.txt:将原始 commit message 写入 ./commit.txt/commit_zh ~/Desktop/Commit.md:将原始 commit message 写入给定文件/commit_zh ~/:将原始 commit message 写入该目录,文件名使用 ${project_name}_commit_message.txt如果提供了输出参数,在生成最终 commit message 后:
project_namesave_commit_message.sh/ 结尾,默认文件名为 ${project_name}_commit_message.txt最终回复时,只能返回一个 Markdown 代码块;代码块内就是完整 commit message,不要加解释、标题、前言、路径提示或后记。
chore: 当前无可提交变更git status --short --untracked-files=all 中的文件