prizmkit 1.1.108 → 1.1.110

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 (46) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +20 -0
  3. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +1 -0
  4. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +21 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
  6. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +208 -0
  7. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +508 -0
  8. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +3 -1
  9. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +3 -1
  10. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +3 -1
  11. package/bundled/dev-pipeline/scripts/prizmkit-runtime-helper.py +27 -0
  12. package/bundled/dev-pipeline/scripts/utils.py +48 -77
  13. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +44 -71
  14. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +48 -75
  15. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +52 -78
  16. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -2
  17. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
  18. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +1 -1
  19. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +8 -8
  20. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +33 -55
  21. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +28 -33
  22. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +22 -62
  23. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
  24. package/bundled/dev-pipeline/templates/sections/phase-commit.md +1 -1
  25. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -1
  26. package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +1 -1
  27. package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +1 -1
  28. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +1 -1
  30. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +1 -1
  31. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +1 -1
  32. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +1 -1
  34. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -1
  35. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +7 -6
  36. package/bundled/dev-pipeline/templates/sections/phase0-init.md +1 -1
  37. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
  38. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +1 -1
  39. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +1 -1
  40. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +152 -3
  41. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +2 -1
  42. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -1
  43. package/bundled/dev-pipeline/tests/test_runtime_helper.py +211 -0
  44. package/bundled/dev-pipeline/tests/test_unified_cli.py +5 -0
  45. package/bundled/skills/_metadata.json +1 -1
  46. package/package.json +1 -1
@@ -70,7 +70,7 @@ You are the **bug fix session agent**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}".
70
70
  ### Phase 0: Initialize
71
71
 
72
72
  ```bash
73
- mkdir -p .prizmkit/bugfix/{{BUG_ID}}
73
+ {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/bugfix/{{BUG_ID}}
74
74
  ```
75
75
 
76
76
  {{IF_BROWSER_INTERACTION}}
@@ -186,7 +186,7 @@ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
186
186
  **Gate Check — Review Report**:
187
187
  After `/prizmkit-code-review` returns, verify the review report:
188
188
  ```bash
189
- grep -q "## Verdict" .prizmkit/bugfix/{{BUG_ID}}/review-report.md && echo "GATE:PASS" || echo "GATE:MISSING"
189
+ {{RUNTIME_HELPER_CMD}} text contains .prizmkit/bugfix/{{BUG_ID}}/review-report.md --pattern "## Verdict"
190
190
  ```
191
191
  If GATE:MISSING:
192
192
  - Do not re-run `/prizmkit-code-review` in an unbounded report-repair loop.
@@ -96,7 +96,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
96
96
 
97
97
  Create refactor artifacts directory:
98
98
  ```bash
99
- mkdir -p .prizmkit/refactor/{{REFACTOR_ID}}
99
+ {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/refactor/{{REFACTOR_ID}}
100
100
  ```
101
101
 
102
102
  ### Step 2: Pipeline Phases
@@ -208,7 +208,7 @@ Evidence must cover affected UI render, primary user interactions, behavior-sens
208
208
  - **Gate Check — Review Report**:
209
209
  After Reviewer returns, verify the review report contains a verdict:
210
210
  ```bash
211
- grep -q "## Verdict" .prizmkit/refactor/{{REFACTOR_ID}}/review-report.md && echo "GATE:PASS" || echo "GATE:MISSING"
211
+ {{RUNTIME_HELPER_CMD}} text contains .prizmkit/refactor/{{REFACTOR_ID}}/review-report.md --pattern "## Verdict"
212
212
  ```
213
213
  If GATE:MISSING:
214
214
  - Do not enter an unbounded report-repair loop and do not repeatedly re-spawn Reviewer.
@@ -9,7 +9,7 @@ A checkpoint file tracks your progress through this workflow:
9
9
  Use this helper to update checkpoint status. Do not hand-edit `workflow-checkpoint.json` directly.
10
10
 
11
11
  ```bash
12
- python3 .prizmkit/dev-pipeline/scripts/update-checkpoint.py \
12
+ {{CHECKPOINT_PYTHON_CMD}} \
13
13
  --checkpoint-path {{CHECKPOINT_PATH}} \
14
14
  --step <step-id-or-skill-name> \
15
15
  --status <in_progress|completed|failed|skipped> \
@@ -6,18 +6,18 @@ You are running in **headless non-interactive mode** with a FINITE context windo
6
6
 
7
7
  1. **context-snapshot.md is your single source of truth** — After it is built, ALWAYS read context-snapshot.md instead of re-reading individual source files
8
8
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
9
- 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use `grep -n '<pattern>' <file>` or `sed -n '<start>,<end>p' <file>` for targeted line lookups instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Subagents (Critic, Reviewer) must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
9
+ 3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Subagents (Critic, Reviewer) must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
10
10
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
11
11
  5. **One task at a time** — Complete and test one task before starting the next.
12
- 6. **Minimize tool output** — Never load full command output into context. First capture to a temp file (`cmd 2>&1 | tee /tmp/out.txt | tail -20`), then scan the head/tail to identify relevant fields, and use targeted filtering (`grep`, `sed`, `awk`) to extract only the information needed for the current task. Only read the filtered result — never the raw full output.
12
+ 6. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
13
13
  7. **No intermediate commits** — Do NOT run `git add`/`git commit` during implementation phases. All changes are committed once at the end via `/prizmkit-committer`.
14
- 8. **Capture test output once** — When running test suites during the post-review gate, capture with `<test-command> 2>&1 | tee /tmp/test-out.txt | tail -20`. Then grep `/tmp/test-out.txt` for details. Never re-run the suite just to apply a different filter.
14
+ 8. **Capture test output once** — When running test suites during the post-review gate, capture output once to `/tmp/test-out.txt` using the command/tool output option or the host-appropriate redirection, surface only the final relevant lines, then search `/tmp/test-out.txt` for details. Never re-run the suite just to apply a different filter.
15
15
  9. **Package version verification (HARD CONSTRAINT — BLOCKING)** — Before writing ANY dependency version in `package.json`, `requirements.txt`, `Cargo.toml`, `go.mod`, `Gemfile`, `pyproject.toml`, or any other dependency manifest:
16
16
  - You MUST verify the real version exists by querying the package registry first:
17
- - npm/Node.js: `npm view <package> dist-tags.latest 2>/dev/null`
18
- - Python/pip: `pip index versions <package> 2>/dev/null | head -1`
19
- - Go: `go list -m -versions <module>@latest 2>/dev/null`
20
- - Rust: `cargo search <crate> --limit 1 2>/dev/null`
17
+ - npm/Node.js: `npm view <package> dist-tags.latest`
18
+ - Python/pip: `pip index versions <package>` and use the first result line
19
+ - Go: `go list -m -versions <module>@latest`
20
+ - Rust: `cargo search <crate> --limit 1`
21
21
  - **NEVER guess or hallucinate version numbers**. If you cannot verify a version, use `"latest"` or `"*"` as a placeholder, or omit the version constraint entirely and let the package manager resolve it
22
22
  - If the registry query fails (network issue, package not found), you MUST either:
23
23
  (a) Use a known-safe version you have high confidence in, OR
@@ -26,4 +26,4 @@ You are running in **headless non-interactive mode** with a FINITE context windo
26
26
  - **This is a BLOCKING gate**: do NOT run `npm install` / `pip install` / `cargo build` / `go mod tidy` until ALL versions in the manifest have been verified or use open constraints
27
27
  - Batch version lookups: query multiple packages in parallel to save time (e.g., run multiple `npm view` commands concurrently)
28
28
  10. **Build artifact hygiene** — After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary, build directory, generated bundle, or cache directory is ignored by git before the commit phase. Never commit compiled binaries, build output, or generated artifacts.
29
- 11. **Read offset safety (BLOCKING)** — If Read returns "shorter than offset"/"File is empty"/"Wasted call" — do NOT retry same offset. Run `wc -l <file>` to get real line count, then `sed -n '<start>,<end>p' <file>` for exact range. 2 consecutive offset errors → STOP Reading that file. Never guess offsets `grep -n '<anchor>'` first.
29
+ 11. **Read offset safety (BLOCKING)** — If Read returns "shorter than offset"/"File is empty"/"Wasted call" — do NOT retry same offset. Use the platform file-reading tool to refresh bounded line information, or locate an anchor with `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<anchor>" --json` before reading a small bounded range. 2 consecutive offset errors → STOP Reading that file. Never guess offsets or prescribe POSIX-only lookup commands.
@@ -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 the installed skill from the Claude user skills directory 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,19 @@ 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: `opencli browser open http://localhost:<DEV_PORT>`
66
+ 3. Inspect: `opencli browser state`
84
67
  3. If auth needed, opencli reuses Chrome cookies — SSO/OAuth may already be active
85
68
 
86
69
  **Step 2 — Verification (opencli)**:
@@ -89,36 +72,32 @@ Use `opencli browser state` to discover elements with `[N]` indices, then verify
89
72
 
90
73
  Key commands: `state`, `click <N>`, `type <N> "text"`, `get text <N>`, `get value <N>`, `wait text "..."`, `wait selector "..."`, `scroll down`, `eval "(function(){ ... })()"`.
91
74
 
92
- **Chain commands with `&&`**: `opencli browser type 3 "hello" && opencli browser click 7`
75
+ Run page-changing commands sequentially; for example, run `opencli browser type 3 "hello"`, then run `opencli browser click 7`.
93
76
 
94
77
  Always run `state` after page-changing actions to get fresh indices.
95
78
 
96
79
  **Step 3 — Cleanup (opencli)**:
97
80
  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`
81
+ 2. `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
82
+ 3. `{{RUNTIME_HELPER_CMD}} port check <DEV_PORT>`
100
83
 
101
84
  ---
102
85
 
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"`
118
-
119
- Start dev server: `<start-command> & DEV_SERVER_PID=$!`
86
+ **Shared: Dev Server Port / Process Helpers** (used by both tools):
120
87
 
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).
88
+ 1. Determine `DEV_PORT` from the pipeline value (`{{DEV_PORT}}`) or project config; do not guess.
89
+ 2. Verify port available:
90
+ ```bash
91
+ {{RUNTIME_HELPER_CMD}} port check <DEV_PORT>
92
+ ```
93
+ 3. Start dev server:
94
+ ```bash
95
+ {{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>
96
+ ```
97
+ 4. Wait for ready:
98
+ ```bash
99
+ {{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<DEV_PORT> --timeout 30 --interval 2
100
+ ```
122
101
 
123
102
  ---
124
103
 
@@ -128,7 +107,7 @@ Append results to `context-snapshot.md`:
128
107
  ```
129
108
  ## Browser Verification
130
109
  Tool: <playwright-cli or opencli>
131
- URL: http://localhost:$DEV_PORT
110
+ URL: http://localhost:<DEV_PORT>
132
111
  Dev Server Command: <actual command used>
133
112
  Tool version: <version>
134
113
  Steps executed: [list of commands used]
@@ -140,4 +119,3 @@ Append results to `context-snapshot.md`:
140
119
 
141
120
  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
121
 
143
-
@@ -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,23 @@ 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>
55
+ opencli browser state
64
56
  ```
65
57
  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
58
 
@@ -80,16 +72,14 @@ Key opencli browser commands for verification:
80
72
  - `opencli browser scroll down` — scroll page
81
73
  - `opencli browser eval "(function(){ ... })()"` — read-only JS evaluation for data extraction
82
74
 
83
- **Chain commands aggressively with `&&`** to minimize tool calls:
75
+ **Run commands sequentially and refresh state after page-changing actions**:
84
76
  ```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
89
- opencli browser type 3 "hello" && opencli browser type 4 "world" && opencli browser click 7
90
-
91
- # GOOD: click + wait + re-inspect
92
- opencli browser click 12 && opencli browser wait time 1 && opencli browser state
77
+ opencli browser open http://localhost:<DEV_PORT>
78
+ opencli browser state
79
+ opencli browser type 3 "hello"
80
+ opencli browser type 4 "world"
81
+ opencli browser click 7
82
+ opencli browser state
93
83
  ```
94
84
 
95
85
  **IMPORTANT**: Always run `opencli browser state` after page-changing actions (open, click on links, scroll) to get fresh element indices. Never guess indices.
@@ -99,8 +89,14 @@ Construct your verification workflow based on: (1) the `opencli browser --help`
99
89
  **Step 3 — Cleanup (REQUIRED — you started it, you stop it)**:
100
90
 
101
91
  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`
92
+ 2. Stop the dev server process using the PID file written in Step 1:
93
+ ```bash
94
+ {{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>
95
+ ```
96
+ 3. Verify port is released:
97
+ ```bash
98
+ {{RUNTIME_HELPER_CMD}} port check <DEV_PORT>
99
+ ```
104
100
 
105
101
  **Step 4 — Reporting**:
106
102
 
@@ -108,7 +104,7 @@ Append results to `context-snapshot.md`:
108
104
  ```
109
105
  ## Browser Verification
110
106
  Tool: opencli
111
- URL: http://localhost:$DEV_PORT
107
+ URL: http://localhost:<DEV_PORT>
112
108
  Dev Server Command: <actual command used>
113
109
  opencli version: <version>
114
110
  Steps executed: [list of opencli browser commands used]
@@ -120,4 +116,3 @@ Append results to `context-snapshot.md`:
120
116
 
121
117
  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
118
 
123
-
@@ -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 the installed skill from the Claude user skills directory 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,4 +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
-
@@ -2,7 +2,7 @@
2
2
 
3
3
  **a.** Check if feature already committed:
4
4
  ```bash
5
- git log --oneline | grep "{{FEATURE_ID}}" | head -3
5
+ git log --oneline
6
6
  ```
7
7
  - If a commit for `{{FEATURE_ID}}` already exists → **skip d** (do NOT run /prizmkit-committer, do NOT run git reset, do NOT stage or unstage anything). Proceed directly to e Final verification.
8
8
  - If no existing commit → proceed normally with b–d.
@@ -30,7 +30,7 @@ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ update
30
30
  ```bash
31
31
  git status --short
32
32
  ```
33
- Working tree MUST be clean after this step. If any feature-related files remain, stage them into the SAME commit via `git add <file> && git commit --amend --no-edit`, do NOT create a separate commit.
33
+ Working tree MUST be clean after this step. If any feature-related files remain, stage them explicitly and amend the SAME commit with `git commit --amend --no-edit`; do NOT create a separate commit.
34
34
 
35
35
  **f.** Write completion summary for downstream dependency context:
36
36
 
@@ -23,7 +23,7 @@ This single commit includes: feature code + tests + .prizmkit/prizm-docs/ update
23
23
  ```bash
24
24
  git status --short
25
25
  ```
26
- Working tree MUST be clean after this step. If any feature-related files remain, stage them into the SAME commit via `git add <file> && git commit --amend --no-edit`, do NOT create a separate commit.
26
+ Working tree MUST be clean after this step. If any feature-related files remain, stage them explicitly and amend the SAME commit with `git commit --amend --no-edit`; do NOT create a separate commit.
27
27
 
28
28
  **e.** Write completion summary for downstream dependency context:
29
29
 
@@ -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:
@@ -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
 
@@ -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
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  Before starting, check plan.md Tasks:
6
6
  ```bash
7
- grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null || true
7
+ {{RUNTIME_HELPER_CMD}} text count .prizmkit/specs/{{FEATURE_SLUG}}/plan.md --pattern "- [ ]"
8
8
  ```
9
9
  - If result is `0` (all tasks already `[x]`) → **SKIP to Review**.
10
10
  - If non-zero → implement directly below.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Before starting, check plan.md Tasks:
6
6
  ```bash
7
- grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null || true
7
+ {{RUNTIME_HELPER_CMD}} text count .prizmkit/specs/{{FEATURE_SLUG}}/plan.md --pattern "- [ ]"
8
8
  ```
9
9
  - If result is `0` (all tasks already `[x]`) → **SKIP to Review**.
10
10
  - If non-zero → implement directly below.
@@ -1,7 +1,7 @@
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`:
@@ -1,7 +1,7 @@
1
1
  ### Plan & Tasks
2
2
 
3
3
  ```bash
4
- ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
4
+ {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}
5
5
  ```
6
6
 
7
7
  If plan.md missing, run `/prizmkit-plan` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`:
@@ -5,8 +5,8 @@
5
5
  Create a current-run marker immediately before invoking the skill:
6
6
 
7
7
  ```bash
8
- mkdir -p .prizmkit/specs/{{FEATURE_SLUG}}
9
- touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
8
+ {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/specs/{{FEATURE_SLUG}}
9
+ {{RUNTIME_HELPER_CMD}} artifact touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
10
10
  ```
11
11
 
12
12
  Run `/prizmkit-test` with the feature artifact directory:
@@ -9,7 +9,7 @@ The skill runs an internal review-fix loop (Reviewer Agent → filter → orches
9
9
  **Gate Check — Review Report**:
10
10
  After `/prizmkit-code-review` returns, verify the review report:
11
11
  ```bash
12
- grep -q "## Verdict" .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md && echo "GATE:PASS" || echo "GATE:MISSING"
12
+ {{RUNTIME_HELPER_CMD}} text contains .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md --pattern "## Verdict"
13
13
  ```
14
14
  If GATE:MISSING:
15
15
  - Do not re-run `/prizmkit-code-review` in an unbounded report-repair loop.