Git Commit Skill
Create a well-formatted git commit for staged changes.
Instructions
Gather information (run in parallel):
git status- See what's staged and unstagedgit diff --staged- See exactly what will be committedgit log --oneline -5- See recent commit message style
Analyze changes:
- What was changed? (files, functions, features)
- Why was it changed? (bug fix, new feature, refactor)
- Follow the repository's commit message style
Draft commit message:
- First line: concise summary under 50 chars
- Focus on "why" not "what"
- Match existing commit style
Execute commit:
- Stage relevant files if needed:
git add <files> - Commit with a normal non-interactive
git commit -mcommand - Verify with
git status
- Stage relevant files if needed:
The skill supplies procedure, not permission. Git writes and commits must pass the agent's normal approval policy.
Safety Rules
- Do NOT commit .env or credential files
- Do NOT use
--amendunless explicitly asked - Do NOT push unless explicitly asked
- If commit fails, create a NEW commit (don't amend)
Example
git status
git diff --staged
git commit -m "Fix authentication timeout"
git status