AAWEA.ORG
AAWEA.ORG
AAWEA.ORG
CI Interval trigger πŸ‘‘ Official πŸ›‘ Hardened

CI Failure Watcher

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

πŸ‘ 1,827 views πŸ“₯ 1,152 installs πŸ‘€ by loops!
Download loop
Share Now
Manual start
↓
  1. 1
    Check CI status

    Check the latest CI run for the current branch using gh CLI.

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

    If CI failed, read logs, identify the root cause, and apply the smallest fix.

  3. 3
    Verify locally

    Run the failing CI step locally before pushing again.

↓
βœ“
Exit condition: ci_green

Latest CI run conclusion is success

> gh run list --branch $(git branch --show-current) --limit 1 --json conclusion -q '.[0].conclusion'
πŸ“¦ Install Files
These files are included when you download the loop.
πŸ“„ .cursor/loops/ci-failure-watcher/watch.sh
#!/usr/bin/env bash
set -euo pipefail
BRANCH="$(git branch --show-current)"
gh run list --branch "$BRANCH" --limit 1 --json conclusion,url -q '.[0]'
πŸ“„ .cursor/loops/ci-failure-watcher/README.md
# CI Failure Watcher

Poll CI every 5 minutes and fix failures until green.

Pair with: /loop 5m <kickoff prompt from loops!>
πŸ“Š Flow Diagram
flowchart TD Start(["Interval start"]) Start --> S0 S0("Check CI status") S1("Investigate failure") S0 --> S1 S2("Verify locally") S1 --> S2 Exit{"Latest CI run conclusion is success"} S2 --> Exit Exit -- "No" --> S0 Exit -- "Yes" --> Done(["Success"]) style Exit fill:#fffbeb,stroke:#f59e0b,stroke-width:2px,color:#92400e style Done fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#065f46
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.
Anti-gaming rules
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
  • If stuck after several iterations, stop and report blockers instead of gaming metrics