Git Commit Style
Conventions for writing git commit messages and pull request descriptions. Project-specific conventions always take priority.
Subject Line
- Try to keep under 50 characters total
- No trailing period
- Lowercase imperative verbs:
fix, add, remove, use, avoid, ensure, adjust, allow, enable, extract, introduce, show, move, roll
- Capital letter only when starting with a proper noun or class name — never capitalize verbs
- Embed the "why" directly when possible:
avoid enlarging small images, avoid double-save on withdraw
- Technical identifiers kept verbatim:
config.x.asset_file_uploadable, event_submission_open?
- Arrow notation for renames:
ops-lb: rknw -> rknet
Keeping Under 50 Characters
Techniques when the subject runs long:
- Drop
add when the subject already names the primary new thing: site-sessions: SiteSession model not … add SiteSession model — keep add when supplementing existing code (specs, logging)
- Omit secondary artifacts when the primary deliverable is clear:
site-sessions: SiteSessionIssuance service not … service and background jobs — mention omitted parts in the body
& over and: PrimarySession & User changes
- Drop qualifiers the prefix already provides:
site-sessions: PrimarySession & User changes not … for site sessions
Contextful Verbs
Prefer specific verbs over generic ones:
avoid or address over fix for preventive changes
extract over refactor when pulling out a concern/class
introduce over add when creating a new concept/abstraction
reflect over update when syncing with external state
gains for new capabilities (component as subject): SponsorEvent: gains hero image upload
learns for new options/parameters: TitoApi: learns v3.1 pagination
no longer for behavioral removals: event_submission_open? no longer gates asset uploads
roll for dependency updates and referenced image/git tag updates, releng for release engineering, trigger for CI/build triggers
Prefix Pattern
Format: prefix: rest of subject — use when the commit targets a specific component.
Prefix types vary by what is being changed:
- Class/module name (PascalCase, matching actual name; short, greppable, consistent — prefer over lowercase descriptive forms):
SponsorEventAssetFilesController: fix set_asset_file authorization, SiteSessionRenewal: just propagate errors
- Method reference (Class#method):
SponsorEventsController#destroy: avoid double-save on withdraw
- View/route path:
broadcasts/show: sort recipients alphabetically
- Feature/epic name (hyphenated, no spaces — consistent across a series):
event-assets: begin validation, site-sessions: SiteSession model
- File or directory:
Dockerfile: build minimal libvips, CI: install libvips-tools
- Subsystem/infra name:
tf/k8s: ..., radius: ..., grafana: ...
Omit prefix when:
- The subject already names the target:
Extract GithubInstallation from GenerateSponsorsYamlFileJob
- Whole-project or obvious-context changes:
roll latest dependencies, trigger build for 3.2.10
- Terse commits:
typo, wip, oops
Body
The most important role of the body is to explain background and context that is NOT obvious from the diff. The diff shows what changed; the body explains why it was changed, what problem it solves, or what non-obvious behavior motivated the change.
- Do not repeat what the diff already says — focus on what a reader cannot infer from code alone
- Opening sentence or paragraph: the background, rationale, or problem
- Bullet list with
- when enumerating multiple specifics
- Wrap lines at ~72 characters
- Issue references:
Closes #N
- Skip body entirely when the subject + diff are self-explanatory
Examples:
sponsor_events: wrap asset file update in transaction
Prevent data loss when replacing a hero image and the subsequent
update fails validation. The old asset file destroy is now rolled
back if the event update doesn't succeed.
SponsorEventsController#destroy: avoid double-save on withdraw
withdrawn! saves immediately, creating one editing history record,
then save! creates a second one with no meaningful diff. The job
was enqueued with the second history, missing the status change
and skipping YAML regeneration.
Pull Request Titles and Descriptions
Apply the same subject line conventions to PR titles (under 70 chars).
- Single-commit branch: use the commit subject as title and commit body as description
- Multi-commit branch: write a concise summary title, then explain individual commits under headings or bullet points using Markdown
Never include test procedures, test plans, QA checklists, task lists, or TODO checkboxes in PR descriptions.
Git Command Usage
- Never use
git -C <path> — it invalidates pre-approved permissions in Claude Code. Always cd to the target directory first, then run git commands.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: commit-style3description: This skill should be used when writing git commit messages, creating git commits, composing pull request titles and descriptions, or when the user asks to "commit", "git commit", "write commit message", "pull request", or "PR description". Provides conventions for subject lines, prefix patterns, body content, and verb choices. Use when this capability is needed.4---56# Git Commit Style78Conventions for writing git commit messages and pull request descriptions. Project-specific conventions always take priority.910## Subject Line1112- Try to keep under 50 characters total13- No trailing period14- Lowercase imperative verbs: `fix`, `add`, `remove`, `use`, `avoid`, `ensure`, `adjust`, `allow`, `enable`, `extract`, `introduce`, `show`, `move`, `roll`15- Capital letter only when starting with a proper noun or class name — never capitalize verbs16- Embed the "why" directly when possible: `avoid enlarging small images`, `avoid double-save on withdraw`17- Technical identifiers kept verbatim: `config.x.asset_file_uploadable`, `event_submission_open?`18- Arrow notation for renames: `ops-lb: rknw -> rknet`1920### Keeping Under 50 Characters2122Techniques when the subject runs long:2324- Drop `add` when the subject already names the primary new thing: `site-sessions: SiteSession model` not `… add SiteSession model` — keep `add` when supplementing existing code (specs, logging)25- Omit secondary artifacts when the primary deliverable is clear: `site-sessions: SiteSessionIssuance service` not `… service and background jobs` — mention omitted parts in the body26- `&` over `and`: `PrimarySession & User changes`27- Drop qualifiers the prefix already provides: `site-sessions: PrimarySession & User changes` not `… for site sessions`2829### Contextful Verbs3031Prefer specific verbs over generic ones:3233- `avoid` or `address` over `fix` for preventive changes34- `extract` over `refactor` when pulling out a concern/class35- `introduce` over `add` when creating a new concept/abstraction36- `reflect` over `update` when syncing with external state37- `gains` for new capabilities (component as subject): `SponsorEvent: gains hero image upload`38- `learns` for new options/parameters: `TitoApi: learns v3.1 pagination`39- `no longer` for behavioral removals: `event_submission_open? no longer gates asset uploads`40- `roll` for dependency updates and referenced image/git tag updates, `releng` for release engineering, `trigger` for CI/build triggers4142## Prefix Pattern4344Format: `prefix: rest of subject` — use when the commit targets a specific component.4546Prefix types vary by what is being changed:47- **Class/module name** (PascalCase, matching actual name; short, greppable, consistent — prefer over lowercase descriptive forms): `SponsorEventAssetFilesController: fix set_asset_file authorization`, `SiteSessionRenewal: just propagate errors`48- **Method reference** (Class#method): `SponsorEventsController#destroy: avoid double-save on withdraw`49- **View/route path**: `broadcasts/show: sort recipients alphabetically`50- **Feature/epic name** (hyphenated, no spaces — consistent across a series): `event-assets: begin validation`, `site-sessions: SiteSession model`51- **File or directory**: `Dockerfile: build minimal libvips`, `CI: install libvips-tools`52- **Subsystem/infra name**: `tf/k8s: ...`, `radius: ...`, `grafana: ...`5354Omit prefix when:55- The subject already names the target: `Extract GithubInstallation from GenerateSponsorsYamlFileJob`56- Whole-project or obvious-context changes: `roll latest dependencies`, `trigger build for 3.2.10`57- Terse commits: `typo`, `wip`, `oops`5859## Body6061The most important role of the body is to explain background and context that is **NOT obvious from the diff**. The diff shows what changed; the body explains why it was changed, what problem it solves, or what non-obvious behavior motivated the change.6263- Do not repeat what the diff already says — focus on what a reader cannot infer from code alone64- Opening sentence or paragraph: the background, rationale, or problem65- Bullet list with `- ` when enumerating multiple specifics66- Wrap lines at ~72 characters67- Issue references: `Closes #N`68- Skip body entirely when the subject + diff are self-explanatory6970Examples:7172```73sponsor_events: wrap asset file update in transaction7475Prevent data loss when replacing a hero image and the subsequent76update fails validation. The old asset file destroy is now rolled77back if the event update doesn't succeed.78```7980```81SponsorEventsController#destroy: avoid double-save on withdraw8283withdrawn! saves immediately, creating one editing history record,84then save! creates a second one with no meaningful diff. The job85was enqueued with the second history, missing the status change86and skipping YAML regeneration.87```8889## Pull Request Titles and Descriptions9091Apply the same subject line conventions to PR titles (under 70 chars).9293- **Single-commit branch**: use the commit subject as title and commit body as description94- **Multi-commit branch**: write a concise summary title, then explain individual commits under headings or bullet points using Markdown9596Never include test procedures, test plans, QA checklists, task lists, or TODO checkboxes in PR descriptions.9798## Git Command Usage99100- Never use `git -C <path>` — it invalidates pre-approved permissions in Claude Code. Always `cd` to the target directory first, then run git commands.101102---103> Converted and distributed by [TomeVault](https://tomevault.io/claim/sorah) — claim your Tome and manage your conversions.104<!-- tomevault:4.0:skill_md:2026-04-11 -->