renn-studio 0.6.0

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 (112) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +36 -0
  3. package/agents/renn-architect.md +1463 -0
  4. package/agents/renn-auditor.md +1053 -0
  5. package/agents/renn-codebase-mapper.md +908 -0
  6. package/agents/renn-design-reviewer.md +422 -0
  7. package/agents/renn-designer.md +814 -0
  8. package/agents/renn-detective.md +1204 -0
  9. package/agents/renn-integration-checker.md +957 -0
  10. package/agents/renn-navigator.md +659 -0
  11. package/agents/renn-plan-reviewer.md +812 -0
  12. package/agents/renn-project-scout.md +880 -0
  13. package/agents/renn-runner.md +842 -0
  14. package/agents/renn-stage-scout.md +705 -0
  15. package/agents/renn-synthesizer.md +256 -0
  16. package/bin/install.js +1466 -0
  17. package/commands/renn.add-stage.md +211 -0
  18. package/commands/renn.add-todo.md +194 -0
  19. package/commands/renn.audit-milestone.md +280 -0
  20. package/commands/renn.audit.md +219 -0
  21. package/commands/renn.check-todos.md +229 -0
  22. package/commands/renn.complete-milestone.md +136 -0
  23. package/commands/renn.continue.md +46 -0
  24. package/commands/renn.dash.md +308 -0
  25. package/commands/renn.debug.md +169 -0
  26. package/commands/renn.design-screens.md +107 -0
  27. package/commands/renn.design-system.md +100 -0
  28. package/commands/renn.discuss-stage.md +86 -0
  29. package/commands/renn.help.md +550 -0
  30. package/commands/renn.insert-stage.md +231 -0
  31. package/commands/renn.list-stage-assumptions.md +49 -0
  32. package/commands/renn.map-codebase.md +72 -0
  33. package/commands/renn.new-milestone.md +80 -0
  34. package/commands/renn.pause.md +132 -0
  35. package/commands/renn.plan-milestone-gaps.md +314 -0
  36. package/commands/renn.plan-stage.md +118 -0
  37. package/commands/renn.remove-stage.md +353 -0
  38. package/commands/renn.research-stage.md +200 -0
  39. package/commands/renn.restyle.md +98 -0
  40. package/commands/renn.run-stage.md +343 -0
  41. package/commands/renn.set-profile.md +116 -0
  42. package/commands/renn.settings.md +151 -0
  43. package/commands/renn.ship.md +52 -0
  44. package/commands/renn.start.md +95 -0
  45. package/commands/renn.status.md +530 -0
  46. package/commands/renn.watch.md +51 -0
  47. package/hooks/dist/renn-check-update.js +67 -0
  48. package/hooks/dist/renn-statusline.js +96 -0
  49. package/package.json +89 -0
  50. package/renn/references/continuation-format.md +249 -0
  51. package/renn/references/design-artifacts.md +674 -0
  52. package/renn/references/design-tokens.md +162 -0
  53. package/renn/references/gates.md +1078 -0
  54. package/renn/references/git-integration.md +254 -0
  55. package/renn/references/horsepower-profiles.md +84 -0
  56. package/renn/references/planning-config.md +189 -0
  57. package/renn/references/questioning.md +141 -0
  58. package/renn/references/security-checklist.md +2184 -0
  59. package/renn/references/tdd.md +263 -0
  60. package/renn/references/ui-brand.md +189 -0
  61. package/renn/references/verification-patterns.md +612 -0
  62. package/renn/templates/DEBUG.md +159 -0
  63. package/renn/templates/INTEL.md +283 -0
  64. package/renn/templates/RECAP.md +246 -0
  65. package/renn/templates/UAT.md +247 -0
  66. package/renn/templates/architect-prompt.md +119 -0
  67. package/renn/templates/brief.md +190 -0
  68. package/renn/templates/codebase/architecture.md +264 -0
  69. package/renn/templates/codebase/concerns.md +310 -0
  70. package/renn/templates/codebase/conventions.md +307 -0
  71. package/renn/templates/codebase/design.md +336 -0
  72. package/renn/templates/codebase/integrations.md +280 -0
  73. package/renn/templates/codebase/stack.md +186 -0
  74. package/renn/templates/codebase/structure.md +295 -0
  75. package/renn/templates/codebase/testing.md +480 -0
  76. package/renn/templates/config.json +36 -0
  77. package/renn/templates/continue-here.md +80 -0
  78. package/renn/templates/detective-prompt.md +93 -0
  79. package/renn/templates/milestone-archive.md +123 -0
  80. package/renn/templates/milestone.md +117 -0
  81. package/renn/templates/proof.md +326 -0
  82. package/renn/templates/pulse.md +176 -0
  83. package/renn/templates/research/architecture.md +206 -0
  84. package/renn/templates/research/features.md +149 -0
  85. package/renn/templates/research/pitfalls.md +202 -0
  86. package/renn/templates/research/recap.md +187 -0
  87. package/renn/templates/research/stack.md +122 -0
  88. package/renn/templates/research/ux.md +283 -0
  89. package/renn/templates/research-lite.md +146 -0
  90. package/renn/templates/research.md +582 -0
  91. package/renn/templates/specs.md +233 -0
  92. package/renn/templates/stage-prompt.md +571 -0
  93. package/renn/templates/track.md +211 -0
  94. package/renn/templates/user-setup.md +315 -0
  95. package/renn/workflows/audit-stage.md +717 -0
  96. package/renn/workflows/audit-work.md +596 -0
  97. package/renn/workflows/complete-milestone.md +875 -0
  98. package/renn/workflows/continue-project.md +306 -0
  99. package/renn/workflows/design-stage.md +2019 -0
  100. package/renn/workflows/diagnose-issues.md +231 -0
  101. package/renn/workflows/initialize-project.md +1039 -0
  102. package/renn/workflows/list-assumptions.md +178 -0
  103. package/renn/workflows/map-codebase.md +374 -0
  104. package/renn/workflows/new-milestone.md +718 -0
  105. package/renn/workflows/plan-stage.md +810 -0
  106. package/renn/workflows/research-stage.md +289 -0
  107. package/renn/workflows/run-plan.md +1844 -0
  108. package/renn/workflows/run-stage.md +692 -0
  109. package/renn/workflows/scope-stage.md +546 -0
  110. package/renn/workflows/ship-project.md +859 -0
  111. package/renn/workflows/transition.md +556 -0
  112. package/renn/workflows/watch-project.md +797 -0
@@ -0,0 +1,859 @@
1
+ <purpose>
2
+ Ship the project to a deployment target in 3 phases:
3
+
4
+ 1. **ASK** -- Present project summary, detect stack, suggest platforms, user declares target
5
+ 2. **RESEARCH & PLAN** -- Investigate target requirements, generate deployment checklist
6
+ 3. **WALK CHECKLIST** -- Execute auto items, gate on human items, track progress
7
+
8
+ All three phases are fully implemented.
9
+ </purpose>
10
+
11
+ <core_principle>
12
+ Smart defaults, user decides. Detect the stack automatically, suggest the best-fit platforms, but the user always declares the final target. Persist the declaration so future phases can act on it without re-asking.
13
+ </core_principle>
14
+
15
+ <process>
16
+
17
+ <step name="detect_existing_ship" priority="first">
18
+
19
+ Check for existing ship artifacts from a previous run:
20
+
21
+ ```bash
22
+ [ -f .renn/ship-plan.md ] && echo "EXISTING_PLAN" || echo "NO_PLAN"
23
+ [ -f .renn/ship-target.md ] && echo "EXISTING_TARGET" || echo "NO_TARGET"
24
+ ```
25
+
26
+ **Case 1: `.renn/ship-plan.md` exists (plan already generated)**
27
+
28
+ Read the file to extract the previous target and status:
29
+
30
+ ```bash
31
+ head -20 .renn/ship-plan.md
32
+ cat .renn/ship-target.md 2>/dev/null
33
+ STATUS=$(grep -m1 '^\*\*Status:\*\*' .renn/ship-target.md 2>/dev/null | sed 's/\*\*Status:\*\* //')
34
+ ```
35
+
36
+ Present options using AskUserQuestion:
37
+ - header: "Existing Ship Plan"
38
+ - question: "Found an existing ship plan for [previous target]. What would you like to do?"
39
+ - options:
40
+ - "Resume" (description: "Continue where you left off")
41
+ - "Restart" (description: "Start fresh for the same target")
42
+ - "Different target" (description: "Ship somewhere else")
43
+
44
+ **If "Resume":** Skip to `phase_3_walk_checklist`. The plan already exists, so Phase 1 and Phase 2 are complete. Phase 3 walks the checklist.
45
+
46
+ **If "Restart":** Delete both files and continue to phase_1_ask:
47
+
48
+ ```bash
49
+ rm -f .renn/ship-plan.md .renn/ship-target.md .renn/ship-research.md
50
+ ```
51
+
52
+ **If "Different target":** Delete both files and continue to phase_1_ask:
53
+
54
+ ```bash
55
+ rm -f .renn/ship-plan.md .renn/ship-target.md .renn/ship-research.md
56
+ ```
57
+
58
+ **Case 2: `.renn/ship-target.md` exists but `.renn/ship-plan.md` does NOT (Phase 1 done, Phase 2 pending)**
59
+
60
+ ```bash
61
+ # Target declared but plan not yet generated
62
+ if [ ! -f .renn/ship-plan.md ] && [ -f .renn/ship-target.md ]; then
63
+ echo "TARGET_ONLY"
64
+ fi
65
+ ```
66
+
67
+ If TARGET_ONLY: Display "Found existing target declaration. Continuing to research and plan generation..." and skip directly to `phase_2_research_plan`.
68
+
69
+ **Case 3: Neither file exists**
70
+
71
+ Continue to `phase_1_ask`.
72
+
73
+ </step>
74
+
75
+ <step name="phase_1_ask">
76
+
77
+ Phase 1 has 6 sub-steps: extract project summary, detect stack, map stack to platforms, present summary and suggestions, persist target, display completion message.
78
+
79
+ ---
80
+
81
+ **Sub-step 2a: Extract project summary from brief.md**
82
+
83
+ Read `.renn/brief.md` and extract:
84
+
85
+ ```bash
86
+ # Project name from first heading
87
+ PROJECT_NAME=$(head -1 .renn/brief.md 2>/dev/null | sed 's/^# //')
88
+
89
+ # Platform from Context section
90
+ PLATFORM=$(grep -m1 '^\*\*Platform:\*\*' .renn/brief.md 2>/dev/null | sed 's/\*\*Platform:\*\* //')
91
+ ```
92
+
93
+ Also extract from brief.md by reading these sections:
94
+ - `## What This Is` -- 2-3 sentence project description
95
+ - `## Core Value` -- one-liner priority statement
96
+ - `## Requirements > ### Active` -- what is currently being built
97
+
98
+ If brief.md does not exist, inform the user and stop:
99
+
100
+ ```
101
+ No .renn/brief.md found. Run /renn.init first to set up your project.
102
+ ```
103
+
104
+ ---
105
+
106
+ **Sub-step 2b: Stack detection (5 layers)**
107
+
108
+ Detect the project's technology stack using 5 layers in priority order:
109
+
110
+ **Layer 1: brief.md Platform field**
111
+
112
+ Already extracted above as `$PLATFORM`. Values like: web, mobile-ios, cli, api, desktop, etc.
113
+
114
+ **Layer 2: `.renn/codebase/STACK.md` (if exists)**
115
+
116
+ ```bash
117
+ cat .renn/codebase/STACK.md 2>/dev/null | head -50
118
+ ```
119
+
120
+ If present, this contains a full stack analysis from the codebase mapper. Extract framework names, language, and runtime information.
121
+
122
+ **Layer 3: `.renn/research/stack.md` (if exists)**
123
+
124
+ ```bash
125
+ cat .renn/research/stack.md 2>/dev/null | head -50
126
+ ```
127
+
128
+ If present, this contains stack recommendations from project research.
129
+
130
+ **Layer 4: Manifest file detection**
131
+
132
+ Check for language-specific manifest files:
133
+
134
+ ```bash
135
+ [ -f package.json ] && echo "node"
136
+ [ -f requirements.txt ] || [ -f pyproject.toml ] && echo "python"
137
+ [ -f Cargo.toml ] && echo "rust"
138
+ [ -f go.mod ] && echo "go"
139
+ [ -f Package.swift ] && echo "swift"
140
+ [ -f Gemfile ] && echo "ruby"
141
+ ```
142
+
143
+ **Layer 5: Framework-specific detection and existing platform config**
144
+
145
+ Detect frameworks from manifest contents:
146
+
147
+ ```bash
148
+ # Node.js frameworks (from package.json dependencies)
149
+ grep -q '"next"' package.json 2>/dev/null && echo "nextjs"
150
+ grep -q '"react"' package.json 2>/dev/null && echo "react"
151
+ grep -q '"vue"' package.json 2>/dev/null && echo "vue"
152
+ grep -q '"nuxt"' package.json 2>/dev/null && echo "nuxt"
153
+ grep -q '"svelte"' package.json 2>/dev/null && echo "svelte"
154
+ grep -q '"express"' package.json 2>/dev/null && echo "express"
155
+ grep -q '"fastify"' package.json 2>/dev/null && echo "fastify"
156
+ grep -q '"hono"' package.json 2>/dev/null && echo "hono"
157
+
158
+ # Python frameworks (from requirements.txt or pyproject.toml)
159
+ grep -qi 'django' requirements.txt 2>/dev/null && echo "django"
160
+ grep -qi 'flask' requirements.txt 2>/dev/null && echo "flask"
161
+ grep -qi 'fastapi' requirements.txt 2>/dev/null && echo "fastapi"
162
+ ```
163
+
164
+ Detect existing platform configuration:
165
+
166
+ ```bash
167
+ [ -f vercel.json ] && echo "vercel-configured"
168
+ [ -f netlify.toml ] && echo "netlify-configured"
169
+ [ -f fly.toml ] && echo "fly-configured"
170
+ [ -f render.yaml ] && echo "render-configured"
171
+ [ -f railway.json ] && echo "railway-configured"
172
+ [ -f Dockerfile ] && echo "docker"
173
+ [ -f docker-compose.yml ] || [ -f docker-compose.yaml ] && echo "docker-compose"
174
+ ```
175
+
176
+ Check if npm-publishable:
177
+
178
+ ```bash
179
+ # npm-publishable if package.json exists AND "private": true is NOT present
180
+ if [ -f package.json ]; then
181
+ grep -q '"private": true' package.json || echo "npm-publishable"
182
+ fi
183
+ ```
184
+
185
+ Combine all layers into a comma-separated detected stack string for display and mapping.
186
+
187
+ ---
188
+
189
+ **Sub-step 2c: Map detected stack to suggested platforms**
190
+
191
+ Use the detected stack to determine platform suggestions. If an existing platform config was detected (vercel.json, netlify.toml, etc.), that platform becomes the primary suggestion.
192
+
193
+ Otherwise, use this mapping table:
194
+
195
+ | Detected Stack | Primary | Secondary | Tertiary |
196
+ |----------------|---------|-----------|----------|
197
+ | Next.js | Vercel | Netlify | AWS Amplify |
198
+ | React (CRA/Vite) | Vercel | Netlify | Cloudflare Pages |
199
+ | Vue/Nuxt | Vercel | Netlify | Cloudflare Pages |
200
+ | Svelte/SvelteKit | Vercel | Netlify | Cloudflare Pages |
201
+ | Express/Fastify/Node API | Railway | Render | Fly.io |
202
+ | Python (Django/Flask/FastAPI) | Railway | Render | Fly.io |
203
+ | Rust (Actix/Axum) | Fly.io | Docker | AWS |
204
+ | Go (net/http/Gin/Echo) | Fly.io | Docker | Railway |
205
+ | npm package/library | npm registry | GitHub Packages | -- |
206
+ | CLI tool (Node) | npm registry | Homebrew | -- |
207
+ | CLI tool (Rust) | crates.io | Homebrew | GitHub Releases |
208
+ | CLI tool (Go) | GitHub Releases | Homebrew | -- |
209
+ | Static site | GitHub Pages | Netlify | Cloudflare Pages |
210
+ | Mobile (iOS) | TestFlight | App Store | -- |
211
+ | Mobile (Android) | Google Play | Firebase App Distribution | -- |
212
+ | Docker-configured | Fly.io | Railway | AWS ECS |
213
+
214
+ When multiple stacks are detected (e.g., Next.js + npm-publishable), pick the primary platform for the dominant stack and include npm registry as an additional option.
215
+
216
+ ---
217
+
218
+ **Sub-step 2d: Present project summary and platform suggestions**
219
+
220
+ Display the project summary and suggestions:
221
+
222
+ ```
223
+ ## Your Project
224
+
225
+ **[Project Name]**
226
+ [What This Is description from brief.md]
227
+
228
+ **Stack:** [detected frameworks/languages, comma-separated]
229
+ **Platform:** [from brief.md or detected]
230
+
231
+ ---
232
+
233
+ Based on your stack, here are recommended shipping targets:
234
+ ```
235
+
236
+ Then use AskUserQuestion to let the user choose:
237
+
238
+ - header: "Shipping Target"
239
+ - question: "Where do you want to ship [Project Name]?"
240
+ - options:
241
+ - "[Primary suggestion]" (description: "Best match for your [detected stack] stack")
242
+ - "[Secondary suggestion]" (description: "Also works well with [detected stack]")
243
+ - "[Tertiary suggestion]" (description: "Alternative option")
244
+ - "Other" (description: "Tell me where you want to ship")
245
+
246
+ If the user selects "Other", ask a follow-up question:
247
+
248
+ - header: "Custom Target"
249
+ - question: "What platform or service do you want to ship to?"
250
+
251
+ Use the response as the chosen target.
252
+
253
+ ---
254
+
255
+ **Sub-step 2e: Persist the declared target**
256
+
257
+ Write the chosen target to `.renn/ship-target.md`:
258
+
259
+ ```markdown
260
+ # Ship Target
261
+
262
+ **Target:** [chosen platform]
263
+ **Declared:** [YYYY-MM-DD]
264
+ **Stack detected:** [comma-separated detected stack]
265
+ **Status:** awaiting-plan
266
+ ```
267
+
268
+ This file is small and intentional. It exists so Phase 2 can read the target without re-asking the user.
269
+
270
+ Do NOT create `.renn/ship-plan.md` -- that is Phase 2's responsibility.
271
+
272
+ ---
273
+
274
+ **Sub-step 2f: Display Phase 1 completion message**
275
+
276
+ ```
277
+ Target declared: [chosen platform]
278
+
279
+ Continuing to Phase 2 (Research & Plan)...
280
+ ```
281
+
282
+ </step>
283
+
284
+ <step name="phase_2_research_plan">
285
+
286
+ Phase 2 reads the declared target, researches deployment requirements via renn-stage-scout, and generates a deployment checklist.
287
+
288
+ ---
289
+
290
+ **Sub-step 2a: Read target and validate**
291
+
292
+ Read `.renn/ship-target.md` to extract target, stack, and status:
293
+
294
+ ```bash
295
+ TARGET=$(grep -m1 '^\*\*Target:\*\*' .renn/ship-target.md | sed 's/\*\*Target:\*\* //')
296
+ STACK=$(grep -m1 '^\*\*Stack detected:\*\*' .renn/ship-target.md | sed 's/\*\*Stack detected:\*\* //')
297
+ STATUS=$(grep -m1 '^\*\*Status:\*\*' .renn/ship-target.md | sed 's/\*\*Status:\*\* //')
298
+ ```
299
+
300
+ **Status routing:**
301
+
302
+ - **If STATUS is `plan-ready`:** `.renn/ship-plan.md` already exists. Skip Phase 2 entirely and continue to Phase 3.
303
+ - **If STATUS is not `awaiting-plan` and not `plan-ready`:** Warn "Unexpected status '{STATUS}' in ship-target.md, continuing anyway." and proceed.
304
+ - **If TARGET is empty:** Error "No target found in ship-target.md. Run /renn.ship again to declare a target." and stop execution.
305
+
306
+ ---
307
+
308
+ **Sub-step 2b: Gather context for research prompt**
309
+
310
+ ```bash
311
+ PROJECT_NAME=$(head -1 .renn/brief.md 2>/dev/null | sed 's/^# //')
312
+ WHAT_THIS_IS=$(sed -n '/## What This Is/,/^##/p' .renn/brief.md 2>/dev/null | head -5 | tail -4)
313
+ PLATFORM_TYPE=$(grep -m1 '^\*\*Platform:\*\*' .renn/brief.md 2>/dev/null | sed 's/\*\*Platform:\*\* //')
314
+ MODEL_PROFILE=$(cat .renn/config.json 2>/dev/null | grep -o '"horsepower"[[:space:]]*:[[:space:]]*"[^"]*"' | grep -o '"[^"]*"$' | tr -d '"' || echo "balanced")
315
+ ```
316
+
317
+ Resolve scout model from horsepower profile:
318
+
319
+ | horsepower | scout model |
320
+ |------------|-------------|
321
+ | max | opus |
322
+ | balanced | sonnet |
323
+ | eco | haiku |
324
+
325
+ ---
326
+
327
+ **Sub-step 2c: Spawn renn-stage-scout**
328
+
329
+ Construct a shipping-specific research prompt with XML sections:
330
+
331
+ ```markdown
332
+ <objective>
333
+ Research how to deploy a {stack} project to {target}.
334
+
335
+ Answer: "What are the exact steps to ship this project to {target}?"
336
+ </objective>
337
+
338
+ <project_context>
339
+ **Project:** {project_name}
340
+ **Description:** {what_this_is}
341
+ **Stack:** {stack}
342
+ **Target:** {target}
343
+ **Platform type:** {platform_type}
344
+ </project_context>
345
+
346
+ <research_focus>
347
+ Research the following for deploying to {target}:
348
+
349
+ 1. **Prerequisites** -- CLI tools needed, account requirements, authentication steps
350
+ 2. **Project configuration** -- Config files needed, build settings, framework-specific adapters
351
+ 3. **Environment variables** -- What secrets and config values the platform requires
352
+ 4. **Build and deploy** -- Exact CLI commands for build, deploy, and promote to production
353
+ 5. **DNS/Domain** -- Custom domain configuration (if applicable, otherwise skip)
354
+ 6. **Post-deploy verification** -- How to programmatically and visually confirm deployment succeeded
355
+ 7. **Common gotchas** -- Platform-specific pitfalls for {stack} projects
356
+
357
+ For every step, note whether it can be done via CLI/API or requires human action (browser-required, credential retrieval, etc.). Prefer CLI commands over dashboard instructions.
358
+ </research_focus>
359
+
360
+ <output>
361
+ Write findings to: .renn/ship-research.md
362
+
363
+ Structure as numbered deployment steps with:
364
+ - Step name and description
365
+ - CLI command (if automatable) or human instruction (if not)
366
+ - Verification method
367
+ - Common failure modes
368
+ </output>
369
+ ```
370
+
371
+ Spawn the scout:
372
+
373
+ ```
374
+ Task(
375
+ prompt=research_prompt,
376
+ subagent_type="renn-stage-scout",
377
+ model="{scout_model}",
378
+ description="Research shipping to {target}"
379
+ )
380
+ ```
381
+
382
+ ---
383
+
384
+ **Sub-step 2d: Handle scout return**
385
+
386
+ **If scout returns `## RESEARCH COMPLETE`:**
387
+
388
+ Display: "Research complete. Converting to deployment checklist..."
389
+
390
+ Continue to checklist conversion below.
391
+
392
+ **If scout returns `## RESEARCH BLOCKED`:**
393
+
394
+ Display the blocker message from the scout's return. Then offer recovery options using AskUserQuestion:
395
+
396
+ - header: "Research Blocked"
397
+ - question: "The scout could not complete research for {target}. How would you like to proceed?"
398
+ - options:
399
+ - "Retry research" (description: "Spawn the scout again with the same prompt")
400
+ - "Enter plan manually" (description: "Create .renn/ship-plan.md yourself and resume")
401
+ - "Abort" (description: "Stop the ship workflow")
402
+
403
+ **If "Retry research":** Return to sub-step 2c and spawn the scout again.
404
+
405
+ **If "Enter plan manually":** Display instructions for the expected ship-plan.md format, then stop. User creates the file and runs /renn.ship again (detect_existing_ship will find it).
406
+
407
+ **If "Abort":** Stop the workflow with message "Ship workflow aborted. Run /renn.ship to start again."
408
+
409
+ ---
410
+
411
+ **Sub-step 2e: Convert research to checklist**
412
+
413
+ Read `.renn/ship-research.md` and convert the scout's deployment research into a numbered, classified checklist. This is deterministic workflow logic performed by the orchestrator (Claude running the workflow), not another agent spawn.
414
+
415
+ **Auto/gate classification table:**
416
+
417
+ | Step Type | Tag | Rationale |
418
+ |-----------|-----|-----------|
419
+ | CLI command execution | `[auto]` | Claude can run any CLI command |
420
+ | File creation/modification | `[auto]` | Claude has Write/Edit tools |
421
+ | Package installation | `[auto]` | Claude runs npm/pip/etc. |
422
+ | Build commands | `[auto]` | Claude runs build tools |
423
+ | Git operations | `[auto]` | Claude runs git commands |
424
+ | CLI tool installation | `[auto]` | Claude can install most CLIs |
425
+ | Account creation/signup | `[gate]` | Requires browser, human identity |
426
+ | Authentication/login (browser-based) | `[gate]` | Browser-based OAuth, credential entry |
427
+ | Secret/API key provisioning | `[gate]` | User must retrieve from dashboard |
428
+ | DNS configuration | `[gate]` | Domain registrar, propagation wait |
429
+ | Payment/billing setup | `[gate]` | Credit card, 3D Secure |
430
+ | Visual deployment verification | `[gate]` | Human judges if it looks right |
431
+ | App store submission | `[gate]` | Manual review process |
432
+ | Email/SMS verification | `[gate]` | Requires human to click link |
433
+
434
+ **Key rule (PLN-03):** When a step can be done EITHER via dashboard OR via CLI, classify as `[auto]` and use the CLI approach. Only classify as `[gate]` when NO CLI/API alternative exists.
435
+
436
+ **Conversion process:**
437
+
438
+ 1. Read `.renn/ship-research.md`
439
+ 2. Parse deployment steps from the research
440
+ 3. Classify each step as `[auto]` or `[gate]` using the table above
441
+ 4. Number sequentially across all sections
442
+ 5. Group into logical sections: Prerequisites, Configuration, Deploy, Verify
443
+ 6. For gate items, add an `Instructions:` sub-bullet with human-facing text explaining what the user must do
444
+ 7. Target 8-15 total checklist items. Group related micro-steps into single items. Each item should be one logical action.
445
+
446
+ Write `.renn/ship-plan.md` with this format:
447
+
448
+ ```markdown
449
+ # Ship Plan
450
+
451
+ **Project:** {PROJECT_NAME}
452
+ **Target:** {TARGET}
453
+ **Stack:** {STACK}
454
+ **Created:** {YYYY-MM-DD}
455
+ **Status:** ready
456
+
457
+ ## Prerequisites
458
+
459
+ - [ ] 1. [auto/gate] {step description}
460
+
461
+ ## Configuration
462
+
463
+ - [ ] N. [auto/gate] {step description}
464
+
465
+ ## Deploy
466
+
467
+ - [ ] N. [auto/gate] {step description}
468
+
469
+ ## Verify
470
+
471
+ - [ ] N. [gate] {step description}
472
+ - Instructions: {what the user needs to verify}
473
+
474
+ ---
475
+ *Generated by /renn.ship Phase 2*
476
+ *Research source: renn-stage-scout*
477
+ ```
478
+
479
+ Gate items always include the `Instructions:` sub-bullet. Auto items do not need it (Claude will execute them directly).
480
+
481
+ ---
482
+
483
+ **Sub-step 2f: Update status and display completion**
484
+
485
+ Update ship-target.md status:
486
+
487
+ ```bash
488
+ sed -i 's/^\*\*Status:\*\* awaiting-plan/\*\*Status:\*\* plan-ready/' .renn/ship-target.md
489
+ ```
490
+
491
+ Count auto and gate items:
492
+
493
+ ```bash
494
+ AUTO_COUNT=$(grep -c '\[auto\]' .renn/ship-plan.md)
495
+ GATE_COUNT=$(grep -c '\[gate\]' .renn/ship-plan.md)
496
+ TOTAL=$((AUTO_COUNT + GATE_COUNT))
497
+ ```
498
+
499
+ Display completion message:
500
+
501
+ ```
502
+ Plan generated: .renn/ship-plan.md
503
+ {TOTAL} total steps ({AUTO_COUNT} auto, {GATE_COUNT} gate)
504
+ ```
505
+
506
+ Display: "Continuing to Phase 3..."
507
+
508
+ Then proceed to `phase_3_walk_checklist`.
509
+
510
+ </step>
511
+
512
+ <step name="phase_3_walk_checklist">
513
+
514
+ Phase 3 walks the deployment checklist item by item -- executing auto items, presenting gate items for user action, and tracking progress with checkboxes and timestamps.
515
+
516
+ This phase MUST execute in the main context (NOT a Task() subagent) because it uses AskUserQuestion for gate presentation.
517
+
518
+ ---
519
+
520
+ **Sub-step 3a: Initialize execution**
521
+
522
+ Read ship-plan.md and prepare for execution:
523
+
524
+ ```bash
525
+ # Verify plan exists and read metadata
526
+ TARGET=$(grep -m1 '^\*\*Target:\*\*' .renn/ship-plan.md | sed 's/\*\*Target:\*\* //')
527
+ STATUS=$(grep -m1 '^\*\*Status:\*\*' .renn/ship-plan.md | sed 's/\*\*Status:\*\* //')
528
+
529
+ # Read project name for display
530
+ PROJECT_NAME=$(head -1 .renn/brief.md 2>/dev/null | sed 's/^# //')
531
+
532
+ # Count items
533
+ TOTAL=$(grep -c '^\- \[.\] [0-9]' .renn/ship-plan.md)
534
+ COMPLETED=$(grep -c '^\- \[x\] [0-9]' .renn/ship-plan.md)
535
+ REMAINING=$((TOTAL - COMPLETED))
536
+ ```
537
+
538
+ **If STATUS contains `paused-at`:**
539
+ Display: "Resuming from where you left off ({COMPLETED}/{TOTAL} complete)..."
540
+
541
+ **If REMAINING is 0:**
542
+ Display: "All items already complete!" and skip to sub-step 3g (completion summary).
543
+
544
+ Update status to in-progress:
545
+
546
+ ```bash
547
+ sed -i 's/^\*\*Status:\*\* .*/\*\*Status:\*\* in-progress/' .renn/ship-plan.md
548
+ ```
549
+
550
+ Display execution header:
551
+
552
+ ```
553
+ ## Shipping to {TARGET}
554
+
555
+ {COMPLETED}/{TOTAL} steps complete, {REMAINING} remaining.
556
+ Starting execution...
557
+ ```
558
+
559
+ ---
560
+
561
+ **Sub-step 3b: Walk checklist items**
562
+
563
+ For each unchecked item in ship-plan.md (in order):
564
+
565
+ ```bash
566
+ # Extract unchecked items from ship-plan.md
567
+ grep -n '^\- \[ \] [0-9]' .renn/ship-plan.md
568
+ ```
569
+
570
+ Read each item line to extract:
571
+ - Item number (N)
572
+ - Type tag (`[auto]` or `[gate]`)
573
+ - Description (text after the tag)
574
+ - For gate items: Instructions sub-bullet (next line starting with ` - Instructions:`)
575
+
576
+ **If `[auto]`:**
577
+
578
+ 1. Display: "Step {N}: {description}"
579
+ 2. Interpret the description and execute the appropriate CLI commands or file operations
580
+ - Do NOT hardcode platform-specific execution logic -- Claude interprets auto item descriptions at runtime
581
+ - Show concise output for successful execution
582
+ 3. If execution succeeds:
583
+ - Display: "Step {N} complete"
584
+ - Update checkbox and timestamp in ship-plan.md using sed:
585
+ ```bash
586
+ TIMESTAMP=$(date +%H:%M)
587
+ sed -i "s/^- \[ \] ${ITEM_NUM}\./- [x] ${ITEM_NUM}./" .renn/ship-plan.md
588
+ sed -i "/^\- \[x\] ${ITEM_NUM}\./s/$/ (completed ${TIMESTAMP})/" .renn/ship-plan.md
589
+ ```
590
+ 4. If execution fails:
591
+ - Check if the error is an authentication error -> go to sub-step 3c (dynamic auth gate)
592
+ - Otherwise -> go to sub-step 3d (error recovery)
593
+
594
+ **If `[gate]`:**
595
+
596
+ Present to user via AskUserQuestion:
597
+
598
+ - header: "Step {N}: {description}"
599
+ - question: "{Instructions text}\n\nComplete this step and confirm."
600
+ - options:
601
+ - "Done" (description: "I've completed this step")
602
+ - "Skip" (description: "Skip this step and continue")
603
+ - "Come back later" (description: "Save progress and exit -- for long waits like DNS propagation")
604
+ - "Abort" (description: "Stop the ship workflow entirely")
605
+
606
+ Route based on response:
607
+
608
+ - **"Done":** Update checkbox and timestamp in ship-plan.md, continue to next item:
609
+ ```bash
610
+ TIMESTAMP=$(date +%H:%M)
611
+ sed -i "s/^- \[ \] ${ITEM_NUM}\./- [x] ${ITEM_NUM}./" .renn/ship-plan.md
612
+ sed -i "/^\- \[x\] ${ITEM_NUM}\./s/$/ (completed ${TIMESTAMP})/" .renn/ship-plan.md
613
+ ```
614
+
615
+ - **"Skip":** Mark as checked with "(skipped)" annotation, continue to next item:
616
+ ```bash
617
+ sed -i "s/^- \[ \] ${ITEM_NUM}\./- [x] ${ITEM_NUM}./" .renn/ship-plan.md
618
+ sed -i "/^\- \[x\] ${ITEM_NUM}\./s/$/ (skipped)/" .renn/ship-plan.md
619
+ ```
620
+
621
+ - **"Come back later":** Go to sub-step 3e (pause and save position)
622
+
623
+ - **"Abort":** Go to sub-step 3f (abort handling)
624
+
625
+ **After processing each item:** Update pulse.md at section boundaries (when crossing from Prerequisites to Configuration, to Deploy, to Verify) with:
626
+ ```
627
+ Status: Shipping to {target} ({completed}/{total} steps)
628
+ ```
629
+
630
+ ---
631
+
632
+ **Sub-step 3c: Dynamic authentication gate**
633
+
634
+ When an auto item fails, check the command output for authentication error patterns BEFORE falling through to generic error recovery. Auth errors are checked first because they have a specific recovery path (authenticate then retry).
635
+
636
+ Detect auth error patterns in command output or error messages:
637
+ - "Not authenticated", "Not logged in"
638
+ - "Unauthorized", "401", "403"
639
+ - "Please run {tool} login", "Please login"
640
+ - "Missing API key", "Invalid API key", "Invalid credentials"
641
+ - "Authentication required", "EAUTHUNKNOWN"
642
+
643
+ **If auth error detected:**
644
+
645
+ Present auth gate via AskUserQuestion:
646
+
647
+ - header: "Authentication Required"
648
+ - question: "{tool} requires authentication.\n\n{auth instructions based on error message -- e.g., 'Run `vercel login` in your terminal and complete browser authentication'}\n\nAuthenticate and confirm when done."
649
+ - options:
650
+ - "Done" (description: "I've authenticated")
651
+ - "Abort" (description: "Stop shipping")
652
+
653
+ Route based on response:
654
+
655
+ - **"Done":** Verify authentication if possible (e.g., `vercel whoami`, `npm whoami`, `gh auth status`). Then retry the original auto item from the beginning of its execution logic. If retry succeeds, mark the item complete with checkbox and timestamp. If retry fails with a DIFFERENT error (not auth), fall through to sub-step 3d (error recovery).
656
+
657
+ - **"Abort":** Go to sub-step 3f (abort handling)
658
+
659
+ **Secrets safety (GAP-03):**
660
+ - Credentials are ALWAYS handled via gates, NEVER auto-executed
661
+ - NEVER retry with cached credentials
662
+ - NEVER auto-handle secrets or API keys
663
+ - If an auto item's error suggests providing an API key inline, create a gate instead of trying to auto-provide it
664
+
665
+ ---
666
+
667
+ **Sub-step 3d: Error recovery**
668
+
669
+ When an auto item fails with a non-authentication error (sub-step 3c did not match):
670
+
671
+ Present the failure via AskUserQuestion with full error details:
672
+
673
+ - header: "Step {N} Failed"
674
+ - question: "{description} failed.\n\nCommand: {what was attempted}\nError: {full error output}\n\nHow would you like to proceed?"
675
+ - options:
676
+ - "Retry" (description: "Try this step again")
677
+ - "Skip" (description: "Mark as skipped and continue")
678
+ - "Abort" (description: "Stop the ship workflow")
679
+
680
+ Route based on response:
681
+
682
+ - **"Retry":** Re-execute the same auto item from the beginning of its execution logic (sub-step 3b auto path). The retry loop has no limit -- the user decides when to stop via Skip or Abort.
683
+
684
+ - **"Skip":** Mark the item as checked with "(skipped)" annotation, continue to next item:
685
+ ```bash
686
+ sed -i "s/^- \[ \] ${ITEM_NUM}\./- [x] ${ITEM_NUM}./" .renn/ship-plan.md
687
+ sed -i "/^\- \[x\] ${ITEM_NUM}\./s/$/ (skipped)/" .renn/ship-plan.md
688
+ ```
689
+
690
+ - **"Abort":** Go to sub-step 3f (abort handling)
691
+
692
+ **Error output:** Show verbose error output on failure (unlike success which shows concise output). The user needs full context to decide between retry, skip, and abort.
693
+
694
+ ---
695
+
696
+ **Sub-step 3e: Come back later (async gate)**
697
+
698
+ When user selects "Come back later" on a gate item (for long-running operations like DNS propagation, app store review, CI pipeline):
699
+
700
+ 1. Update ship-plan.md Status from `in-progress` to `paused-at-{N}` where N is the current item number:
701
+ ```bash
702
+ sed -i "s/^\*\*Status:\*\* in-progress/\*\*Status:\*\* paused-at-${ITEM_NUM}/" .renn/ship-plan.md
703
+ ```
704
+
705
+ 2. Update pulse.md Session Continuity:
706
+ ```
707
+ Last activity: {date} -- Shipping paused at step {N} of {TOTAL}
708
+ Resume file: .renn/ship-plan.md
709
+ Next action: Run /renn.ship to resume shipping
710
+ ```
711
+
712
+ 3. Display exit message:
713
+ ```
714
+ Progress saved at step {N} of {TOTAL}.
715
+ {COMPLETED} steps complete, {REMAINING} remaining.
716
+
717
+ Run /renn.ship to resume from step {N}.
718
+ ```
719
+
720
+ 4. Stop execution (return from the workflow -- do NOT continue to the next item)
721
+
722
+ **Resume mechanism:** No new code needed. The existing `detect_existing_ship` step already handles resume: ship-plan.md exists -> user picks "Resume" -> Phase 3 starts -> sub-step 3a reads ship-plan.md -> finds first unchecked item -> continues from there.
723
+
724
+ ---
725
+
726
+ **Sub-step 3f: Abort**
727
+
728
+ When user selects "Abort" from a gate item or error recovery:
729
+
730
+ 1. Update ship-plan.md Status to `aborted`:
731
+ ```bash
732
+ sed -i 's/^\*\*Status:\*\* in-progress/\*\*Status:\*\* aborted/' .renn/ship-plan.md
733
+ ```
734
+
735
+ 2. Update pulse.md with abort status:
736
+ ```
737
+ Last activity: {date} -- Ship workflow aborted at step {N}
738
+ ```
739
+
740
+ 3. Display abort message:
741
+ ```
742
+ Ship workflow aborted at step {N}.
743
+ {COMPLETED}/{TOTAL} steps were completed.
744
+
745
+ Run /renn.ship to resume or restart.
746
+ ```
747
+
748
+ 4. Stop execution
749
+
750
+ ---
751
+
752
+ **Sub-step 3g: Completion summary**
753
+
754
+ After all items in ship-plan.md are processed (no unchecked items remain):
755
+
756
+ 1. Count results:
757
+ ```bash
758
+ COMPLETED=$(grep -c '^\- \[x\] [0-9]' .renn/ship-plan.md)
759
+ SKIPPED=$(grep -c '(skipped)' .renn/ship-plan.md)
760
+ TOTAL=$(grep -c '^\- \[.\] [0-9]' .renn/ship-plan.md)
761
+ ```
762
+
763
+ 2. Verify no unchecked items remain before declaring complete:
764
+ ```bash
765
+ UNCHECKED=$(grep -c '^\- \[ \] [0-9]' .renn/ship-plan.md)
766
+ if [ "$UNCHECKED" -gt 0 ]; then
767
+ echo "ERROR: ${UNCHECKED} unchecked items remain -- do not declare complete"
768
+ # Return to sub-step 3b to continue processing
769
+ fi
770
+ ```
771
+
772
+ 3. Update ship-plan.md Status to `complete`:
773
+ ```bash
774
+ sed -i 's/^\*\*Status:\*\* in-progress/\*\*Status:\*\* complete/' .renn/ship-plan.md
775
+ ```
776
+
777
+ 4. Update ship-target.md Status to `shipped`:
778
+ ```bash
779
+ sed -i 's/^\*\*Status:\*\* plan-ready/\*\*Status:\*\* shipped/' .renn/ship-target.md
780
+ ```
781
+
782
+ 5. Update pulse.md to reflect shipping completion -- revert to standard format and note shipping completed:
783
+ ```
784
+ Last activity: {date} -- Shipped {project_name} to {target}
785
+ ```
786
+
787
+ 6. Display completion summary:
788
+ ```
789
+ ## Ship Complete!
790
+
791
+ **Project:** {project_name}
792
+ **Target:** {target}
793
+ **Steps:** {COMPLETED} completed, {SKIPPED} skipped
794
+ ```
795
+
796
+ If skipped items exist, list them:
797
+ ```
798
+ ### Skipped Steps
799
+
800
+ {For each item with "(skipped)" annotation, list the item number and description}
801
+
802
+ These steps were skipped and may need manual attention.
803
+ ```
804
+
805
+ Display next action:
806
+ ```
807
+ ---
808
+
809
+ ## What's Next
810
+
811
+ Set up monitoring for your deployed project:
812
+
813
+ `/renn.watch` -- error tracking, uptime monitoring, and more
814
+
815
+ <sub>`/clear` first -- fresh context window</sub>
816
+ ```
817
+
818
+ **Critical details:**
819
+ - Status field transitions: `ready` -> `in-progress` -> `paused-at-N` / `complete` / `aborted`
820
+ - "Come back later" and "Abort" both STOP execution -- they do not continue the loop
821
+ - The completion summary ONLY runs when no unchecked items remain (verified with grep before declaring complete)
822
+ - ship-target.md Status update to `shipped` only happens on completion, not on pause or abort
823
+ - pulse.md format during shipping: `Status: Shipping to {target} ({N}/{total} steps)`, reverted on completion/abort
824
+
825
+ </step>
826
+
827
+ </process>
828
+
829
+ <success_criteria>
830
+ - [ ] Re-ship detection works when .renn/ship-plan.md exists (resume/restart/different-target)
831
+ - [ ] Re-ship detection handles target-only state (Phase 1 done, Phase 2 pending)
832
+ - [ ] Project summary extracted from brief.md and displayed
833
+ - [ ] Stack detected via 5 layers (brief.md, STACK.md, research, manifests, frameworks)
834
+ - [ ] Detected stack mapped to platform suggestions
835
+ - [ ] User selected target via AskUserQuestion
836
+ - [ ] Target persisted to .renn/ship-target.md with status awaiting-plan
837
+ - [ ] .renn/ship-plan.md is NOT created by Phase 1
838
+ - [ ] renn-stage-scout spawned with shipping-specific research prompt
839
+ - [ ] Scout research converted to numbered checklist with auto/gate classification
840
+ - [ ] .renn/ship-plan.md created with project metadata, target, and checklist items
841
+ - [ ] ship-target.md status updated from awaiting-plan to plan-ready
842
+ - [ ] Auto items prefer CLI commands over dashboard instructions
843
+ - [ ] Phase 3 walks checklist items with auto-execution and gate presentation
844
+ - [ ] Auto items interpreted and executed by Claude at runtime
845
+ - [ ] Gate items presented via AskUserQuestion with Done/Skip/Come back later/Abort
846
+ - [ ] Auth errors in auto items create dynamic gates before retry
847
+ - [ ] Failed auto items offer retry/skip/abort recovery
848
+ - [ ] Checkbox updates use sed with HH:MM timestamps
849
+ - [ ] Skipped items use `- [x]` with "(skipped)" annotation
850
+ - [ ] Async gates save position for resume via "Come back later"
851
+ - [ ] Error recovery offers retry/skip/abort for failed auto items
852
+ - [ ] Auth errors create dynamic authentication gates
853
+ - [ ] Completion summary displayed with skipped items highlighted
854
+ - [ ] ship-plan.md Status transitions: ready -> in-progress -> complete/paused/aborted
855
+ - [ ] ship-target.md updated to shipped on completion
856
+ - [ ] pulse.md reflects shipping progress
857
+ - [ ] Phase 3 walks checklist with auto/gate execution, progress tracking, and error recovery
858
+ - [ ] Completion summary suggests /renn.watch as the next action (WATCH-11)
859
+ </success_criteria>