---
name: git-commit-message-formatter
description: "Three ready-to-paste commit messages written from your diff in the team's convention, each with a precise subject line, a body that explains why, and the ticket and breaking-change footers in the right place. Use when a diff or change needs a commit message in Conventional Commits or another house style, with the right type, scope, and footers. Do not use for writing pull request descriptions, release notes, or changelogs. Related topics: coding, git, utility."
---

# Git Commit Message Formatter

Three ready-to-paste commit messages written from your diff in the team's convention, each with a precise subject line, a body that explains why, and the ticket and breaking-change footers in the right place.

## When to use

Use this skill when a diff or change needs a commit message in Conventional Commits or another house style, with the right type, scope, and footers. Do not use it for writing pull request descriptions, release notes, or changelogs.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Identify the single behaviour change in the diff and decide whether it should be one commit or split, so the type and scope are unambiguous.
3. Write an imperative subject line of 50 characters or fewer with no trailing full stop, in the convention's type and scope format.
4. Draft the body around the reason and the consequence of the change, bulleted when requested, with nothing that merely restates the diff.
5. Place the ticket reference and any BREAKING CHANGE footer where the convention expects them, adding a migration note for breaking changes.
6. Present three variants of increasing length and name the one that matches the size of the change.

## Inputs

- **Diff or description of the change** (longer free text)
- **Convention** (choose one: Conventional Commits (feat/fix/chore), Angular Style, Simple/Brief, Descriptive/Long)
- **Ticket or issue number** (free text, e.g. "PROJ-123 or leave blank")
- **Impact of the change** (choose any: Breaking Change, UI Update, Database Migration, Performance Fix, Security Fix, Dependency Update)
- **Bulleted body** (choose one: Yes, No)

## Output

Three commit messages in fenced blocks, from subject only to subject with body and footers, followed by one line recommending which to use.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Git Commit Message Formatter

Turn my change into commit messages that follow the team's convention.

#### The change
- Diff or description of the change: {{Diff or description of the change}}
- Convention: {{Convention}}
- Ticket or issue number: {{Ticket or issue number}}
- Impact of the change: {{Impact of the change}}
- Bulleted body: {{Bulleted body}}

Read the diff for what actually changed, not what the surrounding code does, and work out the one behaviour a reviewer needs to know. Pick the type and scope from the convention: a diff that touches several concerns gets the type of its main change and a note that it could be split. Write the subject in the imperative mood, 50 characters or under, with no trailing full stop. Use the body for the why and the consequence, not a restatement of the diff; when the bulleted option is on, one bullet per distinct change. Put the ticket reference and any BREAKING CHANGE footer where the convention expects them, with a one-line migration note for breaking changes. Give three variants: the shortest honest subject alone, a subject with a short body, and a full message with footers, and say which one fits the size of the change.

## Pitfalls

- Describing what the code does now instead of what the change did, which makes the message useless in git blame.
- Tagging a mixed diff as feat when the user-visible part is a fix, so the changelog puts it under the wrong heading.
- Omitting the BREAKING CHANGE footer when Breaking Change was selected as an impact, which hides the change from semantic-release tooling.
