“生成代码评审友好的 commit 信息”

— description from SKILL.md by shenjingnan
MITAuto-check passedDevelopment

Install Commit

skills CLI
$ npx skills add shenjingnan/xiaozhi-client --skill commit -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install shenjingnan/xiaozhi-client commit --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/shenjingnan/xiaozhi-client.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/commit .claude/skills/commit && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
commit
GitHub stars
341
Token cost
~1.4k tokens
SKILL.md length
192 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
MIT

At a glance

  • Works in 12 steps: 代码改动分析 → Commit 类型判断 → 分支名称生成 → …
  • SKILL.md covers 技能能力, Commit 示例, 生成 Commit 时的注意事项 and xiaozhi-client 项目特定规范, plus 3 more sections
  • Calls git

About this skill

Commit is a skill in shenjingnan/xiaozhi-client (341 stars). Its SKILL.md is about 1.4k tokens. Licence: MIT.

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. 代码改动分析
  2. Commit 类型判断
  3. 分支名称生成
  4. Commit 信息生成
  5. 真实性原则
  6. 评审友好原则
  7. 格式规范
  8. 路径别名系统
  9. 常见改动模式
  10. 与项目开发理念一致
  11. Git 别名
  12. 与其他技能配合

What it can do on your machine

Read from SKILL.md and the folder at commit fe3c382. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Commit loads about 1.4k tokens when it runs. Until then it costs about 7 tokens; SKILL.md has 192 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~7
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from shenjingnan/xiaozhi-client at commit fe3c382, republished under its MIT licence (© shenjingnan). 192 words, ~1,400 tokens.

Download SKILL.mdSave it as .claude/skills/commit/SKILL.md (or your agent's skills folder).
name
commit
description
生成代码评审友好的 commit 信息

我是 Git Commit 生成技能,专门为 xiaozhi-client 项目生成符合规范的、代码评审友好的 commit 信息,同时遵循务实开发理念。

技能使用原则
  • 真实准确,但避免过度详细:基于实际代码改动生成信息,不虚构不存在的细节
  • 评审友好优先,格式完美次之:让评审人快速理解改动比完美格式更重要
  • 简单明确优于复杂说明:优先选择清晰直接的描述方式
  • 务实开发指导:突出"为什么改"和"改了什么"两个核心问题

技能能力

1. 代码改动分析

核心能力:分析实际的代码改动,提取关键信息用于生成 commit 信息。

分析流程
bash
# 1. 更新远程分支信息
git fetch origin

# 2. 获取主分支名称
MAIN_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')

# 3. 获取改动内容(优先检查未 add 的改动)
git diff --no-pager
git diff --cached --no-pager

# 4. 获取相对于主分支的改动
git diff --no-pager origin/$MAIN_BRANCH...HEAD
分析要点
  • 改动范围:哪些文件、模块被修改
  • 改动类型:新增功能、修复 bug、重构、文档更新等
  • 影响分析:改动对现有功能的影响
  • 验证方式:如何验证改动的正确性
2. Commit 类型判断

根据改动内容自动判断合适的 commit 类型。

Type 类型定义
  • feat:新增 feature
  • fix:修复 bug
  • docs:仅仅修改了文档,比如 README、CHANGELOG、CONTRIBUTE 等等
  • style:仅仅修改了空格、格式缩进、逗号等等,不改变代码逻辑
  • refactor:代码重构,没有加新功能或者修复 bug
  • perf:优化相关,比如提升性能、体验
  • test:测试用例,包括单元测试、集成测试等
  • chore:改变构建流程、或者增加依赖库、工具等
  • revert:回滚到上一个版本
类型判断示例
typescript
// feat 判断标准
// - 新增文件
// - 新增公共方法
// - 新增配置选项
// - 新增 API 端点

// fix 判断标准
// - 修复 bug
// - 修复内存泄漏
// - 修复崩溃问题
// - 修复类型错误

// refactor 判断标准
// - 代码结构调整
// - 变量重命名
// - 代码提取/合并
// - 类型定义优化

// test 判断标准
// - 新增测试用例
// - 修复测试用例
// - 提高测试覆盖率
3. 分支名称生成

根据改动内容生成符合规范的分支名称。

分支命名规范
  • 前缀类型:feature/、bugfix/、docs/、test/、refactor/、chore/
  • 格式要求:kebab-case 格式,简洁反映改动内容
  • 长度限制:不超过 50 字符
分支命名示例
bash
# 功能开发
feature/add-user-auth-api
feature/implement-websocket-adapter
feature/support-modelscope-integration

# Bug 修复
bugfix/fix-memory-leak
bugfix/fix-type-error-in-mcp-service
bugfix/fix-connection-timeout-issue

# 文档更新
docs/update-readme-installation
docs/add-mcp-protocol-guide

# 测试相关
test/add-unit-tests-for-connection-manager
test-improve-test-coverage

# 重构
refactor-simplify-mcp-manager
refactor-optimize-path-alias-system
4. Commit 信息生成

生成符合代码评审友好的 commit 信息。

Commit 信息结构
<type>(<scope>): <subject>

## 改动说明
- 为什么改:<改动动机和问题背景>
- 改了什么:<具体的改动内容>
- 影响范围:<受影响的模块和兼容性>
- 验证方式:<测试方法或验证点>
输出格式
text
<分支名称>
text
<type>(<scope>): <subject>

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

Commit 示例

示例 1:功能开发
text
feature/add-user-auth-api
text
feat(api): 新增用户认证接口

## 改动说明
- 为什么改:提升系统安全性,实现基于 JWT 的用户认证
- 改了什么:新增 UserAuthController,实现 register、login、refresh-token 接口
- 影响范围:新增 /api/auth/* 路由,需要前端适配认证流程
- 验证方式:新增 15 个单元测试,集成测试验证完整流程
示例 2:Bug 修复
text
bugfix/fix-memory-leak
text
fix(core): 修复内存泄漏导致的性能问题

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

## 改动说明
- 为什么改:原实现过于复杂(340 行),包含不必要的互斥锁和状态管理
- 改了什么:移除复杂的并发控制,简化为直接的单例实现(133 行)
- 影响范围:功能保持完整,大幅降低维护成本,API 保持向后兼容
- 验证方式:所有现有测试通过,功能验证正常
示例 4:测试相关
text
test/add-connection-manager-tests
text
test(mcp): 补充连接管理器的单元测试

## 改动说明
- 为什么改:连接管理器模块测试覆盖率不足
- 改了什么:新增 12 个测试用例,覆盖核心功能和边界情况
- 影响范围:测试覆盖率从 65% 提升至 85%
- 验证方式:所有新增测试通过,覆盖率报告符合要求
示例 5:文档更新
text
docs/update-mcp-protocol-guide
text
docs(mcp): 更新 MCP 协议集成文档

## 改动说明
- 为什么改:现有文档未包含最新的 ModelScope 集成说明
- 改了什么:新增 ModelScope 配置章节,更新示例代码
- 影响范围:仅文档更新,不影响代码功能
- 验证方式:文档本地渲染验证,链接检查通过

生成 Commit 时的注意事项

1. 真实性原则
  • 基于实际改动:不要虚构不存在的内容
  • 避免夸大:如实描述改动,不过度宣传
  • 技术准确:确保技术实现描述的准确性和专业性
2. 评审友好原则
  • 突出重点:评审人最关心的是"为什么改"和"改了什么"
  • 具体明确:避免模糊的描述,如"优化了性能"应具体说明如何优化
  • 结构清晰:按照模板结构组织信息,便于快速阅读
3. 格式规范
  • 标题简洁:commit 标题不超过 50 字符
  • 使用中文:所有 commit 信息必须使用中文
  • 忽略分支名:不参考当前分支名称(通常不具有参考价值)
  • 不执行提交:仅提供 commit 信息建议,不执行实际的 git commit 操作

xiaozhi-client 项目特定规范

1. 路径别名系统

项目使用复杂的路径别名系统,commit 信息中应正确引用:

typescript
// 常见 scope 定义
- cli: CLI 层 (src/cli/)
- mcp-core: MCP 核心层 (src/mcp-core/)
- server: 后端服务层 (src/server/)
- web: 前端 Web 应用 (src/web/)
- config: 配置管理 (src/config/)
- endpoint: 端点处理 (src/endpoint/)
- utils: 通用工具 (src/utils/)
- types: 类型定义 (src/types/)
- test: 测试相关
- docs: 文档相关
- build: 构建相关
2. 常见改动模式
typescript
// MCP 服务相关改动
feat(mcp): 支持新增的 MCP 服务器
fix(mcp): 修复 MCP 连接超时问题
refactor(mcp): 重构 MCP 服务管理器

// CLI 相关改动
feat(cli): 新增配置验证命令
fix(cli): 修复命令行参数解析错误

// Web UI 相关改动
feat(web): 新增服务配置界面
fix(web): 修复 WebSocket 连接断开问题

// 配置相关改动
feat(config): 支持环境变量配置
fix(config): 修复配置文件解析错误

// 测试相关改动
test(mcp): 补充 MCP 协议集成测试
test(cli): 新增命令行工具测试
3. 与项目开发理念一致
  • 功能驱动:commit 信息应体现"需要什么功能就实现什么功能"
  • 优雅实现:描述代码如何清晰、可维护、结构合理
  • 避免过度设计:不提及为了"未来可能需要"而增加的复杂度
  • 务实开发:反映"先实现功能,遇到问题再优化"的开发方式

质量检查清单

生成 commit 信息后,应检查以下项目:

  • commit 标题符合 git 规范,简洁明确,不超过 50 字符
  • 类型选择正确(feat/fix/refactor/test/docs 等)
  • scope 准确反映改动模块
  • 改动说明包含"为什么改"、"改了什么"、"影响范围"、"验证方式"
  • 所有内容使用中文
  • 基于实际代码改动,无虚构内容
  • 技术描述准确专业
  • 分支名称符合规范(前缀 + kebab-case)
  • 便于代码评审人快速理解改动

使用方式

当需要生成 commit 信息时:

  1. 确保代码已暂存:git add 需要提交的文件
  2. 调用此技能:/commit 或 skill: commit
  3. 分析输出结果:获取分支名称建议和 commit 信息
  4. 使用建议的 commit:git commit -m "<commit 信息>"
  5. 创建分支(如需要):git checkout -b <分支名称>

集成方式

1. Git 别名
bash
# 设置 commit 生成别名
git config --global alias.gencommit '!git add -A && echo "请使用 /commit 技能生成 commit 信息"'
2. 与其他技能配合
  • type-validator:修复类型错误后再生成 commit
  • localization-validator:确保本地化符合要求
  • ci-validator:commit 前运行完整质量检查

通过这个技能,可以确保 xiaozhi-client 项目的 commit 信息始终保持高质量,便于代码评审和项目维护,同时符合务实开发理念。

© shenjingnan, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/commit of shenjingnan/xiaozhi-client.

Open the folder on GitHubat commit fe3c382

Compare with similar skills

Commit next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Commit compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Commit this skillshenjingnan/xiaozhi-client341—~1.4kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from shenjingnan/xiaozhi-client

All 16 skills in this repo
  • E2E Coverage Analyzer

    shenjingnan/xiaozhi-client

    分析当前分支 git 改动,检查 e2e 测试用例覆盖情况,并可补充缺失的测试用例. An agent skill from shenjingnan/xiaozhi-client.

    341 GitHub stars~954 tokensUpdated 1 mo ago
    Auto-check passed
  • Fix Comment

    shenjingnan/xiaozhi-client

    GitHub 评论修复技能,用于获取 PR 的 Copilot 评论并分析修复问题. An agent skill from shenjingnan/xiaozhi-client.

    341 GitHub stars~873 tokensUpdated 1 mo ago
    Auto-check passed
  • API Docs

    shenjingnan/xiaozhi-client

    文档自动生成

    341 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • CI Validator

    shenjingnan/xiaozhi-client

    CI检查验证和质量保障

    341 GitHub stars~2.1k tokensUpdated 1 mo ago
    Auto-check passed
  • Dev Workflow Checker

    shenjingnan/xiaozhi-client

    开发流程检查技能,确保代码修改后执行必要的质量检查

    341 GitHub stars~464 tokensUpdated 1 mo ago
    Auto-check passed
  • Docs Creator

    shenjingnan/xiaozhi-client

    文档创建技能,用于创建标准化的项目文档

    341 GitHub stars~614 tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Commit

How do I install Commit in Claude Code?

Run `npx skills add shenjingnan/xiaozhi-client --skill commit -a claude-code`. Or copy the skill folder (.agents/skills/commit in shenjingnan/xiaozhi-client) into .claude/skills/commit in your project. Claude Code loads it when a task matches its description.

How do I install Commit in Codex?

Run `npx skills add shenjingnan/xiaozhi-client --skill commit -a codex`. Or copy the skill folder (.agents/skills/commit in shenjingnan/xiaozhi-client) into .agents/skills/commit in your project. Codex loads it when a task matches its description.

Can I use Commit in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add shenjingnan/xiaozhi-client --skill commit -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/commit, .gemini/skills/commit, .github/skills/commit and .opencode/skills/commit in your project.

What does Commit need to run?

Going by SKILL.md and its folder, Commit needs the command-line tools its instructions call (git).

Does Commit access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Commit safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Commit use?

Commit is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Commit use?

About 1.4k tokens (SKILL.md is roughly 5.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Commit?

Skills that share tags, products or a category with Commit: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Commit?

shenjingnan (a GitHub user) maintains it in shenjingnan/xiaozhi-client, which has 341 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on September 3, 2026.

Source: shenjingnan/xiaozhi-client on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.