landing-prs
Lands a reviewed pull request by rebasing onto the base when the branch is behind and resolving any conflicts, running the project's declared pre-merge steps, pushing, waiting for green CI, and squash-merging. Use when the user says "ship it", or when the user explicitly asks to land, ship, or merge a reviewed PR. Never infer from approval, green CI, or completion. Not for a watch that should merge on approval; use watching-authored-prs. Not for updating a PR without landing; use modernizing-prs.
How do I install this agent skill?
npx skills add https://github.com/bostonaholic/skills --skill landing-prsIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill automates landing pull requests via git and the GitHub CLI, incorporating safety checks and CI gating logic. While it includes robust input validation for commands, it possesses an indirect prompt injection surface by ingesting pull request titles and status check names provided by external users without sanitization.
- Socketpass
No alerts
- Snykwarn
Risk: MEDIUM · 1 issue
What does this agent skill do?
Landing 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.12(enqueue): the base's merge queue retests the PR against the latest base, so go to Merge with itsHEADwithout rebasing; there5means queued.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.unstablemeans a check that branch protection does not require (codecov, for one) failed; it blocks the merge like any other failure.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.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/bostonaholic/skills/landing-prs">View landing-prs on skillZs</a>