commit
Git Commit Command
When & Why to Use This Skill
The Git Commit skill automates the version control workflow by enforcing standardized commit practices and professional message formatting. It streamlines the entire process—from running pre-commit tests and staging specific files to generating structured, emoji-enhanced commit messages—ensuring a clean, readable, and professional repository history without AI attribution.
Use Cases
- Standardizing Repository History: Automatically apply consistent emoji prefixes (like :bug:, :sparkles:, or :recycle:) and imperative mood to all commit messages for better team collaboration.
- Automated Quality Assurance: Integrate mandatory pre-commit checks (e.g., npm test, rake) into the commit workflow to prevent broken code from being committed.
- Precise Change Management: Replace risky 'git add .' commands with explicit file staging, ensuring only intended changes are included in each commit.
- Professional Documentation: Generate concise 'what and why' commit descriptions that focus on impact rather than implementation details, ideal for generating clean changelogs.
| name | commit |
|---|---|
| description | Git Commit Command |
| allowed-tools | [Bash, Read, Grep] |
Git Commit Skill
Assists with creating git commits.
IMPORTANT: When using this skill, announce to the user: "Using commit skill to create a git commit."
Workflow
# 1. Pre-commit checks (skip tests for documentation-only changes)
rake # Ruby
npm test # Node.js
make test # Make
# 2. Review changes
git status
git diff
# 3. Stage specific files (NEVER use "git add ." or "git add -A")
git add path/to/file.ext
git add path/to/another.ext
# 4. Review staged changes
git diff --cached
# 5. Commit with temporary file (MUST use <<'EOF' with single quotes)
cat > /tmp/commit_msg.txt <<'EOF'
:emoji: Subject line in imperative mood
Brief explanation (optional)
- Key impact 1
- Key impact 2
EOF
git commit -F /tmp/commit_msg.txt
rm /tmp/commit_msg.txt
# 6. Push if needed
git push
Key Rules
- Write in English only
- Use
:emoji:codes (not raw Unicode), with a space after - Imperative mood: "Fix" not "Fixed"
- No period at end of subject line
- Focus on WHAT and WHY, not HOW
- 2-3 bullet points max in body
- Omit reverted changes and implementation details
- NEVER include AI/coding agent attribution (e.g., "Generated by Claude", "Co-authored-by: Claude")
Emoji Codes
:zap:- Performance:bug:- Bug fix:sparkles:- Feature:memo:- Documentation:recycle:- Refactor:art:- Structure/format:wrench:- Configuration:white_check_mark:- Tests:fire:- Remove:package:- Dependencies