---
name: commit-message
description: "Write a Conventional Commits message from the staged git diff."
allowed-tools: ["Bash(git diff:*)", "Bash(git status:*)", "Read"]
scope: "single commit"
---

# Commit Message Writer

## Musts

- Run `git diff --staged` and read the actual changes before writing anything.
- Use Conventional Commits format: `type(scope): summary`.
- Keep the summary line in the imperative mood and ≤72 characters.
- The body (if any) explains **why** the change was made, not a restatement of the diff. Wrap at 72 columns.
- Never describe changes that are not present in the staged diff.

## Guidelines

- Prefer these types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`.
- Omit the scope if it isn't obvious; don't invent one.
- Reference an issue in the body (`Refs #123`) only if the user provides it.

## Example

Input (staged diff): a new rate-limiter added to the login route.

```
feat(auth): rate-limit login attempts

Brute-force attempts were unbounded. Adds a 5-attempts-per-minute
limiter per IP on the login route to slow credential stuffing.
```
