mcpField
L
landing-prs

landing-prs

github.com/bostonaholicDevelopment267 installsUpdated today
Repository

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

  1. 01Require explicit ship intent
  2. 02Run preflight checks
  3. 03Rebase branches that are behind
  4. 04Push with lease protection after rebase
  5. 05Gate merging on CI results
  6. 06Report merge and release status

Use cases

  1. 01Merge a PR after an explicit request
  2. 02Update a behind PR branch before merging
  3. 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-prs

After installing, type/landing-prsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
scripts/
ci-gate.mjs
merge.sh
preflight.sh
shared/
skill-calls.md

Details

From the project README

Landing PRs

  • gh pr merge is 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:

  1. git rebase refs/remotes/<REMOTE>/<BASE_REF>, adding --rebase-merges when MERGES is above 0.
  2. On a conflict, git rebase --abort and call the Skill tool with modernizing-prs and <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 with Next: /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 its HEAD.
  • 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 each FAILED check.
  • 3 (stop): stop and report STATUS verbatim (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 the MERGED commit.
  • 3: the head moved after the gate. Re-run the CI gate once; a second 3 stops.
  • 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 --admin or any bypass.

Point at gh run list for any release the merge triggers; do not assume it is done.

Comments

Markdown supported