commit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCommit Skill - Conventional Commits
提交技能 - Conventional Commits规范
When to use
适用场景
- When user requests "commit this", "commit", "save changes"
- When command is invoked
/commit
- 当用户请求“提交这个”、“提交”、“保存更改”时
- 当调用命令时
/commit
Configuration
配置
Project-specific settings:
.agent/skills/commit/config/commit-config.yaml项目特定设置:
.agent/skills/commit/config/commit-config.yamlCommit Types
提交类型
| Type | Description | Branch Prefix |
|---|---|---|
| feat | New feature | feature/ |
| fix | Bug fix | fix/ |
| refactor | Code improvement | refactor/ |
| docs | Documentation changes | docs/ |
| test | Test additions/modifications | test/ |
| chore | Build, configuration, etc. | chore/ |
| style | Code style changes | style/ |
| perf | Performance improvements | perf/ |
| 类型 | 描述 | 分支前缀 |
|---|---|---|
| feat | 新功能 | feature/ |
| fix | 修复Bug | fix/ |
| refactor | 代码优化 | refactor/ |
| docs | 文档变更 | docs/ |
| test | 测试新增/修改 | test/ |
| chore | 构建、配置等变更 | chore/ |
| style | 代码样式变更 | style/ |
| perf | 性能优化 | perf/ |
Commit Format
提交格式
<type>(<scope>): <description>
[optional body]
Co-Authored-By: First Fluke <our.first.fluke@gmail.com><type>(<scope>): <description>
[可选正文]
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>Workflow
工作流程
Step 1: Analyze Changes
步骤1:分析变更
bash
git status
git diff --staged
git log --oneline -5bash
git status
git diff --staged
git log --oneline -5Step 1.5: Split by Feature (if needed)
步骤1.5:按功能拆分(如有需要)
If changed files span multiple features/domains, split commits by feature.
Split criteria:
- Different scopes (e.g., workflows vs skills vs docs)
- Different types (e.g., feat vs fix vs docs)
- Logically independent changes
Example:
undefined若变更文件涉及多个功能/领域,请按功能拆分提交。
拆分标准:
- 不同作用域(例如:工作流、技能、文档)
- 不同类型(例如:feat、fix、docs)
- 逻辑独立的变更
示例:
undefinedChanged files:
变更文件:
.agent/workflows/.md (7 files) → fix(workflows): ...
.agent/skills/**/.md (4 files) → fix(skills): ...
USAGE.md, USAGE-ko.md → docs: ...
.agent/workflows/.md (7个文件) → fix(workflows): ...
.agent/skills/**/.md (4个文件) → fix(skills): ...
USAGE.md, USAGE-ko.md → docs: ...
Split into 3 commits
拆分为3个提交
**Do NOT split when:**
- All changes belong to a single feature
- Few files changed (5 or fewer)
- User requested a single commit
**以下情况请勿拆分:**
- 所有变更属于单一功能
- 变更文件数量少(5个及以下)
- 用户要求单次提交Step 2: Determine Commit Type
步骤2:确定提交类型
Analyze changes → Select appropriate type:
- New files added →
feat - Bug fixed →
fix - Refactoring →
refactor - Documentation only →
docs - Tests added →
test - Build/config changes →
chore
分析变更内容 → 选择合适的类型:
- 新增文件 →
feat - 修复Bug →
fix - 代码重构 →
refactor - 仅文档变更 →
docs - 新增测试 →
test - 构建/配置变更 →
chore
Step 3: Determine Scope
步骤3:确定作用域
Use changed module/component as scope:
- : Authentication related
feat(auth) - : API related
fix(api) - : UI related
refactor(ui) - No scope is also valid:
chore: update dependencies
以变更的模块/组件作为作用域:
- :与认证相关
feat(auth) - :与API相关
fix(api) - :与UI相关
refactor(ui) - 也可以不指定作用域:
chore: update dependencies
Step 4: Write Description
步骤4:编写描述
- Under 72 characters
- Use imperative mood (add, fix, update, remove...)
- Lowercase first letter
- No trailing period
- 长度不超过72个字符
- 使用祈使语气(add、fix、update、remove...)
- 首字母小写
- 末尾无句号
Step 5: Confirm with User
步骤5:与用户确认
📝 Commit message preview:
feat(orchestrator): add multi-CLI agent mapping support
- Add user-preferences.yaml for CLI configuration
- Update spawn-agent.sh to read agent-CLI mapping
- Update memory schema with CLI field
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
Proceed with this commit? (Y/N/Edit)📝 提交消息预览:
feat(orchestrator): add multi-CLI agent mapping support
- Add user-preferences.yaml for CLI configuration
- Update spawn-agent.sh to read agent-CLI mapping
- Update memory schema with CLI field
Co-Authored-By: First Fluke <our.first.fluke@gmail.com>
是否执行此提交?(Y/N/编辑)Step 6: Execute Commit
步骤6:执行提交
After user confirmation:
bash
git add <specific-files>
git commit -m "<message>"获得用户确认后:
bash
git add <specific-files>
git commit -m "<message>"References
参考资料
- Configuration:
config/commit-config.yaml - Guide:
resources/conventional-commits.md
- 配置文件:
config/commit-config.yaml - 指南:
resources/conventional-commits.md
Important Notes
重要注意事项
- NEVER commit without user confirmation
- NEVER use or
git add -Awithout explicit permissiongit add . - NEVER commit files that may contain secrets (.env, credentials, etc.)
- ALWAYS use specific file names when staging
- ALWAYS use HEREDOC for multi-line commit messages
- 绝对不要在未获得用户确认的情况下提交
- 绝对不要在未获得明确许可的情况下使用或
git add -Agit add . - 绝对不要提交可能包含敏感信息的文件(.env、凭证等)
- 始终在暂存时使用具体的文件名
- 始终使用HEREDOC编写多行提交消息