Poll CI on an interval, investigate failures when checks go red, and push fixes until green.
Check the latest CI run for the current branch using gh CLI.
If CI failed, read logs, identify the root cause, and apply the smallest fix.
Run the failing CI step locally before pushing again.
Latest CI run conclusion is success
#!/usr/bin/env bash set -euo pipefail BRANCH="$(git branch --show-current)" gh run list --branch "$BRANCH" --limit 1 --json conclusion,url -q '.[0]'
# CI Failure Watcher Poll CI every 5 minutes and fix failures until green. Pair with: /loop 5m <kickoff prompt from loops!>
/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.