一键导入
pr-repair-flow
Standard PR-repair workflow for pod `repair` agent sessions. Covers claim/diagnose/fix/verify/push lifecycle and the fix-or-abandon principle.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Standard PR-repair workflow for pod `repair` agent sessions. Covers claim/diagnose/fix/verify/push lifecycle and the fix-or-abandon principle.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | pr-repair-flow |
| description | Standard PR-repair workflow for pod `repair` agent sessions. Covers claim/diagnose/fix/verify/push lifecycle and the fix-or-abandon principle. |
| allowed-tools | Bash, Read, Glob, Grep, Edit, Write |
/repair sessions work on PRs, not feature issues. The job is to salvage
unhealthy PRs (merge conflicts, failed CI, stuck CI) or close them cleanly
when salvage is not worth doing.
Repair sessions have exactly two terminal outcomes:
coordination mark-pr-salvaged.coordination close-pr-unsalvageable after a
bounded number of failed attempts. This removes has-pr from the linked
issue and adds replan, so a fresh plan can be produced.Repair sessions do not author directive issues. The directive
label flows top-down from the project owner; it is not a place agents
escalate to. Complex conflicts become re-implementations via replan,
not human tickets. If verification keeps failing, abandon.
| Command | Purpose |
|---|---|
coordination list-pr-repair | Read-only list of PRs needing repair, priority-ordered (conflict > failed > stuck). No label writes. |
coordination claim-pr-repair N | Adds repair-claimed label + comment, races detected via a short re-read. Fails if already claimed or another session won the race. |
coordination mark-pr-salvaged N | Clears repair-claimed, comments salvage summary. Call after a successful push. |
coordination close-pr-unsalvageable N "reason" | Closes PR, adds unsalvageable, removes has-pr on linked issue, adds replan. |
PR repair claims live in a namespace distinct from issue claims. Pod's
housekeeping loop runs check_dead_pr_claimed_prs every 10 minutes to
release claims whose owning session has died.
coordination list-pr-repair
Pick the top line (priority order is conflict > failed > stuck). Parse the
PR number out of #<num> [<reason>] <title> and claim it:
coordination claim-pr-repair <pr-number>
If the claim output says the PR is already repair-claimed or you lost
the race, move to the next candidate. If all candidates are claimed,
exit — another dispatch will handle the work later.
gh pr checkout <pr-number>
Do not create a new branch. You are working on the existing PR's head branch. The PR will be updated by force-push when you're done.
Look at one thing at a time, in this order:
gh pr view <N> --json mergeable,statusCheckRollup,headRefName,baseRefNamemergeable == "CONFLICTING": git fetch origin && git merge origin/<base>
(or rebase) to surface the conflicting files.FAILURE: gh pr checks <N> then read the
failing job's log via gh run view --log-failed.git commit --allow-empty -m "kick CI") is a
reasonable first fix.merge or
rebase — both produce the same end state but merge preserves the
original commits and is less fiddly if history is messy.Run the project's own verification — the same build/test flow a /feature
session would run before opening a PR. See the project's top-level
CLAUDE.md for the exact commands.
Verification is the arbiter. Do not push until it passes locally.
If verification passes:
git push --force-with-lease
coordination mark-pr-salvaged <pr-number>
Auto-merge (already set by coordination create-pr) will squash-merge the
PR once the remote CI reports green. Exit the session.
If verification fails after at most 3 fix → verify cycles:
coordination close-pr-unsalvageable <pr-number> "<reason>"
Valid reasons to abandon:
Be specific in the reason — it goes on the closing comment and on the linked issue, and a future planner will read it when producing a replan.
Don't poll CI. Don't wait for auto-merge. The session ends once you've either marked salvaged or closed unsalvageable.
repair-claimed — set by claim-pr-repair, cleared by mark-pr-salvaged
/ close-pr-unsalvageable, or by the housekeeping reconciler if the
claiming session dies.unsalvageable — set by close-pr-unsalvageable on the PR for
observability. Not functional.There is intentionally no needs-repair label. Repair candidates are
computed on demand by list-pr-repair; a label would drift out of sync.
replan comment if genuinely
helpful context).directive to escalate (directives are owner-issued only)..claude/CLAUDE.md or roadmap files.Produce before/after native speed-vs-ratio comparison graphs (against the other-language curves), post them to the PR, and show them to Kim BEFORE merging. PROACTIVELY REQUIRED for any lean-zip performance PR (perf:/runtime/throughput change to compress or decode): the moment such a PR goes green, invoke this YOURSELF without being asked — generating and posting the graphs is part of finishing the PR, never a step that waits for Kim to request it. Do not report the PR as done, and do not merely offer to "produce them if she wants", until the graphs are generated and posted; only the merge itself waits for her go-ahead. Most interesting for compression changes.
Standard claim/branch/verify/publish workflow for pod agent sessions. Read this skill at the start of any feature, review, summarize, or meditate session.
Use when fixing merge conflicts on agent PRs, rebasing stale branches, or deciding whether to salvage vs. redo a PR. Also use when a rebase/fix-PR plan issue is claimed.
Use when adding a new concrete-shape closed-form rung to a checksum ladder — Adler-32, CRC32, or any future checksum with a Spec/Native split (e.g. XxHash). Covers the three-part Spec identity → Native bridge → public wrapper template, the hypothesis-bearing invariant pattern, `@[simp]` and visibility discipline, and the boundary where the template stops applying (non-Nat algebra).
Use when writing a test that must match an error message thrown by lean-zip — bomb-limit tests, malformed-archive assertThrows, CD/LH consistency assertions, or any `.toBaseIO` + `msg.contains` block. Tabulates the error-substring families so you pick the right match string the first time.
Use when landing a PR that closes a numbered item in `SECURITY_INVENTORY.md` *Recommended policy* or *Missing work*, or when threading a new parameter through public APIs with a deferred default flip. Covers the *Executed past-tense one-liner* phrasing and when to use the half-closed two-step.