mcpField
C
commit

commit

github.com/davila7开发33.1k435 次安装今天更新
代码仓库

关于 commit

commit 是为 Sentry 项目规定提交信息格式的技能,涵盖标题结构、类型、主题与正文规则、问题引用方式,以及常见变更示例。

主要功能

  1. 01必需标题格式与可选范围
  2. 02提交类型定义
  3. 03主题和正文撰写规则
  4. 04问题引用页脚格式
  5. 05撤销与破坏性变更示例

适用场景

  1. 01撰写 Sentry 错误修复提交
  2. 02描述带范围的功能变更
  3. 03在提交页脚引用问题
  4. 04规范撤销或破坏性变更格式

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/davila7/claude-code-templates --skill commit

安装后在 Claude Code 中输入/commit确认已加载。

详细介绍

Sentry 提交信息

为 Sentry 项目创建提交时,请遵循以下约定。

格式

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

<body>

<footer>

标题为必填项。范围(Scope)为可选项。所有行必须保持在 100 个字符以内。

提交类型

类型用途
feat新功能
fix缺陷修复
ref重构(不改变行为)
perf性能改进
docs仅文档
test新增或修正测试
build构建系统或依赖
ciCI 配置
chore维护任务
style代码格式化(不改变逻辑)
meta仓库元数据
license许可证变更

主题行规则

  • 使用祈使语气、一般现在时:"Add feature" 而非 "Added feature"
  • 首字母大写
  • 结尾不加句号
  • 最多 70 个字符

正文指南

  • 解释是什么和为什么,而非如何做
  • 使用祈使语气和一般现在时
  • 包含变更的动机
  • 在相关时与之前的行为进行对比

页脚:问题引用

在页脚中使用以下模式引用问题:

Fixes GH-1234
Fixes #1234
Fixes SENTRY-1234
Refs LINEAR-ABC-123
  • Fixes 在合并时关闭该问题
  • Refs 仅链接而不关闭

示例

简单修复
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
带范围的功能
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
重构
ref: Extract common validation logic to shared module

Move duplicate validation code from three endpoints into a shared
validator class. No behavior 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: feat(api): Add new endpoint

This reverts commit abc123def456.

Reason: Caused performance regression in production.

原则

  • 每个提交应当是单一、稳定的变更
  • 提交应当可独立审查
  • 每次提交后,仓库应处于可正常工作状态

参考

评论

支持 Markdown