oma-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:
.agents/skills/commit/config/commit-config.yaml项目特定设置:.agents/skills/commit/config/commit-config.yaml
Commit 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如果变更文件涉及多个功能/领域,按功能拆分提交。
拆分标准:
- 不同范围(例如:工作流 vs 技能 vs 文档)
- 不同类型(例如:新功能 vs Bug修复 vs 文档)
- 逻辑上独立的变更
示例:
undefinedChanged files:
变更文件:
.agents/workflows/.md (7 files) → fix(workflows): ...
.agents/skills/**/.md (4 files) → fix(skills): ...
USAGE.md, USAGE-ko.md → docs: ...
.agents/workflows/.md (7个文件) → fix(workflows): ...
.agents/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个字符
- 使用祈使语气(添加、修复、更新、移除...)
- 首字母小写
- 末尾无句号
Step 5: Execute Commit
步骤5:执行提交
Show the commit message and proceed immediately without asking for confirmation:
📝 Committing:
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>bash
git add <specific-files>
git commit -m "<message>"显示提交消息并直接执行,无需确认:
📝 提交内容:
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>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 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编写多行提交消息