跳到正文
Skillpedia
通用编程40k · #7121

conventional-commit

它能做什么

这个工具可以帮你撰写清晰、规范的提交信息,用来记录代码的改动。它遵循特定的格式,让其他开发者也能轻松理解改动了什么。

适用场景

  • ✓当你为代码添加新功能时。
  • ✓当你修复代码中的 bug 时。
  • ✓当你更新代码文档时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/conventional-commit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/conventional-commit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  1. Run git status to review changed files.
  2. Run git diff or git diff --cached to inspect changes.
  3. Stage your changes with git add <file>.
  4. Construct your commit message using the following XML structure.
  5. 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"
  1. 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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能