Land
Close the loop on approved work: merge, then clean up. Invoke only when the
user directly asks — /land, "land it", "merge & cleanup worktree", "merge the
stack". Never run this on your own initiative after opening a PR; opening a PR
ends at the PR.
Contract
- Merge only PRs this session owns or ones the user named.
- Run
jj statusfirst. When it succeeds, use$jj; for a stack managed by bookmarks, use$jjprfor status and reconciliation. Detect native GitHub Stack membership before choosing the landing command. - Conflicts and stale base are yours to fix: get the branch on latest main (rebase or merge, whichever is simpler — don't ask which), resolve conflicts, rerun the repo gate if code changed, push, continue.
- Ordinary
$jjprstacks merge base-most first and reconcile the remainder according to config. Native GitHub Stacks land only through the$jjprskill'sgh stack mergeworkflow. For plain Git stacks, retarget/rebase each child, wait for CI, then merge it. - Release PRs (release-please and similar) and staging/prod deploy watching are explicit-ask only. Do not merge a release PR or babysit deploy workflows unless the user asked for that in this session.
- Use the repo's standard merge method (check repo settings or recent merge history); ask only if genuinely ambiguous.
- Leave the user's main checkout alone unless asked to update it.
Workflow
- Identify target: the current bookmark/branch's PR, the named PR, or the
explicit top bookmark of a stack. Resolve its exact base and Git remote. In
jj, record
jj workspace listand the session workspace name/root before landing. - Watch checks (
gh pr checks --watch, background). Red CI: fix, push, re-watch until green. - JJ stack: resolve the intended ordered PR set and read every PR's Stack
membership through explicitly scoped REST calls.
jjpr statusis advisory because it cannot select a remote. Use the native path only when an authorized landing scope exactly equals one Stack's complete open membership or one explicit bottom prefix. For a mixed chain or multiple Stacks, partition and verify every separately authorized scope; otherwise stop. Follow$jjprLand a native Stack, including its pre-merge local-work inventory, bounded remote settlement, and survivor reconciliation; never runjjpr mergeon native members. For a wholly ordinary stack, runjjpr merge <top> --base <base> --remote <remote> --dry-run, then the same command without--dry-run. Re-run after any CI/review blocker clears; do not reproduce reconciliation with Git commands. - Single PR or plain Git stack: sync a stale/conflicted branch per contract, push, merge, and delete the remote branch if the merge did not.
- Plain Git stack: repeat 2 and 4 per child in order.
- Only if explicitly asked: merge the release PR, watch staging/prod deploy workflows, report deployed versions.
- Teardown only after every intended PR is remotely verified merged. Then
remove only the session's isolated checkout. In jj, inspect its
@and diff, resolve its exact root, forget it from a surviving workspace, and abandon only a captured disposable empty working-copy change.forgetdoes not delete files, changes, or bookmarks; remove only the verified directory. In plain Git, verify clean, remove the worktree, delete the local branch, and prune. - Report: merged PR URLs + merge SHAs, CI state, what was cleaned up, and anything left (e.g. release PR untouched).