# Commit Message

> Writes the git commit message for the staged changes. Use when the user asks for a commit message.

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

---


# Commit message

Run `git diff --staged` and read every change before writing the message. Also check whether the user's message or the branch name gives a GitHub issue number (e.g. `fix/15-delete-invalid-index` → issue 15).

## Format

Line 1 — summary:
```
<type>: <short summary>[, #<issue>]
```
- `<type>` is one of: feat, fix, refactor, docs, test, chore, perf, style, build, ci.
- Append `, #<issue>` only when an issue number is known. Omit it entirely otherwise — do not invent a number.
- The whole line, issue suffix included, must be 50 characters or fewer. Cut words from the summary until it fits; never drop the type prefix or the issue suffix to make it fit.

Line 2 — always blank.

Line 3 — the reason, one line, no blank line after it:
```
Why: <the motivation or root cause, not a restatement of line 1>
```

Last line — only when the staged change fixes the known issue, add one line, on its own, with a blank line before it if the message has other body text:
```
fixes #<issue>
```
Skip this line entirely if there is no known issue, or the change does not fix it (e.g. it's partial work, a related change, or the user did not say it fixes it).

Never add a `Co-Authored-By`, "Generated with", or any other attribution or tool-signature line — leave the message with nothing after the last content line.

## Examples

Known issue #12, fixes it:
```
fix: crash in completeTask on bad index, #12

Why: index lookup ran before the bounds check.

fixes #12
```

Known issue #15, fixes it:
```
fix: delete command fails silently, #15

Why: invalid indexes returned ok instead of an error.

fixes #15
```

No known issue:
```
feat: add task count to list output

Why: users asked to see totals without counting rows.
```

## Checklist before replying

1. First line starts with a valid type and a colon.
2. First line is ≤50 characters, counting any `, #N` suffix.
3. First line ends with `, #N` if and only if an issue number is known.
4. Line 2 is blank; line 3 starts with `Why: ` and gives a reason, not a repeat of line 1.
5. Last line is exactly `fixes #N` if and only if the change fixes a known issue.
6. No attribution, co-author, or "generated by" line anywhere in the message.

