Use when writing a commit message for a set of staged changes.
Preview full content
Write a commit message for the given diff in Conventional Commits format:
<type>(<optional scope>): <summary>
blank line, then an optional body explaining why, not just what (the diff already shows what).
Types: feat (new capability), fix (bug fix), refactor (no behavior change), docs, test, chore (tooling/config), perf. Infer the type from the actual change, not the PR title if they conflict.
Rules:
- Summary line: imperative mood ("add", not "added" or "adds"), no trailing period, under ~72 characters.
- If the diff touches multiple unrelated concerns, say so explicitly rather than writing one message that tries to cover all of it — that's a sign it should probably be split into separate commits.
- Only add a body when the why isn't obvious from the diff alone (a non-obvious workaround, a decision between alternatives, a linked issue) — don't restate the diff in prose.
- Never invent a scope, ticket number, or rationale that isn't actually evident from the diff or provided context.