agentleFS
Smirnov-LabsSmirnov-Labs/claude-skills/skills/pr-land/SKILL.md

pr-land

Skill6 starsChanged 10 days agoMITView on GitHub

Use when asked to merge or land a pull request ("merge it", "land it", "ship it", "merge when clean"), or to clean up the worktree and branch of a PR that is already merged.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Wait for the bots: prbots wait <PR> --trigger, in the background (the watching-pr-bot-reviews skill).

    line 12
  2. Very specific:

    Read the repo's CLAUDE.md.

    line 13
  3. Distinctive:

    If this session entered the PR's worktree with EnterWorktree, leave it with ExitWorktree first.

    line 14
  4. Distinctive:

    Make sure no agent you started still works in that worktree.

    line 15
  5. Very specific:

    Delete the remote branch if someone pushed to it after the merge.

    line 60
  6. Very specific:

    Delete a local branch that moved: the delete is an atomic update-ref on the PR head.

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Land a PR

prland merges a PR only when its bots are clean, and it confirms that GitHub says MERGED. Then it removes that PR's own worktree and branch, and fast-forwards the main checkout. Done by hand, most sessions stopped after the merge and left the cleanup behind.

Before you run it

  1. Wait for the bots: prbots wait <PR> --trigger, in the background (the watching-pr-bot-reviews skill). prland checks the verdict once and does not wait.
  2. Read the repo's CLAUDE.md. It may name the bots that must be clean (--need) or a merge method other than squash.
  3. If this session entered the PR's worktree with EnterWorktree, leave it with ExitWorktree first. Otherwise the harness blocks git in the main checkout.
  4. Make sure no agent you started still works in that worktree.

Run it

Run it from any checkout of the repo: the main one or the PR's worktree. prland is on PATH where skillsync installed this skill. Otherwise call it by its full path, <this skill's base directory>/bin/prland, and stay in the checkout: it finds the repo and the worktrees from there. It calls prbots from the watching-pr-bot-reviews skill.

CaseCommand
A clean PRprland 123
The bots this repo requiresprland 123 --need sar
A repo with no review botsprland 123 --need ci
See the plan firstprland 123 --dry-run
Keep the worktreeprland 123 --keep-worktree
A worktree holds only ignored files you can loseprland 123 --allow-ignored

A PR URL works too, and names its own repo. prland --help lists the rest (-R, --method, --subject, --no-sync).

Read the output

It prints one line per step:

gate     CLEAN @85c6e8f (--need sar)
merge    squash · codex-review: one command for a read-only Codex review (#20)
merged   4af28c7a2c
remote   deleted codex-review (was 85c6e8f)
worktree removed /tmp/wt-codex-review
branch   deleted codex-review (was 85c6e8f1a2)
sync     ~/src/claude-skills is at 4af28c7 (origin/main)
ExitMeaning
0Merged. A cleanup step it skipped says why.
1The gate said no (not CLEAN, a draft, closed). Nothing was merged.
2The merge failed, or GitHub did not report MERGED.
3Usage error.

Report the merge SHA, plus anything it left in place and why.

What it will not do

  • Merge without a CLEAN verdict for this repo, this PR and its current head SHA. It reads prbots --json, so text in a check name cannot fake the verdict. A misspelled --need is an error, not an empty gate.
  • Merge a draft, or a head that moved after the check (--match-head-commit).
  • Merge through a merge queue: a base branch with one is refused, and an auto-merge that GitHub queued instead of merging is cancelled.
  • Delete the remote branch if someone pushed to it after the merge. The delete is GitHub's compare-and-delete (updateRefs with beforeOid set to the PR head) on that exact repository, so no git URL rewrite can redirect it.
  • Act on a PR from another host or repo: a URL's host must match the host gh uses, and the PR URL GitHub returns must name the requested repo and number.
  • Remove a worktree with --force, or one with changed tracked files, untracked files, commits past the PR head, files marked assume-unchanged or skip-worktree, or ignored files other than build and cache output (.env and notes stay). It reads these with git ls-files, so status.showUntrackedFiles cannot hide them.
  • Delete a local branch that moved: the delete is an atomic update-ref on the PR head.
  • Prune other worktrees, or touch any branch except the PR's own. A fork PR's branches are left alone.
  • Switch branches in the main checkout, sync it while it has tracked changes, or follow its upstream: it fast-forwards to origin/<base>, and never over an ignored file the new commits start tracking.
  • Guess a PR number across repos: with -R, give the number.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.