Analyzes git diffs and automatically creates fine-grained commits with rule-based commit messages following Angular.js conventions. Use when you have multiple unstaged changes that need to be organized into logical commits.
Analyzes unstaged changes and creates logical, atomic commits with Angular.js-compliant messages. Use when you have multiple changes that need to be organized into separate, meaningful commits.
/plugin marketplace add mei28/claude-code/plugin install mei28-auto-commit-auto-commit@mei28/claude-codeAnalyzes unstaged changes in your git repository and automatically creates well-structured, logically grouped commits with meaningful messages following Angular.js commit conventions.
Follow Angular.js commit guideline prefixes:
| Prefix | Usage | Example |
|---|---|---|
feat | New feature | feat: add user authentication feature |
fix | Bug fix | fix: resolve login exception handling |
docs | Documentation only | docs: update API documentation |
style | Code formatting (no logic change) | style: unify indentation |
refactor | Code restructuring (no behavior change) | refactor: extract authentication logic |
perf | Performance improvement | perf: optimize database queries |
test | Test additions/modifications | test: add user registration tests |
chore | Build process/tooling changes | chore: update package.json |
## Git Workflow > Language: Japanese setting<prefix>: <concise description>The plugin checks for language preference in this order:
Example CLAUDE.md configuration:
## Git Workflow
### Commit Convention
Language: Japanese # Use Japanese for commit messages
Simply invoke the command when you have unstaged changes:
/commit
The command will:
git status # Get list of changed files
git diff # Get detailed changes
Creates a TodoWrite task list for tracking progress.
Group files based on:
Grouping Strategy:
For each file group:
git add <files>git status after each commitgit status # Confirm no remaining changes
git log -3 # Show recent commits
When analyzing diffs, consider:
File Path: Infer purpose from directory structure
src/components/ → likely UI featuresrc/utils/ → utility function changestests/ → test additions/modificationsdocs/ → documentation changesChange Content: Understand what changed
featfixrefactor or styleperfChange Context: Read files if needed
Read tool to understand broader contextBad Example (too technical):
feat: add new function getUserData()
Good Example (business value) - English:
feat: add user profile retrieval feature
Implement API-based user data fetching with caching.
Introduce 5-minute in-memory cache for performance improvement.
Good Example (business value) - Japanese:
feat: ユーザープロフィール取得機能を追加
APIからユーザーデータを取得し、キャッシュする機能を実装。
パフォーマンス改善のため、5分間のメモリキャッシュを導入。
Always use heredoc format for proper message formatting:
English (Default):
git commit -m "$(cat <<'EOF'
feat: add user authentication feature
Implement OAuth 2.0 authentication flow.
Store tokens in localStorage with auto-refresh support.
EOF
)"
Japanese (if configured):
git commit -m "$(cat <<'EOF'
feat: ユーザー認証機能を追加
OAuth 2.0を使用した認証フローを実装。
トークンはlocalStorageに保存し、自動更新に対応。
EOF
)"
If pre-commit hooks fail (e.g., linting, formatting):
Example:
❌ Commit failed due to pre-commit hook
Error:
eslint: src/component.js
Line 15: Unexpected console.log statement
Suggestions:
1. Remove console.log statement
2. Run `npm run lint:fix`
3. Skip this commit and continue with others
What would you like to do?
If merge conflicts detected:
⚠️ Merge conflicts detected
Please resolve conflicts manually:
- src/config.js
- src/utils/helper.js
Run `/commit` again after resolving conflicts.
If no unstaged changes:
✅ No unstaged changes found
All changes are already committed or staged.
Use `git status` to check repository state.
When in doubt about the purpose of changes:
# Read modified files to understand context
Read src/components/UserProfile.tsx
Read src/api/user.ts
This helps generate meaningful commit messages that explain "why" not just "what".
Good Grouping:
Group 1: feat: add user profile feature
- src/components/UserProfile.tsx
- src/components/UserProfile.test.tsx
- src/components/UserProfile.module.css
Group 2: fix: improve API error handling
- src/api/client.ts
- src/utils/errorHandler.ts
Bad Grouping:
Group 1: Multiple unrelated changes
- src/components/UserProfile.tsx (new feature)
- src/api/client.ts (bug fix)
- docs/README.md (documentation)
Commit in logical dependency order:
Each commit should:
Use TodoWrite to track progress:
## Auto-Commit Progress
- [x] Analyze changes (3 files modified)
- [x] Group files into commits
- [ ] Commit 1/3: feat: add user authentication
- [ ] Commit 2/3: test: add authentication tests
- [ ] Commit 3/3: docs: update authentication documentation
Update after each commit:
## Auto-Commit Progress
- [x] Analyze changes (3 files modified)
- [x] Group files into commits
- [x] Commit 1/3: feat: add user authentication
- [ ] Commit 2/3: test: add authentication tests
- [ ] Commit 3/3: docs: update authentication documentation
Present clear, actionable information:
## Auto-Commit Analysis
### Changes Detected
- 5 files modified
- 2 files added
- 1 file deleted
### Proposed Commits
#### Commit 1: feat: add dark mode feature
**Files**:
- src/theme/darkMode.ts (new)
- src/components/ThemeToggle.tsx (new)
- src/App.tsx (modified)
**Changes**:
- Implement theme switching functionality
- Persist user preferences
- Sync with system settings
---
#### Commit 2: test: add dark mode tests
**Files**:
- src/theme/darkMode.test.ts (new)
- src/components/ThemeToggle.test.tsx (new)
**Changes**:
- Unit tests for theme switching
- Verify localStorage behavior
---
### Execution Plan
1. Stage and commit feat changes
2. Stage and commit test changes
3. Verify all commits
4. Display final git log
Proceed with commits? (Will execute automatically)
Changes:
M src/auth/login.ts
A src/auth/login.test.ts
M src/components/LoginForm.tsx
Commits (English):
Commit 1: feat: implement login functionality
Add OAuth authentication flow and token management.
Support persistent login state across sessions.
Files:
- src/auth/login.ts
- src/components/LoginForm.tsx
---
Commit 2: test: add login functionality tests
Implement test cases for auth flow and token validation.
Files:
- src/auth/login.test.ts
Changes:
M src/api/client.ts
M src/utils/retry.ts
Commit (English):
fix: resolve infinite loop in API retry logic
Fix network error handling to prevent infinite retries.
Limit to maximum 3 retry attempts, then return error.
Files:
- src/api/client.ts
- src/utils/retry.ts
Changes:
M src/services/userService.ts
M src/services/authService.ts
D src/services/legacyAuth.ts
Commit (English):
refactor: consolidate authentication services
Remove legacy auth logic and migrate to unified interface.
Reduce code duplication and improve maintainability.
Files:
- src/services/userService.ts
- src/services/authService.ts
- src/services/legacyAuth.ts (deleted)
Always check project-specific commit conventions:
Read CLAUDE.md
Look for:
Example CLAUDE.md:
## Git Workflow
### Commit Convention
- Language: Japanese # Use Japanese instead of English
- Prefix: Use Angular.js guidelines
- Include rationale, context, and purpose
If CLAUDE.md specifies different conventions:
Complete session:
User: /commit
Assistant: Analyzing changes...
[TodoWrite: Create task list]
## Auto-Commit Analysis
### Changes Detected
- src/auth/login.ts (modified)
- src/auth/login.test.ts (new)
- src/components/LoginForm.tsx (modified)
- docs/AUTH.md (modified)
### Language
Using **English** (default). To use Japanese, add to CLAUDE.md:
Language: Japanese
### Proposed Commits
#### Commit 1: feat: implement login functionality
**Files**: src/auth/login.ts, src/components/LoginForm.tsx
**Reason**: New feature (OAuth authentication flow)
#### Commit 2: test: add login functionality tests
**Files**: src/auth/login.test.ts
**Reason**: Test code addition
#### Commit 3: docs: update authentication documentation
**Files**: docs/AUTH.md
**Reason**: Documentation update
### Executing commits...
[git add src/auth/login.ts src/components/LoginForm.tsx]
[git commit with message]
✅ Commit 1/3 completed
[git add src/auth/login.test.ts]
[git commit with message]
✅ Commit 2/3 completed
[git add docs/AUTH.md]
[git commit with message]
✅ Commit 3/3 completed
### Summary
✅ 3 commits created successfully
✅ All changes committed
✅ No unstaged changes remaining
Run `git log -3` to see recent commits.
EnterPlanMode: Plan implementation before making changes/dig: Clarify requirements before coding/deslop: Clean up code before committing/pr-template: Generate PR description after commits/deslop before /commit to ensure code quality/dig to clarify requirements before implementinggit log after commits to verify messagesgit commit --amend if you need to fix the last commit message