commit-standards
AsiaOstrich/universal-dev-skills
依照「Conventional Commits」標準格式撰寫提交訊息。適用情境:撰寫提交訊息、執行 `git commit` 指令、檢視提交歷史紀錄。關鍵字:commit、git、message、conventional、提交、訊息、feat、fix、refactor。
...展開全部關於「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」。
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
- Length: ≤72 characters (50 ideal)
- Tense: Imperative mood ("Add feature" not "Added feature")
- Capitalization: First letter capitalized
- 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 descriptiveBody 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 #789Breaking 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 createdAtIssue References
Closes #123 # Automatically closes issueFixes #456 # Automatically closes issueRefs #789 # Links without closingConfiguration Detection
This skill supports project-specific language configuration.
Detection Order
- Check
CONTRIBUTING.mdfor "Commit Message Language" section - If found, use the specified option (English / Traditional Chinese / Bilingual)
- If not found, default to English for maximum tool compatibility
First-Time Setup
If no configuration found and context is unclear:
- Ask the user: "This project hasn't configured commit message language preference. Which option would you like to use? (English / 中文 / Bilingual)"
- 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





首頁
