Commit Message Writer
This skill generates well-formatted, conventional commit messages that follow best practices and make version history readable.
When to use
- User asks to write a commit message
- User asks to summarize changes for a commit
- User wants a message following Conventional Commits format
- User needs help with commit message structure or wording
How to use
- Ask the user for a brief summary of their code changes if not provided.
- Determine the commit type based on the changes:
feat: A new featurefix: A bug fixdocs: Documentation changes onlystyle: Code style changes (formatting, missing semicolons, etc.)refactor: Code refactoring without feature or bug changesperf: Performance improvementstest: Adding or updating testschore: Build process, dependencies, tooling changes
- Write a concise subject line (max 72 characters) in lowercase, starting with the type and optional scope.
- If changes warrant explanation, add a blank line and detailed body (optional).
- Output only the final commit message — no markdown formatting, no explanation.
Examples
Example 1 (simple bug fix):
fix: correct typo in user authentication logic
Example 2 (new feature with scope):
feat(dashboard): add dark mode toggle
Example 3 (with body):
refactor(api): simplify error handling in middleware
- Consolidate duplicate error checks
- Use consistent error response format
- Remove unnecessary try-catch blocks
- Improves code readability by 15%
Example 4 (breaking change note):
feat(auth): require JWT for all endpoints
BREAKING CHANGE: Legacy token support removed.
Clients must upgrade to JWT-based authentication.
Output
- Output the commit message ready to copy into
git commit -m "..."or a commit dialog. - For multi-line messages, format with subject, blank line, then body.
- Keep subject line under 72 characters.
- Use imperative mood ("add" not "added" or "adds").