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.
Standardize commit messages
Run this loop in Cursor, Claude Code, Codex, OpenCode, or Gemini CLI. It will validate your last commit message against conventional commit standards and iteratively guide you to fix any issues.
Start the Loop
Begin by running the agent in prompt mode with the kickoff prompt.
Automatic Validation
The agent will automatically run commitlint to check the latest commit message.
Fix Issues
If commitlint fails, the agent will suggest corrections and help rewrite the commit message.
Repeat Until Success
The process repeats up to 10 times or stops when all commits pass validation.
Check Commit
Use commitlint to validate the most recent commit message.
Evaluate Result
If the commit passes, proceed to exit. If it fails, generate a corrected message.
Git
Automatically splits large, monolithic Git commits into smaller, more reviewable units while preserving logical code boundaries and maintaining clean history.
Git
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
Automate the resolution of Git merge conflicts by iteratively detecting conflicts, resolving them, and retrying the merge until successful.
Suggest Fix
The agent provides a conventional commit-compliant version of the message.
Rewrite Commit
Amend the commit with the corrected message using git commit --amend.
Restart Loop
Return to step 1 to re-validate the amended commit.
Start the "Conventional Commit Enforcer" loop. Goal: Standardize commit messages Max iterations: 10 Between iterations run: commitlint Exit when: Commit lint passes Check the last commit message using commitlint. If it fails, suggest a fix and amend the commit. Repeat until it passes or max iterations are reached. Self-pace this loop. After each iteration, run `commitlint` and evaluate the output, and only continue if the exit condition is not met (Commit lint passes). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.