Prepare git commit messages following conventional commits. Activates on: commit, prepare commit, commit this, commit message, ready to commit, stage and commit
Automatically prepare commit messages following conventional commits standard.
This skill activates on keywords:
When activated, follow these steps:
Run these commands to understand what's being committed:
# See all changes
git status
# Staged changes (what will be committed)
git diff --cached --stat
git diff --cached
# Unstaged changes (won't be committed yet)
git diff --stat
Determine:
Follow conventional commits format:
<type>(<scope>): <subject>
<body>
<footer>
| Type | When to Use | Example |
|---|---|---|
feat |
New feature | feat: add user authentication |
fix |
Bug fix | fix: resolve null pointer in parser |
docs |
Documentation only | docs: update API reference |
refactor |
Code restructuring | refactor: extract validation logic |
test |
Adding/fixing tests | test: add unit tests for auth |
perf |
Performance improvement | perf: optimize database queries |
chore |
Maintenance, deps | chore: update dependencies |
ci |
CI/CD changes | ci: add caching to workflow |
style |
Formatting only | style: fix indentation |
If there are unstaged changes, ask:
git add .)After user confirms the message:
git add <files>
git commit -m "<message>"
Important: Always use HEREDOC for multi-line commits:
git commit -m "$(cat <<'EOF'
feat: add user authentication
Implement OAuth2 flow with Google and GitHub providers.
Includes session management with secure cookies.
š¤ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"
After successful commit:
git log -1 to confirmgit push if readyUser: "commit these changes"
Claude:
git status
git diff --cached
Looking at your staged changes:
src/auth/oauth.py - added token refresh logictests/test_auth.py - added refresh testsSuggested commit:
feat(auth): add OAuth token refresh
Implement automatic token refresh when access token expires.
Includes retry logic with exponential backoff.
Shall I commit with this message?
User: "ready to commit"
Claude: I see you've changed the API response format. This is a breaking change.
Suggested commit:
feat(api)!: change response envelope format
BREAKING CHANGE: API responses now use { data, meta, errors }
envelope instead of flat response. Clients must update parsing.
Migration: Update response handlers to access .data property.
This marks it as a breaking change with !. Proceed?
User: "commit this"
Claude: I see changes to multiple unrelated areas:
parser.pyexport.pyRecommend splitting into separate commits:
fix(parser): handle empty input gracefullyfeat(export): add CSV export optiondocs: update export documentationWant me to help stage and commit each separately?
Always include Claude attribution for AI-assisted commits:
š¤ Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
git commit --amend on pushed commits--no-verify unless explicitly asked