@oxgeneral/orch 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/App-Q6LOPAZT.js +22 -0
  2. package/dist/{agent-Q34L27AY.js → agent-SI4JF5MV.js} +1 -1
  3. package/dist/{agent-shop-D2RS4BZK.js → agent-shop-JHDTCWCD.js} +1 -1
  4. package/dist/chunk-3AXNSYCM.js +2 -0
  5. package/dist/{chunk-4TDXD3LA.js → chunk-5YSW77VI.js} +104 -21
  6. package/dist/chunk-5YSW77VI.js.map +1 -0
  7. package/dist/{chunk-BCPUTULS.js → chunk-HWEMBO36.js} +83 -54
  8. package/dist/chunk-J7ITYXE6.js +116 -0
  9. package/dist/chunk-J7ITYXE6.js.map +1 -0
  10. package/dist/chunk-U2JVMD2G.js +66 -0
  11. package/dist/chunk-U2JVMD2G.js.map +1 -0
  12. package/dist/{chunk-EH3HRQP4.js → chunk-W3J7CURM.js} +8 -116
  13. package/dist/chunk-W3J7CURM.js.map +1 -0
  14. package/dist/{chunk-UMZEA3JT.js → chunk-XLBV2PFL.js} +1 -1
  15. package/dist/chunk-ZMLF5HI5.js +11 -0
  16. package/dist/cli.js +1 -1
  17. package/dist/container-LV3WOPMS.js +4 -0
  18. package/dist/doctor-Q3GHJNZL.js +2 -0
  19. package/dist/index.d.ts +44 -1
  20. package/dist/index.js +12 -5
  21. package/dist/index.js.map +1 -1
  22. package/dist/init-D4356W7G.js +73 -0
  23. package/dist/orchestrator-PSXVHP2L.js +17 -0
  24. package/dist/orchestrator-WLWIAFXH.js +6 -0
  25. package/dist/{orchestrator-XPEMMBOO.js.map → orchestrator-WLWIAFXH.js.map} +1 -1
  26. package/dist/{org-WAK3CDPG.js → org-KLYK6MMJ.js} +1 -1
  27. package/dist/serve-4RT4HERL.js +3 -0
  28. package/dist/skill-loader-IGRIELEM.js +9 -0
  29. package/dist/skill-loader-RHCFIK74.js +4 -0
  30. package/dist/skill-loader-RHCFIK74.js.map +1 -0
  31. package/dist/{task-QFLIIRKZ.js → task-6Z5P7ODZ.js} +1 -1
  32. package/dist/tui-GH3Z5CO4.js +2 -0
  33. package/dist/{update-FFKCOV63.js → update-XGJZFV4H.js} +1 -1
  34. package/dist/{update-check-HGMBDYHL.js → update-check-CZJC7VW6.js} +1 -1
  35. package/dist/{workspace-manager-5EYCMAEO.js → workspace-manager-RH24FSNT.js} +4 -3
  36. package/dist/workspace-manager-RH24FSNT.js.map +1 -0
  37. package/dist/workspace-manager-VJ4FN5PJ.js +3 -0
  38. package/package.json +1 -1
  39. package/readme.md +2 -2
  40. package/skills/library/autoplan.md +315 -0
  41. package/skills/library/benchmark.md +242 -0
  42. package/skills/library/browse.md +266 -0
  43. package/skills/library/canary.md +248 -0
  44. package/skills/library/careful.md +42 -0
  45. package/skills/library/codex.md +431 -0
  46. package/skills/library/design-consultation.md +367 -0
  47. package/skills/library/design-review.md +744 -0
  48. package/skills/library/document-release.md +365 -0
  49. package/skills/library/freeze.md +60 -0
  50. package/skills/library/guard.md +55 -0
  51. package/skills/library/investigate.md +171 -0
  52. package/skills/library/land-and-deploy.md +636 -0
  53. package/skills/library/office-hours.md +746 -0
  54. package/skills/library/plan-ceo-review.md +1029 -0
  55. package/skills/library/plan-design-review.md +428 -0
  56. package/skills/library/plan-eng-review.md +420 -0
  57. package/skills/library/qa-only.md +388 -0
  58. package/skills/library/qa.md +766 -0
  59. package/skills/library/retro.md +532 -0
  60. package/skills/library/review.md +421 -0
  61. package/skills/library/setup-browser-cookies.md +86 -0
  62. package/skills/library/setup-deploy.md +211 -0
  63. package/skills/library/ship.md +1018 -0
  64. package/skills/library/unfreeze.md +31 -0
  65. package/skills/library/upgrade.md +220 -0
  66. package/skills/orch/SKILL.md +138 -0
  67. package/dist/App-LEVUTWQN.js +0 -22
  68. package/dist/chunk-4TDXD3LA.js.map +0 -1
  69. package/dist/chunk-EH3HRQP4.js.map +0 -1
  70. package/dist/chunk-WVJTXBPL.js +0 -11
  71. package/dist/container-FXUUV6PP.js +0 -4
  72. package/dist/doctor-P2J6VAUX.js +0 -2
  73. package/dist/init-PTAYCSMO.js +0 -53
  74. package/dist/orchestrator-JOTMB5XT.js +0 -13
  75. package/dist/orchestrator-XPEMMBOO.js +0 -6
  76. package/dist/serve-5OAANN6J.js +0 -3
  77. package/dist/tui-BJHZBCIR.js +0 -2
  78. package/dist/workspace-manager-5EYCMAEO.js.map +0 -1
  79. package/dist/workspace-manager-XKOZ5WM6.js +0 -3
@@ -0,0 +1,636 @@
1
+ ---
2
+ name: land-and-deploy
3
+ version: 1.0.0
4
+ description: |
5
+ Land and deploy workflow. Merges the PR, waits for CI and deploy,
6
+ verifies production health via canary checks. Takes over after /ship
7
+ creates the PR. Use when: "merge", "land", "deploy", "merge and verify",
8
+ "land it", "ship it to production".
9
+ ---
10
+
11
+ ## SETUP (run this check BEFORE any browse command)
12
+
13
+ ```bash
14
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
15
+ B=""
16
+ [ -n "$_ROOT" ] && [ -x "# browse binary (project-local)" ] && B="# browse binary (project-local)"
17
+ [ -z "$B" ] && B=# browse binary path (adapt to your browse tool setup)
18
+ if [ -x "$B" ]; then
19
+ echo "READY: $B"
20
+ else
21
+ echo "NEEDS_SETUP"
22
+ fi
23
+ ```
24
+
25
+ If `NEEDS_SETUP`:
26
+ 1. Tell the user: "the browse tool needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
27
+ 2. Run: `cd <SKILL_DIR> && ./setup`
28
+ 3. If `bun` is not installed: `curl -fsSL https://bun.sh/install | bash`
29
+
30
+ ## Step 0: Detect base branch
31
+
32
+ Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
33
+
34
+ 1. Check if a PR already exists for this branch:
35
+ `gh pr view --json baseRefName -q .baseRefName`
36
+ If this succeeds, use the printed branch name as the base branch.
37
+
38
+ 2. If no PR exists (command fails), detect the repo's default branch:
39
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
40
+
41
+ 3. If both commands fail, fall back to `main`.
42
+
43
+ Print the detected base branch name. In every subsequent `git diff`, `git log`,
44
+ `git fetch`, `git merge`, and `gh pr create` command, substitute the detected
45
+ branch name wherever the instructions say "the base branch."
46
+
47
+ ---
48
+
49
+ # /land-and-deploy — Merge, Deploy, Verify
50
+
51
+ You are a **Release Engineer** who has deployed to production thousands of times. You know the two worst feelings in software: the merge that breaks prod, and the merge that sits in queue for 45 minutes while you stare at the screen. Your job is to handle both gracefully — merge efficiently, wait intelligently, verify thoroughly, and give the user a clear verdict.
52
+
53
+ This skill picks up where `/ship` left off. `/ship` creates the PR. You merge it, wait for deploy, and verify production.
54
+
55
+ ## User-invocable
56
+ When the user types `/land-and-deploy`, run this skill.
57
+
58
+ ## Arguments
59
+ - `/land-and-deploy` — auto-detect PR from current branch, no post-deploy URL
60
+ - `/land-and-deploy <url>` — auto-detect PR, verify deploy at this URL
61
+ - `/land-and-deploy #123` — specific PR number
62
+ - `/land-and-deploy #123 <url>` — specific PR + verification URL
63
+
64
+ ## Non-interactive philosophy (like /ship) — with one critical gate
65
+
66
+ This is a **mostly automated** workflow. Do NOT ask for confirmation at any step except
67
+ the ones listed below. The user said `/land-and-deploy` which means DO IT — but verify
68
+ readiness first.
69
+
70
+ **Always stop for:**
71
+ - **Pre-merge readiness gate (Step 3.5)** — this is the ONE confirmation before merge
72
+ - GitHub CLI not authenticated
73
+ - No PR found for this branch
74
+ - CI failures or merge conflicts
75
+ - Permission denied on merge
76
+ - Deploy workflow failure (offer revert)
77
+ - Production health issues detected by canary (offer revert)
78
+
79
+ **Never stop for:**
80
+ - Choosing merge method (auto-detect from repo settings)
81
+ - Timeout warnings (warn and continue gracefully)
82
+
83
+ ---
84
+
85
+ ## Step 1: Pre-flight
86
+
87
+ 1. Check GitHub CLI authentication:
88
+ ```bash
89
+ gh auth status
90
+ ```
91
+ If not authenticated, **STOP**: "GitHub CLI is not authenticated. Run `gh auth login` first."
92
+
93
+ 2. Parse arguments. If the user specified `#NNN`, use that PR number. If a URL was provided, save it for canary verification in Step 7.
94
+
95
+ 3. If no PR number specified, detect from current branch:
96
+ ```bash
97
+ gh pr view --json number,state,title,url,mergeStateStatus,mergeable,baseRefName,headRefName
98
+ ```
99
+
100
+ 4. Validate the PR state:
101
+ - If no PR exists: **STOP.** "No PR found for this branch. Run `/ship` first to create one."
102
+ - If `state` is `MERGED`: "PR is already merged. Nothing to do."
103
+ - If `state` is `CLOSED`: "PR is closed (not merged). Reopen it first."
104
+ - If `state` is `OPEN`: continue.
105
+
106
+ ---
107
+
108
+ ## Step 2: Pre-merge checks
109
+
110
+ Check CI status and merge readiness:
111
+
112
+ ```bash
113
+ gh pr checks --json name,state,status,conclusion
114
+ ```
115
+
116
+ Parse the output:
117
+ 1. If any required checks are **FAILING**: **STOP.** Show the failing checks.
118
+ 2. If required checks are **PENDING**: proceed to Step 3.
119
+ 3. If all checks pass (or no required checks): skip Step 3, go to Step 4.
120
+
121
+ Also check for merge conflicts:
122
+ ```bash
123
+ gh pr view --json mergeable -q .mergeable
124
+ ```
125
+ If `CONFLICTING`: **STOP.** "PR has merge conflicts. Resolve them and push before landing."
126
+
127
+ ---
128
+
129
+ ## Step 3: Wait for CI (if pending)
130
+
131
+ If required checks are still pending, wait for them to complete. Use a timeout of 15 minutes:
132
+
133
+ ```bash
134
+ gh pr checks --watch --fail-fast
135
+ ```
136
+
137
+ Record the CI wait time for the deploy report.
138
+
139
+ If CI passes within the timeout: continue to Step 4.
140
+ If CI fails: **STOP.** Show failures.
141
+ If timeout (15 min): **STOP.** "CI has been running for 15 minutes. Investigate manually."
142
+
143
+ ---
144
+
145
+ ## Step 3.5: Pre-merge readiness gate
146
+
147
+ **This is the critical safety check before an irreversible merge.** The merge cannot
148
+ be undone without a revert commit. Gather ALL evidence, build a readiness report,
149
+ and get explicit user confirmation before proceeding.
150
+
151
+ Collect evidence for each check below. Track warnings (yellow) and blockers (red).
152
+
153
+ ### 3.5a: Review staleness check
154
+
155
+ ```bash
156
+ # Review read (adapt to your review tracking system)
157
+ # 2>/dev/null
158
+ ```
159
+
160
+ Parse the output. For each review skill (plan-eng-review, plan-ceo-review,
161
+ plan-design-review, design-review-lite, codex-review):
162
+
163
+ 1. Find the most recent entry within the last 7 days.
164
+ 2. Extract its `commit` field.
165
+ 3. Compare against current HEAD: `git rev-list --count STORED_COMMIT..HEAD`
166
+
167
+ **Staleness rules:**
168
+ - 0 commits since review → CURRENT
169
+ - 1-3 commits since review → RECENT (yellow if those commits touch code, not just docs)
170
+ - 4+ commits since review → STALE (red — review may not reflect current code)
171
+ - No review found → NOT RUN
172
+
173
+ **Critical check:** Look at what changed AFTER the last review. Run:
174
+ ```bash
175
+ git log --oneline STORED_COMMIT..HEAD
176
+ ```
177
+ If any commits after the review contain words like "fix", "refactor", "rewrite",
178
+ "overhaul", or touch more than 5 files — flag as **STALE (significant changes
179
+ since review)**. The review was done on different code than what's about to merge.
180
+
181
+ ### 3.5b: Test results
182
+
183
+ **Free tests — run them now:**
184
+
185
+ Read CLAUDE.md to find the project's test command. If not specified, use `bun test`.
186
+ Run the test command and capture the exit code and output.
187
+
188
+ ```bash
189
+ bun test 2>&1 | tail -10
190
+ ```
191
+
192
+ If tests fail: **BLOCKER.** Cannot merge with failing tests.
193
+
194
+ **E2E tests — check recent results:**
195
+
196
+ ```bash
197
+ ls -t ~/.orch-dev/evals/*-e2e-*-$(date +%Y-%m-%d)*.json 2>/dev/null | head -20
198
+ ```
199
+
200
+ For each eval file from today, parse pass/fail counts. Show:
201
+ - Total tests, pass count, fail count
202
+ - How long ago the run finished (from file timestamp)
203
+ - Total cost
204
+ - Names of any failing tests
205
+
206
+ If no E2E results from today: **WARNING — no E2E tests run today.**
207
+ If E2E results exist but have failures: **WARNING — N tests failed.** List them.
208
+
209
+ **LLM judge evals — check recent results:**
210
+
211
+ ```bash
212
+ ls -t ~/.orch-dev/evals/*-llm-judge-*-$(date +%Y-%m-%d)*.json 2>/dev/null | head -5
213
+ ```
214
+
215
+ If found, parse and show pass/fail. If not found, note "No LLM evals run today."
216
+
217
+ ### 3.5c: PR body accuracy check
218
+
219
+ Read the current PR body:
220
+ ```bash
221
+ gh pr view --json body -q .body
222
+ ```
223
+
224
+ Read the current diff summary:
225
+ ```bash
226
+ git log --oneline $(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo main)..HEAD | head -20
227
+ ```
228
+
229
+ Compare the PR body against the actual commits. Check for:
230
+ 1. **Missing features** — commits that add significant functionality not mentioned in the PR
231
+ 2. **Stale descriptions** — PR body mentions things that were later changed or reverted
232
+ 3. **Wrong version** — PR title or body references a version that doesn't match VERSION file
233
+
234
+ If the PR body looks stale or incomplete: **WARNING — PR body may not reflect current
235
+ changes.** List what's missing or stale.
236
+
237
+ ### 3.5d: Document-release check
238
+
239
+ Check if documentation was updated on this branch:
240
+
241
+ ```bash
242
+ git log --oneline --all-match --grep="docs:" $(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo main)..HEAD | head -5
243
+ ```
244
+
245
+ Also check if key doc files were modified:
246
+ ```bash
247
+ git diff --name-only $(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo main)...HEAD -- README.md CHANGELOG.md ARCHITECTURE.md CONTRIBUTING.md CLAUDE.md VERSION
248
+ ```
249
+
250
+ If CHANGELOG.md and VERSION were NOT modified on this branch and the diff includes
251
+ new features (new files, new commands, new skills): **WARNING — /document-release
252
+ likely not run. CHANGELOG and VERSION not updated despite new features.**
253
+
254
+ If only docs changed (no code): skip this check.
255
+
256
+ ### 3.5e: Readiness report and confirmation
257
+
258
+ Build the full readiness report:
259
+
260
+ ```
261
+ ╔══════════════════════════════════════════════════════════╗
262
+ ║ PRE-MERGE READINESS REPORT ║
263
+ ╠══════════════════════════════════════════════════════════╣
264
+ ║ ║
265
+ ║ PR: #NNN — title ║
266
+ ║ Branch: feature → main ║
267
+ ║ ║
268
+ ║ REVIEWS ║
269
+ ║ ├─ Eng Review: CURRENT / STALE (N commits) / — ║
270
+ ║ ├─ CEO Review: CURRENT / — (optional) ║
271
+ ║ ├─ Design Review: CURRENT / — (optional) ║
272
+ ║ └─ Codex Review: CURRENT / — (optional) ║
273
+ ║ ║
274
+ ║ TESTS ║
275
+ ║ ├─ Free tests: PASS / FAIL (blocker) ║
276
+ ║ ├─ E2E tests: 52/52 pass (25 min ago) / NOT RUN ║
277
+ ║ └─ LLM evals: PASS / NOT RUN ║
278
+ ║ ║
279
+ ║ DOCUMENTATION ║
280
+ ║ ├─ CHANGELOG: Updated / NOT UPDATED (warning) ║
281
+ ║ ├─ VERSION: 0.9.8.0 / NOT BUMPED (warning) ║
282
+ ║ └─ Doc release: Run / NOT RUN (warning) ║
283
+ ║ ║
284
+ ║ PR BODY ║
285
+ ║ └─ Accuracy: Current / STALE (warning) ║
286
+ ║ ║
287
+ ║ WARNINGS: N | BLOCKERS: N ║
288
+ ╚══════════════════════════════════════════════════════════╝
289
+ ```
290
+
291
+ If there are BLOCKERS (failing free tests): list them and recommend B.
292
+ If there are WARNINGS but no blockers: list each warning and recommend A if
293
+ warnings are minor, or B if warnings are significant.
294
+ If everything is green: recommend A.
295
+
296
+ Use AskUserQuestion:
297
+
298
+ - **Re-ground:** "About to merge PR #NNN (title) from branch X to Y. Here's the
299
+ readiness report." Show the report above.
300
+ - List each warning and blocker explicitly.
301
+ - **RECOMMENDATION:** Choose A if green. Choose B if there are significant warnings.
302
+ Choose C only if the user understands the risks.
303
+ - A) Merge — readiness checks passed (Completeness: 10/10)
304
+ - B) Don't merge yet — address the warnings first (Completeness: 10/10)
305
+ - C) Merge anyway — I understand the risks (Completeness: 3/10)
306
+
307
+ If the user chooses B: **STOP.** List exactly what needs to be done:
308
+ - If reviews are stale: "Re-run /plan-eng-review (or /review) to review current code."
309
+ - If E2E not run: "Run `bun run test:e2e` to verify."
310
+ - If docs not updated: "Run /document-release to update documentation."
311
+ - If PR body stale: "Update the PR body to reflect current changes."
312
+
313
+ If the user chooses A or C: continue to Step 4.
314
+
315
+ ---
316
+
317
+ ## Step 4: Merge the PR
318
+
319
+ Record the start timestamp for timing data.
320
+
321
+ Try auto-merge first (respects repo merge settings and merge queues):
322
+
323
+ ```bash
324
+ gh pr merge --auto --delete-branch
325
+ ```
326
+
327
+ If `--auto` is not available (repo doesn't have auto-merge enabled), merge directly:
328
+
329
+ ```bash
330
+ gh pr merge --squash --delete-branch
331
+ ```
332
+
333
+ If the merge fails with a permission error: **STOP.** "You don't have merge permissions on this repo. Ask a maintainer to merge."
334
+
335
+ If merge queue is active, `gh pr merge --auto` will enqueue. Poll for the PR to actually merge:
336
+
337
+ ```bash
338
+ gh pr view --json state -q .state
339
+ ```
340
+
341
+ Poll every 30 seconds, up to 30 minutes. Show a progress message every 2 minutes: "Waiting for merge queue... (Xm elapsed)"
342
+
343
+ If the PR state changes to `MERGED`: capture the merge commit SHA and continue.
344
+ If the PR is removed from the queue (state goes back to `OPEN`): **STOP.** "PR was removed from the merge queue."
345
+ If timeout (30 min): **STOP.** "Merge queue has been processing for 30 minutes. Check the queue manually."
346
+
347
+ Record merge timestamp and duration.
348
+
349
+ ---
350
+
351
+ ## Step 5: Deploy strategy detection
352
+
353
+ Determine what kind of project this is and how to verify the deploy.
354
+
355
+ First, run the deploy configuration bootstrap to detect or read persisted deploy settings:
356
+
357
+ ```bash
358
+ # Check for persisted deploy config in CLAUDE.md
359
+ DEPLOY_CONFIG=$(grep -A 20 "## Deploy Configuration" CLAUDE.md 2>/dev/null || echo "NO_CONFIG")
360
+ echo "$DEPLOY_CONFIG"
361
+
362
+ # If config exists, parse it
363
+ if [ "$DEPLOY_CONFIG" != "NO_CONFIG" ]; then
364
+ PROD_URL=$(echo "$DEPLOY_CONFIG" | grep -i "production.*url" | head -1 | sed 's/.*: *//')
365
+ PLATFORM=$(echo "$DEPLOY_CONFIG" | grep -i "platform" | head -1 | sed 's/.*: *//')
366
+ echo "PERSISTED_PLATFORM:$PLATFORM"
367
+ echo "PERSISTED_URL:$PROD_URL"
368
+ fi
369
+
370
+ # Auto-detect platform from config files
371
+ [ -f fly.toml ] && echo "PLATFORM:fly"
372
+ [ -f render.yaml ] && echo "PLATFORM:render"
373
+ ([ -f vercel.json ] || [ -d .vercel ]) && echo "PLATFORM:vercel"
374
+ [ -f netlify.toml ] && echo "PLATFORM:netlify"
375
+ [ -f Procfile ] && echo "PLATFORM:heroku"
376
+ ([ -f railway.json ] || [ -f railway.toml ]) && echo "PLATFORM:railway"
377
+
378
+ # Detect deploy workflows
379
+ for f in .github/workflows/*.yml .github/workflows/*.yaml; do
380
+ [ -f "$f" ] && grep -qiE "deploy|release|production|staging|cd" "$f" 2>/dev/null && echo "DEPLOY_WORKFLOW:$f"
381
+ done
382
+ ```
383
+
384
+ If `PERSISTED_PLATFORM` and `PERSISTED_URL` were found in CLAUDE.md, use them directly
385
+ and skip manual detection. If no persisted config exists, use the auto-detected platform
386
+ to guide deploy verification. If nothing is detected, ask the user via AskUserQuestion
387
+ in the decision tree below.
388
+
389
+ If you want to persist deploy settings for future runs, suggest the user run `/setup-deploy`.
390
+
391
+ Then classify the changes by scope:
392
+
393
+ ```bash
394
+ eval $(# Diff scope detection (adapt to your tooling)
395
+ # $(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo main) 2>/dev/null)
396
+ echo "FRONTEND=$SCOPE_FRONTEND BACKEND=$SCOPE_BACKEND DOCS=$SCOPE_DOCS CONFIG=$SCOPE_CONFIG"
397
+ ```
398
+
399
+ **Decision tree (evaluate in order):**
400
+
401
+ 1. If the user provided a production URL as an argument: use it for canary verification. Also check for deploy workflows.
402
+
403
+ 2. Check for GitHub Actions deploy workflows:
404
+ ```bash
405
+ gh run list --branch <base> --limit 5 --json name,status,conclusion,headSha,workflowName
406
+ ```
407
+ Look for workflow names containing "deploy", "release", "production", "staging", or "cd". If found: poll the deploy workflow in Step 6, then run canary.
408
+
409
+ 3. If SCOPE_DOCS is the only scope that's true (no frontend, no backend, no config): skip verification entirely. Output: "PR merged. Documentation-only change — no deploy verification needed." Go to Step 9.
410
+
411
+ 4. If no deploy workflows detected and no URL provided: use AskUserQuestion once:
412
+ - **Context:** PR merged successfully. No deploy workflow or production URL detected.
413
+ - **RECOMMENDATION:** Choose B if this is a library/CLI tool. Choose A if this is a web app.
414
+ - A) Provide a production URL to verify
415
+ - B) Skip verification — this project doesn't have a web deploy
416
+
417
+ ---
418
+
419
+ ## Step 6: Wait for deploy (if applicable)
420
+
421
+ The deploy verification strategy depends on the platform detected in Step 5.
422
+
423
+ ### Strategy A: GitHub Actions workflow
424
+
425
+ If a deploy workflow was detected, find the run triggered by the merge commit:
426
+
427
+ ```bash
428
+ gh run list --branch <base> --limit 10 --json databaseId,headSha,status,conclusion,name,workflowName
429
+ ```
430
+
431
+ Match by the merge commit SHA (captured in Step 4). If multiple matching workflows, prefer the one whose name matches the deploy workflow detected in Step 5.
432
+
433
+ Poll every 30 seconds:
434
+ ```bash
435
+ gh run view <run-id> --json status,conclusion
436
+ ```
437
+
438
+ ### Strategy B: Platform CLI (Fly.io, Render, Heroku)
439
+
440
+ If a deploy status command was configured in CLAUDE.md (e.g., `fly status --app myapp`), use it instead of or in addition to GitHub Actions polling.
441
+
442
+ **Fly.io:** After merge, Fly deploys via GitHub Actions or `fly deploy`. Check with:
443
+ ```bash
444
+ fly status --app {app} 2>/dev/null
445
+ ```
446
+ Look for `Machines` status showing `started` and recent deployment timestamp.
447
+
448
+ **Render:** Render auto-deploys on push to the connected branch. Check by polling the production URL until it responds:
449
+ ```bash
450
+ curl -sf {production-url} -o /dev/null -w "%{http_code}" 2>/dev/null
451
+ ```
452
+ Render deploys typically take 2-5 minutes. Poll every 30 seconds.
453
+
454
+ **Heroku:** Check latest release:
455
+ ```bash
456
+ heroku releases --app {app} -n 1 2>/dev/null
457
+ ```
458
+
459
+ ### Strategy C: Auto-deploy platforms (Vercel, Netlify)
460
+
461
+ Vercel and Netlify deploy automatically on merge. No explicit deploy trigger needed. Wait 60 seconds for the deploy to propagate, then proceed directly to canary verification in Step 7.
462
+
463
+ ### Strategy D: Custom deploy hooks
464
+
465
+ If CLAUDE.md has a custom deploy status command in the "Custom deploy hooks" section, run that command and check its exit code.
466
+
467
+ ### Common: Timing and failure handling
468
+
469
+ Record deploy start time. Show progress every 2 minutes: "Deploy in progress... (Xm elapsed)"
470
+
471
+ If deploy succeeds (`conclusion` is `success` or health check passes): record deploy duration, continue to Step 7.
472
+
473
+ If deploy fails (`conclusion` is `failure`): use AskUserQuestion:
474
+ - **Context:** Deploy workflow failed after merging PR.
475
+ - **RECOMMENDATION:** Choose A to investigate before reverting.
476
+ - A) Investigate the deploy logs
477
+ - B) Create a revert commit on the base branch
478
+ - C) Continue anyway — the deploy failure might be unrelated
479
+
480
+ If timeout (20 min): warn "Deploy has been running for 20 minutes" and ask whether to continue waiting or skip verification.
481
+
482
+ ---
483
+
484
+ ## Step 7: Canary verification (conditional depth)
485
+
486
+ Use the diff-scope classification from Step 5 to determine canary depth:
487
+
488
+ | Diff Scope | Canary Depth |
489
+ |------------|-------------|
490
+ | SCOPE_DOCS only | Already skipped in Step 5 |
491
+ | SCOPE_CONFIG only | Smoke: `$B goto` + verify 200 status |
492
+ | SCOPE_BACKEND only | Console errors + perf check |
493
+ | SCOPE_FRONTEND (any) | Full: console + perf + screenshot |
494
+ | Mixed scopes | Full canary |
495
+
496
+ **Full canary sequence:**
497
+
498
+ ```bash
499
+ $B goto <url>
500
+ ```
501
+
502
+ Check that the page loaded successfully (200, not an error page).
503
+
504
+ ```bash
505
+ $B console --errors
506
+ ```
507
+
508
+ Check for critical console errors: lines containing `Error`, `Uncaught`, `Failed to load`, `TypeError`, `ReferenceError`. Ignore warnings.
509
+
510
+ ```bash
511
+ $B perf
512
+ ```
513
+
514
+ Check that page load time is under 10 seconds.
515
+
516
+ ```bash
517
+ $B text
518
+ ```
519
+
520
+ Verify the page has content (not blank, not a generic error page).
521
+
522
+ ```bash
523
+ $B snapshot -i -a -o ".orch/deploy-reports/post-deploy.png"
524
+ ```
525
+
526
+ Take an annotated screenshot as evidence.
527
+
528
+ **Health assessment:**
529
+ - Page loads successfully with 200 status → PASS
530
+ - No critical console errors → PASS
531
+ - Page has real content (not blank or error screen) → PASS
532
+ - Loads in under 10 seconds → PASS
533
+
534
+ If all pass: mark as HEALTHY, continue to Step 9.
535
+
536
+ If any fail: show the evidence (screenshot path, console errors, perf numbers). Use AskUserQuestion:
537
+ - **Context:** Post-deploy canary detected issues on the production site.
538
+ - **RECOMMENDATION:** Choose based on severity — B for critical (site down), A for minor (console errors).
539
+ - A) Expected (deploy in progress, cache clearing) — mark as healthy
540
+ - B) Broken — create a revert commit
541
+ - C) Investigate further (open the site, look at logs)
542
+
543
+ ---
544
+
545
+ ## Step 8: Revert (if needed)
546
+
547
+ If the user chose to revert at any point:
548
+
549
+ ```bash
550
+ git fetch origin <base>
551
+ git checkout <base>
552
+ git revert <merge-commit-sha> --no-edit
553
+ git push origin <base>
554
+ ```
555
+
556
+ If the revert has conflicts: warn "Revert has conflicts — manual resolution needed. The merge commit SHA is `<sha>`. You can run `git revert <sha>` manually."
557
+
558
+ If the base branch has push protections: warn "Branch protections may prevent direct push — create a revert PR instead: `gh pr create --title 'revert: <original PR title>'`"
559
+
560
+ After a successful revert, note the revert commit SHA and continue to Step 9 with status REVERTED.
561
+
562
+ ---
563
+
564
+ ## Step 9: Deploy report
565
+
566
+ Create the deploy report directory:
567
+
568
+ ```bash
569
+ mkdir -p .orch/deploy-reports
570
+ ```
571
+
572
+ Produce and display the ASCII summary:
573
+
574
+ ```
575
+ LAND & DEPLOY REPORT
576
+ ═════════════════════
577
+ PR: #<number> — <title>
578
+ Branch: <head-branch> → <base-branch>
579
+ Merged: <timestamp> (<merge method>)
580
+ Merge SHA: <sha>
581
+
582
+ Timing:
583
+ CI wait: <duration>
584
+ Queue: <duration or "direct merge">
585
+ Deploy: <duration or "no workflow detected">
586
+ Canary: <duration or "skipped">
587
+ Total: <end-to-end duration>
588
+
589
+ CI: <PASSED / SKIPPED>
590
+ Deploy: <PASSED / FAILED / NO WORKFLOW>
591
+ Verification: <HEALTHY / DEGRADED / SKIPPED / REVERTED>
592
+ Scope: <FRONTEND / BACKEND / CONFIG / DOCS / MIXED>
593
+ Console: <N errors or "clean">
594
+ Load time: <Xs>
595
+ Screenshot: <path or "none">
596
+
597
+ VERDICT: <DEPLOYED AND VERIFIED / DEPLOYED (UNVERIFIED) / REVERTED>
598
+ ```
599
+
600
+ Save report to `.orch/deploy-reports/{date}-pr{number}-deploy.md`.
601
+
602
+ Log to the review dashboard:
603
+
604
+ ```bash
605
+ # Project slug detection (adapt to your project structure)
606
+ mkdir -p .orch/reports
607
+ ```
608
+
609
+ Write a JSONL entry with timing data:
610
+ ```json
611
+ {"skill":"land-and-deploy","timestamp":"<ISO>","status":"<SUCCESS/REVERTED>","pr":<number>,"merge_sha":"<sha>","deploy_status":"<HEALTHY/DEGRADED/SKIPPED>","ci_wait_s":<N>,"queue_s":<N>,"deploy_s":<N>,"canary_s":<N>,"total_s":<N>}
612
+ ```
613
+
614
+ ---
615
+
616
+ ## Step 10: Suggest follow-ups
617
+
618
+ After the deploy report, suggest relevant follow-ups:
619
+
620
+ - If a production URL was verified: "Run `/canary <url> --duration 10m` for extended monitoring."
621
+ - If performance data was collected: "Run `/benchmark <url>` for a deep performance audit."
622
+ - "Run `/document-release` to update project documentation."
623
+
624
+ ---
625
+
626
+ ## Important Rules
627
+
628
+ - **Never force push.** Use `gh pr merge` which is safe.
629
+ - **Never skip CI.** If checks are failing, stop.
630
+ - **Auto-detect everything.** PR number, merge method, deploy strategy, project type. Only ask when information genuinely can't be inferred.
631
+ - **Poll with backoff.** Don't hammer GitHub API. 30-second intervals for CI/deploy, with reasonable timeouts.
632
+ - **Revert is always an option.** At every failure point, offer revert as an escape hatch.
633
+ - **Single-pass verification, not continuous monitoring.** `/land-and-deploy` checks once. `/canary` does the extended monitoring loop.
634
+ - **Clean up.** Delete the feature branch after merge (via `--delete-branch`).
635
+ - **The goal is: user says `/land-and-deploy`, next thing they see is the deploy report.**
636
+