Git Commit Creation
Your task
Create a git commit following this workflow:
Step 1: Analysis
First, run these commands to understand the current state:
- Check git status
- Review all changes (staged and unstaged)
- Check recent commit style
Then:
- Review all changes (staged and unstaged)
- Identify change patterns and complexity level
- Check for potential breaking changes
- Match commit style with recent commits
Step 2: Determine Mode and Route
First, check for explicit mode flags in arguments:
-f or --fast: Force Route A (Simple) regardless of change type
-v or --verbose: Force Route B (Detailed) regardless of change type
- No flags: Auto-determine based on change complexity
Route A (Simple) - For changes matching these patterns:
- Documentation updates (
docs:)
- Style/formatting fixes (
style:)
- Simple bug fixes (
fix:)
- Chore/maintenance (
chore:)
- Test additions/updates (
test:)
Route B (Detailed) - For changes requiring:
- Feature additions (
feat:)
- Refactoring (
refactor:)
- Performance improvements (
perf:)
- Breaking changes (with exclamation mark)
- Detailed explanations needed
Step 3: Execute Route
Route A: Simple Commit (autonomous)
- Stage relevant unstaged changes
- Create commit message following conventional format
- Ask user: "Please review the commit message above. Should I proceed with this commit?"
- Execute commit
- Verify success
Route B: Detailed Commit (with comprehensive analysis)
- Analyze changes: Determine commit type and scope based on actual changes
- Check for breaking changes: Identify API changes, removed features, or incompatible modifications
- Show files to be committed: List specific files that will be included in this commit
- Propose commit details:
- Recommend commit type (feat, fix, refactor, etc.)
- Identify if breaking changes exist and need highlighting
- Suggest scope if applicable
- Ask user: "I recommend [type] for these files: [file list]. [Breaking/No breaking] changes detected. Should I proceed?"
- Stage relevant unstaged changes
- Create detailed commit message with body and proper breaking change formatting
- Ask user: "Please review the commit message above. Should I proceed with this commit?"
- Execute commit
- Verify success
Step 4: Quality Checks
Always ensure:
- Subject line under 50 characters, imperative mood
- Proper conventional commit format
- No secrets committed (.env, credentials.json, etc.)
Custom Message Support
If user provided arguments, incorporate their message while maintaining conventional commit format and quality standards.
Final Output
Show:
- Commit message that was used
- Files that were committed
- Git status after commit
- Next step suggestions