Commit

作者 getsentryd18b7aa8ba87無授權條款1K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 天前更新

Use for every request to commit changes or draft a commit message. Creates Sentry-style conventional commits with issue references.

AI 產生的概覽

指導代理撰寫 Sentry 風格約定式提交訊息並安全建立 git 提交。

功能
此技能提供準備與建立 git 提交的說明。它要求代理檢查目前分支,避免直接提交到 main 或 master,讓每次提交只包含一項連貫的變更,並以約定格式撰寫提交訊息,包含類型、可選範圍、主旨、本文與頁尾。它定義了允許的類型、主旨與行長規則、Fixes 與 Refs 等議題引用頁尾,以及排除客戶名稱、電子郵件、工單內容、機密與 PII 的隱私規則。它也規定使用多個 -m 參數,而非字面換行序列或互動式編輯器。
適用情境
當請求涉及提交變更或撰寫提交訊息時使用。它適合需要遵循約定式 Sentry 風格格式、包含議題引用,並避免直接提交到 main 或 master 的工作流程。
執行需求
需要 git 儲存庫以及執行 git 命令(例如 git branch --show-current 與 git commit)的能力。除 git 本身外,不包含指令碼、套件、認證資訊或網路存取。

Sentry Commit Messages

Before Committing

bash
git branch --show-current

If the branch is main or master, create a feature branch unless the user explicitly requested a direct commit. Re-check the branch and stop if it is still main or master.

Commit one coherent, independently reviewable change at a time.

Message Rules

Use:

text
<type>(<scope>): <subject>
<optional body>
<optional footer>
  • Scope is optional. Add ! before : for a breaking change.
  • Write the subject in imperative, present tense; capitalize it, omit the trailing period, and keep it at 70 characters or fewer.
  • Keep every line under 100 characters.
  • Use the body only when useful. Explain what changed and why, including previous behavior or motivation when it helps.
  • Never include customer or organization names, user emails, support ticket contents, secrets, or PII. Describe the technical symptom instead.

Allowed types: feat, fix, ref, perf, docs, test, build, ci, chore, style, meta, license, and revert.

Use ref for refactoring without behavior changes, style for formatting without logic changes, and meta for repository metadata.

Footers

  • Fixes <issue> closes an issue when merged.
  • Refs <issue> links an issue without closing it.
  • For breaking changes, add BREAKING CHANGE: <impact>.

Creating the Commit

Use separate -m arguments for paragraphs and footers. Never put literal \n sequences in a commit message or open an interactive editor.

bash
git commit -m "fix(api): Handle null response in user endpoint" \  -m "Return 404 when the user API finds a deleted account." \  -m "Fixes SENTRY-5678"

來源與署名

來源:getsentry/skills位於skills/commit提交d18b7aa

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架