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

Fix CI Until Green

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

πŸ‘ 2,058 views πŸ“₯ 1,423 installs πŸ‘€ by loops!
Download loop
Share Now
Manual start
↓
  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'
↓
βœ“
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'
πŸ“Š Flow Diagram
flowchart TD Start(["Manual start"]) Start --> S0 S0("Fetch failed run") S1("Reproduce locally") S0 --> S1 S2("Apply fix") S1 --> S2 S3("Push and verify") S2 --> S3 Exit{"Latest CI run conclusion is success"} S3 --> 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
Run "Fix CI Until Green" in your agent
Prompt only
Deeplinks and "Open in Cursor" only paste the kickoff prompt. They do not install hook files β€” your agent cannot tell whether files are on disk until you add them yourself.
Two separate pieces
  • Kickoff prompt β€” tells the agent the goal, check command, exit condition, and how to self-pace.
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.
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