commit
Commit
生成符合 Conventional Commits 规范的提交信息。
默认格式
<type>[(<scope>)]: <emoji> <subject>
示例:
feat: 🎸 添加用户注册功能
fix(api): 🐛 修复查询参数解析错误
docs: ✏️ 更新 README 安装说明
Commit Type
根据更改内容选择:
- feat 🎸: 新功能
- fix 🐛: Bug 修复
- docs ✏️: 文档更新
- style 💄: 代码格式调整(不影响功能)
- refactor 💡: 代码重构(不是新功能也不是修复)
- perf ⚡️: 性能优化
- test 💍: 添加或修改测试
- chore 🤖: 构建过程或辅助工具的变更
- ci 🎡: CI 配置变更
- release 🏹: 创建发布提交
Scope(可选)
标识 commit 影响的范围,例如:api、auth、database、ui
如果 scope 不明显或涉及多个范围,可以省略。
Description(必填)
- 使用祈使句、现在时态:"添加"不是"添加了"
- 首字母小写
- 不要以句号结尾
- 限制在 50 个字符以内
Body(可选)
详细描述 what 和 why(不是 how):
- 每行限制在 72 个字符以内
- 使用中文
Footer(可选)
- 关联 issue:
Closes #123,Fixes #456 - Breaking changes:
BREAKING CHANGE: API endpoint changed
工作流程
- 检测配置:查找项目配置文件(见下方)
- 分析变更:使用
git status和git diff查看更改 - 确定 type:根据变更性质选择合适的 type
- 确定 scope(可选):识别影响范围
- 编写 description:简洁描述做了什么
- 生成 message:组合成完整的 commit message
配置检测
自动检测项目配置以确定正确的格式和 emoji 位置。
检测优先级
按顺序查找以下配置文件:
-
cz-git 配置:
.commitlintrc.*/commitlint.config.*.czrc/cz.config.*- 读取
useEmoji和types
-
git-cz 配置:
changelog.config.js/.git-cz.json- 读取
disableEmoji和types
-
无配置:使用默认 git-cz 风格
格式差异
| 配置 | 格式 | 示例 |
|---|---|---|
| 无配置(默认) | type: emoji subject |
feat: 🎸 新功能 |
| cz-git (useEmoji: true) | emoji type: subject |
✨ feat: 新功能 |
| cz-git (useEmoji: false) | type: subject |
feat: 新功能 |
详细说明:references/config-detection.md
参考资源
- 完整规范:references/spec.md
- 更多示例:references/examples.md
- 格式变体:references/variants/
More from zkl2333/skills
amap-maps
高德地图 API(通过 MCP)。地理编码(地址↔坐标)、IP 定位、天气、POI 搜索、路线规划(骑行/步行/驾车/公交)、距离测量。Triggers: '高德', 'amap', '地理编码', 'geocoding', '经纬度', 'POI', '路线规划', '导航'. NOT for: 高德 JSAPI 前端开发(用 AMap-Web/amap-skills).
30caiyun-weather
Get weather data via Caiyun (彩云天气) API through MCP. Use when: user asks about weather, temperature, forecasts, air quality, or weather alerts for any location in China. Supports realtime, hourly (72h), daily (7d), historical (24h), and alerts. Triggers: '天气', 'weather', '气温', '空气质量', 'AQI', '降水', '预报'. NOT for: locations outside China (use weather skill instead).
22web-search-prime
Search the web via the Zhipu CodePlan MCP web-search-prime server. Use when you need fast web discovery (titles/URLs/snippets) without a browser. Triggers: web-search-prime, webSearchPrime, search web, web search prime.
2check-updates
检查 OpenClaw 版本更新。当用户说"检查更新"、"有没有新版本"、"update"、"升级"时使用。执行标准三步检查:当前版本、npm 最新版、GitHub 最新版,并给出更新内容摘要和是否建议更新的判断。
1codex-cli
Operate OpenAI Codex CLI (terminal coding agent) to accomplish software engineering tasks. Use when the user asks to: run codex commands, use codex for coding tasks, execute codex exec for automation, do code review with codex, manage codex sessions (resume/fork), configure codex (config.toml, approval modes, sandbox), use codex cloud, set up MCP servers in codex, or any task involving the `codex` command-line tool. Triggers: codex, codex exec, codex review, codex cloud, codex mcp, codex resume, codex sandbox, openai codex.
1