CIprompt onlyIntermediate

Merge Queue Ready

This agent loop automates the process of preparing a feature branch for submission to a merge queue. It iteratively validates the branch against the merge queue's criteria, identifies required changes, and applies them until the branch is accepted.

← all loops
CImergequeuevalidationautomation

Goal

Prepare branch for merge queue

How to Run

Run this loop in your preferred CLI tool (Cursor, Claude Code, Codex, OpenCode, Gemini CLI) to automatically prepare your branch for the merge queue. The agent will validate, diagnose issues, and fix them iteratively.

  1. 01

    Step 1: Navigate to Repository

    Ensure you're in the root directory of the repository containing the branch you want to prepare for merge.

  2. 02

    Step 2: Start Loop Execution

    Initiate the loop by providing the kickoff prompt. The agent will begin validating the branch against merge queue requirements.

  3. 03

    Step 3: Monitor Progress

    Observe the agent's actions and validation results. It will automatically address issues until the branch meets all criteria or reaches the maximum iterations.

  4. 04

    Step 4: Confirm Acceptance

    Once the merge queue accepts the PR (exit condition met), verify the changes and proceed with merging.

Workflow Steps

  1. 01

    Check Merge Queue Status

    Run initial validation to determine if the branch is already ready or what specific issues need to be addressed.

  2. 02

    Analyze Validation Output

    Parse the validation result to identify missing requirements such as test coverage, linting errors, or documentation gaps.

  3. 03

    Apply Required Changes

    Make targeted modifications to the branch to meet the identified merge queue criteria.

  4. 04

    Re-validate Changes

    Re-run the merge queue validation command to check if the applied changes have resolved the issues.

  5. 05

    Iterate Until Acceptance

    Repeat the process of analyzing and applying changes until the branch passes validation or the maximum iterations are reached.

Kickoff Prompt

Start the "Merge Queue Ready" loop.

Goal: Prepare branch for merge queue
Max iterations: 10
Between iterations run: merge queue validation
Exit when: Queue accepts PR


Prepare this branch for the merge queue. Start by running the merge queue validation command to identify any issues preventing acceptance, then apply necessary fixes until the branch is ready.

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

Guardrails

hardcoded
  • ·Do not modify code beyond what is necessary to satisfy merge queue requirements.
  • ·Avoid introducing new dependencies or making unrelated changes.
  • ·Ensure all changes are reversible if needed.
  • ·Stop immediately if validation commands fail unexpectedly or return ambiguous results.
  • ·Prioritize stability and correctness over speed.

Flow Diagram

rendering…

Related loops — CI