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 从公开仓库中收录这些内容。

举报或申请下架