
prcheckloop
Iterate on a GitHub PR until latest-head checks are green or a precise blocker is named. Use when a PR still has failing or pending checks after review fixes, including after greploop.
- Installs
- 181
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/paperclipai/paperclip --skill prcheckloop- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads prcheckloop automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
PRCheckloop
Get a GitHub PR to a fully green check state, or exit with a concrete blocker.
Scope
- GitHub PRs only. If the repo is GitLab, stop and use
check-pr. - Focus on checks for the latest PR head SHA, not old commits.
- Focus on CI/status checks, not review comments or PR template cleanup.
- If the user also wants review-comment cleanup, pair this with
check-pr.
Inputs
- PR number (optional): If not provided, detect the PR for the current branch.
- Max iterations: default
5.
Workflow
1. Identify the PR
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:
ghis not authenticated- there is no PR for the branch
- the repo is not hosted on GitHub
2. Track the latest head SHA
Always 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.
3. Inventory checks for that SHA
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"
4. Wait for checks to actually run
After a new push, checks can take a moment to appear. Poll every 15-30 seconds until one of these is true:
- checks have appeared and every item is in a terminal state
- checks have appeared and at least one failed
- no checks appear after a reasonable wait, usually 2 minutes
Treat these as terminal success states:
- check runs:
SUCCESS,NEUTRAL,SKIPPED - status contexts:
SUCCESS
Treat these as pending:
- check runs:
QUEUED,PENDING,WAITING,REQUESTED,IN_PROGRESS - status contexts:
PENDING
Treat these as failures:
- check runs:
FAILURE,TIMED_OUT,CANCELLED,ACTION_REQUIRED,STARTUP_FAILURE,STALE - status contexts:
FAILURE,ERROR
If 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.
5. Investigate failing checks
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.
6. Fix actionable failures
If the failure is actionable from the checked-out code:
- Read the workflow or failing command to identify the real gate.
- Reproduce locally where reasonable.
- Make the smallest correct fix.
- Run focused verification first, then broader verification if needed.
- Commit in a logical commit.
- Push before re-checking the PR.
Do not stop at a local fix. The loop is only complete when the remote PR checks for the new head SHA are green.
7. Push and repeat
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:
- all checks for the latest head SHA are green, or
- a blocker remains after reasonable repair effort, or
- the max iteration count is reached
8. Escalate blockers precisely
If you cannot get the PR green, report:
- PR URL
- latest head SHA
- exact failing or missing check names
- details URLs
- what you already tried
- why it is blocked
- who should likely unblock it
- the next concrete action
Good blocker examples:
- external status app outage
- missing GitHub secret or permission
- required check name mismatch in branch protection
- persistent flake after one rerun
- failure needs credentials or infrastructure access you do not have
Output
When the skill completes, report:
- PR URL and branch
- final head SHA
- green/pending/failing check summary
- fixes made and verification run
- whether changes were pushed
- blocker summary if not fully green
Notes
- This skill is intentionally narrower than
check-pr: it is a repair loop for PR checks. - This skill complements
greploop: Greptile can be perfect while CI is still red.
FAQ
What does the prcheckloop skill do?
Iterate on a GitHub PR until latest-head checks are green or a precise blocker is named. Use when a PR still has failing or pending checks after review fixes, including after greploop.
How do I install prcheckloop?
Run npx skills add https://github.com/paperclipai/paperclip --skill prcheckloop in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/prcheckloop/ (personal) or .claude/skills/prcheckloop/ (project).
Which AI agents can use prcheckloop?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is prcheckloop safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains prcheckloop?
It is published by paperclipai in paperclipai/paperclip. It has 181 recorded installs.
More from paperclipai/paperclip
paperclip
paperclipai/paperclip
Use for Paperclip-managed tasks and heartbeats: reading task context, delivering task documents or files, updating completion or blockers, coordinating or delegating work, and following company governance. Includes control plane API operations for assignments, comments, approvals, and routines.
paperclip-create-agent
paperclipai/paperclip
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.
paperclip-create-plugin
paperclipai/paperclip
Create and develop external Paperclip plugins with the CLI-first workflow. Use when scaffolding a plugin, iterating on a local plugin, installing it into Paperclip, or updating plugin authoring docs.
para-memory-files
paperclipai/paperclip
Use a file-based PARA memory system to store, retrieve, and organize durable knowledge across sessions. Trigger on saving facts, daily notes, entity records, weekly synthesis, recall, tacit user patterns, or plan memory.
create-agent-adapter
paperclipai/paperclip
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.