prizmkit 1.1.107 → 1.1.109

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 (86) hide show
  1. package/bin/create-prizmkit.js +4 -0
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +20 -0
  4. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +1 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/config.py +81 -14
  6. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +21 -0
  7. package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +19 -8
  8. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -1
  9. package/bundled/dev-pipeline/prizmkit_runtime/launch_profiles.py +18 -0
  10. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +208 -0
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +22 -2
  12. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +3 -1
  13. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +20 -1
  14. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +508 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +151 -30
  16. package/bundled/dev-pipeline/scripts/continuation.py +0 -1
  17. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +8 -46
  18. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +9 -34
  19. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +42 -33
  20. package/bundled/dev-pipeline/scripts/prizmkit-runtime-helper.py +27 -0
  21. package/bundled/dev-pipeline/scripts/utils.py +94 -0
  22. package/bundled/dev-pipeline/templates/agent-prompts/critic-plan-challenge.md +4 -3
  23. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  24. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +39 -65
  25. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +58 -96
  26. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -95
  27. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +6 -18
  28. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +5 -17
  29. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +14 -48
  30. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +7 -13
  31. package/bundled/dev-pipeline/templates/sections/feature-context.md +0 -4
  32. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +31 -61
  33. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +21 -37
  34. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +22 -69
  35. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +0 -14
  36. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -14
  37. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -7
  38. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -3
  39. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -7
  40. package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +7 -9
  41. package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +4 -8
  42. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -7
  43. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +0 -7
  44. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -7
  45. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +3 -10
  46. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +2 -9
  47. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +15 -16
  48. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +1 -8
  49. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -8
  50. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +9 -15
  51. package/bundled/dev-pipeline/templates/sections/phase0-init.md +1 -8
  52. package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +2 -15
  53. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
  54. package/bundled/dev-pipeline/tests/conftest.py +0 -1
  55. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +392 -23
  56. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +37 -17
  57. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +118 -14
  58. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +79 -2
  59. package/bundled/dev-pipeline/tests/test_runtime_helper.py +211 -0
  60. package/bundled/dev-pipeline/tests/test_unified_cli.py +663 -13
  61. package/bundled/skills/_metadata.json +4 -4
  62. package/bundled/skills/app-planner/SKILL.md +1 -1
  63. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
  64. package/bundled/skills/bug-fix-workflow/SKILL.md +174 -128
  65. package/bundled/skills/bug-planner/SKILL.md +101 -15
  66. package/bundled/skills/bug-planner/references/severity-rules.md +20 -8
  67. package/bundled/skills/feature-planner/SKILL.md +87 -8
  68. package/bundled/skills/feature-planner/assets/planning-guide.md +34 -10
  69. package/bundled/skills/feature-workflow/SKILL.md +100 -81
  70. package/bundled/skills/{prizm-kit → prizmkit}/SKILL.md +1 -1
  71. package/bundled/skills/prizmkit-code-review/SKILL.md +1 -1
  72. package/bundled/skills/refactor-planner/SKILL.md +88 -7
  73. package/bundled/skills/refactor-planner/references/fast-path.md +2 -1
  74. package/bundled/skills/refactor-planner/references/planning-phases.md +29 -11
  75. package/bundled/skills/refactor-workflow/SKILL.md +116 -57
  76. package/bundled/templates/project-memory-template.md +1 -1
  77. package/package.json +1 -1
  78. package/src/ai-cli-launch.js +194 -0
  79. package/src/config.js +26 -14
  80. package/src/index.js +11 -44
  81. package/src/platforms.js +10 -3
  82. package/src/prompts.js +60 -2
  83. package/src/scaffold.js +26 -14
  84. package/bundled/dev-pipeline/scripts/prizmkit-test-gate.py +0 -446
  85. package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +0 -20
  86. package/bundled/dev-pipeline/tests/test_prizmkit_test_gate.py +0 -107
@@ -6,10 +6,8 @@ You MUST attempt this phase. Mark it as skipped only when no usable browser tool
6
6
 
7
7
  0a. Check which browser tools are available:
8
8
  ```bash
9
- echo "=== playwright-cli ==="
10
- which playwright-cli 2>/dev/null && playwright-cli --version 2>/dev/null || echo "PLAYWRIGHT_CLI:NOT_INSTALLED"
11
- echo "=== opencli ==="
12
- which opencli 2>/dev/null && opencli --version 2>/dev/null || echo "OPENCLI:NOT_INSTALLED"
9
+ {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
10
+ {{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
13
11
  ```
14
12
 
15
13
  0b. Use this single decision tree:
@@ -18,19 +16,15 @@ which opencli 2>/dev/null && opencli --version 2>/dev/null || echo "OPENCLI:NOT_
18
16
  3. Else install `playwright-cli` as the default:
19
17
  ```bash
20
18
  npm install -g @playwright/cli@latest
21
- playwright-cli --version
19
+ {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
22
20
  ```
23
21
  4. If no browser tool is usable after these steps, append `## Browser Verification: SKIPPED — no usable browser tool` to `context-snapshot.md`, then continue to reporting/checkpoint.
24
22
 
25
23
  Use `opencli` instead of `playwright-cli` only when the scenario requires an existing Chrome login/session or third-party integration cookies.
26
24
 
27
- Record your choice:
28
- ```bash
29
- BROWSER_TOOL="playwright-cli" # or "opencli" or "skipped"
30
- echo "Selected browser tool: $BROWSER_TOOL"
31
- ```
25
+ Record your choice in the Browser Verification report as `Tool: playwright-cli`, `Tool: opencli`, or `Tool: skipped`.
32
26
 
33
- If `BROWSER_TOOL="skipped"`, do NOT start a dev server and do NOT run browser commands. Go directly to Step 4 Reporting and the checkpoint update.
27
+ If tool is `skipped`, do NOT start a dev server and do NOT run browser commands. Go directly to Step 4 Reporting and the checkpoint update.
34
28
 
35
29
  ---
36
30
 
@@ -38,27 +32,15 @@ If `BROWSER_TOOL="skipped"`, do NOT start a dev server and do NOT run browser co
38
32
 
39
33
  0d. Check if playwright-cli skill is installed for the current AI platform:
40
34
  ```bash
41
- CURRENT_PLATFORM=""
42
- if which claude >/dev/null 2>&1; then
43
- CURRENT_PLATFORM="claude"; SKILL_DIR="$HOME/.claude/skills"
44
- elif which cbc >/dev/null 2>&1; then
45
- CURRENT_PLATFORM="codebuddy"; SKILL_DIR="$HOME/.cbc/skills"
46
- else
47
- CURRENT_PLATFORM="unknown"
48
- fi
49
- if [ -d "$SKILL_DIR/playwright-cli" ] || ls "$SKILL_DIR"/playwright* 2>/dev/null | grep -q .; then
50
- echo "SKILL_EXISTS"
51
- else
52
- echo "SKILL_MISSING"
53
- fi
35
+ {{RUNTIME_HELPER_CMD}} platform skill playwright-cli --prefix
54
36
  ```
55
- If `SKILL_MISSING`: run `playwright-cli install --skills`. If current platform is NOT claude, copy installed skill from `$HOME/.claude/skills/playwright-cli` to `$SKILL_DIR/playwright-cli`.
37
+ If `SKILL_MISSING`: run `playwright-cli install --skills`. If current platform is NOT claude, copy installed skill from `$HOME/.claude/skills/playwright-cli` to the path shown by the helper output for the current platform.
56
38
 
57
39
  0e. Read the installed playwright-cli skill (SKILL.md) for workflow guidance. Learn usage: `playwright-cli --help`.
58
40
 
59
41
  **Step 1 — Start Dev Server + Open (playwright-cli)**:
60
- 1. Identify and start the dev server (see port detection below)
61
- 2. Open: `playwright-cli open http://localhost:$DEV_PORT`
42
+ 1. Identify and start the dev server (see shared helper commands below)
43
+ 2. Open: `playwright-cli open http://localhost:<DEV_PORT>`
62
44
  3. If auth needed, use playwright-cli to register a test user and log in
63
45
 
64
46
  **Step 2 — Verification (playwright-cli)**:
@@ -69,18 +51,18 @@ Construct your verification workflow based on: (1) the playwright-cli skill docu
69
51
 
70
52
  **Step 3 — Cleanup (playwright-cli)**:
71
53
  1. `playwright-cli close`
72
- 2. `kill $DEV_SERVER_PID 2>/dev/null || true`
73
- 3. `lsof -ti:$DEV_PORT | xargs kill -9 2>/dev/null || true`
54
+ 2. `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
55
+ 3. `{{RUNTIME_HELPER_CMD}} port check <DEV_PORT>`
74
56
 
75
57
  ---
76
58
 
77
59
  **If you chose `opencli`**, follow this workflow:
78
60
 
79
- 0d. Learn usage: `opencli browser --help 2>/dev/null || opencli --help`
61
+ 0d. Learn usage: `opencli browser --help`
80
62
 
81
63
  **Step 1 — Start Dev Server + Open (opencli)**:
82
- 1. Identify and start the dev server (see port detection below)
83
- 2. Open and inspect: `opencli browser open http://localhost:$DEV_PORT && opencli browser state`
64
+ 1. Identify and start the dev server (see shared helper commands below)
65
+ 2. Open and inspect: `opencli browser open http://localhost:<DEV_PORT> && opencli browser state`
84
66
  3. If auth needed, opencli reuses Chrome cookies — SSO/OAuth may already be active
85
67
 
86
68
  **Step 2 — Verification (opencli)**:
@@ -95,30 +77,26 @@ Always run `state` after page-changing actions to get fresh indices.
95
77
 
96
78
  **Step 3 — Cleanup (opencli)**:
97
79
  1. `opencli browser close`
98
- 2. `kill $DEV_SERVER_PID 2>/dev/null || true`
99
- 3. `lsof -ti:$DEV_PORT | xargs kill -9 2>/dev/null || true`
80
+ 2. `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
81
+ 3. `{{RUNTIME_HELPER_CMD}} port check <DEV_PORT>`
100
82
 
101
83
  ---
102
84
 
103
- **Shared: Dev Server Port Detection** (used by both tools):
104
-
105
- ```bash
106
- DEV_PORT={{DEV_PORT}}
107
- if [ "$DEV_PORT" = "{{DEV_PORT}}" ]; then
108
- DEV_PORT=$(node -e "const s=require('./package.json').scripts.dev; const m=s.match(/-p\s+(\d+)/); console.log(m?m[1]:'')")
109
- if [ -z "$DEV_PORT" ]; then
110
- DEV_PORT=$(echo "$NEXT_PUBLIC_SITE_URL" | sed -nE 's|.*:([0-9]+).*|\1|p')
111
- fi
112
- DEV_PORT=${DEV_PORT:-3000}
113
- fi
114
- echo "Detected DEV_PORT=$DEV_PORT"
115
- ```
116
-
117
- Verify port available: `lsof -ti:$DEV_PORT 2>/dev/null && echo "PORT_IN_USE" || echo "PORT_FREE"`
85
+ **Shared: Dev Server Port / Process Helpers** (used by both tools):
118
86
 
119
- Start dev server: `<start-command> & DEV_SERVER_PID=$!`
120
-
121
- Wait for ready: poll `http://localhost:$DEV_PORT` with `curl -s -o /dev/null -w "%{http_code}"` until 200/302 (max 30s, 2s interval).
87
+ 1. Determine `DEV_PORT` from the pipeline value (`{{DEV_PORT}}`) or project config; do not guess.
88
+ 2. Verify port available:
89
+ ```bash
90
+ {{RUNTIME_HELPER_CMD}} port check <DEV_PORT>
91
+ ```
92
+ 3. Start dev server:
93
+ ```bash
94
+ {{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>
95
+ ```
96
+ 4. Wait for ready:
97
+ ```bash
98
+ {{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<DEV_PORT> --timeout 30 --interval 2
99
+ ```
122
100
 
123
101
  ---
124
102
 
@@ -128,7 +106,7 @@ Append results to `context-snapshot.md`:
128
106
  ```
129
107
  ## Browser Verification
130
108
  Tool: <playwright-cli or opencli>
131
- URL: http://localhost:$DEV_PORT
109
+ URL: http://localhost:<DEV_PORT>
132
110
  Dev Server Command: <actual command used>
133
111
  Tool version: <version>
134
112
  Steps executed: [list of commands used]
@@ -140,11 +118,3 @@ Append results to `context-snapshot.md`:
140
118
 
141
119
  If verification fails, log the failure details but continue to commit. Failures do NOT block the commit, but you MUST attempt verification and MUST clean up the dev server.
142
120
 
143
-
144
- **Checkpoint update**: Run the update script to set step `browser-verification` to `"completed"`:
145
- ```bash
146
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
147
- --checkpoint-path {{CHECKPOINT_PATH}} \
148
- --step browser-verification \
149
- --status completed
150
- ```
@@ -12,13 +12,13 @@ You MUST execute this phase. Do NOT skip it. Do NOT mark it as completed without
12
12
 
13
13
  0a. Check if `opencli` is installed:
14
14
  ```bash
15
- which opencli 2>/dev/null && opencli --version 2>/dev/null || echo "NOT_INSTALLED"
15
+ {{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
16
16
  ```
17
17
  If output is `NOT_INSTALLED`, install it:
18
18
  ```bash
19
19
  npm install -g @jackwener/opencli@latest
20
20
  ```
21
- Then verify installation succeeded: `opencli --version`. If installation fails, log `## Browser Verification: SKIPPED — opencli installation failed` in context-snapshot.md and proceed to the next phase.
21
+ Then verify installation succeeded: `{{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version`. If installation fails, log `## Browser Verification: SKIPPED — opencli installation failed` in context-snapshot.md and proceed to the next phase.
22
22
 
23
23
  0b. Verify Browser Bridge connectivity:
24
24
  ```bash
@@ -28,7 +28,7 @@ If `opencli doctor` fails (Chrome not running or extension not installed), log `
28
28
 
29
29
  0c. Learn opencli browser usage (run once per session):
30
30
  ```bash
31
- opencli browser --help 2>/dev/null || opencli --help
31
+ opencli browser --help
32
32
  ```
33
33
 
34
34
  **Step 1 — Start Dev Server**:
@@ -36,31 +36,22 @@ opencli browser --help 2>/dev/null || opencli --help
36
36
  You know this project's tech stack. Detect and start the dev server yourself:
37
37
 
38
38
  1. Identify the dev server start command from project config (`package.json` scripts, `Makefile`, `docker-compose.yml`, etc.)
39
- 2. **Detect the dev server port** use the pre-detected port from pipeline if available, otherwise extract from project config. Do NOT hardcode or guess the port:
39
+ 2. Determine the dev server port from the pre-detected pipeline value (`{{DEV_PORT}}`) or project config. Do NOT hardcode or guess the port. Record it as `DEV_PORT` in your notes.
40
+ 3. Verify the port is available:
40
41
  ```bash
41
- DEV_PORT={{DEV_PORT}}
42
- if [ "$DEV_PORT" = "{{DEV_PORT}}" ]; then
43
- DEV_PORT=$(node -e "const s=require('./package.json').scripts.dev; const m=s.match(/-p\s+(\d+)/); console.log(m?m[1]:'')")
44
- if [ -z "$DEV_PORT" ]; then
45
- DEV_PORT=$(echo "$NEXT_PUBLIC_SITE_URL" | sed -nE 's|.*:([0-9]+).*|\1|p')
46
- fi
47
- DEV_PORT=${DEV_PORT:-3000}
48
- fi
49
- echo "Detected DEV_PORT=$DEV_PORT"
42
+ {{RUNTIME_HELPER_CMD}} port check <DEV_PORT>
50
43
  ```
51
- 3. Verify the port is available:
44
+ 4. Start the dev server with the runtime helper and capture a PID file:
52
45
  ```bash
53
- lsof -ti:$DEV_PORT 2>/dev/null && echo "PORT_IN_USE" || echo "PORT_FREE"
46
+ {{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>
54
47
  ```
55
- 4. Start the dev server in background, capture PID:
48
+ 5. Wait for server to be ready:
56
49
  ```bash
57
- <start-command> &
58
- DEV_SERVER_PID=$!
50
+ {{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<DEV_PORT> --timeout 30 --interval 2
59
51
  ```
60
- 5. Wait for server to be ready: poll `http://localhost:$DEV_PORT` with `curl -s -o /dev/null -w "%{http_code}"` until it returns 200 or 302 (max 30 seconds, 2s interval)
61
52
  6. Open the app in opencli and inspect page state:
62
53
  ```bash
63
- opencli browser open http://localhost:$DEV_PORT && opencli browser state
54
+ opencli browser open http://localhost:<DEV_PORT> && opencli browser state
64
55
  ```
65
56
  7. If the page requires authentication, use opencli browser to interact with login forms (opencli reuses Chrome cookies, so SSO/OAuth may already be active)
66
57
 
@@ -82,13 +73,8 @@ Key opencli browser commands for verification:
82
73
 
83
74
  **Chain commands aggressively with `&&`** to minimize tool calls:
84
75
  ```bash
85
- # GOOD: open + inspect in one call
86
- opencli browser open http://localhost:$DEV_PORT && opencli browser state
87
-
88
- # GOOD: fill form in one call
76
+ opencli browser open http://localhost:<DEV_PORT> && opencli browser state
89
77
  opencli browser type 3 "hello" && opencli browser type 4 "world" && opencli browser click 7
90
-
91
- # GOOD: click + wait + re-inspect
92
78
  opencli browser click 12 && opencli browser wait time 1 && opencli browser state
93
79
  ```
94
80
 
@@ -99,8 +85,14 @@ Construct your verification workflow based on: (1) the `opencli browser --help`
99
85
  **Step 3 — Cleanup (REQUIRED — you started it, you stop it)**:
100
86
 
101
87
  1. Close the opencli browser session: `opencli browser close`
102
- 2. Kill the dev server process: `kill $DEV_SERVER_PID 2>/dev/null || true`
103
- 3. Verify port is released: `lsof -ti:$DEV_PORT | xargs kill -9 2>/dev/null || true`
88
+ 2. Stop the dev server process using the PID file written in Step 1:
89
+ ```bash
90
+ {{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>
91
+ ```
92
+ 3. Verify port is released:
93
+ ```bash
94
+ {{RUNTIME_HELPER_CMD}} port check <DEV_PORT>
95
+ ```
104
96
 
105
97
  **Step 4 — Reporting**:
106
98
 
@@ -108,7 +100,7 @@ Append results to `context-snapshot.md`:
108
100
  ```
109
101
  ## Browser Verification
110
102
  Tool: opencli
111
- URL: http://localhost:$DEV_PORT
103
+ URL: http://localhost:<DEV_PORT>
112
104
  Dev Server Command: <actual command used>
113
105
  opencli version: <version>
114
106
  Steps executed: [list of opencli browser commands used]
@@ -120,11 +112,3 @@ Append results to `context-snapshot.md`:
120
112
 
121
113
  If verification fails, log the failure details but continue to commit. Failures do NOT block the commit, but you MUST attempt verification and MUST clean up the dev server.
122
114
 
123
-
124
- **Checkpoint update**: Run the update script to set step `browser-verification` to `"completed"`:
125
- ```bash
126
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
127
- --checkpoint-path {{CHECKPOINT_PATH}} \
128
- --step browser-verification \
129
- --status completed
130
- ```
@@ -10,9 +10,9 @@ You MUST execute this phase. Do NOT skip it. Do NOT mark it as completed without
10
10
 
11
11
  **Step 0 — Playwright CLI Readiness Check (BLOCKING — must pass before any browser action)**:
12
12
 
13
- 0a. Check if `playwright-cli` is installed:
13
+ 0a. Check if `playwright-cli` is installed using the runtime helper:
14
14
  ```bash
15
- which playwright-cli 2>/dev/null && playwright-cli --version 2>/dev/null || echo "NOT_INSTALLED"
15
+ {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
16
16
  ```
17
17
  If output is `NOT_INSTALLED`, install it:
18
18
  ```bash
@@ -20,7 +20,7 @@ npm install -g @playwright/cli@latest
20
20
  ```
21
21
  Then verify installation succeeded:
22
22
  ```bash
23
- playwright-cli --version
23
+ {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
24
24
  ```
25
25
  If installation fails, log the error in context-snapshot.md under `## Browser Verification: SKIPPED — playwright-cli installation failed` and proceed to the next phase. Do NOT attempt browser verification without playwright-cli.
26
26
 
@@ -32,43 +32,9 @@ Use this output to determine the correct commands for your verification steps. D
32
32
 
33
33
  0c. Check if playwright-cli skill is installed for the current AI platform:
34
34
  ```bash
35
- # Detect AI CLI platform
36
- CURRENT_PLATFORM=""
37
- if which claude >/dev/null 2>&1; then
38
- CURRENT_PLATFORM="claude"
39
- SKILL_DIR="$HOME/.claude/skills"
40
- elif which cbc >/dev/null 2>&1; then
41
- CURRENT_PLATFORM="codebuddy"
42
- SKILL_DIR="$HOME/.cbc/skills"
43
- else
44
- # Try to detect from environment or config
45
- CURRENT_PLATFORM="unknown"
46
- fi
47
-
48
- # Check if playwright-cli skill exists
49
- if [ -d "$SKILL_DIR/playwright-cli" ] || ls "$SKILL_DIR"/playwright* 2>/dev/null | grep -q .; then
50
- echo "SKILL_EXISTS"
51
- else
52
- echo "SKILL_MISSING"
53
- fi
54
- ```
55
- If `SKILL_MISSING`:
56
- ```bash
57
- # Install playwright-cli skills (defaults to claude platform)
58
- playwright-cli install --skills
59
- ```
60
- If the current platform is NOT claude, move the installed skill files to the correct location:
61
- ```bash
62
- # Skills are installed to claude's default location — move to current platform's skill dir
63
- if [ "$CURRENT_PLATFORM" != "claude" ] && [ "$CURRENT_PLATFORM" != "unknown" ]; then
64
- CLAUDE_SKILL_DIR="$HOME/.claude/skills"
65
- if [ -d "$CLAUDE_SKILL_DIR/playwright-cli" ]; then
66
- mkdir -p "$SKILL_DIR"
67
- cp -r "$CLAUDE_SKILL_DIR/playwright-cli" "$SKILL_DIR/"
68
- echo "Moved playwright-cli skill from claude to $CURRENT_PLATFORM"
69
- fi
70
- fi
35
+ {{RUNTIME_HELPER_CMD}} platform skill playwright-cli --prefix
71
36
  ```
37
+ If `SKILL_MISSING`: run `playwright-cli install --skills`. If current platform is NOT claude, copy installed skill from `$HOME/.claude/skills/playwright-cli` to the path shown by the helper output for the current platform.
72
38
 
73
39
  0d. Read the installed playwright-cli skill for workflow guidance:
74
40
  After skill installation, read the skill's SKILL.md to understand recommended workflows and patterns. Use these patterns to construct your verification flow — do NOT invent your own patterns if the skill provides them.
@@ -78,31 +44,20 @@ After skill installation, read the skill's SKILL.md to understand recommended wo
78
44
  You know this project's tech stack. Detect and start the dev server yourself:
79
45
 
80
46
  1. Identify the dev server start command from project config (`package.json` scripts, `Makefile`, `docker-compose.yml`, etc.)
81
- 2. **Detect the dev server port** — use the pre-detected port from pipeline if available, otherwise extract from project config. Do NOT hardcode or guess the port:
47
+ 2. Use the pre-detected port if available, otherwise determine the dev server port from project config. Do NOT hardcode or guess the port. Record it as `DEV_PORT` in your notes.
48
+ 3. Verify the port is available:
82
49
  ```bash
83
- # Use pipeline-injected port if available, otherwise extract from package.json
84
- DEV_PORT={{DEV_PORT}}
85
- # If DEV_PORT is still a placeholder, detect at runtime:
86
- if [ "$DEV_PORT" = "{{DEV_PORT}}" ]; then
87
- DEV_PORT=$(node -e "const s=require('./package.json').scripts.dev; const m=s.match(/-p\s+(\d+)/); console.log(m?m[1]:'')")
88
- if [ -z "$DEV_PORT" ]; then
89
- DEV_PORT=$(echo "$NEXT_PUBLIC_SITE_URL" | sed -nE 's|.*:([0-9]+).*|\1|p')
90
- fi
91
- DEV_PORT=${DEV_PORT:-3000}
92
- fi
93
- echo "Detected DEV_PORT=$DEV_PORT"
50
+ {{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}
94
51
  ```
95
- 3. Verify the port is available:
52
+ 4. Start the dev server with the runtime helper and capture a PID file:
96
53
  ```bash
97
- lsof -ti:$DEV_PORT 2>/dev/null && echo "PORT_IN_USE" || echo "PORT_FREE"
54
+ {{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>
98
55
  ```
99
- 4. Start the dev server in background, capture PID:
56
+ 5. Wait for server to be ready:
100
57
  ```bash
101
- <start-command> &
102
- DEV_SERVER_PID=$!
58
+ {{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:{{DEV_PORT}} --timeout 30 --interval 2
103
59
  ```
104
- 5. Wait for server to be ready: poll `http://localhost:$DEV_PORT` with `curl -s -o /dev/null -w "%{http_code}"` until it returns 200 or 302 (max 30 seconds, 2s interval)
105
- 6. Open the app in playwright-cli: `playwright-cli open http://localhost:$DEV_PORT`
60
+ 6. Open the app in playwright-cli: `playwright-cli open http://localhost:{{DEV_PORT}}`
106
61
  7. If the page requires authentication, use playwright-cli to register a test user and log in first
107
62
 
108
63
  **Step 2 — Verification**:
@@ -122,15 +77,21 @@ Take a final screenshot for evidence: `playwright-cli screenshot`
122
77
  **Step 3 — Cleanup (REQUIRED — you started it, you stop it)**:
123
78
 
124
79
  1. Close the playwright-cli browser: `playwright-cli close`
125
- 2. Kill the dev server process: `kill $DEV_SERVER_PID 2>/dev/null || true`
126
- 3. Verify port is released: `lsof -ti:$DEV_PORT | xargs kill -9 2>/dev/null || true`
80
+ 2. Stop the dev server process using the PID file written in Step 1:
81
+ ```bash
82
+ {{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>
83
+ ```
84
+ 3. Verify port is released:
85
+ ```bash
86
+ {{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}
87
+ ```
127
88
 
128
89
  **Step 4 — Reporting**:
129
90
 
130
91
  Append results to `context-snapshot.md`:
131
92
  ```
132
93
  ## Browser Verification
133
- URL: http://localhost:$DEV_PORT
94
+ URL: http://localhost:<DEV_PORT>
134
95
  Dev Server Command: <actual command used>
135
96
  playwright-cli version: <version>
136
97
  Steps executed: [list of playwright-cli commands used]
@@ -142,11 +103,3 @@ Browser cleanup: confirmed
142
103
 
143
104
  If verification fails, log the failure details but continue to commit. Failures do NOT block the commit, but you MUST attempt verification and MUST clean up the dev server.
144
105
 
145
-
146
- **Checkpoint update**: Run the update script to set step `browser-verification` to `"completed"`:
147
- ```bash
148
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
149
- --checkpoint-path {{CHECKPOINT_PATH}} \
150
- --step browser-verification \
151
- --status completed
152
- ```
@@ -55,20 +55,6 @@ Rules for writing completion notes:
55
55
  - If this feature has no downstream dependents, still write the summary (it serves as documentation)
56
56
 
57
57
 
58
- **Checkpoint update**: After `/prizmkit-retrospective` completes, run the update script to set step `prizmkit-retrospective` to `"completed"`:
59
- ```bash
60
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
61
- --checkpoint-path {{CHECKPOINT_PATH}} \
62
- --step prizmkit-retrospective \
63
- --status completed
64
- ```
65
- After `/prizmkit-committer` completes, set step `prizmkit-committer` to `"completed"`:
66
- ```bash
67
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
68
- --checkpoint-path {{CHECKPOINT_PATH}} \
69
- --step prizmkit-committer \
70
- --status completed
71
- ```
72
58
 
73
59
  ### TERMINAL STOP — Commit Completed
74
60
 
@@ -48,20 +48,6 @@ Rules for writing completion notes:
48
48
  - If this feature has no downstream dependents, still write the summary (it serves as documentation)
49
49
 
50
50
 
51
- **Checkpoint update**: After `/prizmkit-retrospective` completes, run the update script to set step `prizmkit-retrospective` to `"completed"`:
52
- ```bash
53
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
54
- --checkpoint-path {{CHECKPOINT_PATH}} \
55
- --step prizmkit-retrospective \
56
- --status completed
57
- ```
58
- After `/prizmkit-committer` completes, set step `prizmkit-committer` to `"completed"`:
59
- ```bash
60
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
61
- --checkpoint-path {{CHECKPOINT_PATH}} \
62
- --step prizmkit-committer \
63
- --status completed
64
- ```
65
51
 
66
52
  ### TERMINAL STOP — Commit Completed
67
53
 
@@ -22,10 +22,3 @@
22
22
  - <trap entries extracted from L1/L2 docs>
23
23
 
24
24
 
25
- **Checkpoint update**: Run the update script to set step `context-snapshot` to `"completed"`:
26
- ```bash
27
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
28
- --checkpoint-path {{CHECKPOINT_PATH}} \
29
- --step context-snapshot \
30
- --status completed
31
- ```
@@ -1,7 +1,7 @@
1
1
  ### Build Context Snapshot
2
2
 
3
3
  ```bash
4
- ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXISTS" || echo "MISSING"
4
+ {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
5
5
  ```
6
6
 
7
7
  If MISSING — build it now:
@@ -10,5 +10,3 @@ If MISSING — build it now:
10
10
  3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
11
11
  - **Section 1 — Feature Brief**: 2-3 line feature description from Task Contract
12
12
  - **Section 2 — Verification Gates**: gate checklist from Task Contract
13
- - **Section 3 — Key TRAPS & RULES**: extract only relevant TRAPS/RULES from prizm-docs that apply to files in this scope. Do NOT copy full L0/L1/L2 content.
14
- - **Section 4 — File Manifest**: file path, why needed, key interfaces. Format: Files to Modify | Files for Reference tables.
@@ -10,10 +10,3 @@
10
10
  |------|-----------|----------------|
11
11
 
12
12
 
13
- **Checkpoint update**: Run the update script to set step `context-snapshot` to `"completed"`:
14
- ```bash
15
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
16
- --checkpoint-path {{CHECKPOINT_PATH}} \
17
- --step context-snapshot \
18
- --status completed
19
- ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Guard**: Verify critic agent file exists before spawning:
4
4
  ```bash
5
- ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
5
+ {{RUNTIME_HELPER_CMD}} artifact exists {{CRITIC_SUBAGENT_PATH}} --exists-marker CRITIC:READY --missing-marker CRITIC:MISSING
6
6
  ```
7
7
  If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent not installed — skipping Plan Challenge."
8
8
 
@@ -26,13 +26,18 @@ If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent n
26
26
  | subagent_type | prizm-dev-team-critic |
27
27
  | mode | plan |
28
28
  | run_in_background | false |
29
+ | isolation | default/no worktree; do not request worktree isolation |
30
+
31
+ No-worktree boundary: this prevents AI tool-created `.claude/worktrees/...` subagent worktrees. It does not disable PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...`, which are controlled separately by `USE_WORKTREE`.
29
32
 
30
33
  **Prompt**:
31
34
  > {{AGENT_PROMPT_CRITIC_PLAN_CHALLENGE}}
32
35
 
33
36
  **If {{CRITIC_COUNT}} = 3 → Multi-Critic Voting** (skip Single Critic above):
34
37
 
35
- Spawn 3 Critic agents in PARALLEL (issue all 3 Agent tool calls in the SAME message turn). Do NOT wait for one before spawning the next. Each with mode="plan", run_in_background=false:
38
+ Spawn 3 Critic agents in PARALLEL (issue all 3 Agent tool calls in the SAME message turn). Do NOT wait for one before spawning the next. Each with mode="plan", run_in_background=false, and default/no worktree isolation; do not request worktree isolation.
39
+
40
+ No-worktree boundary: default/no worktree isolation prevents AI tool-created `.claude/worktrees/...` subagent worktrees. It does not disable PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...`, which are controlled separately by `USE_WORKTREE`.
36
41
 
37
42
  Critic-A prompt (append to base prompt above):
38
43
  > "**Focus Lens: Architecture & Scalability.** Prioritize: architectural pattern fit, scalability implications, over-engineering risks, component boundary design.
@@ -54,10 +59,3 @@ After all critics return, read all 3 reports:
54
59
  **CP-2.5**: Plan challenges reviewed and resolved.
55
60
 
56
61
 
57
- **Checkpoint update**: Run the update script to set step `critic-plan-review` to `"completed"`:
58
- ```bash
59
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
60
- --checkpoint-path {{CHECKPOINT_PATH}} \
61
- --step critic-plan-review \
62
- --status completed
63
- ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Guard**: Verify critic agent file exists before spawning:
4
4
  ```bash
5
- ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
5
+ {{RUNTIME_HELPER_CMD}} artifact exists {{CRITIC_SUBAGENT_PATH}} --exists-marker CRITIC:READY --missing-marker CRITIC:MISSING
6
6
  ```
7
7
  If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent not installed — skipping Plan Challenge."
8
8
 
@@ -12,6 +12,9 @@ If CRITIC:MISSING — skip this phase entirely and proceed. Log: "Critic agent n
12
12
  | subagent_type | prizm-dev-team-critic |
13
13
  | mode | plan |
14
14
  | run_in_background | false |
15
+ | isolation | default/no worktree; do not request worktree isolation |
16
+
17
+ No-worktree boundary: this prevents AI tool-created `.claude/worktrees/...` subagent worktrees. It does not disable PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...`, which are controlled separately by `USE_WORKTREE`.
15
18
 
16
19
  **Prompt**:
17
20
  > {{AGENT_PROMPT_CRITIC_PLAN_CHALLENGE}}
@@ -33,10 +36,3 @@ Wait for Critic to return.
33
36
  **CP-2.5**: Plan challenges reviewed and resolved.
34
37
 
35
38
 
36
- **Checkpoint update**: Run the update script to set step `critic-plan-review` to `"completed"`:
37
- ```bash
38
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
39
- --checkpoint-path {{CHECKPOINT_PATH}} \
40
- --step critic-plan-review \
41
- --status completed
42
- ```
@@ -43,10 +43,3 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
43
43
 
44
44
  **CP-2**: All tasks `[x]`, Implementation Log written with Gate Evidence, and blocked gates documented in `failure-log.md`. Test execution is deferred until after code review.
45
45
 
46
- **Checkpoint update**:
47
- ```bash
48
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
49
- --checkpoint-path {{CHECKPOINT_PATH}} \
50
- --step prizmkit-implement \
51
- --status completed
52
- ```
@@ -43,10 +43,3 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
43
43
 
44
44
  **CP-2**: All tasks `[x]`, Implementation Log written with Gate Evidence, and blocked gates documented in `failure-log.md`. Test execution is deferred until after code review.
45
45
 
46
- **Checkpoint update**:
47
- ```bash
48
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
49
- --checkpoint-path {{CHECKPOINT_PATH}} \
50
- --step prizmkit-implement \
51
- --status completed
52
- ```
@@ -21,10 +21,3 @@
21
21
  **CP-2**: Implementation may proceed only when all tasks are `[x]` and blocked gates are documented in `failure-log.md`. Test execution is deferred until after code review.
22
22
 
23
23
 
24
- **Checkpoint update**: Run the update script to set step `prizmkit-implement` to `"completed"`:
25
- ```bash
26
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
27
- --checkpoint-path {{CHECKPOINT_PATH}} \
28
- --step prizmkit-implement \
29
- --status completed
30
- ```
@@ -1,27 +1,20 @@
1
1
  ### Plan & Tasks
2
2
 
3
3
  ```bash
4
- ls .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null
4
+ {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/plan.md
5
5
  ```
6
6
 
7
7
  If missing, run `/prizmkit-plan` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to generate `plan.md`:
8
8
  - The plan.md should include: architecture — components, interfaces, data flow, files to create/modify, testing approach, and a Tasks section with `[ ]` checkboxes ordered by dependency.
9
- - Resolve any `[NEEDS CLARIFICATION]` markers using the feature description do NOT pause for interactive input.
9
+ - Resolve uncertain requirements from the feature description, existing code, and conservative existing-project patterns.
10
10
 
11
11
  **Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
12
12
  Before proceeding past CP-1, verify:
13
13
  1. Plan.md Data Model section references existing schema/model files (scan for `*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*` files; read them if not already in context-snapshot)
14
14
  2. All new tables/fields follow existing naming conventions, ID strategy, timestamp patterns, and constraint style
15
- 3. No `[NEEDS CLARIFICATION]` remains in Data Model section — resolve by reading existing code and making a conservative choice that matches existing patterns. Document the resolution in plan.md.
15
+ 3. No unresolved data model uncertainty remains in the Data Model section — resolve by reading existing code and making a conservative choice that matches existing patterns. Document the resolution in plan.md.
16
16
  4. If a DB design decision genuinely cannot be resolved from existing code alone, document the assumption made and flag it in the Implementation Log for user review.
17
17
 
18
18
  **CP-1**: plan.md exists with Tasks section.
19
19
 
20
20
 
21
- **Checkpoint update**: Run the update script to set step `prizmkit-plan` to `"completed"`:
22
- ```bash
23
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
24
- --checkpoint-path {{CHECKPOINT_PATH}} \
25
- --step prizmkit-plan \
26
- --status completed
27
- ```