ワンクリックで
gh-pr-merger
Guarded PR merger; merges merge-ready PRs after verifying label, CI status, branch protection, and preflight checks.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guarded PR merger; merges merge-ready PRs after verifying label, CI status, branch protection, and preflight checks.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Open a conservative Robot SF PR with scope verification, freshness checks, and artifact discipline.
Use for an autonomous Robot SF issue-to-PR loop that selects eligible GitHub issues, implements one scoped issue at a time, validates, pushes, and opens PRs.
Use for an autonomous Robot SF PR review loop that fixes scoped review gaps, validates proof, resolves review threads, and applies merge-ready; not for merging.
Autonomous issue-to-PR workflow from next eligible issue to ready PR with consistent metadata handling.
Continuous goal autopilot; orchestrates implement, review, merge, and discover cycles with preflight validation and delegation failure recovery.
Clarify ambiguous GitHub issues by tightening scope and acceptance criteria, proposing solution options with pros/cons, and marking decision-required issues when maintainer input is needed.
| name | gh-pr-merger |
| description | Guarded PR merger; merges merge-ready PRs after verifying label, CI status, branch protection, and preflight checks. |
| category | github-pr |
| kind | atomic |
| phase | verification |
| requires_write | true |
| requires_slurm | false |
| requires_benchmark_artifacts | false |
| delegates_to | [] |
| output_schema | skill_run_summary.v1 |
| aliases | ["pr-merger","guarded-pr-merge"] |
Use this skill when a PR is merge-ready and the owner or parent orchestrator has authorized a
bounded guarded-merge run.
This skill is intentionally restricted: it never force-pushes, never rewrites history, and stops on any auth/permission/CI failure.
Use this skill when the user asks to merge approved, merge-ready PRs.
Do not use it for:
merge-ready label,main branches without explicit override.AGENTS.md.agents/skills/goal-pr-review/SKILL.mddocs/code_review.md.github/PULL_REQUEST_TEMPLATE/pr_default.mdRun the declared runtime preflight before processing a batch:
uv run python scripts/dev/check_skills.py --preflight gh-pr-merger
Before each merge operation, verify:
merge-ready label. Labels are the source of truth; do not infer
merge authorization from Projects, dashboards, a local ledger, or a worker report. If absent,
skip and report.main (or the explicitly allowed base branch).uv run python scripts/dev/check_pr_ci_status.py <number>).
In non-TTY agent sessions, prefer bounded polling over gh pr checks --watch:
uv run python scripts/dev/check_pr_ci_status.py <number> --poll-attempts 20 --poll-interval 30.
Exit code 2 means checks were still queued or in progress after the polling budget; inspect the
listed check URLs or run gh run view <run-id> --json status,conclusion,jobs for job state.gh pr view <number> --json mergeable).python scripts/dev/check_pr_merge_staleness.py <number>.
Exit code 1 means main has moved since the PR's CI ran; skip and report the
PR as stale — the author must update the branch and re-run CI before merge.
Exit code 2 means the check could not determine staleness (API error, no
workflow-run metadata); log a warning and continue with remaining preflight
checks. See issue #5389 for context.goal-pr-review's documented
single-account internal-review waiver.main allow merges from the current actor.merge-ready review evidence. A
single-account waiver never waives exact-head evidence; any head change requires re-review.If any preflight check fails, report the specific failure and do not merge. Do not retry preflight on the same PR without a state change.
Starting this bounded merge run authorizes the merger to update merge-status labels, post preflight or outcome comments, and execute the guarded squash merge without another per-PR confirmation. The merger may delete the merged feature branch only after verifying it contains no unique unpreserved work. It must not force-push, rewrite history, resolve substantive review findings itself, or bypass branch protection.
Owner approval is required before deleting durable scientific artifacts, experiment records or
runs, or GitHub releases. A merge command, cleanup option, or stale local cache never implies that
approval. Store merger/review control-plane artifacts outside git worktrees, and never commit
RESULT.md or REVIEW.json.
merge-ready label:
gh pr list --state open --label merge-ready --json number,title,headRefName,baseRefName,mergeable,statusCheckRollup
.agents/skills/goal-autopilot/SKILL.md with the PR
number, head SHA, preflight status, merge command status, cleanup status, and next action.HEAD_SHA=$(gh pr view <number> --json headRefOid --jq .headRefOid)
gh pr merge <number> --squash --delete-branch --match-head-commit "$HEAD_SHA"
If HEAD_SHA is empty or the gh pr view command fails, stop and report
the lookup failure before attempting the merge.Do not merge multiple PRs in parallel. Process sequentially.
Merge conflict:
goal-pr-review must fix the branch before retry.CI check failure:
scripts/dev/check_pr_ci_status.py --poll-attempts ... --poll-interval ...; logs
may be unavailable until a job completes, so use gh run view <run-id> --json status,conclusion,jobs
to distinguish queued, in-progress, and completed states before fetching logs.Auth/permission failure:
Branch protection rejection:
gh CLI output.Merge command failure:
gh pr view <number> --json state,mergedAt,mergeCommit,headRefOid,headRefName
state == "MERGED" and mergedAt is set, the remote merge succeeded
but local cleanup (branch deletion, cache update) may have failed. Report
the merged commit SHA and note the cleanup failure separately. Do not
retry; the PR is already merged.state is not "MERGED", the merge genuinely failed. Record the
headRefOid, exit code, and stderr. Do not retry without an external
state change."MERGED"."MERGED", even if the local
gh pr merge command exited nonzero. Check with
gh pr view <number> --json state before any retry attempt.High: PR merged successfully with all preflight checks passed.Medium: PR skipped because preflight failed with a clear, fixable reason.Low: auth/permission/environment blocker.For each attempted merge, report:
Use this skill for the scope named in its frontmatter description and registry metadata.
.agents/skills/skills.yaml.Return the schema named by the output_schema frontmatter field, or a compact equivalent when the caller does not require YAML.