Awesome-omni-skill Git Commit Helper
Creates well-formatted conventional commits with intelligent change analysis. Use when creating commits, committing changes, staging files, or when the user mentions "commit", "git commit", or wants to save their work to version control. Analyzes diffs to suggest splitting commits when multiple concerns are detected.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/cli-automation/git-commit-helper" ~/.claude/skills/diegosouzapw-awesome-omni-skill-git-commit-helper && rm -rf "$T"
skills/cli-automation/git-commit-helper/SKILL.md- references .env files
Git Commit Helper
Helps create atomic, well-formatted commits following conventional commit standards. Automatically analyzes changes to determine if they should be split into multiple commits.
Core Responsibilities
- Parallel git operations - Run
andgit status
concurrently for speedgit diff - Smart staging detection - Check if files are already staged, otherwise auto-stage
- Intelligent diff analysis - Determine if changes should be split into multiple commits
- Conventional commit messages - Generate properly formatted commit messages
- Commit attribution - Add Claude Code attribution to commit messages
When to Use This Skill
Use this skill when:
- User explicitly requests commit creation
- Creating commits with proper conventional format
- Analyzing changes to determine if they should be split
- Need to generate meaningful commit messages automatically
- Working with staging area and need guidance
Use direct git commands when:
- User wants to run specific git commands directly
- Debugging git issues
- Complex git operations beyond basic commits
Workflow
1. Gather Information (Parallel)
# Run concurrently for speed git status & git diff --staged & git diff & git diff --stat
2. Analyze and Decide
Single commit if:
- All changes relate to one purpose
- Changes are tightly coupled
- Splitting would create incomplete features
- Total diff is reasonably sized
Split commits if:
- Different functionality (features vs bug fixes vs refactoring)
- Different subsystems (auth vs API vs UI)
- Different file types (code vs docs vs config)
- Different purposes (implementation vs tests vs dependencies)
3. Stage Strategically
# Stage all (excluding secrets) git add . # Stage specific files git add path/to/file1.js path/to/file2.js # Stage by pattern git add src/auth/* # Stage interactively git add -p file.js
4. Create Commit
Always use HEREDOC format:
git commit -m "$(cat <<'EOF' <type>[optional scope]: <description> [optional body explaining why, not what] [optional footer: Fixes #123] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )"
5. Verify
git status # Verify commit created git log -1 # Review last commit
Conventional Commit Types
- A new featurefeat
- A bug fixfix
- Documentation only changesdocs
- Code style changes (formatting, semicolons, etc.)style
- Code change that neither fixes a bug nor adds a featurerefactor
- Performance improvementperf
- Adding or correcting teststest
- Build system or external dependenciesbuild
- CI configuration files and scriptsci
- Other changes that don't modify src or test fileschore
- Reverts a previous commitrevert
With scope:
feat(auth): add password reset
Breaking change: feat!: remove deprecated API (note the !)
Commit Message Rules
Description line:
- Use imperative mood: "add" not "added" or "adds"
- Don't capitalize first letter
- No period at the end
- Keep under 72 characters
- Be specific: ✓
✗fix: resolve race condition in data syncfix: bug fix
Body (optional):
- Wrap at 72 characters
- Explain "why" not "what"
- Include motivation and context
Footer (optional):
- Reference issues:
,Fixes #123
,Closes #456See also: #789 - Breaking changes:
BREAKING CHANGE: removed /v1/auth endpoint
Security: Never Commit Secrets
Always exclude:
,.env*
,credentials.jsonsecrets.json
,*.pem
,*.key
,*.p12*.pfx- API tokens, passwords, private keys
If secrets detected: Warn user, suggest
.gitignore or environment variables, only proceed if user explicitly confirms
Pre-commit Hook Handling
Standard flow:
- Attempt commit
- If hooks fail, read error message
- Fix issues hooks identified
- Retry commit
If hooks modify files:
# Check if safe to amend (should show Claude as author, not pushed) git log -1 --format='%an %ae' git status # If safe, amend git add . git commit --amend --no-edit # Otherwise, create new commit git commit -m "$(cat <<'EOF' chore: apply pre-commit hook fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )"
Bypass hooks: Only when user explicitly requests
--no-verify
Common Patterns
Simple Commit
git status & git diff git add . git commit -m "$(cat <<'EOF' feat: add user dashboard with activity widgets 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )" git status
Commit Staged Files Only
git diff --staged git commit -m "$(cat <<'EOF' fix: resolve email validation for plus addressing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )"
Split Commits
# First commit git add src/auth/* git commit -m "$(cat <<'EOF' feat: implement OAuth2 authentication flow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )" # Second commit git add tests/auth/* git commit -m "$(cat <<'EOF' test: add OAuth2 flow integration tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )"
With Detailed Body
git commit -m "$(cat <<'EOF' refactor: extract API client configuration to separate module Moved API client setup logic from individual service files to centralized config module to reduce duplication and simplify updates. Fixes #123 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )"
Quick Troubleshooting
- Hooks rejected commit: Read error, fix issues, retry
- Wrong message:
(if not pushed)git commit --amend -m "new message" - Forgot files:
(if not pushed)git add file && git commit --amend --no-edit - Need to split:
, then stage and commit separately (if not pushed)git reset HEAD~1 - Committed secrets:
, restage without secrets (if not pushed; if pushed, use git-filter-repo)git reset HEAD~1
Best Practices
- Each commit = one logical change (atomic commits)
- Test before committing
- Review diffs before staging
- Write clear, descriptive messages
- Commit frequently (small commits > large commits)
- Don't mix unrelated changes
- Use conventional format for parseable history
- Reference issue tracker when relevant
Performance Tips
- Run git commands in parallel when independent
- Use
for quick overview before full diffgit diff --stat - Use HEREDOC directly (no temp files)
- Cache staging status to avoid repeated checks
Integration
- Git hooks: Compatible with pre-commit, commit-msg, prepare-commit-msg
- Changelog generators: conventional-changelog, semantic-release, standard-version
- Issue trackers: Reference issues in footers (
)Fixes #123
Quick Reference
# Analyze (parallel) git status & git diff --staged & git diff & wait # Stage git add . # All files git add path/to/file1 path/to/file2 # Specific files git add src/**/*.ts # Pattern # Commit git commit -m "$(cat <<'EOF' <type>: <description> [optional body] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> EOF )" # Verify git status && git log -1 # Fix (if not pushed) git commit --amend --no-edit # Amend git commit --amend -m "msg" # Change message git reset HEAD~1 # Undo commit
Resources
- Conventional Commits: https://www.conventionalcommits.org/
- Git Documentation: https://git-scm.com/doc
- Git Best Practices: https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project