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.
Best use case
Git Commit Helper is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using Git Commit Helper should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/git-commit-helper/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How Git Commit Helper Compares
| Feature / Agent | Git Commit Helper | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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 1. **Parallel git operations** - Run `git status` and `git diff` concurrently for speed 2. **Smart staging detection** - Check if files are already staged, otherwise auto-stage 3. **Intelligent diff analysis** - Determine if changes should be split into multiple commits 4. **Conventional commit messages** - Generate properly formatted commit messages 5. **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) ```bash # 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 ```bash # 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: ```bash 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 ```bash git status # Verify commit created git log -1 # Review last commit ``` ## Conventional Commit Types - `feat` - A new feature - `fix` - A bug fix - `docs` - Documentation only changes - `style` - Code style changes (formatting, semicolons, etc.) - `refactor` - Code change that neither fixes a bug nor adds a feature - `perf` - Performance improvement - `test` - Adding or correcting tests - `build` - Build system or external dependencies - `ci` - CI configuration files and scripts - `chore` - Other changes that don't modify src or test files - `revert` - Reverts a previous commit **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 sync` ✗ `fix: bug fix` **Body** (optional): - Wrap at 72 characters - Explain "why" not "what" - Include motivation and context **Footer** (optional): - Reference issues: `Fixes #123`, `Closes #456`, `See also: #789` - Breaking changes: `BREAKING CHANGE: removed /v1/auth endpoint` ## Security: Never Commit Secrets **Always exclude**: - `.env*`, `credentials.json`, `secrets.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**: 1. Attempt commit 2. If hooks fail, read error message 3. Fix issues hooks identified 4. Retry commit **If hooks modify files**: ```bash # 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 ```bash 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 ```bash 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 ```bash # 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 ```bash 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**: `git commit --amend -m "new message"` (if not pushed) - **Forgot files**: `git add file && git commit --amend --no-edit` (if not pushed) - **Need to split**: `git reset HEAD~1`, then stage and commit separately (if not pushed) - **Committed secrets**: `git reset HEAD~1`, restage without secrets (if not pushed; if pushed, use git-filter-repo) ## Best Practices 1. Each commit = one logical change (atomic commits) 2. Test before committing 3. Review diffs before staging 4. Write clear, descriptive messages 5. Commit frequently (small commits > large commits) 6. Don't mix unrelated changes 7. Use conventional format for parseable history 8. Reference issue tracker when relevant ## Performance Tips - Run git commands in parallel when independent - Use `git diff --stat` for quick overview before full diff - 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 ```bash # 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
Related Skills
git-commit-for-ai-agents
Commit changes to a git repository. Use whenever a git commit is to be executed.
basilica-cli-helper
This skill should be used when users need to rent GPUs, run ML training jobs, or manage compute resources on Basilica's decentralized GPU marketplace. Use it for PyTorch/TensorFlow training, distributed training setup, GPU rental management, cost monitoring, or any Basilica CLI workflows. Includes workaround for non-TTY environments like Claude Code.
adversarial-committee
Committee of personas with opposing propensities forcing genuine debate
push-commit
Stage all changes, commit with a descriptive message, and push to the remote. Trigger with "push commit", "commit and push", "push changes", "/push-commit".
git-create-commit-skill
Use when creating git commits - mandates commits format with required scopes for all new commits, provides scope discovery from codebase structure, and prevents rationalization under pressure (emergency, fatigue, ambiguity)
git-commit-push
This skill should be used when the user wants to commit their work to git and push to GitHub. It guides through reviewing changes, crafting meaningful commit messages following project conventions (including Conventional Commits when detected), creating commits with security checks, and pushing to remote repositories.
commit
diff分析 → 論理的に分割コミット。conventional commitメッセージを自動生成。
commit-quick
codemapの更新をスキップして素早くgit commitする。変更内容を分析し、適切なコミットメッセージを自動生成してコミットを作成する。
ai4pkm-helper
AI4PKM helper for onboarding guidance, quick help, and Gobi Desktop/CLI workflow integration.
esphome-config-helper
This skill should be used when the user asks to "create an esphome config", "set up an esp32 device", "configure esphome yaml", "add a sensor to esphome", "fix esphome compile error", or mentions "gpio pin assignment", "wifi setup", "ota update", or error messages like "Unknown platform", "GPIO already in use", "Could not compile", or "WiFi connection failed". Provides rapid ESPHome configuration generation, troubleshooting, and validation.
commit-feature
Stage changes, create conventional commit (no co-author), push to origin, and add detailed PR comment with session context
commit-conventions
This skill should be used when writing commit messages, when asked about commit format, when reviewing a commit message, or when creating a git commit. Provides Conventional Commits format and project-specific conventions.