# Land and Deploy (land-and-deploy)

> Picks up the GitHub PR from /ship: checks CI and readiness, merges after approval, monitors the deploy, verifies production and writes a report.

- Category: [Deploy & Release](https://www.myskills.tools/en/categories/deploy-release/)
- Source: Community · Garry Tan
- Repository: https://github.com/garrytan/gstack/tree/main/land-and-deploy (commit a77fae2 · v1.0.0)
- SKILL.md: https://github.com/garrytan/gstack/blob/main/land-and-deploy/SKILL.md
- Install command: `npx skills add garrytan/gstack --skill land-and-deploy`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✓
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.
- ⚠ It merges PRs, deletes branches and pushes revert commits to the base branch on rollback; requires an authenticated gh and supports GitHub only.

## Core rule

Never force-push, bypass CI, replay a confirmed merge, or hide missing evidence.

## Execution Phases

1. **Pre-flight** — Confirm gh auth, find the PR and base branch, require a clean checkout matching the PR head, and run a dry-run validation on first use.
2. **CI and readiness** — Gate on all CI checks for the head, merge conflicts and VERSION drift, waiting for CI if pending, then pass the pre-merge readiness gate.
3. **Merge and wait** — Merge after approval, detect the deploy strategy, and confirm the matching revision deployed via GitHub Actions or platforms like Fly.io or Heroku.
4. **Canary verification** — Check the production URL's health; on failure, roll back with revert commits only after the user explicitly chooses to.
5. **Deploy report** — Pick a verdict from the evidence, such as DEPLOYED AND VERIFIED or MERGED (UNVERIFIED), save it to .gstack/deploy-reports/ and suggest follow-ups.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Limited | Writes deploy reports and temp files under .gstack/ plus confirmation markers and logs in the gstack state directory; it does not edit code before merging. |
| Command execution | Required | Runs git, gh, jq, gstack helper scripts and platform status commands like fly or heroku, including merge, revert and push. |
| Network outbound | Limited | Talks to GitHub (gh, git fetch/push), deploy platform status endpoints and the production URL being verified, and logs gstack telemetry. |

## SKILL.md frontmatter (YAML)

```yaml
---
name: land-and-deploy
preamble-tier: 4
version: 1.0.0
description: Land and deploy workflow. (gstack)
allowed-tools:
  - Bash
  - Read
  - Write
  - Glob
  - AskUserQuestion
triggers:
  - merge and deploy
  - land the pr
  - ship to production
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/land-and-deploy/
