跳到正文
Skillpedia
通用编程48k · #4212

commit

它能做什么

这个工具可以为你保存的代码生成 commit(提交)信息,遵循 Sentry 项目中使用的特定格式。它能确保信息清楚地说明改了什么、为什么改,并检查你是否在正确的分支上保存代码。

适用场景

  • ✓当你想保存代码更改(即创建一次 commit)时。
  • ✓当你需要特定格式的 commit 信息时。
  • ✓当你想确保不会直接把代码保存到 main 等重要分支上时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/commit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/commit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“帮我写一条 commit 信息,修复一个会显示密码的登录 Bug。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会分析你对代码做了哪些更改,并按照标准格式生成内容,包括类型(比如修复 Bug 用 fix)、简短摘要以及更改详情。它还会检查你当前是否位于安全的分支上,再保存代码。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Sentry Commit Messages

Follow these conventions when creating commits for Sentry projects.

When to Use

  • The user asks to commit code, prepare a commit message, or save changes in git.
  • You need Sentry-style commit formatting with conventional commit structure and issue references.
  • The task requires enforcing branch safety before committing, especially avoiding direct commits on main or master.

Prerequisites

Before committing, always check the current branch:

git branch --show-current

Read repository policy before creating a commit. If the default branch is PR-only, create an authorized topic branch and use the repository's native maintainer flow, even when an administrator could bypass server checks. AAS requires antigravity-maintainer-batch-release and protected source PRs.

Inspect git status --short, git diff --cached, and the intended changed paths; preserve unrelated staged/dirty work. Use an installed create-branch helper only if available and appropriate, otherwise create the topic branch through the repository workflow. Verify the actual branch before proceeding. A request for a message alone does not authorize staging, committing or pushing.

Format

<type>(<scope>): <subject>

<body>

<footer>

The header is required. Scope is optional. All lines must stay under 100 characters.

Commit Types

Type Purpose
feat New feature
fix Bug fix
ref Refactoring (no behavior change)
perf Performance improvement
docs Documentation only
test Test additions or corrections
build Build system or dependencies
ci CI configuration
chore Maintenance tasks
style Code formatting (no logic change)
meta Repository metadata
license License changes

Subject Line Rules

  • Use imperative, present tense: "Add feature" not "Added feature"
  • Capitalize the first letter
  • No period at the end
  • Maximum 70 characters

Body Guidelines

  • Explain what and why, not how
  • Use imperative mood and present tense
  • Include motivation for the change
  • Contrast with previous behavior when relevant

Footer: Issue References

Reference issues in the footer using these patterns:

Fixes GH-1234
Fixes #1234
Fixes SENTRY-1234
Refs LINEAR-ABC-123
  • Fixes closes the issue when merged
  • Refs links without closing

AI-Generated Changes

Follow the repository's attribution policy and identify the actual contributor. The following is an example for Claude; do not attach it to work produced by a different agent or invent a person's contribution:

Co-Authored-By: Claude <noreply@anthropic.com>

Repository attribution and disclosure rules take precedence. Do not add phrases like "Generated by AI", "Written with Claude", or similar markers in the subject, body, or anywhere else in the commit message.

Examples

Simple fix

fix(api): Handle null response in user endpoint

The user API could return null for deleted accounts, causing a crash
in the dashboard. Add null check before accessing user properties.

Fixes SENTRY-5678
Co-Authored-By: Claude <noreply@anthropic.com>

Feature with scope

feat(alerts): Add Slack thread replies for alert updates

When an alert is updated or resolved, post a reply to the original
Slack thread instead of creating a new message. This keeps related
notifications grouped together.

Refs GH-1234

Refactor

ref: Extract common validation logic to shared module

Move duplicate validation code from three endpoints into a shared
validator class. No behavior change.

Breaking change

feat(api)!: Remove deprecated v1 endpoints

Remove all v1 API endpoints that were deprecated in version 23.1.
Clients should migrate to v2 endpoints.

BREAKING CHANGE: v1 endpoints no longer available
Fixes SENTRY-9999

Revert Format

revert: feat(api): Add new endpoint

This reverts commit abc123def456.

Reason: Caused performance regression in production.

Principles

  • Each commit should be a single, stable change
  • Commits should be independently reviewable
  • The repository should be in a working state after each commit

References

Limitations

  • Use this skill only when the task clearly matches the scope described above.

…

常见问题

什么是 commit?

它就像是在某个时刻给你的代码拍一张快照。这张快照保存了你做过的更改,需要时还能回到这个版本。

什么是 Sentry 风格?

这是一套编写 commit 信息的规则,能帮助人们快速看懂每次代码更改的作用,比如修复 Bug 或新增功能。

为什么要检查分支?

这是为了确保你不会不小心改动项目中的重要部分,从而导致项目出错。就像在动笔之前,先确认自己是在正确的画布上作画。

详情

作者的原始描述

Prepare or create commits using Sentry-style message conventions when the repository requests them; inspect staged scope and honor its protected branch workflow.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4212
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能