← Back to Skills Marketplace
gnllk

Git 提交信息生成器

by gnllk · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
118
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install commit-message-generator
Description
Git 提交信息生成器。根据代码变更内容自动生成符合 Conventional Commits 规范的提交信息,包含类型、范围、简短描述、详细说明和关联的 Issue/需求号。触发词:生成提交信息、提交信息、commit message、git commit、生成 commit 信息
README (SKILL.md)

Git 提交信息生成器

根据代码变更内容,自动生成符合 Conventional Commits 规范的 Git 提交信息。

何时使用

  • 完成代码修改后,需要生成规范的提交信息
  • 团队要求遵循 Conventional Commits 规范
  • 需要关联 Issue 或需求号
  • 不确定提交信息应该如何撰写

处理流程

Step 1: 接收变更描述

用户可以通过以下方式提供变更内容:

  • 文字描述变更内容
  • 粘贴 git diff 输出
  • 列出修改的文件和功能点

Step 2: 分析变更类型

使用 scripts/generate_commit_message.py 自动分析:

scripts/generate_commit_message.py "用户输入的变更描述"

自动识别变更类型:

类型 说明 关键词
feat 新功能 新增、添加、feature
fix 修复 Bug 修复、bug、问题
docs 文档 文档、readme、注释
style 格式 格式、空格、lint
refactor 重构 重构、整理、清理
perf 性能优化 性能、优化、加速
test 测试 测试、unit、用例
chore 杂项 配置、构建、工具

Step 3: 提取影响范围

自动识别模块/范围:

  • 从文件路径提取(如 src/algorithm/algorithm
  • 从代码内容识别(类名、函数名)
  • 匹配常见模块名

Step 4: 生成提交信息

生成符合规范的提交信息:

\x3Ctype>(\x3Cscope>): \x3Csubject>

\x3Cbody>

\x3Cfooter>

Step 5: 输出和复制

输出格式化的提交信息,用户可直接:

  • 复制到剪贴板
  • 用于 git commit 命令
  • 粘贴到 Git 工具中

提交信息结构

标准格式

feat(algorithm): 增加缓冲液单人份独立配置

- 新增配置项"单人份缓冲液量",用于精确计算消耗
- 修改稀释逻辑,支持按实际人份计算而非固定倍数
- 更新相关接口文档

Closes #234

各部分说明

主题行(Subject)

  • 格式:\x3Ctype>(\x3Cscope>): \x3Cdescription>
  • 长度:≤50 字符
  • 时态:一般现在时
  • 大小写:首字母小写

正文(Body)

  • 说明为什么修改,而非修改了什么
  • 每行≤72 字符
  • 可包含多个变更点

页脚(Footer)

  • Issue 关闭:Closes #123
  • 破坏性变更:BREAKING CHANGE: ...
  • 联合作者:Co-authored-by: ...

使用示例

示例 1:新功能

用户输入:

生成提交信息:新增缓冲液单人份配置功能,支持精确计算消耗量,需求号 234

输出:

feat(algorithm): 增加缓冲液单人份独立配置

- 新增配置项"单人份缓冲液量"
- 修改稀释逻辑,支持按实际人份计算

Closes #234

示例 2:Bug 修复

用户输入:

修复试剂仓传感器数据读取偶发失败的问题,添加重试机制

输出:

fix(sensor): 修复试剂仓传感器数据读取偶发失败

- 添加重试机制(最多 3 次)
- 增加超时处理
- 完善错误日志

影响:修复问题,建议尽快合并

示例 3:重构

用户输入:

重构稀释模块代码,提高可读性,无功能变化

输出:

refactor(dilution): 重构稀释模块代码提高可读性

- 拆分大函数为多个小函数
- 提取公共逻辑到工具类
- 添加单元测试覆盖

影响:代码重构,功能不变

示例 4:带 git diff

用户输入:

生成提交信息
diff --git a/src/core/algorithm.py b/src/core/algorithm.py
+ def calculate_reagent_volume():
+     """计算试剂用量"""
+     pass

输出:

feat(core): 新增试剂用量计算函数

- 新增 calculate_reagent_volume 函数
- 实现试剂用量计算逻辑

影响:新功能,不影响现有功能

参考文档

详见 references/conventional-commits.md - Conventional Commits 完整规范 详见 references/commit-examples.md - 提交信息示例集合

注意事项

  1. 主题行简洁 - 50 字符以内,一眼看懂变更
  2. 说明为什么 - 正文重点说明修改原因,而非内容
  3. 关联 Issue - 有需求号一定要关联,便于追溯
  4. 破坏性变更 - 如有 API 不兼容修改,必须标注 BREAKING CHANGE
  5. 原子提交 - 一次提交只做一件事,便于回滚和审查

团队规范建议

## 提交规范

1. 使用 Conventional Commits
2. 主题行 50 字符以内
3. 正文说明为什么修改
4. 关联 Issue 号
5. 破坏性变更必须标注
Usage Guidance
This skill appears coherent and limited to generating Conventional Commits messages from user-provided descriptions or diffs. Recommended precautions before installing/using: 1) Inspect SKILL.md and scripts/generate_commit_message.py locally for any hidden or unexpected content (the scanner flagged unicode-control characters in SKILL.md). 2) Do not paste diffs that contain secrets, credentials, or private keys into the skill — the generator uses whatever text you provide. 3) Run the Python script locally on harmless example diffs first to confirm behavior. 4) No credentials or installs are required, so there is low systemic risk; if you plan to integrate this into automated hooks, review and test the script to ensure it meets your team's policies.
Capability Assessment
Purpose & Capability
Name/description match the provided assets (SKILL.md, README, references, and a single Python script). No unrelated binaries, environment variables, or config paths are required.
Instruction Scope
Runtime instructions tell the agent to accept user text or a pasted git diff and run the included scripts/generate_commit_message.py. The instructions do not direct the agent to read arbitrary system files, access credentials, or send data to external endpoints.
Install Mechanism
No install spec — instruction-only plus a local script. Nothing is downloaded or written to disk by an installer.
Credentials
The skill declares no required environment variables, credentials, or config paths; the code likewise does not access external secrets or environment values.
Persistence & Privilege
Skill is not always-enabled and does not request elevated persistence or modify other skills/system settings. It produces output only and does not store tokens or alter agent config.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install commit-message-generator
  3. After installation, invoke the skill by name or use /commit-message-generator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
初始版本 - 支持自动生成符合 Conventional Commits 规范的 Git 提交信息,智能识别变更类型和范围,关联 Issue 号
Metadata
Slug commit-message-generator
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Git 提交信息生成器?

Git 提交信息生成器。根据代码变更内容自动生成符合 Conventional Commits 规范的提交信息,包含类型、范围、简短描述、详细说明和关联的 Issue/需求号。触发词:生成提交信息、提交信息、commit message、git commit、生成 commit 信息. It is an AI Agent Skill for Claude Code / OpenClaw, with 118 downloads so far.

How do I install Git 提交信息生成器?

Run "/install commit-message-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Git 提交信息生成器 free?

Yes, Git 提交信息生成器 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Git 提交信息生成器 support?

Git 提交信息生成器 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Git 提交信息生成器?

It is built and maintained by gnllk (@gnllk); the current version is v1.0.0.

💬 Comments