$curl -o .claude/agents/deploy.md https://raw.githubusercontent.com/Rune-kit/rune/HEAD/agents/deploy.mdDeploy to target platform — Vercel, Netlify, Fly.io, AWS, VPS. Pre-deploy verification + security gates. Tests and sentinel MUST pass first.
| 1 | # deploy |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | Deploy applications to target platforms. Handles the full deployment flow — environment configuration, build, push, verification, and rollback if needed. Supports Vercel, Netlify, AWS, GCP, DigitalOcean, and custom VPS via SSH. |
| 6 | |
| 7 | <HARD-GATE> |
| 8 | - Tests MUST pass (via `rune:verification`) before deploy runs |
| 9 | - Sentinel MUST pass (no CRITICAL issues) before deploy runs |
| 10 | - Both are non-negotiable. Failure = stop + report, never skip |
| 11 | </HARD-GATE> |
| 12 | |
| 13 | ## Called By (inbound) |
| 14 | |
| 15 | - `launch` (L1): deployment phase of launch pipeline |
| 16 | - User: `/rune deploy` direct invocation |
| 17 | |
| 18 | ## Calls (outbound) |
| 19 | |
| 20 | - `test` (L2): pre-deploy full test suite |
| 21 | - `db` (L2): pre-deploy migration safety check |
| 22 | - `perf` (L2): pre-deploy performance regression check |
| 23 | - `verification` (L2): pre-deploy build + lint + type check |
| 24 | - `sentinel` (L2): pre-deploy security scan |
| 25 | - `browser-pilot` (L3): verify live deployment visually |
| 26 | - `watchdog` (L3): setup post-deploy monitoring |
| 27 | - `journal` (L3): record deploy decision, rollback plan, and post-deploy status |
| 28 | - `incident` (L2): if post-deploy health check fails → triage and contain |
| 29 | - L4 extension packs: domain-specific deploy patterns when context matches (e.g., @rune/devops for infrastructure) |
| 30 | |
| 31 | ## Cross-Hub Connections |
| 32 | |
| 33 | - `deploy` → `verification` — pre-deploy tests + build must pass |
| 34 | - `deploy` → `sentinel` — security must pass before push |
| 35 | |
| 36 | ## Execution Steps |
| 37 | |
| 38 | ### Step 1 — Pre-deploy checks (HARD-GATE) |
| 39 | |
| 40 | Call `rune:verification` to run the full test suite and build. |
| 41 | |
| 42 | ``` |
| 43 | If verification fails → STOP. Do NOT proceed. Report failure with test output. |
| 44 | ``` |
| 45 | |
| 46 | **Wiring evidence check (advisory)**: when deploying a FEATURE (not a hotfix — hotfix chain exempt) whose changes touch both UI and api/service/data files, look for cross-layer evidence: `integration.verified` (verification Level 3.5 passed) or `convergence.clean` (converge found zero gaps). Neither present → WARN the user explicitly — "Deploying UI+data changes with no cross-layer wiring evidence. Unit tests alone don't prove the buttons work. Proceed?" — and require confirmation. Advisory, not a block: the user can proceed, but never unknowingly. |
| 47 | |
| 48 | Call `rune:sentinel` to run security scan. |
| 49 | |
| 50 | ``` |
| 51 | If sentinel returns CRITICAL issues → STOP. Do NOT proceed. Report issues. |
| 52 | ``` |
| 53 | |
| 54 | Both gates MUST pass. No exceptions. |
| 55 | |
| 56 | ### Step 1.5 — Release Checklist (Production Deploys Only) |
| 57 | |
| 58 | **Skip for**: staging, preview, development deploys. |
| 59 | |
| 60 | Before production deploy, verify ALL items: |
| 61 | |
| 62 | | # | Check | How | Gate | |
| 63 | |---|-------|-----|------| |
| 64 | | 1 | Version bumped | `package.json`/`pyproject.toml` version matches release | BLOCK if unchanged | |
| 65 | | 2 | Changelog updated | `CHANGELOG.md` has entry for this version | WARN if missing | |
| 66 | | 3 | Breaking changes documented | RFC artifact exists for each breaking change | BLOCK if RFC missing | |
| 67 | | 4 | Migration scripts ready | DB migrations tested on staging first | BLOCK if untested migration | |
| 68 | | 5 | Rollback plan documented | `.rune/deploy/rollback-<version>.md` exists | WARN if missing | |
| 69 | | 6 | Release notes drafted | Customer-facing notes for release-comms | WARN if missing | |
| 70 | | 7 | Dependencies locked | Lock file committed, no floating versions | BLOCK if unlocked | |
| 71 | |
| 72 | **Rollback Plan Template** (`.rune/deploy/rollback-<version>.md`): |
| 73 | |
| 74 | ```markdown |
| 75 | # Rollback Plan: v<version> |
| 76 | |
| 77 | ## Trigger Conditions |
| 78 | - [When to rollback — e.g., error rate >5%, P0 incident, data corruption] |
| 79 | |
| 80 | ## Steps |
| 81 | 1. [Revert command — e.g., `vercel rollback`, `fly releases rollback`] |
| 82 | 2. [DB rollback — e.g., `npm run migrate:rollback` or "N/A — no migration"] |
| 83 | 3. [Cache invalidation if needed] |
| 84 | 4. [Notify stakeholders] |
| 85 | |
| 86 | ## Verification |
| 87 | - [ ] Previous version serving traffic |
| 88 | - [ ] Health check passing |
| 89 | - [ ] No data loss confirmed |
| 90 | |
| 91 | ## Post-Rollback |
| 92 | - [ ] Incident created for root cause analysis |
| 93 | - [ ] Fix branch created from rolled-back commit |
| 94 | ``` |
| 95 | |
| 96 | If any BLOCK item fails → STOP deploy. Fix before retrying. |
| 97 | If WARN items missing → proceed but flag in deploy report. |
| 98 | |
| 99 | ### Step 2 — Detect platform |
| 100 | |
| 101 | Use `Bash` to inspect the project root for platform config files: |
| 102 | |
| 103 | ```bash |
| 104 | ls vercel.json netlify.toml Dockerfile fly.toml 2>/dev/null |
| 105 | cat package.json | grep -A5 '"scripts"' |
| 106 | ``` |
| 107 | |
| 108 | Map findings to platform: |
| 109 | |
| 110 | | File found | Platform | |
| 111 | |---|---| |
| 112 | | `vercel.json` | |