🚀 快速安装
复制以下命令并运行,立即安装此 Skill:
npx @anthropic-ai/skills install github/awesome-copilot/conventional-commit
💡 提示:需要 Node.js 和 NPM
操作指南
<description>该文件包含用于生成遵循约定式提交规范的消息模板。它提供了说明、示例和格式化指南,帮助用户根据约定式提交规范编写标准化、描述性的提交消息。</description>
工作流程
请遵循以下步骤:
- 运行
git status查看已更改的文件。 - 运行
git diff或git diff --cached检查更改内容。 - 使用
git add <file>暂存您的更改。 - 使用以下 XML 结构构建您的提交消息。
- 生成提交消息后,Copilot 将自动在您的集成终端中运行以下命令(无需确认):
git commit -m "type(scope): description"
- 只需执行此提示,Copilot 就会在终端中为您处理提交操作。
提交消息结构
<commit-message>
<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert</type>
<scope>()</scope>
<description>对更改的简短、祈使句摘要</description> <!-- 翻译 -->
<body>(可选:更详细的解释)</body> <!-- 翻译 -->
<footer>(可选:例如 BREAKING CHANGE:详细信息,或议题引用)</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>必须是允许的类型之一。参见 <reference>https://www.conventionalcommits.org/zh-hans/v1.0.0/</reference></type> <!-- 翻译并更新为中文链接 -->
<scope>可选,但建议使用以提高清晰度。</scope> <!-- 翻译 -->
<description>必填。使用祈使语气(例如 "add",而不是 "added" 或 "adds")。</description> <!-- 翻译 -->
<body>可选。用于提供附加上下文。</body> <!-- 翻译 -->
<footer>用于标记破坏性变更或引用议题。</footer> <!-- 翻译 -->
</validation>
最后一步
<final-step>
<cmd>git commit -m "type(scope): description"</cmd>
<note>请替换为您构建的消息。如有需要,可包含正文和脚注。</note> <!-- 翻译 -->
</final-step>
📄 原始文档
完整文档(英文):
https://skills.sh/github/awesome-copilot/conventional-commit
💡 提示:点击上方链接查看 skills.sh 原始英文文档,方便对照翻译。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

评论(0)