Commit e874019
feat(workflow): H2→preview server auto-launch + /pf:preview slash command (Phase 2) (#104)
* feat(scripts): start-preview-server.sh — profile-aware preview server launcher (Phase 2)
Bridges H2 freeze → live local app gap (DEMO-STORYBOARD.md L1:50–2:00).
Auto-detects profile (docker-compose.yml vs apps/{api,web}/package.json),
picks free port from 18080+, spawns dev servers in background, opens browser.
Idempotent (re-runs only re-open URL), supports stop + status subcommands.
PF_PREVIEW_DRY_RUN=1 keeps unit tests light.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(commands): /pf:preview slash command (Phase 2)
User-facing manual entry point for re-opening or stopping the local preview
server post-H2 (e.g. after a reboot or explicit /pf:preview stop). Wraps
scripts/start-preview-server.sh; defaults to most-recent run when run_id
omitted.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(agents,commands): explicit H2→preview auto-launch imperative (Phase 2)
Adds an HTML-comment-delimited block to chief-engineer-pm.md instructing M3
to invoke scripts/start-preview-server.sh immediately after H2 approval —
matching the markdown-imperatives pattern Phase 1 uses for H1→SpecDD.
freeze.md gains a footer note describing the same auto-launch and the
manual /pf:preview re-open / stop commands. The HTML delimiter keeps the
H2 block textually distinct from any §3.9 H1 dispatch block Phase 1 may
add, so the two PRs merge cleanly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(preview-server): apply PR #104 review feedback (codex + coderabbit)
- Detect scaffold under <run_dir>/generated/ in addition to <run_dir>/ so
freshly-frozen runs (be-lead writes apps to runs/<id>/generated/) auto-launch
instead of mis-aborting with exit 2 (codex P1).
- Replace per-line `docker compose ps --format json` parser with
read-all-stdin logic that correctly handles both NDJSON and single
JSON-array formats (codex P2 + coderabbit minor).
- Add cleanup_spawned trap so wait_tcp 60s timeout no longer leaks api/web
pids; PID_FILE is removed and SIGTERM sent to both children before exit
(coderabbit major).
- Remove unused spawn() helper to eliminate dead code (coderabbit nitpick).
- chief-engineer-pm.md: explicitly whitelist start-preview-server.sh in
allowed_scope as a v1.7.0+ Phase 2 sanctioned exception, resolving the
Rule 6 conflict between the H2 auto-launch block and the read-only Bash
policy (coderabbit major).
- verify-plugin.sh: sync header checklist comment 14 -> 15 to match the
command-count assertion at line 80 (coderabbit minor, outside-diff).
Refs PR #104 review comments
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 17f354a commit e874019
5 files changed
Lines changed: 502 additions & 7 deletions
File tree
- plugins/preview-forge
- agents/meta
- commands
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
131 | 148 | | |
132 | 149 | | |
133 | 150 | | |
| |||
179 | 196 | | |
180 | 197 | | |
181 | 198 | | |
182 | | - | |
183 | | - | |
184 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
185 | 203 | | |
186 | 204 | | |
187 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments