commit-message-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrerequisites
前提条件
- This Skill retrieves Git diffs and suggests meaningful commit messages
- Message format should follow Conventional Commits
- Commit messages should have a one-line Conventional Commits header, an optional blank second line, and from the third line onward include a bulleted list summarizing the changes
- Commit messages should be in English
- Never perform Git commit or Git push
- 该Skill可获取Git diff并生成有意义的提交信息建议
- 消息格式需遵循Conventional Commits规范
- 提交信息应包含一行符合Conventional Commits规范的标题,可选的空行,从第三行开始使用项目符号列表总结变更内容
- 提交信息需使用英文
- 绝对不要执行Git commit或Git push操作
Steps
操作步骤
- Run to check modified files
git status - Retrieve diffs with or
git diffgit diff --cached - Analyze the diff content and determine if changes should be split into multiple commits
- For each logical group of changes:
- List the target files
- Generate a message in English compliant with Conventional Commits
- Suggest the command:
git add <files> && git commit -m "<message>"
- If changes are extensive and should be split, provide:
- Rationale for the split
- Multiple commit suggestions with their respective target files and messages
- 运行查看已修改文件
git status - 使用或
git diff获取diff内容git diff --cached - 分析diff内容,判断是否应将变更拆分为多个提交
- 针对每一组逻辑相关的变更:
- 列出目标文件
- 生成符合Conventional Commits规范的英文提交信息
- 建议执行命令:
git add <files> && git commit -m "<message>"
- 如果变更内容较多且需要拆分,需提供:
- 拆分的理由
- 多个提交建议,包含各自的目标文件和提交信息
Commit Splitting Guidelines
提交拆分准则
- Split commits when changes span multiple logical concerns (e.g., feature + refactoring)
- Group related files that serve the same purpose
- Keep each commit focused on a single, atomic change
- 当变更涉及多个逻辑关注点时(例如:功能开发 + 代码重构),拆分提交
- 将用途相同的相关文件归为一组
- 确保每个提交聚焦于单一、原子性的变更
Notes
注意事项
- This Skill must never execute or
git commitgit push - Only suggest commands; execution is entirely at user's discretion
- Users must explicitly perform commits and pushes themselves
- 该Skill绝对不能执行或
git commit操作git push - 仅提供命令建议;执行操作完全由用户自行决定
- 用户必须自行明确执行提交和推送操作