.agents/skills/prcheckloop/SKILL.md
Iteratively gets a GitHub pull request's checks green. Detects the PR for the current branch or uses a provided PR number, waits for every check on the latest head SHA to appear and finish, investigates failing checks, fixes actionable code or test issues, pushes, and repeats. Escalates with a precise blocker when failures are external, flaky, or not safely fixable. Use when a PR still has unsuccessful checks after review fixes, including after greploop.
npx skillsauth add paperclipai/paperclip prcheckloopInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Get a GitHub PR to a fully green check state, or exit with a concrete blocker.
check-pr.check-pr.5.If no PR number is provided, detect it from the current branch:
gh pr view --json number,headRefName,headRefOid,url,isDraft
If needed, switch to the PR branch before making changes.
Stop early if:
gh is not authenticatedAlways work against the current PR head SHA:
PR_JSON=$(gh pr view "$PR_NUMBER" --json number,headRefName,headRefOid,url)
HEAD_SHA=$(echo "$PR_JSON" | jq -r .headRefOid)
PR_URL=$(echo "$PR_JSON" | jq -r .url)
Ignore failing checks from older SHAs. After every push, refresh HEAD_SHA and
restart the inspection loop.
Fetch both GitHub check runs and legacy commit status contexts:
gh api "repos/{owner}/{repo}/commits/$HEAD_SHA/check-runs?per_page=100"
gh api "repos/{owner}/{repo}/commits/$HEAD_SHA/status"
For a compact PR-level view, this GraphQL payload is useful:
gh api graphql -f query='
query($owner:String!, $repo:String!, $pr:Int!) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$pr) {
headRefOid
url
statusCheckRollup {
contexts(first:100) {
nodes {
__typename
... on CheckRun { name status conclusion detailsUrl workflowName }
... on StatusContext { context state targetUrl description }
}
}
}
}
}
}' -F owner=OWNER -F repo=REPO -F pr="$PR_NUMBER"
After a new push, checks can take a moment to appear. Poll every 15-30 seconds until one of these is true:
Treat these as terminal success states:
SUCCESS, NEUTRAL, SKIPPEDSUCCESSTreat these as pending:
QUEUED, PENDING, WAITING, REQUESTED, IN_PROGRESSPENDINGTreat these as failures:
FAILURE, TIMED_OUT, CANCELLED, ACTION_REQUIRED, STARTUP_FAILURE, STALEFAILURE, ERRORIf no checks appear for the latest SHA, inspect .github/workflows/, workflow
path filters, and branch protection expectations. If the missing check cannot be
caused or fixed from the repo, escalate.
For GitHub Actions failures, inspect runs and failed logs for the current SHA:
gh run list --commit "$HEAD_SHA" --json databaseId,workflowName,status,conclusion,url,headSha
gh run view <RUN_ID> --json databaseId,name,workflowName,status,conclusion,jobs,url,headSha
gh run view <RUN_ID> --log-failed
For each failing check, classify it:
| Failure type | Action | |---|---| | Code/test regression | Reproduce locally, fix, and verify | | Lint/type/build mismatch | Run the matching local command from the workflow and fix it | | Flake or transient infra issue | Rerun once if evidence supports flakiness | | External service/status app failure | Escalate with the details URL and owner guess | | Missing secret/permission/branch protection issue | Escalate immediately |
Only rerun a failed job once without code changes. Do not loop on reruns.
If the failure is actionable from the checked-out code:
Do not stop at a local fix. The loop is only complete when the remote PR checks for the new head SHA are green.
After each fix:
git push
sleep 5
Then refresh the PR metadata, get the new HEAD_SHA, and restart from Step 3.
Exit the loop only when:
If you cannot get the PR green, report:
Good blocker examples:
When the skill completes, report:
check-pr: it is a repair loop for
PR checks.greploop: Greptile can be perfect while CI is still
red.tools
Interact with the Paperclip control plane API to manage tasks, coordinate with other agents, and follow company governance. Use when you need to check assignments, update task status, delegate work, post comments, set up or manage routines (recurring scheduled tasks), or call any Paperclip API endpoint. Do NOT use for the actual domain work itself (writing code, research, etc.) — only for Paperclip coordination.
tools
Run a single Terminal-Bench problem through Paperclip in a bounded, human-in-the-loop improvement cycle until the smoke passes, the board rejects the next fix, the iteration budget is exhausted, or a real blocker is named. Each iteration runs a bounded smoke against an isolated Paperclip App worktree, captures artifacts, diagnoses the exact stop point with `/diagnose-why-work-stopped`, requests board confirmation before any product fix, then reruns against the same worktree. Use whenever an issue asks to "run Terminal-Bench in a loop", "drive Terminal-Bench until it passes", "loop fix-git through Paperclip", or otherwise points at a Terminal-Bench task and asks for bounded iteration with diagnosis.
tools
Create new agents in Paperclip with governance-aware hiring. Use when you need to inspect adapter configuration options, compare existing agent configs, draft a new agent prompt/config, and submit a hire request.
development
How to handle "why did this work stop / why is this looping?" assignments. Forensics first on the named tree, surface the exact stop-point, frame the fix as a general product rule that respects three invariants (productive work continues, only real blockers stop work, no infinite loops), and deliver a plan — no code changes — gated by board/CTO approval before child issues are created. Use whenever the issue title or body asks for forensics on a stalled, looping, or "went too deep" tree.