Commit Helper
Generate a conventional commit message from your staged changes.
When to use
- You have staged changes and need a commit message
- You want structured conventional commits (feat:, fix:, etc.)
- You're unsure what type or scope to use
Prerequisites
gitavailable in PATH- Changes are staged (
git add)
Steps
- Run
git diff --cached --statto see what changed - Run
git diff --cachedfor full staged diff - Classify changes:
feat:new featurefix:bug fixdocs:documentation onlyrefactor:code change that neither fixes a bug nor adds a featureperf:performance improvementtest:adding or fixing testschore:build process, tooling, or library changesci:CI configuration changesbuild:build system or dependency changes
- Determine scope from changed paths (e.g.,
auth,api,ui,deps) - Write subject line in imperative mood, ≤72 chars
- Add body explaining why if the change is non-trivial
- Present the commit message and offer to commit
Output format
<type>(<scope>): <imperative-subject>
<optional body — explain motivation, not mechanics>
Examples
feat(auth): add email verification flow
fix(api): handle empty response from payment webhook
docs(readme): update installation instructions
refactor(db): extract query builder into separate module
Notes
- Never use past tense ("added" → "add")
- Don't end the subject line with a period
- Keep the subject under 72 characters
- Use the body to explain what and why, not how
- If the diff is large, summarize major categories first
