Gitprompt onlyIntermediate

Commit History Cleanup

Refactor and clean up commit history to improve code documentation, readability, and maintainability. This loop focuses on squashing redundant commits, rewriting unclear messages, and ensuring a logical progression of changes.

← all loops
gitcommithistorycleanuprefactoringdocumentation

Goal

Improve commit history

How to Run

Run this loop in your coding agent to iteratively refine and enhance your Git commit history.

  1. 01

    Initiate Loop

    Start the loop by providing the kickoff prompt to your agent.

  2. 02

    Review Current History

    The agent will analyze the current commit history and identify areas for improvement.

  3. 03

    Propose Changes

    Based on the review, the agent will suggest specific improvements like squashing or rewording commits.

  4. 04

    Apply Improvements

    The agent will implement the suggested changes using appropriate Git commands.

  5. 05

    Verify Result

    After each iteration, the agent will check if the commit history meets the exit condition.

Workflow Steps

  1. 01

    Analyze History

    Use 'git log' to examine commit messages, structure, and redundancy.

  2. 02

    Identify Issues

    Flag commits with unclear messages, excessive splitting, or logical inconsistencies.

  3. 03

    Suggest Changes

    Recommend specific actions like squashing, rewording, or reordering commits.

  4. 04

    Execute Commands

    Apply Git commands such as 'rebase -i' to implement proposed changes.

  5. 05

    Validate Output

    Confirm that the revised history improves clarity and meets project standards.

Kickoff Prompt

Start the "Commit History Cleanup" loop.

Goal: Improve commit history
Max iterations: 10
Between iterations run: history review
Exit when: History approved


Please review the current Git commit history for this project. Identify any commits with unclear messages, redundant changes, or poor structure. Suggest improvements to create a cleaner, more logical history. Prioritize squashing fixup commits and rewording vague messages.

Self-pace this loop. After each iteration, run `history review` and evaluate the output, and only continue if the exit condition is not met (History approved). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.

Guardrails

hardcoded
  • ·Only modify commits reachable from the current branch HEAD.
  • ·Never rewrite public/shared history without explicit confirmation.
  • ·Preserve all changes in commits; only restructure or reword as needed.
  • ·Limit squashing/fixup operations to the last 10 commits to minimize risk.
  • ·Ensure no merge commits are involved in the cleanup process.

Flow Diagram

rendering…

Related loops — Git