About landing-prs
A skill that guides a coding agent through landing a pull request, from preflight checks and any required rebase to CI-gated merging. It requires explicit ship intent and stops when checks or repository safeguards block the process.
Key features
- 01Require explicit ship intent
- 02Run preflight checks
- 03Rebase branches that are behind
- 04Push with lease protection after rebase
- 05Gate merging on CI results
- 06Report merge and release status
Use cases
- 01Merge a PR after an explicit request
- 02Update a behind PR branch before merging
- 03Stop a merge when CI or branch protections block it
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ bostonaholic/ skills --skill landing-prsAfter installing, type/landing-prsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
agents/openai.yamlscripts/ci-gate.mjsmerge.shpreflight.shshared/skill-calls.mdDetails
From the project READMELanding PRs
gh pr mergeis irreversible.- Run only on a direct "ship it", "land the PR", or
/landing-prs; an approved, green, or finished-looking PR is not ship intent. - That request also authorizes the rebase and the lease-guarded force-push a behind branch needs; never stop to hand either back to the user.
- Once the CI gate below passes, merge without asking again.
The scripts live in <skill-dir>/scripts/ and run from the repository, on the
PR's head branch.
Before pushing
Run "<skill-dir>/scripts/preflight.sh" [<n>], passing the argument (digits
only) when the user gave one. On exit 0 use its KEY=VALUE lines below. Any
other exit: stop and report its stderr. For exit 4 on a wrong branch, tell the
user to run gh pr checkout <n> and re-run.
Rebase when behind
Rebase only when BEHIND is above 0:
git rebase refs/remotes/<REMOTE>/<BASE_REF>, adding--rebase-mergeswhenMERGESis above0.- On a conflict,
git rebase --abortand call the Skill tool withmodernizing-prsand<n>(see skill calls). When it finishes pushed, continue; when it stops, stop and relay its report. If it is not installed, name the conflicting paths and end withNext: /modernizing-prs <n>, then /landing-prs <n>.
Pre-merge steps and push
If the project's agent instructions declare a step to run before merging (for example, a version bump), run it now. If it stops, stop.
Then push. After a rebase this skill ran itself and has not pushed,
git push --force-with-lease=<HEAD_REF>:<LEASE> <REMOTE> HEAD:<HEAD_REF>;
otherwise, including after modernizing-prs pushed, git push. Never
a bare --force. If the push is rejected, report git's message verbatim
and stop without retrying.
CI gate
Run node "<skill-dir>/scripts/ci-gate.mjs" <URL> in the background and act on its
exit code:
0(merge): go to Merge with itsHEAD.10(rebase): re-run Before pushing, rebase, push, and re-run the gate. After three rebases in one run, stop: "base keeps moving".1(fail),11(unstable),124(timeout): stop with the verdict, naming eachFAILEDcheck.3(stop): stop and reportSTATUSverbatim (BLOCKED,DIRTY,DRAFT, ...). Never merge on an unnamed status.143: the harness killed it; re-run it in the background.- Anything else: stop and report its stderr (
127: a missing command, not a check failure).
Merge
Run "<skill-dir>/scripts/merge.sh" <URL> <HEAD>.
0: report theMERGEDcommit.3: the head moved after the gate. Re-run the CI gate once; a second3stops.5: not merged yet (merge queue or auto-merge); report that.- Anything else, including a branch-protection rejection (
4): report its stderr verbatim and stop. Never use--adminor any bypass.
Point at gh run list for any release the merge triggers; do not assume it is
done.