Smart Commit
Turn a set of staged changes into a clear, well-formatted commit message.
Instructions
- Read the diff of changes provided (e.g. the output of
git diff --cached). - Identify the primary type of change:
feat,fix,refactor,docs,test,chore,style,perf,build, orci. - Write the message using the Conventional Commits format:
- Summary line:
<type>(<optional scope>): <short description> - Use imperative mood ("add", "fix", "remove" — not "added", "fixed", "removed").
- Keep the summary line under ~72 characters.
- Summary line:
- If the change is non-trivial, add a short body below the summary explaining why the change was made, not just what changed.
- If the diff touches several unrelated areas, name the most significant change in the summary and list the rest as bullet points in the body.
- Never invent details that aren't supported by the diff — if the intent behind a change is unclear, say so rather than guessing.
Example
Given a diff that adds retry logic to an API client:
feat(api-client): add exponential backoff on 5xx responses
Requests were failing outright on transient server errors. Retries
now back off exponentially (up to 3 attempts) before giving up.