[01] LOOP
CIinterval

CI Failure Watcher

Poll CI on an interval, investigate failures when checks go red, and push fixes until green.

by Trooper

Kickoff prompt
/loop 5m Start the "CI Failure Watcher" loop.

Goal: latest CI run on this branch is green.
Max iterations: 12.
Between iterations run: gh run list --branch $(git branch --show-current) --limit 1
Exit when: latest run conclusion is success.

Step 1: Check CI status. If failed, read logs, fix root cause, verify locally, and push if needed.

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.

Paste the kickoff prompt into Cursor, Claude Code, or Codex. Deeplinks do not install hook files.

Steps

1. Check CI status

Poll the latest workflow run on the current branch.

2. Read failure logs

If red, pull logs and identify the smallest root cause.

3. Fix and verify locally

Patch once, run the failing check locally if possible.

4. Push and wait

Push the fix and wait for CI to rerun.

Flow diagram

Guardrails

Rules the agent must follow so it cannot cheat the exit condition.

  • Do not modify the check command or exit criteria to force success
  • Do not skip, disable, or bypass checks to pass the exit condition

More CI loops