Large Commit Splitter
Automatically splits large, monolithic Git commits into smaller, more reviewable units while preserving logical code boundaries and maintaining clean history.
Goal
Create smaller commits
How to Run
Guide the agent through splitting large commits into granular changes
- 01
Setup Environment
Ensure you're in a Git repository with staged or uncommitted changes
- 02
Run Initial Audit
Execute 'git diff --stat' to assess current change volume
- 03
Iterate Splitting
Prompt agent to split commits based on file boundaries or logical units
- 04
Verify & Commit
Review each proposed split and confirm with 'git commit'
Workflow Steps
- 01
Analyze current staged changes using git diff --name-status and git diff --stat
Identify files and overall scope of changes
- 02
Group related file changes by logical component or feature area
Create coherent commit boundaries
- 03
Create interactive add hunks for first logical group using git add -p
Stage portion of changes for initial small commit
- 04
Commit staged changes with descriptive message
Create first smaller commit
- 05
Repeat process for remaining changes until all are committed
Ensure all original changes are preserved in split form
- 06
Run 'commit audit' to verify each commit meets size targets
Check exit condition achievement
Kickoff Prompt
Start the "Large Commit Splitter" loop. Goal: Create smaller commits Max iterations: 10 Between iterations run: commit audit Exit when: Commit size target reached Please analyze my current staged changes and split them into multiple smaller commits, ensuring each commit is under 200 lines changed and represents a coherent logical change. Maintain clean commit messages that describe each change clearly. Start by checking what files are currently staged with 'git diff --name-status' and 'git diff --stat' to understand the scope. Self-pace this loop. After each iteration, run `commit audit` and evaluate the output, and only continue if the exit condition is not met (Commit size target reached). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.
Guardrails
hardcoded- ·Only modify uncommitted changes, never alter committed history
- ·Do not force push or rewrite public branches during splitting
- ·Maintain meaningful commit messages for each split change
- ·Preserve file modification integrity across splits
- ·Avoid splitting mid-function or mid-logic block
- ·Recommend maximum 100-200 lines per split commit
Flow Diagram
Related loops — Git
Git
Conventional Commit Enforcer
This loop ensures all Git commits follow the Conventional Commits specification by using commitlint to validate commit messages. It automatically detects non-compliant commits, suggests fixes, and guides the user through correcting them until all commits pass validation.
Git
Git Hygiene Loop
This loop helps maintain a clean Git repository by identifying and removing stale or outdated branches that are no longer needed. It ensures your branch list remains manageable and reduces clutter in collaborative environments.
Git
Merge Conflict Resolver
Automate the resolution of Git merge conflicts by iteratively detecting conflicts, resolving them, and retrying the merge until successful.