en un clic
land
Merge an approved PR and complete the associated task
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Menu
Merge an approved PR and complete the associated task
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Basé sur la classification professionnelle SOC
| name | land |
| version | 1.1.0 |
| standalone | true |
| description | Merge an approved PR and complete the associated task |
| uses | ["development/git"] |
| requires | {"tools":["git","gh","curl"],"env":[]} |
| security | {"risk_level":"write","capabilities":["git:write","github:pr:merge","coordinator:write"],"requires_approval":false} |
Merge an approved pull request using squash-merge, delete the feature branch, and publish a task_completed event to the bus. This closes the approved -> done lifecycle gap where approved PRs sit forever waiting for a human merge.
Platform note: Uses GitHub (gh CLI). The methodology is platform-agnostic; only the tool commands are GitHub-specific.
Standalone mode: Works without agent-coordinator. Skip the bus publish and coordinator task completion steps when AC_COORDINATOR_URL is not set. The core action — merge PR via gh pr merge — works with just gh.
This is a bash skill (handler: type: bash). When land is invoked, the executor runs pre-merge checks and then gh pr merge with the provided parameters. On success it publishes a bus event to trigger the approved -> done workflow transition.
review_approved bus messageapproved status and has a linked PR ready to mergepr_number (required) — the PR to mergetask_id (optional) — coordinator task ID to complete after mergerepo (optional) — owner/repo for cross-repo merges; omit for current repoIf repo is provided, pass --repo <repo> to all gh commands.
Before merging, confirm all preconditions are met:
# Get PR status (JSON)
gh pr view <pr_number> [--repo <repo>] --json state,reviewDecision,mergeable,statusCheckRollup,headRefName
Check each field:
| Field | Required Value | If Not Met |
|---|---|---|
state | OPEN | Abort — PR is already closed or merged |
reviewDecision | APPROVED | Abort — PR is not approved |
mergeable | MERGEABLE | Abort — PR has merge conflicts |
statusCheckRollup | All checks SUCCESS or NEUTRAL, or empty (no required checks) | Abort — CI is not green |
If any check fails, report the failure and stop. Do NOT retry — the underlying issue (conflicts, failing CI, missing approval) requires human or developer intervention.
gh pr merge <pr_number> [--repo <repo>] --squash --delete-branch
--squash produces a single clean commit on the base branch--delete-branch removes the feature branch after mergeIf the merge command fails (race condition, protected branch rule, network error), capture the error message and report it. Do NOT retry.
After a successful merge, switch the local checkout back to the base branch and pull the merge commit:
git checkout main && git pull
After a successful merge, publish a task_completed event so the workflow transitions the task from approved to done:
Use the bus_publish tool with:
channel: "work"type: "task_completed"payload:
agent: your agent namepr_number: the merged PR numbertask_id: the task ID (if provided)merge_commit: the merge commit SHA (from gh pr view after merge, or git log -1 --format=%H)If task_id is provided, also update the coordinator:
curl -s -X POST "${AC_COORDINATOR_URL:-http://localhost:9889}/tasks/${task_id}/complete" \
-H "Content-Type: application/json" \
-d '{"completion_state": "DONE", "summary": "PR #<pr_number> merged via squash"}'
Output a summary of what happened:
## PR Landed
- PR: #<pr_number>
- Merge commit: <sha>
- Branch deleted: <branch_name>
- Task: <task_id> -> done (or "no task_id provided")
- Bus event: task_completed published
On success:
## PR Landed
- PR: #N
- Merge commit: abc1234
- Branch deleted: feat/some-feature
- Task: <task_id> -> done
- Bus event: task_completed published
On failure:
## Land Failed
- PR: #N
- Reason: <specific failure reason>
- Action needed: <what needs to happen before retry>
statusCheckRollup before merging. A green review does not mean green CI.mergeable status. Conflicts require developer intervention (rebase).task_completed bus event, the workflow transition from approved to done does not happen and the task appears stuck.The land skill is complete when:
task_completed is published to work channelReview pull requests for code quality, security, and correctness
Review pull requests for code quality, security, and correctness
End-to-end shipping workflow — tests, PR creation, review request. Unified pr-create + pr-complete.
Periodic cross-agent learning consolidation — review what worked, what didn't, propagate insights
Break down complex problems through structured analytical frameworks
Persist and recall context across sessions — critical for continuity