Merges approved PRs safely. Automates pre-flight checks, squash merging, and issue status transitions.
Install
mkdir -p .claude/skills/land-hojinzs && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18271" && unzip -o skill.zip -d .claude/skills/land-hojinzs && rm skill.zipInstalls to .claude/skills/land-hojinzs
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Merge an approved PR during the Land state. Runs pre-flight checks, performs squash merge, completes post-merge bookkeeping, and transitions the issue to Done.Key capabilities
- →Verify human approval for a pull request
- →Check required CI checks status for a pull request
- →Ensure branch is up-to-date with its base
- →Confirm changeset presence if labeled
- →Perform a squash merge of an approved pull request
- →Transition an issue to 'Done' after merge
How it works
The skill performs pre-flight checks on a pull request, including approvals and CI status, then executes a squash merge and updates the associated issue's status and workpad.
Inputs & outputs
When to use land
- →Merging an approved pull request
- →Moving a task to done after merge
- →Performing automated PR bookkeeping
About this skill
/land — Land State Merge Workflow
Trigger
Use this skill only when the issue is in the Land state. A human has approved the PR and the remaining job is to merge it safely and complete required post-merge bookkeeping.
Work unattended. Do not ask humans for follow-up. Stop only on a genuine blocker (see Failure Handling).
Operating Rules
- Use
/gh-projectfor every Status field change. Never call ProjectV2 GraphQL APIs directly. - Use
/pullwhen the head branch is behind its PR base — nevergit merge/git rebaseby hand inside this skill. - All issue/PR comments are in the issue's report language; written via
gh ... --body-file <file>, never with inline\nstrings. - Never modify the issue body.
- Never hardcode
origin/mainfor branch-freshness checks — always use the PR's actual base branch (it may be an Epic working branch). - Squash merge only for this repository. Other merge strategies are not used.
- Record every merge attempt, blocker, and outcome in the Land cycle workpad comment.
Required Context
Before acting, collect:
- Issue: state, identifier, title, labels, description, URL, repository.
- Land cycle workpad comment for this issue. (Step 4 created it. If absent, create one before proceeding.)
- PR: number, URL, base branch, head branch,
mergeStateStatus, reviews, CI checks, head SHA. - Changeset file path, if the issue carries a
changeset:major|minor|patchlabel.
If no PR is linked to the issue, record the blocker in the workpad and exit.
Sibling skills. This skill delegates to /gh-project for the Done transition and /pull for branch freshness. Both were updated alongside this skill to target the Moncher Stack project and accept the PR's actual base branch — no special workaround is required. If either fails at runtime (e.g. authentication, board re-configuration), record the specific failure in the workpad and exit with a ⛔ Blocker comment.
Pre-flight Checks
All must pass before merging. If any fails, record the failure in the workpad and do not merge.
- At least one human approval.
gh pr view <pr-number> --json reviews --jq '[.reviews[] | select(.state == "APPROVED")] | length'must be ≥ 1. - All required CI checks green.
gh pr checks <pr-number>— no failing or pending required checks. - Branch up-to-date with the PR base.
If behind: runbase=$(gh pr view <pr-number> --json baseRefName --jq .baseRefName) git fetch origin "$base" git merge-base --is-ancestor "origin/$base" HEAD/pull, then re-run the full pre-flight sequence from step 1 (pushing the rebase invalidates prior CI runs and any prior approval). - Changeset present if labeled. If the issue has a
changeset:major|minor|patchlabel, confirm at least one.changeset/*.mdfile exists on the head branch (excludingREADME.md/config.json). If absent, record the blocker, do not merge. - PR mergeable.
gh pr view <pr-number> --json mergeStateStatus --jq .mergeStateStatusmust beCLEAN/HAS_HOOKS/UNSTABLE(the last allowed only when failing checks are all non-required).BLOCKED/DIRTY/BEHIND→ not mergeable.
Flow
- Load context and run all Pre-flight Checks. While loading context, verify the Land cycle workpad has the
🔁 Status: In review → Landtransition line recorded by Step 4; if the workpad is present but the transition line is missing, append it before running pre-flight (this is a recoverable inconsistency, not a blocker). - If the PR is already merged, skip the merge command; run post-merge steps idempotently.
- Otherwise squash-merge with branch deletion:
gh pr merge <pr-number> --squash --delete-branch. - Capture the merge commit SHA:
gh pr view <pr-number> --json mergeCommit --jq .mergeCommit.oid. - Update the Land cycle workpad's
### Validationsection: merge commit SHA, changeset path (if any), timestamp. - Transition the issue to
Donevia/gh-project. Only proceed to step 7 once/gh-projectreturns success. - Post the standalone
🔁 Status: Land → Donecomment (cycle close: land) and append the matching workpad Status Transitions line. - Update the workpad's
### Progress Logwith the final outcome.
Failure Handling
- Record the exact failure (command, exit code, output excerpt, timestamp) in the workpad
### Progress Log. - If recoverable in this run (e.g. branch behind → run
/pull), do so and re-run pre-flight from scratch. - After 3 consecutive failures of the same step (same cause), stop: write a
⛔ Blockerissue comment with what · why · how to unblock, leave the issue inLand(do not auto-transition toBacklog— Land failures are usually merge-policy issues, not code-blockers), and exit. A human resolves and either re-entersLandor moves the issue elsewhere.
Guardrails
- Do not merge without ≥1 approval and green required CI.
- Do not use merge / rebase / auto-merge — only squash with branch deletion.
- Do not transition the issue to
Donebefore the merge succeeds. - Do not call ProjectV2 GraphQL APIs directly; use
/gh-project. - Do not modify the issue body.
- Do not auto-move a failed Land to
Backlog— leave the human-resolvable state visible.
When not to use it
- →When the issue is not in the `Land` state
- →When the pull request is not approved
- →When merge strategies other than squash merge are required
Limitations
- →Only performs squash merges
- →Requires at least one human approval and green required CI checks
- →Does not modify the issue body
How it compares
This workflow automates the merging of approved pull requests with pre-flight checks and post-merge bookkeeping, ensuring adherence to project policies without manual intervention.
Compared to similar skills
land side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| land (this skill) | 0 | 2mo | Review | Intermediate |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| git-advanced-workflows | 11 | 2mo | Review | Advanced |
| nx-workspace | 4 | 6mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by hojinzs
View all by hojinzs →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
nx-workspace
nrwl
Explore and understand Nx workspaces. USE WHEN answering any questions about the nx workspace, the projects in it or tasks to run. EXAMPLES: 'What projects are in this workspace?', 'How is project X configured?', 'What targets can I run?', 'What's affected by my changes?', 'Which projects depend on library Y?', or any questions about Nx workspace structure, project configuration, or available tasks.
fix-github-issue
AgnosticUI
Fix a GitHub issue by number. Use when asked to fix GitHub issues.
rebase-pr
AztecProtocol
Rebase a PR on its base branch, fix conflicts, and verify build
resolve-pr-parallel
EveryInc
Resolve all PR comments using parallel processing. Use when addressing PR review feedback, resolving review threads, or batch-fixing PR comments.