Imported from kjuhwa/skills-hub (
skills/agents/pre-release-pr-triage-worktree/SKILL.md). Install upstream withnpx skills add kjuhwa/skills-hub --skill pre-release-pr-triage-worktree. Copyright stays with the author.
Pre-release PR triage (worktree)
When to use
A solo maintainer (or small team) has accumulated 10+ open PRs and wants to land the critical subset before cutting a minor/major release — without losing the changelog narrative and without deep-reviewing everything.
Steps
- Create a dedicated PR-review worktree:
git worktree add ../<repo>-pr-review -b pr-review-<version> main. Keep the main worktree for release prep (changelog, direct follow-ups); use the review worktree forgh pr checkoutso HEAD moves without contaminating release work. - Bulk-gather metadata once:
gh pr list --state open --limit 50 --json number,title,author,mergeable,mergeStateStatus,additions,deletions,maintainerCanModify,files. Capture size, mergeable state, file paths (for overlap detection), and whether maintainer can push to the fork. - Sort every PR into one of four tiers:
- Tier 1 (merge): small, mergeable, clean CI, low review cost.
- Tier 2 (candidate): 50-200 lines, needs a close read but looks sound.
- Supersede: covered by something already merged — verify by diff, not by title similarity.
- Defer: big features, dirty conflicts, draft PRs, anything risky.
- Write
<VERSION>_PR_TRIAGE.mdwith a Progress header, per-tier tables (with checkbox status columns), supersede table, defer list, and order-of-attack. The doc is your session state. - For each PR:
gh pr checkout N, review viagit show HEAD/git show --stat HEAD(NEVERmain..HEADon a stale branch — it lies),git rebase origin/mainif behind, andgit push <author> HEAD:<branch> --force-with-leaseifmaintainerCanModify=true. Thengh pr merge N --squash. - Batch obviously-correct one-liners in a loop:
for pr in ...; do gh pr merge $pr --squash; done. Verify each withgh pr view $pr --json state,mergeCommit. - For partial-applies:
git checkout <pr-sha> -- <files>, review staged, commit with aCo-Authored-By:trailer crediting the original author, then close the PR with a comment naming the applied commit. - Update
<VERSION>_PR_TRIAGE.mdafter every action. If interrupted, the doc is the only source of truth.
Counter / Caveats
main..HEADon a stale PR branch shows every main commit as deletions, turning a 3-line PR into what looks like a 700-line revert. Always review viagit show HEAD.- Squash-merging an unrebased branch reverts in-between work — rebase first or GitHub's squash computes a bad merge-base diff.
mergeable=UNKNOWNis transient after a push; just try the merge and see.- Route-ordering bugs (FastAPI-style
DELETE /history/failedvsDELETE /history/{id}) are a class of bug that pairs of PRs frequently re-introduce — verify param-path routes land after the literal ones.
Source references: .agents/skills/triage-prs/SKILL.md (the full triage workflow that this skill extracts).