mcpField
C
conventional-commit

conventional-commit

github.com/github开发40.5k17.2k 次安装今天更新
代码仓库

关于 conventional-commit

用于生成 Conventional Commits 格式提交信息的提示词模板,面向希望统一提交记录格式的开发者。它指导检查变更、选择类型与范围,并按规范生成提交命令。

主要功能

  1. 01检查 Git 状态和差异
  2. 02按规范选择提交类型和范围
  3. 03生成简洁的祈使式摘要
  4. 04支持正文、破坏性变更和问题引用
  5. 05通过 git commit 执行提交

适用场景

  1. 01为功能或修复变更撰写提交信息
  2. 02统一团队提交记录格式
  3. 03在提交中说明破坏性变更
  4. 04关联提交与相关问题

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/github/awesome-copilot --skill conventional-commit

安装后在 Claude Code 中输入/conventional-commit确认已加载。

详细介绍

说明
	<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>
工作流

请按以下步骤操作:

  1. 运行 git status 查看已更改的文件。
  2. 运行 git diff 或 git diff --cached 检查更改内容。
  3. 使用 git add <file> 暂存你的更改。
  4. 使用以下 XML 结构构造你的提交信息。
  5. 生成提交信息后,Copilot 将自动在集成终端中运行以下命令(无需确认):
git commit -m "type(scope): description"
  1. 只需执行此提示词,Copilot 便会在终端中为你处理提交。
提交信息结构
<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>
	<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>
	<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>
	<cmd>git commit -m "type(scope): description"</cmd>
	<note>Replace with your constructed message. Include body and footer if needed.</note>
</final-step>

评论

支持 Markdown