MCP.so
Sign In
CImanual

Fix CI Until Green

Fetch the latest failed CI run, reproduce the failure locally, fix it, and repeat until checks pass.

Kickoff prompt

Start the "Fix CI Until Green" loop.

Goal: latest CI run on this branch passes
Max iterations: 8
Between iterations run: gh run list --branch $(git branch --show-current) --limit 1 --json conclusion -q '.[0].conclusion'
Exit when: latest run conclusion is success

Step 1: Find the latest failed CI run, read logs, reproduce locally, fix root cause, push, and verify.

Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.

Basic information

Category

CI

Goal

latest CI run on this branch passes

Max iterations

8

Check command

gh run list --branch $(git branch --show-current) --limit 1 --json conclusion -q '.[0].conclusion'

Exit when

latest run conclusion is success

Supported agents

Cursor, Claude Code

Steps

  1. 1

    Fetch failed run

    Use gh to find the latest failed CI run on this branch. Pull logs for the failing job.

    gh run list --branch $(git branch --show-current) --status failure --limit 1
  2. 2

    Reproduce locally

    Run the failing CI step locally (test, lint, build). Confirm you can reproduce the error.

  3. 3

    Apply fix

    Fix the root cause with a minimal diff. Avoid unrelated refactors.

  4. 4

    Push and verify

    Push the fix and wait for CI. Re-check status before the next iteration.

    gh run list --branch $(git branch --show-current) --limit 1 --json conclusion -q '.[0].conclusion'

More CI loops