Git Commit Skill
Create a well-formatted git commit for staged changes.
Process
- •
Analyze Changes
- •Run
git statusto see all untracked and modified files (never use -uall flag) - •Run
git diff --cachedto see staged changes - •Run
git diffto see unstaged changes - •Run
git log --oneline -5to see recent commit message style
- •Run
- •
Draft Commit Message
- •Summarize the nature of changes (new feature, enhancement, bug fix, refactoring, test, docs)
- •Use correct verb: "add" for new features, "update" for enhancements, "fix" for bugs
- •Keep message concise (1-2 sentences) focusing on "why" not "what"
- •Follow repository's existing commit message style
- •
Safety Checks
- •DO NOT commit files containing secrets (.env, credentials.json, etc.)
- •Warn user if they request to commit sensitive files
- •Stage specific files by name, avoid
git add -Aorgit add .
- •
Create Commit Use HEREDOC format for proper formatting:
bashgit commit -m "$(cat <<'EOF' Your commit message here. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> EOF )"
- •
Verify Success
- •Run
git statusafter commit to confirm
- •Run
Rules
- •NEVER update git config
- •NEVER use destructive commands (push --force, reset --hard, checkout ., clean -f)
- •NEVER skip hooks (--no-verify, --no-gpg-sign)
- •NEVER amend commits unless explicitly requested
- •NEVER use -i flag (interactive mode not supported)
- •NEVER push unless explicitly requested
- •If pre-commit hook fails, fix issues and create NEW commit (don't amend)
User Request
$ARGUMENTS