commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Commit Skill - Conventional Commits

提交技能 - Conventional Commits规范

When to use

适用场景

  • When user requests "commit this", "commit", "save changes"
  • When
    /commit
    command is invoked
  • 当用户请求“提交这个”、“提交”、“保存更改”时
  • 当调用
    /commit
    命令时

Configuration

配置

Project-specific settings:
.agent/skills/commit/config/commit-config.yaml
项目特定设置:
.agent/skills/commit/config/commit-config.yaml

Commit Types

提交类型

TypeDescriptionBranch Prefix
featNew featurefeature/
fixBug fixfix/
refactorCode improvementrefactor/
docsDocumentation changesdocs/
testTest additions/modificationstest/
choreBuild, configuration, etc.chore/
styleCode style changesstyle/
perfPerformance improvementsperf/
类型描述分支前缀
feat新功能feature/
fix修复Bugfix/
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 -5
bash
git status
git diff --staged
git log --oneline -5

Step 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)
  • 逻辑独立的变更
示例:
undefined

Changed 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:
  • feat(auth)
    : Authentication related
  • fix(api)
    : API related
  • refactor(ui)
    : UI related
  • No scope is also valid:
    chore: update dependencies
以变更的模块/组件作为作用域:
  • feat(auth)
    :与认证相关
  • fix(api)
    :与API相关
  • refactor(ui)
    :与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
    git add -A
    or
    git add .
    without explicit permission
  • 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 -A
    git add .
  • 绝对不要提交可能包含敏感信息的文件(.env、凭证等)
  • 始终在暂存时使用具体的文件名
  • 始终使用HEREDOC编写多行提交消息