# Commit Conventions

> Write disciplined git commits. Use whenever committing changes or writing commit messages — conventional-commit subjects, and never commit directly to main.

- Skill: `getsentry/commit-conventions` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add getsentry/commit-conventions`
- Raw SKILL.md: https://api.skillmd.com/api/skills/getsentry/commit-conventions/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Sentry (https://skillmd.com/u/getsentry)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/getsentry/commit-conventions

---


# Commit Conventions

When committing changes, follow these rules without being asked:

## Subject format

Write every commit subject as `<type>(<scope>): <description>`:

- Types: `feat`, `fix`, `docs`, `test`, `ref` (refactor), `chore`. Scope is optional.
- Imperative, present tense: "Add null check", not "Added" or "Adds".
- At most 70 characters. No trailing period.
- Describe the actual change, not the activity ("fix(api): Handle null user response", never "update code").

Example: after fixing a missing null check in `app.js`:

```
fix(app): Handle null result in user lookup
```

## Branch safety

Before committing, check the current branch (`git branch --show-current`):

- On `main` or `master`: create a feature branch first — `git checkout -b <type>/<short-description>` — then commit there. Never commit directly to main, even for small changes.
- Already on a feature branch: commit there.

## Never

- Never amend, rebase, or force-push existing history unless the user explicitly asks.
- Never bundle unrelated changes into one commit — mention anything you left unstaged.

