Merge
Land a finished change. Start from a PR, a stack, or a local change the user kept.
Leave it merged and shown, with issues settled and task resources cleaned up. You are done when
GitHub reports every PR in the set merged, and each issue and cleanup target has a result.
A workflow's Land finish line, picked under its policy, is a merge request too. A merge
request authorizes landing the scoped work, closing fully resolved issues, and cleaning
up task-owned temporary resources. It also covers fixes that
continue. Honor the user's
limits.
Scope. Identify the repository, PRs, landing branch, and evidence. Ask for the target if a
merge request could refer to several PRs. If the work has no PR, publish it through
PR, then continue here. For stacks, use gh-stack to
resolve the exact merge set and command target. Authorization must cover every layer. An
already merged PR skips to step 5.
Bring it to ready. Follow PR's watch. Failures, comments,
conflicts, and commits you didn't push all go through
continue or stop. Fixes that
continue get one line in your report. A wake resumes this step, because the merge request
still stands. An open ## Provisional section, which pr_state reports as a blocker, is a
stop; a merge request alone never clears it. On a stop, cancel any armed landing and confirm
it's cancelled, with gh pr merge --disable-auto or, for a queue, the dequeuePullRequest
mutation. Then leave the
PR open and use Show Me to show the user what happened, including
anything that landed first.
pr_state blocks a head without a passing review-fix-loop status, including after a base
update or restack. A caller with its own repair owner gets the gap back. Without one, take
the head through PR's Prepare and Review steps, publish any fixes,
and read the state again. A new head of reviewed work is a
repair pass.
A caller that keeps its own repair owner gets each failure, comment, and stop back, and resumes
that owner. You repair nothing.
Check it. Capture what the user will want to see first, with Show Me, so this is the last
read before you land. Run pr_state with
--head <verified head> for every PR in the set. Each must be
ready. Its baseRefName must be the landing
branch, or for a stack layer its parent in the scoped set. A different base is a stop.
Every PR, including docs-only changes, needs review of its current head that includes
Show, Don't Tell, plus required verification. The head's
passing review-fix-loop status records the review and its Show, Don't Tell. Step 2 restores
a missing one. Route missing or stale verification the same way as a stale review, then go
back to step 2.
A head you didn't verify holds commits nobody reviewed. Read them, then go back to step 2. It
counts as verified once the evidence above covers it.
Closing links that would close unfinished issues block landing. After repairs or restacking,
recheck every affected layer. Before local history changes, apply
Preserve local files. Land the set only when all of
it is ready.
Land. Follow repository merge settings, protections, and queues. For one PR, use
gh pr merge with
--match-head-commit <verified head>, and leave branch deletion to cleanup. For stacks, use
gh-stack, with guards against unverified head changes on every layer: head preconditions,
or enforced current-head checks and fresh approvals after pushes. Without them, report the
blocker; see
branch protection.
Confirm with pr_state that each PR reports merged. Queued work is still pending. After a
failed or timed-out submission, read GitHub before you retry. If it reports state: MERGED
with the head moved, commits you didn't verify landed. Read them and tell the user what
landed before you finish any issue.
Finish issues. Check linked or task-scoped issues against their acceptance criteria and
intended delivery branch. Confirm automatic closure, or close a fully resolved open issue as
completed with the merged PR link. Keep partial issues, and those waiting on unmerged layers,
open. Check existing state and comments before posting. An intermediate stack merge doesn't
prove delivery, because
automatic closing links
apply when work reaches the default branch.
Clean up. Use Repo Cleanup for confirmed merges. Pass merge
results, proven merge-time source heads, branches and bases, worktrees, and known task
resources, including device installs. Name resources that remaining stack layers still need.
A failed issue update doesn't stop eligible cleanup.
Report merged and pending PRs, the fixes made along the way, issue results, cleanup results, and
blockers, and show the result. The report ends at what landed.
1---2name: merge3description: Use when the user asks to merge a PR or stack, or to keep a finished change, and finish its issues and cleanup.4metadata:5 source: https://skillmd.com/skills/sreejithraman/merge6---78# Merge910Land a finished change. Start from a PR, a stack, or a local change the user kept.11Leave it merged and shown, with issues settled and task resources cleaned up. You are done when12GitHub reports every PR in the set merged, and each issue and cleanup target has a result.1314A workflow's **Land** finish line, picked under its policy, is a merge request too. A merge15request authorizes landing the scoped work, closing fully resolved issues, and cleaning16up task-owned temporary resources. It also covers fixes that17[continue](../review-sweep/references/classification.md#continue-or-stop). Honor the user's18limits.19201. **Scope.** Identify the repository, PRs, landing branch, and evidence. Ask for the target if a21 merge request could refer to several PRs. If the work has no PR, publish it through22 [PR](../pr/SKILL.md#publish), then continue here. For stacks, use [gh-stack](../gh-stack/SKILL.md) to23 resolve the exact merge set and command target. Authorization must cover every layer. An24 already merged PR skips to step 5.25262. **Bring it to ready.** Follow PR's [watch](../pr/references/watch.md). Failures, comments,27 conflicts, and commits you didn't push all go through28 [continue or stop](../review-sweep/references/classification.md#continue-or-stop). Fixes that29 continue get one line in your report. A wake resumes this step, because the merge request30 still stands. An open `## Provisional` section, which `pr_state` reports as a blocker, is a31 stop; a merge request alone never clears it. On a stop, cancel any armed landing and confirm32 it's cancelled, with `gh pr merge --disable-auto` or, for a queue, the `dequeuePullRequest`33 mutation. Then leave the34 PR open and use [Show Me](../show-me/SKILL.md) to show the user what happened, including35 anything that landed first.3637 `pr_state` blocks a head without a passing `review-fix-loop` status, including after a base38 update or restack. A caller with its own repair owner gets the gap back. Without one, take39 the head through PR's [Prepare and Review steps](../pr/SKILL.md#publish), publish any fixes,40 and read the state again. A new head of reviewed work is a41 [repair pass](../review-fix-loop/SKILL.md#4-route-repairs).4243 A caller that keeps its own repair owner gets each failure, comment, and stop back, and resumes44 that owner. You repair nothing.45463. **Check it.** Capture what the user will want to see first, with Show Me, so this is the last47 read before you land. Run [`pr_state`](../pr/references/watch.md#read-the-state) with48 `--head <verified head>` for every PR in the set. Each must be49 [ready](../pr/references/watch.md#ready-or-blocked). Its `baseRefName` must be the landing50 branch, or for a stack layer its parent in the scoped set. A different base is a stop.5152 Every PR, including docs-only changes, needs review of its current head that includes53 [Show, Don't Tell](../show-dont-tell/SKILL.md), plus required verification. The head's54 passing `review-fix-loop` status records the review and its Show, Don't Tell. Step 2 restores55 a missing one. Route missing or stale verification the same way as a stale review, then go56 back to step 2.5758 A head you didn't verify holds commits nobody reviewed. Read them, then go back to step 2. It59 counts as verified once the evidence above covers it.6061 Closing links that would close unfinished issues block landing. After repairs or restacking,62 recheck every affected layer. Before local history changes, apply63 [Preserve local files](../pr/references/preserve-local-files.md). Land the set only when all of64 it is ready.65664. **Land.** Follow repository merge settings, protections, and queues. For one PR, use67 [gh pr merge](https://cli.github.com/manual/gh_pr_merge) with68 `--match-head-commit <verified head>`, and leave branch deletion to cleanup. For stacks, use69 `gh-stack`, with guards against unverified head changes on every layer: head preconditions,70 or enforced current-head checks and fresh approvals after pushes. Without them, report the71 blocker; see72 [branch protection](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches).73 Confirm with `pr_state` that each PR reports `merged`. Queued work is still pending. After a74 failed or timed-out submission, read GitHub before you retry. If it reports `state: MERGED`75 with `the head moved`, commits you didn't verify landed. Read them and tell the user what76 landed before you finish any issue.77785. **Finish issues.** Check linked or task-scoped issues against their acceptance criteria and79 intended delivery branch. Confirm automatic closure, or close a fully resolved open issue as80 completed with the merged PR link. Keep partial issues, and those waiting on unmerged layers,81 open. Check existing state and comments before posting. An intermediate stack merge doesn't82 prove delivery, because83 [automatic closing links](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue)84 apply when work reaches the default branch.85866. **Clean up.** Use [Repo Cleanup](../repo-cleanup/SKILL.md) for confirmed merges. Pass merge87 results, proven merge-time source heads, branches and bases, worktrees, and known task88 resources, including device installs. Name resources that remaining stack layers still need.89 A failed issue update doesn't stop eligible cleanup.9091Report merged and pending PRs, the fixes made along the way, issue results, cleanup results, and92blockers, and show the result. The report ends at what landed.