From git-workflow
Guides git commits with atomic change analysis, conventional commit messages, and interactive staging options. Flags non-atomic commits and suggests splits for better maintainability.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-workflow:commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Category**: Development
Category: Development
commit [--all | --staged | --interactive]
--all: Analyze all uncommitted changes (staged + unstaged)--staged: Only analyze currently staged changes (default)--interactive: Guide through staging changes atomically before committingThis command delegates to the commit-expert agent (Haiku model) for fast, cost-effective execution.
Delegation: Use the Task tool with:
subagent_type: "git-workflow:commit-expert"prompt: Include the mode (--staged, --all, or --interactive) and current working directoryExample:
Task(subagent_type="git-workflow:commit-expert", prompt="Run commit in --staged mode in /path/to/repo")
When this command is run, Claude Code should:
Analyze Changes
git status to understand current stategit diff --staged for staged changes (or git diff for all)Check for Atomic Commit Violations
Generate Commit Message
Present for Approval
🔍 Analyzing your changes...
Staged changes:
M src/auth/login.py (+45, -12)
M src/auth/tokens.py (+23, -5)
A tests/test_login.py (+89)
Unstaged changes:
M src/styles/button.css (+15, -3)
M README.md (+20)
✅ Good: Changes appear to be a single logical unit
All changes relate to authentication/login functionality
OR
⚠️ Warning: Changes may not be atomic
These appear to be separate concerns:
1. Authentication changes (src/auth/*)
2. Style changes (src/styles/button.css)
3. Documentation (README.md)
Recommendations:
- Commit auth changes first: feat(auth): ...
- Commit style changes: fix(ui): ...
- Commit docs separately: docs: ...
Would you like to:
1. Proceed with current staging (not recommended)
2. Unstage some files and commit in parts
3. Show me how to split this commit
📝 Proposed commit message:
feat(auth): add JWT refresh token rotation
Implement automatic token refresh to improve session security.
Tokens now rotate on each refresh, with old tokens invalidated
after a 5-minute grace period.
- Add refresh token rotation logic
- Update token validation to check rotation status
- Add tests for token refresh flow
Does this look correct?
1. Yes, commit with this message
2. Edit the message
3. Change the commit type
4. Cancel
Select commit type:
1. feat - New feature
2. fix - Bug fix
3. docs - Documentation only
4. style - Code style (formatting, no logic change)
5. refactor - Code restructuring (no feature/fix)
6. perf - Performance improvement
7. test - Adding/fixing tests
8. build - Build system or dependencies
9. ci - CI/CD configuration
10. chore - Maintenance tasks
Current selection: feat
Enter number or type:
Suggested scopes based on changed files:
1. auth (src/auth/*)
2. api (src/api/*)
3. No scope
Enter scope or select number: auth
Write a short description (max 50 chars, imperative mood):
Examples:
✅ "add password reset flow"
✅ "fix token expiration bug"
❌ "added password reset" (past tense)
❌ "fixes the token bug" (not imperative)
Description: add JWT refresh token rotation
Add a commit body? (Explain what and why)
1. Yes, add details
2. No, subject line is sufficient
[If yes]
Enter commit body (empty line to finish):
> Implement automatic token refresh to improve session security.
> Tokens now rotate on each refresh, with old tokens invalidated
> after a 5-minute grace period.
>
📋 Final commit message:
feat(auth): add JWT refresh token rotation
Implement automatic token refresh to improve session security.
Tokens now rotate on each refresh, with old tokens invalidated
after a 5-minute grace period.
Confirm commit? (yes/no/edit): yes
✅ Committed: abc1234
feat(auth): add JWT refresh token rotation
3 files changed, 157 insertions(+), 17 deletions(-)
When using --interactive, guide users through staging atomic commits:
🎯 Interactive Atomic Commit Mode
Analyzing all changes to help you create atomic commits...
Found 5 modified files with different concerns:
Group 1: Authentication (recommended first commit)
M src/auth/login.py
M src/auth/tokens.py
A tests/test_login.py
Group 2: UI Fixes
M src/styles/button.css
Group 3: Documentation
M README.md
Stage Group 1 for commit? (yes/no/show diff): yes
[Stages files, then proceeds to commit flow]
The command should enforce:
Message Length
Format
Content Quality
Atomic Check
No AI Tool Attribution
❌ No changes to commit
Run `git status` to see the current state.
❌ Commit message too vague
"fix bug" is not specific enough.
Please describe what was fixed: "fix(auth): correct token expiration check"
❌ Not in a git repository
Initialize with `git init` or navigate to a git repository.
⚠️ Unstaged changes will not be included
Stage with `git add <file>` or use `commit --all`
For experienced users, support quick patterns:
# Quick feature commit
commit feat auth "add password reset"
# Quick fix commit
commit fix api "handle null response"
# Quick docs commit
commit docs "update API documentation"
Suggest installing hooks for enforcement:
💡 Tip: Install git hooks to enforce commit standards automatically.
Would you like to set up:
1. commit-msg hook (validate message format)
2. pre-commit hook (run tests/linting)
3. Both
4. Skip for now
$ commit
🔍 Analyzing staged changes...
M src/utils/helpers.py (+12, -3)
✅ Single file change - good atomic commit
📝 Proposed: fix(utils): handle edge case in date parser
Commit? (yes/edit/cancel): yes
✅ Committed: def4567
$ commit --all
🔍 Analyzing all changes...
⚠️ Multiple concerns detected:
Authentication:
M src/auth/login.py
M src/auth/session.py
Unrelated UI fix:
M src/components/Header.vue
Documentation:
M docs/API.md
Recommendation: Split into 3 commits
1. Stage auth files → feat(auth): ...
2. Stage Header.vue → fix(ui): ...
3. Stage API.md → docs(api): ...
Would you like help staging these separately? (yes/no)
npx claudepluginhub jpoutrin/product-forge --plugin git-workflowExecutes git commits with conventional commit message analysis, intelligent staging, and message generation. Use when asked to commit changes or when /commit is invoked.
Generates descriptive commit messages following conventional commits format by analyzing git diffs. Useful when writing commit messages or reviewing staged changes.
Generates Conventional Commits from staged git changes: classifies feat/fix/docs types, detects scopes/breaking changes, matches project style from history.