caveman-commit

caveman-commit

熱門

> 超極簡 Commit 訊息產生器。在保留意圖與原因的前提下,剔除 commit 訊息中的冗餘內容。採用 Conventional Commits 格式。主旨 ≤50 字元,僅在「原因」不夠明顯時才提供內文。當使用者提到「寫 commit」、「commit 訊息」、「產生 commit」、「/commit」或呼叫 /caveman-commit 時使用。會在暫存變更時自動觸發。

7.3萬星標
4468分支
更新於 2026/6/12
SKILL.md
唯讀
名稱
caveman-commit
描述

> 超極簡 Commit 訊息產生器。在保留意圖與原因的前提下,剔除 commit 訊息中的冗餘內容。採用 Conventional Commits 格式。主旨 ≤50 字元,僅在「原因」不夠明顯時才提供內文。當使用者提到「寫 commit」、「commit 訊息」、「產生 commit」、「/commit」或呼叫 /caveman-commit 時使用。會在暫存變更時自動觸發。

撰寫簡潔且精確的 commit 訊息。採用 Conventional Commits 格式。不廢話。重原因勝於重內容。

規則

主旨行:

  • <type>(<scope>): <imperative summary> — <scope> 為可選項
  • 類型:feat、fix、refactor、perf、docs、test、chore、build、ci、style、revert
  • 使用祈使句動詞:"add"、"fix"、"remove" — 不要用 "added"、"adds"、"adding"
  • 儘量保持在 50 字元以內,上限為 72 字元
  • 結尾不要加句號
  • 冒號後的大寫規範請符合專案慣例

內文(僅在必要時):

  • 若主旨已能自釋意圖,請完全省略內文
  • 僅在以下情況新增內文:不夠明顯的 原因、破壞性變更(breaking changes)、轉移說明、關聯的 issue
  • 每行請在 72 字元處折行
  • 列表符號請用 - 而非 *
  • 在結尾引用 issue/PR:Closes #42、Refs #17

絕對不要包含的內容:

  • "This commit does X"、"I"、"we"、"now"、"currently" — diff 差異本身就已經呈現做了什麼
  • "As requested by..." — 請改用 Co-authored-by 結尾標記
  • "Generated with Claude Code" 或任何 AI 署名 — 除非使用者自己的規則要求加入 Assisted-by 或 AI 署名結尾標記,此時才以結尾標記形式新增
  • Emoji(除非專案慣例要求)
  • 當 scope 已經提及檔名時,重覆撰寫檔名

範例

Diff:新增使用者個人檔案的 API 端點,並附帶說明原因的內文

  • ❌ "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.
    

自動釐清機制

以下情況務必包含內文:破壞性變更、安全性修復、資料轉移、任何還原先前 commit 的操作。絕不要將這些壓縮成僅有主旨 — 未來的除錯人員需要這些上下文。

邊界說明

僅產生 commit 訊息。不會執行 git commit,不會暫存(stage)檔案,也不會修改(amend)先前 commit。請將訊息輸出為可供直接複製的程式碼區塊。「stop caveman-commit」或「normal mode」:可切回詳細的 commit 風格。