caveman-commit

caveman-commit

熱門

>

7.3萬星標
4468分支
更新於 2026/6/12
SKILL.md
readonlyread-only
name
caveman-commit
description

超精簡提交訊息產生器。去除提交訊息中的雜訊,同時保留意圖與理由。採用 Conventional Commits 格式。主旨 ≤50 字元,只有在「為什麼」不明顯時才加入內文。當使用者說「寫一個提交」、「提交訊息」、「產生提交」、「/commit」或呼叫 /caveman-commit 時使用。暫存變更時會自動觸發。

撰寫簡潔且精確的提交訊息。採用 Conventional Commits 格式。不廢話。強調「為什麼」而非「做了什麼」。

規則

主旨行:

  • <type>(<scope>): <imperative summary><scope> 可省略
  • 類型:featfixrefactorperfdocstestchorebuildcistylerevert
  • 使用祈使語氣:「add」、「fix」、「remove」— 不要用「added」、「adds」、「adding」
  • 盡量 ≤50 字元,硬上限 72
  • 結尾不加句號
  • 根據專案慣例決定冒號後是否大寫

內文(僅在需要時):

  • 若主旨已足夠說明,則完全省略內文
  • 僅在以下情況加入內文:不明顯的「為什麼」、重大變更、遷移說明、關聯議題
  • 每行 72 字元換行
  • 項目符號使用 - 而非 *
  • 在結尾引用議題/PR:Closes #42Refs #17

絕對不要包含的內容:

  • 「這個提交做了 X」、「我」、「我們」、「現在」、「目前」— diff 已經說明了做了什麼
  • 「應...要求」— 請使用 Co-authored-by 尾註
  • 「由 Claude Code 產生」或任何 AI 歸屬 — 除非使用者自己的規則要求加入 Assisted-by/AI 歸屬尾註,則以尾註形式加入
  • 表情符號(除非專案慣例要求)
  • 當 scope 已包含檔名時,重複檔名

範例

Diff:新增使用者個人資料端點,內文說明原因

  • ❌ "feat: add a new endpoint to get user profile information from the database"
  • feat(api): add GET /users/:id/profile
    
    Mobile client needs profile data without the full user payload
    to reduce LTE bandwidth on cold-launch screens.
    
    Closes #128
    

Diff:重大 API 變更

  • feat(api)!: rename /v1/orders to /v1/checkout
    
    BREAKING CHANGE: clients on /v1/orders must migrate to /v1/checkout
    before 2026-06-01. Old route returns 410 after that date.
    

自動清晰化

以下情況務必包含內文:重大變更、安全性修正、資料遷移、任何還原先前提交的操作。切勿將這些壓縮成只有主旨 — 未來的除錯者需要這些上下文。

邊界

僅產生提交訊息。不會執行 git commit、不會暫存檔案、不會修改提交。將訊息以程式碼區塊形式輸出,方便直接貼上。輸入「stop caveman-commit」或「normal mode」:恢復為詳細的提交風格。