gen-commit

gen-commit is a command for Claude Code from shenjingnan/home-mcp. It costs 8 tokens per session (1,073 once invoked), scanned A, original, MIT.

A command that drafts Chinese Git commit messages, branch names, and change summaries for code review. Git records code changes and their history.

In plain words
What is it for?
Use it to review local changes, choose a branch name, and prepare a Conventional Commits-style message with a short title and detailed notes.
Why use it?
It turns a set of code changes into a consistent explanation of the reason, scope, implementation, and verification without submitting the commit.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/shenjingnan/home-mcp/gen-commit
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/home-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gen-commit

README.md
[![agentmods](https://agentmods.dev/badge/commands/shenjingnan/home-mcp/gen-commit.svg)](https://agentmods.dev/commands/shenjingnan/home-mcp/gen-commit)
Your own site
<a href="https://agentmods.dev/commands/shenjingnan/home-mcp/gen-commit"><img src="https://agentmods.dev/badge/commands/shenjingnan/home-mcp/gen-commit.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,073 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00008 $0.01073
Opus 5 $0.00004 $0.00536
Sonnet 5 $0.00002 $0.00215
Haiku 4.5 $0.00001 $0.00107

Measured 4d ago against content hash 1014f3dbcc5b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gen-commit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/gen-commit.md · 116 lines

What it actually says

我希望你提供给我的内容

  1. 符合 git 规范的 commit 标题和详细说明
  2. 你认为合理的一个分支名称
  3. 生成的 commit 信息必须是中文
  4. 重点:提供便于代码评审人快速理解改动的完整信息

代码评审友好的 commit 信息要求

一个好的 commit 信息应该让评审人能够:

  • 快速理解改动的背景和动机
  • 明确知道改动的范围和影响
  • 了解技术实现的关键点
  • 知道如何验证改动的正确性

一些提示信息

  1. 你可以通过命令:git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' 知道当前仓库的主分支名称
  2. 获取主分支名称后,需要与远端主分支进行对比,因为本地主分支代码可能落后
  3. 当前本地的 origin 可能不是最新,应该先执行 git fetch origin 更新
  4. 优先检查未 git add 的改动
  5. 执行命令时避免交互操作,因为无法进行用户干预。推荐使用 --no-pager 选项

我的要求

基本要求:

  • commit 标题符合 git 规范,简洁明确,不超过 50 字符
  • 忽略当前分支名称(不具有参考价值)
  • 仅提供 commit 信息建议,不执行实际的代码提交操作

Type 类型:

  • feat:新增 feature
  • fix:修复 bug
  • docs:仅仅修改了文档,比如 README、CHANGELOG、CONTRIBUTE 等等
  • style:仅仅修改了空格、格式缩进、逗号等等,不改变代码逻辑
  • refactor:代码重构,没有加新功能或者修复 bug
  • perf:优化相关,比如提升性能、体验
  • test:测试用例,包括单元测试、集成测试等
  • chore:改变构建流程、或者增加依赖库、工具等
  • revert:回滚到上一个版本

分支命名规范:

  • 使用前缀:feature/bugfix/docs/test/
  • 分支名简洁反映改动内容,采用 kebab-case 格式

Commit 信息结构要求:

<type>(<scope>): <subject>

## 改动说明
- 为什么改:<改动动机和问题背景>
- 改了什么:<具体的改动内容>
- 影响范围:<受影响的模块和兼容性>
- 验证方式:<测试方法或验证点>

输出格式:

<分支名称>
<type>(<scope>): <subject>

## 改动说明
- 为什么改:<改动动机和问题背景>
- 改了什么:<具体的改动内容>
- 影响范围:<受影响的模块和兼容性>
- 验证方式:<测试方法或验证点>

Commit 示例

示例 1:功能开发

feat(api): 新增用户认证接口

## 改动说明
- 为什么改:提升系统安全性,实现基于JWT的用户认证
- 改了什么:新增UserAuthController,实现register、login、refresh-token接口
- 影响范围:新增/api/auth/*路由,需要前端适配认证流程
- 验证方式:新增15个单元测试,集成测试验证完整流程

示例 2:Bug 修复

fix(core): 修复内存泄漏导致的性能问题

## 改动说明
- 为什么改:生产环境发现内存持续增长导致服务崩溃
- 改了什么:修复EventEmitter监听器未移除问题,优化内存管理
- 影响范围:核心服务内存使用优化约30%,API接口保持不变
- 验证方式:24小时压力测试验证内存稳定性

生成 Commit 时的注意事项

  1. 保持真实性:基于实际代码改动生成信息,不要虚构不存在的内容
  2. 突出重点:评审人最关心的是"为什么改"和"改了什么"
  3. 具体明确:避免模糊的描述,如"优化了性能"应具体说明如何优化
  4. 结构清晰:按照模板结构组织信息,便于快速阅读
  5. 技术准确:确保技术实现描述的准确性和专业性
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 116 lines · 8 tokens per session scan A 1014f3dbcc5b

Subscribe to this mod's changes

gen-commit is a command published in the GitHub repository shenjingnan/home-mcp (21 stars, last pushed 7mo ago), licensed MIT. It adds 8 tokens to every session and 1,073 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.