Analyze changes in the git staging area, automatically infer the commit type (type) and scope (scope), generate Chinese commit messages that comply with the Conventional Commits v1.0.0 specification, and execute git commit.
分析暂存区变更,生成 Conventional Commits 规范的中文提交消息并自动提交。
完整规范参考:references/conventional-commits-spec.md
运行 git status --porcelain 检查暂存区状态。
M 、A 、D 、R 等)时继续git add,终止流程.git/MERGE_HEAD 存在时提示这是 merge commit,终止流程(用户应使用 git 默认消息).git/REBASE_HEAD 存在时提示当前处于 rebase 状态,终止流程git diff --cached --name-status # 变更文件列表和状态(M/A/D/R)
git diff --cached --stat # 变更统计摘要
git log --oneline -5 # 近期提交风格参考
根据变更规模决定是否读取详细 diff:
| 变更规模 | 判定条件 | 读取策略 |
|----------|----------|----------|
| 小型 | 文件数 ≤ 10 且 stat 显示总行数 ≤ 300 | 完整读取 git diff --cached |
| 中型 | 文件数 ≤ 20 或总行数 ≤ 500 | 仅读取前 10 个文件的 diff |
| 大型 | 文件数 > 20 或总行数 > 500 | 不读取详细 diff,仅基于 name-status 和 stat 推断 |
按优先级从高到低判断:
| 优先级 | 条件 | Type |
|--------|------|------|
| 1 | 所有变更文件在 test/ 或 tests/ 目录 | test |
| 2 | 所有变更文件为文档格式(.md/.rst/.txt) | docs |
| 3 | 所有变更文件为 CI/构建配置(Dockerfile, .github/, Makefile, *.yaml 等) | ci 或 build |
| 4 | 新增文件占比 > 80% | feat |
| 5 | diff 语义分析:修复缺陷、解决异常 | fix |
| 6 | diff 语义分析:代码重组但功能不变 | refactor |
| 7 | diff 语义分析:性能相关优化 | perf |
| 8 | 仅格式/样式变更,无逻辑改动 | style |
| 9 | 以上均不匹配 | chore |
packages/、apps/):取包名src/ 前缀:去除前缀后重新计算docker、deps)分析 diff 是否包含:删除公共函数/方法、修改 API 签名、移除导出接口。检测到时自动添加 ! 后缀和 BREAKING CHANGE: footer。
<type>[(scope)][!]: <中文描述>
[中文 body]
[BREAKING CHANGE: <说明>]
BREAKING CHANGE: <说明>生成消息后直接执行提交:
git commit -m "$(cat <<'EOF'
<完整 commit message>
EOF
)"
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer