PR 检查失败迭代修复
prcheckloop
迭代地让 GitHub 拉取请求(PR)的检查全部通过(变绿)。检测当前分支的 PR 或使用提供的 PR 编号,等待最新 head SHA 上的每项检查出现并完成,调查失败的检查,修复可操作的代码或测试问题,推送,然后重复。当失败源于外部因素、不稳定或无法安全修复时,升级问题并给出精确的阻塞点。当审查修复后 PR 仍有未通过的检查时使用,包括 greploop 之后。
- License 许可
- MIT
- 最近更新
- 2026-10-30
- Stars
- ★ 1
- Forks
- 2
01 前言 Front Matter
- name
- prcheckloop
- description
- 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.
02 资源文件 3
- 参考文档references/api.md8.2 KB
- 参考文档references/README.md1.6 KB
- 参考文档references/tutorials.md9.9 KB
03 SKILL.md 正文
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.
04 同仓库更多 Skills
Terminal-Bench 循环迭代修复诊断
terminal-bench-loop
通过 Paperclip,以有界、人工参与的改进循环运行单个 Terminal-Bench 题目,直到冒烟测试通过、评审委员会拒绝下一项修复、迭代预算耗尽,或明确指出真正的阻塞点。每次迭代都会针对隔离的 Paperclip App 工作树运行有界冒烟测试、捕获产物、使用 `/diagnose-why-work-stopped` 诊断确切的停止点、在任何产品修复前请求评审委员会确认,然后在同一工作树上重新运行。当某个 issue 要求“循环运行 Terminal-Bench”“驱动 Terminal-Bench 直到通过”“通过 Paperclip 循环修复 fix-git”,或以其他方式指向 Terminal-Bench 任务并要求带诊断的有界迭代时使用。
PARA 记忆文件管理
para-memory-files
基于文件的记忆系统,采用 Tiago Forte 的 PARA 方法。当你需要跨会话存储、检索、更新或组织知识时使用此技能。涵盖三个记忆层:(1) PARA 文件夹中的知识图谱与原子化 YAML 事实,(2) 作为原始时间线的每日笔记,(3) 关于用户行为模式的隐性知识。还处理计划文件、记忆衰减、每周综合以及通过 qmd 进行的检索。在任何记忆操作时触发:保存事实、写每日笔记、创建实体、运行每周综合、回忆过去的上下文或管理计划。
Paperclip 任务协调管理
paperclip
与 Paperclip 控制平面 API 交互,以管理任务、与其他智能体协调并遵循公司治理。当你需要检查任务分配、更新任务状态、委派工作、发布评论、设置或管理例程(周期性计划任务),或调用任何 Paperclip API 端点时使用。请勿将其用于实际的领域工作本身(编写代码、研究等)——仅用于 Paperclip 协调。
Paperclip 本地实例开发运维
paperclip-dev
开发并运维本地 Paperclip 实例——启动和停止服务器、从 master 拉取更新、运行构建和测试、管理工作树、备份数据库以及诊断问题。当你需要在 Paperclip 代码库本身上工作,或需要保持运行中的实例健康时使用。
Paperclip 插件创建开发
paperclip-create-plugin
使用 CLI 优先的工作流创建和开发外部 Paperclip 插件。适用于搭建新插件、针对运行中的 Paperclip 实例开发本地插件,或更新插件编写文档。涵盖 `paperclipai plugin init`、通过 `paperclipai plugin install <path>` 进行的本地安装循环、worker/UI 的重建与重新加载语义,以及必需的成功检查清单。
Paperclip 智能体创建
paperclip-create-agent
在 Paperclip 中以治理感知的方式创建新智能体(招聘)。当你需要检查适配器配置选项、对比现有智能体配置、起草新的智能体提示/配置并提交招聘请求时使用。