Commit Message Assistant | Commit Message 助手
Generate well-formatted commit messages following the Conventional Commits standard.
根據 staged 的變更,產生符合 Conventional Commits 格式的 commit message。
Workflow | 工作流程
- Detect language - Read
.standards/manifest.json → check options.output_language. If not found, default to english.
- Check status - Run
git status and git diff --staged to understand changes
- Analyze changes - Determine the type (feat, fix, refactor, etc.) and scope
- Generate message - Create a commit message following the format for the detected language (see below)
- Confirm and commit - Ask user to confirm before executing
git commit
Message Format | 訊息格式
<type>(<scope>): <subject>
<body>
<footer>
Commit Types | 提交類型
| Type |
When to Use |
使用時機 |
feat |
New feature |
新功能 |
fix |
Bug fix |
修復錯誤 |
refactor |
Code refactoring |
重構(無功能變更) |
docs |
Documentation |
文件更新 |
style |
Formatting |
格式調整(無邏輯變更) |
test |
Tests |
測試相關 |
perf |
Performance |
效能優化 |
chore |
Maintenance |
維護任務 |
Rules | 規則
- Subject: imperative mood, no period, first letter capitalized, ≤ 72 characters
- Body: explain WHY the change was made, not just what changed
- Footer: use
BREAKING CHANGE: for breaking changes, Fixes #123 for issue refs
Bilingual Format | 雙語格式
When output_language is bilingual, you MUST use this format:
<type>(<scope>): <English subject>. <中文主旨>.
<English body — explain what and why in English>
<中文本文 — 用中文說明做了什麼及為什麼>
<footer>
MUST Rules | 必須遵守的規則
- English body comes FIRST, Chinese body comes SECOND
- Separate English and Chinese body with a blank line
- NEVER mix languages within the same paragraph
- NEVER omit the Chinese body — both languages are required
- Footer (BREAKING CHANGE, Fixes #, Co-authored-by) goes LAST after both bodies
Bilingual Example | 雙語範例
feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援.
Implement Google OAuth2 authentication flow for user login.
- Add Google OAuth2 SDK integration
- Create callback endpoint for OAuth flow
- Store refresh tokens securely
實作 Google OAuth2 認證流程供使用者登入。
- 整合 Google OAuth2 SDK
- 建立 OAuth 流程回呼端點
- 安全儲存更新權杖
Closes #123
Traditional Chinese Format | 繁體中文格式
When output_language is traditional-chinese, use Chinese types and body:
功能(認證): 新增 OAuth2 Google 登入支援
實作 Google OAuth2 認證流程供使用者登入。
關閉 #123
Usage | 使用方式
/commit - Auto-analyze staged changes and suggest commit message
/commit fix login bug - Generate message based on provided description
Next Steps Guidance | 下一步引導
After /commit completes, the AI assistant should suggest:
提交完成。建議下一步 / Commit complete. Suggested next steps:
- 執行
git push 推送到遠端 ⭐ Recommended / 推薦 — Push to remote
- 準備發布時 → 執行
/changelog + /release — When preparing a release → Run /changelog + /release
- 發現重複模式或規範摩擦 → 執行
/audit --report 回報 — Patterns or friction detected → Run /audit --report to submit feedback
Reference | 參考
AI Agent Behavior | AI 代理行為
完整的 AI 行為定義請參閱對應的命令文件:/commit
For complete AI agent behavior definition, see the corresponding command file: /commit
1---2name: commit3scope: universal4description: |5 [UDS] Generate commit messages that follow Conventional Commits, including the bilingual format.6 Use when: writing a commit message for staged changes, choosing a type and scope, producing a bilingual English and 中文 subject and body.7 Not for: deciding whether the change is ready to commit — use /checkin; aggregating commits into release notes — use /changelog.8 Keywords: commit message, Conventional Commits, feat, fix, refactor, scope, bilingual, 提交訊息, 雙語 commit, 提交規範.9allowed-tools: Read, Grep, Bash(git status:*), Bash(git diff:*), Bash(git log:*), Bash(git add:*), Bash(git commit:*)10argument-hint: "[description of changes | 變更描述]"11status: stable12# 2026-08-18: `disable-model-invocation: true` removed, and a status recorded.13#14# The flag was applied by d415937e alongside the description rewrite and, like15# the two lifted on 2026-08-17, followed no stateable rule. These eight were16# left alone that day for a reason that was correct at the time: the rule17# settled on was "a reference is model-invocable", and none of them carried a18# `status` at all, so lifting them would have replaced one unruled state with19# one unruled action.20#21# Measured 2026-08-18, which is what closed it: all eight carry a full22# `Use when:` trigger and a `Not for:` exclusion, all eight describe an action23# rather than reference material, and all eight already have a slash command —24# which is exactly the shape of `code-review-assistant`, whose paired `/code-review`25# was ruled not to justify the flag. `journey-test-assistant` is the standing26# precedent: same "Generate X" shape, `status: stable`, never disabled.27#28# `stable` rather than a new value: `skills/` uses reference, stable and29# experimental, and inventing a fourth would be the same unruled-action mistake30# in different clothing.31#32# The cost of being wrong is asymmetric and observable in only one direction.33# Over-triggering shows up and is undone by deleting a line; a skill that is34# structurally unable to fire produces no signal at all. (XSPEC-378 R5)35---3637# Commit Message Assistant | Commit Message 助手3839Generate well-formatted commit messages following the Conventional Commits standard.4041根據 staged 的變更,產生符合 Conventional Commits 格式的 commit message。4243## Workflow | 工作流程44450. **Detect language** - Read `.standards/manifest.json` → check `options.output_language`. If not found, default to `english`.461. **Check status** - Run `git status` and `git diff --staged` to understand changes472. **Analyze changes** - Determine the type (feat, fix, refactor, etc.) and scope483. **Generate message** - Create a commit message following the format for the detected language (see below)494. **Confirm and commit** - Ask user to confirm before executing `git commit`5051### Message Format | 訊息格式5253```54<type>(<scope>): <subject>5556<body>5758<footer>59```6061## Commit Types | 提交類型6263| Type | When to Use | 使用時機 |64|------|-------------|---------|65| `feat` | New feature | 新功能 |66| `fix` | Bug fix | 修復錯誤 |67| `refactor` | Code refactoring | 重構(無功能變更) |68| `docs` | Documentation | 文件更新 |69| `style` | Formatting | 格式調整(無邏輯變更) |70| `test` | Tests | 測試相關 |71| `perf` | Performance | 效能優化 |72| `chore` | Maintenance | 維護任務 |7374## Rules | 規則7576- **Subject**: imperative mood, no period, first letter capitalized, ≤ 72 characters77- **Body**: explain **WHY** the change was made, not just what changed78- **Footer**: use `BREAKING CHANGE:` for breaking changes, `Fixes #123` for issue refs7980## Bilingual Format | 雙語格式8182When `output_language` is `bilingual`, you MUST use this format:8384```85<type>(<scope>): <English subject>. <中文主旨>.8687<English body — explain what and why in English>8889<中文本文 — 用中文說明做了什麼及為什麼>9091<footer>92```9394### MUST Rules | 必須遵守的規則95961. English body comes FIRST, Chinese body comes SECOND972. Separate English and Chinese body with a blank line983. NEVER mix languages within the same paragraph994. NEVER omit the Chinese body — both languages are required1005. Footer (BREAKING CHANGE, Fixes #, Co-authored-by) goes LAST after both bodies101102### Bilingual Example | 雙語範例103104```105feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援.106107Implement Google OAuth2 authentication flow for user login.108109- Add Google OAuth2 SDK integration110- Create callback endpoint for OAuth flow111- Store refresh tokens securely112113實作 Google OAuth2 認證流程供使用者登入。114115- 整合 Google OAuth2 SDK116- 建立 OAuth 流程回呼端點117- 安全儲存更新權杖118119Closes #123120```121122## Traditional Chinese Format | 繁體中文格式123124When `output_language` is `traditional-chinese`, use Chinese types and body:125126```127功能(認證): 新增 OAuth2 Google 登入支援128129實作 Google OAuth2 認證流程供使用者登入。130131關閉 #123132```133134## Usage | 使用方式135136- `/commit` - Auto-analyze staged changes and suggest commit message137- `/commit fix login bug` - Generate message based on provided description138139## Next Steps Guidance | 下一步引導140141After `/commit` completes, the AI assistant should suggest:142143> **提交完成。建議下一步 / Commit complete. Suggested next steps:**144> - 執行 `git push` 推送到遠端 ⭐ **Recommended / 推薦** — Push to remote145> - 準備發布時 → 執行 `/changelog` + `/release` — When preparing a release → Run `/changelog` + `/release`146> - 發現重複模式或規範摩擦 → 執行 `/audit --report` 回報 — Patterns or friction detected → Run `/audit --report` to submit feedback147148## Reference | 參考149150- [Conventional Commits Guide](./conventional-commits.md) — Read it when you need the exact type, scope and format rules.151- [Output Language Options](./language-options.md) — Read it when deciding which language a commit message is written in.152- Detailed guide: [guide.md](./guide.md)153- Core standard: [commit-message-guide.md](../../core/commit-message-guide.md)154155156## AI Agent Behavior | AI 代理行為157158> 完整的 AI 行為定義請參閱對應的命令文件:[`/commit`](../commands/commit.md#ai-agent-behavior--ai-代理行為)159>160> For complete AI agent behavior definition, see the corresponding command file: [`/commit`](../commands/commit.md#ai-agent-behavior--ai-代理行為)