conventional-commit
它能做什么
这个工具可以帮你撰写清晰、规范的提交信息,用来记录代码的改动。它遵循特定的格式,让其他开发者也能轻松理解改动了什么。
适用场景
- ✓当你为代码添加新功能时。
- ✓当你修复代码中的 bug 时。
- ✓当你更新代码文档时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/conventional-commit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请生成一条提交信息,内容是添加一个新的登录按钮,类型为 'feat',范围为 'ui'。”
每周 5 个新技能,1 分钟读完。
工作原理
你需要填写一个模板,包括改动类型(比如 'feat' 表示新功能,'fix' 表示 bug 修复)、简短的摘要,以及可选的详细说明。工具随后会为你生成最终的提交信息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Instructions
<description>This file contains a prompt template for generating conventional commit messages. It provides instructions, examples, and formatting guidelines to help users write standardized, descriptive commit messages in accordance with the Conventional Commits specification.</description>
Workflow
Follow these steps:
- Run
git statusto review changed files. - Run
git difforgit diff --cachedto inspect changes. - Stage your changes with
git add <file>. - Construct your commit message using the following XML structure.
- After generating your commit message, Copilot will automatically run the following command in your integrated terminal (no confirmation needed):
git commit -m "type(scope): description"
- Just execute this prompt and Copilot will handle the commit for you in the terminal.
Commit Message Structure
<commit-message>
<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert</type>
<scope>()</scope>
<description>A short, imperative summary of the change</description>
<body>(optional: more detailed explanation)</body>
<footer>(optional: e.g. BREAKING CHANGE: details, or issue references)</footer>
</commit-message>
Examples
<examples>
<example>feat(parser): add ability to parse arrays</example>
<example>fix(ui): correct button alignment</example>
<example>docs: update README with usage instructions</example>
<example>refactor: improve performance of data processing</example>
<example>chore: update dependencies</example>
<example>feat!: send email on registration (BREAKING CHANGE: email service required)</example>
</examples>
Validation
<validation>
<type>Must be one of the allowed types. See <reference>https://www.conventionalcommits.org/en/v1.0.0/#specification</reference></type>
<scope>Optional, but recommended for clarity.</scope>
<description>Required. Use the imperative mood (e.g., "add", not "added").</description>
<body>Optional. Use for additional context.</body>
<footer>Use for breaking changes or issue references.</footer>
</validation>
Final Step
<final-step>
<cmd>git commit -m "type(scope): description"</cmd>
<note>Replace with your constructed message. Include body and footer if needed.</note>
</final-step>
常见问题
什么是“commit”?
commit(提交)就像是为你的代码项目“保存”一次,记录下这组改动。
为什么要使用统一的格式?
它能让项目历史保持条理,方便所有参与项目的人理解。
“祈使语气”是什么意思?
指使用动词的命令形式,比如 'add'(添加)或 'fix'(修复),而不是 'added' 或 'fixed' 这样的过去式。
详情
作者的原始描述
Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation.
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7121
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。