| name | loop-on-ci |
| description | Monitor PR checks and fix failures until green. Uses gh pr checks as the source of truth for PR-attached checks. |
When to use
- Monitor PR checks and fix failures until green
On-demand loading: Read this file when the task matches the triggers below.
Activation: Use this skill when you need to watch a PR and iteratively fix CI failures until all required checks are green. Do NOT use to inspect a single CI run in isolation or to diagnose failures without iterating on fixes.
Loop on CI
Trigger
Need to watch a branch or pull request and iterate on CI failures until all required checks are green.
Use gh pr checks as the source of truth. It includes all PR-attached checks, while gh run list only covers GitHub Actions.
Workflow
- Resolve the PR for the current branch.
- Inspect current PR checks before waiting.
- If checks already failed, diagnose those failures first.
- If checks are pending, watch with
gh pr checks --watch --fail-fast.
- After each push, re-check the full PR check set and repeat until green.
Commands
gh pr view --json number,url,headRefName
gh pr checks --json name,bucket,state,workflow,link
gh pr checks --watch --fail-fast
gh run view <run-id> --log-failed
Guardrails
- Keep each fix scoped to a single failure cause when possible.
- Do not bypass hooks (
--no-verify) to force progress.
- If the failure is clearly unrelated to the PR and appears fixed on main, merge latest main instead of bloating the PR with unrelated fixes.
- If failures are flaky, retry once and report flake evidence.
- Re-run
gh pr checks --json name,bucket,state,workflow,link after every push; the check set can change.
Output
- Current CI status
- Failure summary and fixes applied
- PR URL once checks are green
Related skills
gh-fix-ci: diagnose failing GitHub Actions checks and plan the fix with user approval; prefer it for a single diagnosis pass instead of an autonomous loop
grinding-until-pass: local fix-run-check loop against tests/build/lint; prefer it when the failure reproduces locally without waiting on CI