Fetch the latest failed CI run, reproduce the failure locally, fix it, and repeat until checks pass.
Use gh to find the latest failed CI run on this branch. Pull logs for the failing job.
Run the failing CI step locally (test, lint, build). Confirm you can reproduce the error.
Fix the root cause with a minimal diff. Avoid unrelated refactors.
Push the fix and wait for CI. Re-check status before the next iteration.
Latest CI run conclusion is success
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.