選項
首頁首頁 Skill 程式碼審查 commit-standards

依照「Conventional Commits」標準格式撰寫提交訊息。適用情境:撰寫提交訊息、執行 `git commit` 指令、檢視提交歷史紀錄。關鍵字:commit、git、message、conventional、提交、訊息、feat、fix、refactor。

...展開全部
49
更新時間 2026-06-29

關於「commit-standards」

「commit-standards」技能透過遵循「conventional commits」標準,確保提交訊息格式的一致性。這能確保提交訊息清晰、簡潔且富含資訊。 它透過提供結構化的訊息撰寫方法,解決了提交訊息不一致或含糊不清的問題,從而促進更條理分明且易於理解的提交歷史紀錄。此標準對於軟體開發專案的協作特別有用,因為清晰的版本控制與變更記錄對於團隊和自動化系統而言皆至關重要。

此技能旨在提供一種簡單直觀的方式來格式化提交訊息。它使用一組預定義的提交類型(如「feat」、「fix」、「refactor」等)來有效分類變更。 使用者可遵循包含主旨、正文和結尾的嚴格格式,其中針對主旨行長度、大寫規則及標點符號均有具體規範。此技能亦支援多語言提交訊息格式,包括英文、繁體中文及雙語選項,以滿足多元的開發環境需求。

此技能非常適合希望在提交訊息方面保持一致且專業風格的開發者、團隊及開源貢獻者。對於代碼審查員、版本控制管理員,以及任何依賴提交歷史記錄來理解代碼變更的相關人員而言,此技能尤為有益。 該技能的配置系統允許根據專案偏好進行靈活自訂,使其能適應各種工作流程和團隊需求。

常見問題

如何設定提交訊息的語言?

您可以在專案的「CONTRIBUTING.md」檔案中設定提交訊息的語言。若未找到相關設定,系統將預設使用英文。可選的語言包括英文、繁體中文及雙語。

如果我的提交訊息未遵循標準會如何?

此技能不會自動強制檢查錯誤,但鼓勵遵循最佳實踐以確保一致性與清晰度。確保提交訊息符合格式規範是您團隊的責任。

我能否將此工具應用於非軟體開發專案?

可以,雖然此工具主要設計用於軟體專案,但任何需要明確版本控制與變更記錄的專案都能從中受益。

此技能是否支援提交訊息中的多種語言?

是的,此功能支援英文、繁體中文以及雙語的提交訊息。您可以在「CONTRIBUTING.md」檔案中選擇偏好的語言設定。

這項技能支援哪些提交類型?

此技能支援多種提交類型,包括「feat」、「fix」、「refactor」、「docs」、「style」、「test」、「perf」、「build」、「ci」、「chore」、「revert」及「security」。

在 GitHub 上查看

Commit Message Standards

This skill ensures consistent, meaningful commit messages following conventional commits.

Quick Reference

Basic Format

<type>(<scope>): <subject><body><footer>

Commit Types

English中文When to Use
feat新增New feature
fix修正Bug fix
refactor重構Code refactoring (no functional change)
docs文件Documentation only
style樣式Formatting (no code logic change)
test測試Adding or updating tests
perf效能Performance improvement
build建置Build system or dependencies
ci整合CI/CD pipeline changes
chore維護Maintenance tasks
revert回退Revert previous commit
security安全Security vulnerability fix

Subject Line Rules

  1. Length: ≤72 characters (50 ideal)
  2. Tense: Imperative mood ("Add feature" not "Added feature")
  3. Capitalization: First letter capitalized
  4. No period: Don't end with a period

Detailed Guidelines

For complete standards, see:

  • Conventional Commits Guide
  • Language Options

Examples

✅ Good Examples (English)

feat(auth): Add OAuth2 Google login supportfix(api): Resolve memory leak in user session cacherefactor(database): Extract query builder to separate classdocs(readme): Update installation instructions for Node 20

✅ Good Examples (中文)

新增(認證): 實作 OAuth2 Google 登入支援修正(API): 解決使用者 session 快取記憶體洩漏重構(資料庫): 提取查詢建構器為獨立類別

✅ Good Example (Bilingual)

feat(auth): Add OAuth2 Google login support. 新增 OAuth2 Google 登入支援。Implement Google OAuth2 authentication flow for user login.實作 Google OAuth2 認證流程供使用者登入。Closes #123

❌ Bad Examples

fixed bug                    # Too vague, no scopefeat(auth): added google login  # Past tenseUpdate stuff.                # Period, vagueWIP                          # Not descriptive

Body Guidelines

Use the body to explain WHY the change was made:

fix(api): Resolve race condition in concurrent user updatesWhy this occurred:- Two simultaneous PUT requests could overwrite each other- No optimistic locking implementedWhat this fix does:- Add version field to User model- Return 409 Conflict if version mismatchFixes #789

Breaking Changes

Always document breaking changes in footer:

feat(api): Change user endpoint response formatBREAKING CHANGE: User API response format changedMigration guide:1. Update API clients to remove .data wrapper2. Use created_at instead of createdAt

Issue References

Closes #123    # Automatically closes issueFixes #456     # Automatically closes issueRefs #789      # Links without closing

Configuration Detection

This skill supports project-specific language configuration.

Detection Order

  1. Check CONTRIBUTING.md for "Commit Message Language" section
  2. If found, use the specified option (English / Traditional Chinese / Bilingual)
  3. If not found, default to English for maximum tool compatibility

First-Time Setup

If no configuration found and context is unclear:

  1. Ask the user: "This project hasn't configured commit message language preference. Which option would you like to use? (English / 中文 / Bilingual)"
  2. After user selection, suggest documenting in CONTRIBUTING.md:
## Commit Message LanguageThis project uses **[chosen option]** commit types.<!-- Options: English | Traditional Chinese | Bilingual -->

Configuration Example

In project's CONTRIBUTING.md:

## Commit Message LanguageThis project uses **English** commit types.### Allowed Typesfeat, fix, refactor, docs, style, test, perf, build, ci, chore, revert, security

License: CC BY 4.0 | Source: universal-dev-standards

安裝 commit-standards

請下載並將技能檔案解壓縮至您的 .claude/skills/ 目錄中。

下載 ZIP

複製儲存庫並將技能檔案複製到您的專案中。

git clone https://github.com/AsiaOstrich/universal-dev-skills/blob/main/skills/commit-standards/SKILL.md # Copy SKILL.md to your .claude/skills/ directory

複製 複製
快速設定: 將技能資料夾複製到 .claude/skills/,Claude 會自動偵測並使用該技能

相關技能

code-simplify
更新時間 2026-07-02
requesting-code-review
更新時間 2026-06-29
Git Commit Helper
更新時間 2026-06-29
fetch-pr-review-comments
更新時間 2026-06-29
OR