home / skills / davila7 / claude-code-templates / commit

This skill helps you craft Sentry-style commit messages that follow conventional commits with issue references for clean, traceable history.

This is most likely a fork of the commit skill from xfstudio
npx playbooks add skill davila7/claude-code-templates --skill commit

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.9 KB
---
name: commit
description: Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
---

# Sentry Commit Messages

Follow these conventions when creating commits for Sentry projects.

## 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

## 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
```

### 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

- [Sentry Commit Messages](https://develop.sentry.dev/engineering-practices/commit-messages/)

Overview

This skill generates commit messages that follow Sentry conventions and Conventional Commits. It helps format headers, bodies, and footers to meet Sentry-specific rules for types, scopes, subject lines, and issue references. Use it to produce clear, reviewable, and traceable git history entries.

How this skill works

The skill constructs a three-part commit: header, optional body, and footer. It enforces allowed commit types (feat, fix, ref, perf, docs, test, build, ci, chore, style, meta, license), subject-line rules (imperative, capitalized, no trailing period, ≤70 chars), and line-wrap under 100 characters. For issues, it formats footers using Fixes/Refs patterns (e.g., Fixes SENTRY-1234, Refs GH-1234).

When to use it

  • When committing code changes to keep history consistent with Sentry practices
  • When writing commit messages for features, fixes, refactors, or releases
  • When formatting or cleaning up git history for clarity and reviewability
  • When you need to reference issue trackers (Sentry, GitHub, Linear) in commits
  • When preparing commits that may include breaking changes or reverts

Best practices

  • Choose the single commit type that describes the primary change
  • Keep subjects short, imperative, capitalized, and without a trailing period
  • Explain what and why in the body; avoid implementation details
  • Use footers to close or reference issues with Fixes or Refs patterns
  • Make each commit a single, independently reviewable change

Example use cases

  • Create a fix commit for a null-pointer bug with a Fixes SENTRY-1234 footer
  • Write a feat scoped to alerts that explains behavior and references GH issues
  • Author a refactor commit that notes no behavior change and explains consolidation
  • Prepare a breaking-change commit using ! and a BREAKING CHANGE section in the body
  • Revert a problematic commit with a concise revert header and a reason in the body

FAQ

What commit type should I use for formatting only?

Use style for code formatting or linting changes that don't affect behavior.

How do I close an issue with a commit?

Include a footer like Fixes GH-1234, Fixes #1234, or Fixes SENTRY-1234 to close the issue when merged.

When should I include a scope?

Include a scope to indicate the affected subsystem or package when it adds clarity, but it's optional for small changes.