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
@@ -52,21 +52,18 @@ You are running in **headless non-interactive mode** with a FINITE context windo
52
52
 
53
53
  1. **context-snapshot.md is your single source of truth** — After Phase 1-2 builds it, ALWAYS read context-snapshot.md instead of re-reading individual source files
54
54
  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.
55
- 3. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
55
+ 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.
56
+ 4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
56
57
  4. **One task at a time** — In Phase 4 (implement), complete and test one task before starting the next.
57
58
  5. **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.
58
59
  6. **No intermediate commits** — Do NOT run `git add`/`git commit` during Phase 1-5. All changes are committed once at the end in Phase 6 via `/prizmkit-committer`.
59
60
  7. **Batch independent operations** — Issue multiple independent `Write`/`Read` calls in a single message turn when they have no dependencies. Combine multiple `mkdir -p` into one command. Never run `npm test` twice just to apply a different grep filter — capture output to `/tmp/test-out.txt` once and grep the file.
60
- 8. **Scaffold / generated file awareness** — Files created by scaffolding tools are boilerplate. Tag them, record in context-snapshot.md, NEVER re-read. Edit directly without reading first.
61
61
  9. **Package version verification (BLOCKING)** — Verify dependency versions via registry query before writing them. NEVER guess.
62
62
  10. **Build artifact hygiene** — After build/compile, ensure output is in `.gitignore`.
63
63
  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` for exact range. 2 consecutive offset errors → STOP Reading that file. Never guess offsets — `grep -n '<anchor>'` first.
64
64
 
65
65
  ---
66
66
 
67
- {{LOG_SIZE_AWARENESS}}
68
- ---
69
-
70
67
  ## PrizmKit Directory Convention
71
68
 
72
69
  ```
@@ -82,7 +79,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
82
79
  ## Subagent Timeout Recovery
83
80
 
84
81
  If any agent times out:
85
- 1. `ls .prizmkit/specs/{{FEATURE_SLUG}}/` — check what exists
82
+ 1. `{{RUNTIME_HELPER_CMD}} artifact list .prizmkit/specs/{{FEATURE_SLUG}}` — check what exists
86
83
  2. If `context-snapshot.md` exists: open recovery prompt with `"Read .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md for project context and any Implementation Log/Review Notes from previous agents. Run git diff HEAD to see actual code changes already made. Do NOT re-read individual source files unless the File Manifest directs you to."` + only remaining steps + `model: "lite"`
87
84
  3. Max 2 retries per phase. After 2 failures, orchestrator completes the work directly and appends a Recovery Note to context-snapshot.md.
88
85
 
@@ -93,30 +90,22 @@ If any agent times out:
93
90
  {{IF_INIT_NEEDED}}
94
91
  ### Phase 0: Project Bootstrap
95
92
  - Run `/prizmkit-init` (invoke the prizmkit-init skill)
96
- - Run `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
93
+ - Run `{{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
97
94
  - **CP-0**: Verify `.prizmkit/prizm-docs/root.prizm`, `.prizmkit/config.json` exist
98
95
  {{END_IF_INIT_NEEDED}}
99
96
  {{IF_INIT_DONE}}
100
- ### Phase 0: Detect Test Commands
101
-
102
- **Step 1 — Detect test commands**: You know this project's tech stack. Identify ALL test commands that apply (e.g., `go test ./...`, `npm test`, `cargo test`, `pytest`, `make test`, etc.). Record them as `TEST_CMDS`.
103
-
104
- **Step 2 — Do not run tests yet**: This phase only records the commands that will be used by the post-review PrizmKit Test gate. Test execution happens after code review.
105
-
106
- > **Test Output Rule**: When the post-review gate runs, capture test output to a temp file (`tee /tmp/test-out.txt`). Then grep the file instead of re-running the suite.
107
- {{END_IF_INIT_DONE}}
108
97
 
109
98
  ### Step 1: Initialize
110
99
 
111
100
  1. Run init script:
112
- `python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
101
+ `{{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
113
102
 
114
103
  2. Check for existing artifacts:
115
- `ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null`
104
+ `{{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}`
116
105
 
117
106
  {{IF_FRESH_START}}
118
107
  ```bash
119
- python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
108
+ {{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}
120
109
  ```
121
110
  {{END_IF_FRESH_START}}
122
111
 
@@ -124,7 +113,7 @@ python3 {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEAT
124
113
 
125
114
  Check existing artifacts first:
126
115
  ```bash
127
- ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
116
+ {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}
128
117
  ```
129
118
 
130
119
  - Both (spec.md, plan.md) exist → **SKIP to CP-1**
@@ -143,11 +132,11 @@ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing
143
132
  **Step A — Build Context Snapshot** (skip if `context-snapshot.md` already exists):
144
133
 
145
134
  1. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 prizm docs
146
- 2. Detect source code directories: read KEY_FILES and STRUCTURE sections from `root.prizm` to identify where source code lives (e.g. `src/`, `app/`, `lib/`, `cmd/`, `packages/`, or project root). If `root.prizm` is missing, scan the project tree:
135
+ 2. Detect source code directories from KEY_FILES and STRUCTURE sections in `root.prizm`; if root docs are unavailable, use the helper to list likely source files:
147
136
  ```bash
148
- find . -maxdepth 2 -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.java" -o -name "*.rb" -o -name "*.rs" \) -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/vendor/*' | head -30
137
+ {{RUNTIME_HELPER_CMD}} artifact source-files . --json
149
138
  ```
150
- Identify the top-level source directories from the results.
139
+ Identify the top-level source directories from the helper output.
151
140
  3. Scan the detected source directories for files related to this feature; read each one
152
141
  4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
153
142
  - **Section 1 — Feature Brief**: feature description (2-3 lines) + acceptance criteria (copy from above)
@@ -166,17 +155,18 @@ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing
166
155
 
167
156
  ### Known TRAPS (from .prizmkit/prizm-docs/)
168
157
  - <trap entries extracted from L1/L2 docs>
169
- 4. Confirm: `ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`
158
+ 4. Confirm: `{{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`
170
159
 
171
160
  **After Step A**: Use context-snapshot.md Section 4 File Manifest to guide targeted file reads. Do NOT scan directories or read unrelated files.
172
161
 
173
162
  **Step B — Planning Artifacts** (generate only missing files):
174
163
 
175
164
  ```bash
176
- ls .prizmkit/specs/{{FEATURE_SLUG}}/spec.md .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null
165
+ {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/spec.md
166
+ {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/plan.md
177
167
  ```
178
168
 
179
- - spec.md missing: Run `/prizmkit-plan` → generate spec.md. Resolve any `[NEEDS CLARIFICATION]` markers using the feature description do NOT pause for interactive input.
169
+ - spec.md missing: Run `/prizmkit-plan` → generate spec.md. Resolve uncertain requirements from the feature description, existing code, and conservative existing-project patterns.
180
170
  - plan.md missing: Run `/prizmkit-plan` → generate plan.md (architecture, components, interface design, data model, testing strategy, risk assessment, and Tasks section with `[ ]` checkboxes)
181
171
 
182
172
  > All files go under `.prizmkit/specs/{{FEATURE_SLUG}}/`. Confirm each with `ls` after writing.
@@ -185,14 +175,14 @@ ls .prizmkit/specs/{{FEATURE_SLUG}}/spec.md .prizmkit/specs/{{FEATURE_SLUG}}/pla
185
175
  Before proceeding past CP-1, verify:
186
176
  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)
187
177
  2. All new tables/fields follow existing naming conventions, ID strategy, timestamp patterns, and constraint style
188
- 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.
178
+ 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.
189
179
  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.
190
180
 
191
181
  **CP-1**: Both spec.md and plan.md exist.
192
182
 
193
183
  ### Phase 3: Analyze — Reviewer Agent
194
184
 
195
- Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", mode="plan", run_in_background=false).
185
+ Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", mode="plan", run_in_background=false, isolation=default/no worktree). Do not request worktree isolation; this prevents AI tool-created `.claude/worktrees/...` subagent worktrees. PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...` are separate and controlled by `USE_WORKTREE`.
196
186
 
197
187
  Spawn failure cap: for team/config/lock errors, retry at most once for this Reviewer spawn. If the second attempt fails, do not poll for report artifacts; fix/check the plan inline or write `failure-log.md` before stopping for recovery.
198
188
 
@@ -213,7 +203,7 @@ Wait for Reviewer to return.
213
203
 
214
204
  **Guard**: Verify critic agent file exists before spawning:
215
205
  ```bash
216
- ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
206
+ {{RUNTIME_HELPER_CMD}} artifact exists {{CRITIC_SUBAGENT_PATH}} --exists-marker CRITIC:READY --missing-marker CRITIC:MISSING
217
207
  ```
218
208
  If CRITIC:MISSING — skip Phase 3.5 entirely and proceed to Phase 4. Log: "Critic agent not installed — skipping Plan Challenge."
219
209
 
@@ -221,7 +211,7 @@ If CRITIC:MISSING — skip Phase 3.5 entirely and proceed to Phase 4. Log: "Crit
221
211
 
222
212
  **If {{CRITIC_COUNT}} = 1 → Single Critic** (skip to CP-2.5 after this):
223
213
 
224
- Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", mode="plan", run_in_background=false).
214
+ Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", mode="plan", run_in_background=false, isolation=default/no worktree). Do not request worktree isolation; this prevents AI tool-created `.claude/worktrees/...` subagent worktrees. PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...` are separate and controlled by `USE_WORKTREE`.
225
215
 
226
216
  Spawn failure cap: for team/config/lock errors, retry at most once for this Critic spawn. If the second attempt fails, do not poll for challenge reports; perform the plan challenge inline and record the fallback.
227
217
 
@@ -229,16 +219,17 @@ Prompt:
229
219
  > "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
230
220
  > **MODE: Plan Challenge**
231
221
  > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has TRAPS/RULES, Section 4 has file manifest.
232
- > 2. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 docs for affected modules.
233
- > 3. Read existing source files in the modules this plan touches.
234
- > 4. Challenge plan.md against the project's existing architecture, patterns, and style.
222
+ > 2. Use context-snapshot.md as the shared source of truth. Do not create or enter AI tool-created `.claude/worktrees/...` subagent worktrees; use default/no worktree isolation and do not request worktree isolation.
223
+ > 3. PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...` are a separate runner feature controlled by `USE_WORKTREE`; do not confuse them with AI tool-created `.claude/worktrees/...`.
224
+ > 4. Read additional `.prizmkit/prizm-docs/` or source excerpts only when needed to verify a specific challenge.
225
+ > 5. Challenge plan.md against the project's existing architecture, patterns, and style.
235
226
  > Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` with findings (or 'No significant challenges')."
236
227
 
237
228
  **If {{CRITIC_COUNT}} = 3 → Multi-Critic Voting** (skip Single Critic above):
238
229
 
239
230
  **IMPORTANT**: Spawn all 3 Critics in PARALLEL (issue all 3 Agent tool calls in the SAME message turn). Do NOT wait for one before spawning the next.
240
231
 
241
- Spawn Critic-A, Critic-B, Critic-C simultaneously (each with mode="plan", run_in_background=false):
232
+ Spawn Critic-A, Critic-B, Critic-C simultaneously (each with mode="plan", run_in_background=false, isolation=default/no worktree). Do not request worktree isolation; this prevents AI tool-created `.claude/worktrees/...` subagent worktrees. PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...` are separate and controlled by `USE_WORKTREE`:
242
233
 
243
234
  Critic-A prompt (append to base prompt above):
244
235
  > "**Focus Lens: Architecture & Scalability.** Prioritize: architectural pattern fit, scalability implications, over-engineering risks, component boundary design.
@@ -307,15 +298,6 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
307
298
 
308
299
  **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.
309
300
 
310
- **Checkpoint update**:
311
- ```bash
312
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
313
- --checkpoint-path .prizmkit/specs/{{FEATURE_SLUG}}/workflow-checkpoint.json \
314
- --step prizmkit-implement \
315
- --status completed
316
- ```
317
-
318
-
319
301
  ### Review — Code Review
320
302
 
321
303
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
@@ -327,7 +309,7 @@ The skill runs an internal review-fix loop (Reviewer Agent → filter → orches
327
309
  **Gate Check — Review Report**:
328
310
  After `/prizmkit-code-review` returns, verify the review report:
329
311
  ```bash
330
- grep -q "## Verdict" .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md && echo "GATE:PASS" || echo "GATE:MISSING"
312
+ {{RUNTIME_HELPER_CMD}} text contains .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md --pattern "## Verdict"
331
313
  ```
332
314
  If GATE:MISSING:
333
315
  - Do not re-run `/prizmkit-code-review` in an unbounded report-repair loop.
@@ -345,7 +327,11 @@ Read `review-report.md` and check the Verdict:
345
327
 
346
328
  Run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` after review and before commit.
347
329
 
348
- Before invoking the skill, create `.prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started` so stale reports are ignored.
330
+ Before invoking the skill, create a current-run marker so stale reports are ignored:
331
+ ```bash
332
+ {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/specs/{{FEATURE_SLUG}}
333
+ {{RUNTIME_HELPER_CMD}} artifact touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
334
+ ```
349
335
 
350
336
  Gate requirements:
351
337
  - Generate or update tests only for this feature's changed files, changed public interfaces, and acceptance criteria.
@@ -375,13 +361,13 @@ You MUST execute this phase. Do NOT skip it.
375
361
 
376
362
  0a. Check if `playwright-cli` is installed:
377
363
  ```bash
378
- which playwright-cli 2>/dev/null && playwright-cli --version 2>/dev/null || echo "NOT_INSTALLED"
364
+ {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
379
365
  ```
380
366
  If output is `NOT_INSTALLED`, install it:
381
367
  ```bash
382
368
  npm install -g @playwright/cli@latest
383
369
  ```
384
- Then verify installation succeeded: `playwright-cli --version`. If installation fails, log `## Browser Verification: SKIPPED — playwright-cli installation failed` in context-snapshot.md and proceed to the next phase.
370
+ Then verify installation succeeded: `{{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version`. If installation fails, log `## Browser Verification: SKIPPED — playwright-cli installation failed` in context-snapshot.md and proceed to the next phase.
385
371
 
386
372
  0b. Learn playwright-cli usage (run once per session):
387
373
  ```bash
@@ -390,21 +376,9 @@ playwright-cli --help
390
376
 
391
377
  0c. Check if playwright-cli skill is installed for the current AI platform:
392
378
  ```bash
393
- CURRENT_PLATFORM=""
394
- if which claude >/dev/null 2>&1; then
395
- CURRENT_PLATFORM="claude"; SKILL_DIR="$HOME/.claude/skills"
396
- elif which cbc >/dev/null 2>&1; then
397
- CURRENT_PLATFORM="codebuddy"; SKILL_DIR="$HOME/.cbc/skills"
398
- else
399
- CURRENT_PLATFORM="unknown"
400
- fi
401
- if [ -d "$SKILL_DIR/playwright-cli" ] || ls "$SKILL_DIR"/playwright* 2>/dev/null | grep -q .; then
402
- echo "SKILL_EXISTS"
403
- else
404
- echo "SKILL_MISSING"
405
- fi
379
+ {{RUNTIME_HELPER_CMD}} platform skill playwright-cli --prefix
406
380
  ```
407
- 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`.
381
+ 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.
408
382
 
409
383
  0d. Read the installed playwright-cli skill (SKILL.md) for workflow guidance. Use its recommended patterns to construct your verification flow.
410
384
 
@@ -413,28 +387,16 @@ If `SKILL_MISSING`: run `playwright-cli install --skills`. If current platform i
413
387
  You know this project's tech stack. Detect and start the dev server yourself:
414
388
 
415
389
  1. Identify the dev server start command from project config (`package.json` scripts, `Makefile`, `docker-compose.yml`, etc.)
416
- 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:
417
- ```bash
418
- DEV_PORT={{DEV_PORT}}
419
- if [ "$DEV_PORT" = "{{DEV_PORT}}" ]; then
420
- DEV_PORT=$(node -e "const s=require('./package.json').scripts.dev; const m=s.match(/-p\s+(\d+)/); console.log(m?m[1]:'')")
421
- if [ -z "$DEV_PORT" ]; then
422
- DEV_PORT=$(echo "$NEXT_PUBLIC_SITE_URL" | sed -nE 's|.*:([0-9]+).*|\1|p')
423
- fi
424
- DEV_PORT=${DEV_PORT:-3000}
425
- fi
426
- echo "Detected DEV_PORT=$DEV_PORT"
427
- ```
390
+ 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.
428
391
  3. Verify the port is available:
429
392
  ```bash
430
- lsof -ti:$DEV_PORT 2>/dev/null && echo "PORT_IN_USE" || echo "PORT_FREE"
393
+ {{RUNTIME_HELPER_CMD}} port check $DEV_PORT
431
394
  ```
432
395
  4. Start the dev server in background, capture PID:
433
396
  ```bash
434
- <start-command> &
435
- DEV_SERVER_PID=$!
397
+ {{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>
436
398
  ```
437
- 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)
399
+ 5. Wait for server to be ready: run `{{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:$DEV_PORT --timeout 30 --interval 2`
438
400
  6. Open the app in playwright-cli: `playwright-cli open http://localhost:$DEV_PORT`
439
401
  7. If the page requires authentication, use playwright-cli to register a test user and log in first
440
402
 
@@ -448,8 +410,8 @@ Construct your verification workflow based on: (1) the playwright-cli skill docu
448
410
  **Step 3 — Cleanup (REQUIRED — you started it, you stop it)**:
449
411
 
450
412
  1. Close the playwright-cli browser: `playwright-cli close`
451
- 2. Kill the dev server process: `kill $DEV_SERVER_PID 2>/dev/null || true`
452
- 3. Verify port is released: `lsof -ti:$DEV_PORT | xargs kill -9 2>/dev/null || true`
413
+ 2. Kill the dev server process: `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
414
+ 3. Verify port is released: `{{RUNTIME_HELPER_CMD}} process cleanup-port $DEV_PORT`
453
415
  {{END_IF_BROWSER_TOOL_PLAYWRIGHT}}
454
416
  {{IF_BROWSER_TOOL_OPENCLI}}
455
417
  **Using: opencli** (reuses Chrome logged-in sessions)
@@ -462,45 +424,42 @@ Construct your verification workflow based on: (1) the playwright-cli skill docu
462
424
 
463
425
  0a. Check if `opencli` is installed:
464
426
  ```bash
465
- which opencli 2>/dev/null && opencli --version 2>/dev/null || echo "NOT_INSTALLED"
427
+ {{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
466
428
  ```
467
429
  If `NOT_INSTALLED`: `npm install -g @jackwener/opencli@latest`. If installation fails, log `## Browser Verification: SKIPPED — opencli installation failed` and proceed.
468
430
 
469
431
  0b. Verify Browser Bridge: `opencli doctor`. If fails, log skip and proceed.
470
432
 
471
- 0c. Learn usage: `opencli browser --help 2>/dev/null || opencli --help`
433
+ 0c. Learn usage: `opencli browser --help`
472
434
 
473
- **Step 1 — Start Dev Server**: (same port detection as playwright path)
474
- ```bash
475
- DEV_PORT={{DEV_PORT}}
476
- if [ "$DEV_PORT" = "{{DEV_PORT}}" ]; then
477
- DEV_PORT=$(node -e "const s=require('./package.json').scripts.dev; const m=s.match(/-p\s+(\d+)/); console.log(m?m[1]:'')" 2>/dev/null)
478
- DEV_PORT=${DEV_PORT:-3000}
479
- fi
480
- ```
481
- Start server, wait for ready, then: `opencli browser open http://localhost:$DEV_PORT && opencli browser state`
435
+ **Step 1 — Start Dev Server**:
436
+ 1. Determine `DEV_PORT` from the pipeline value (`{{DEV_PORT}}`) or project config; do not guess.
437
+ 2. Verify port available: `{{RUNTIME_HELPER_CMD}} port check <DEV_PORT>`
438
+ 3. Start server: `{{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>`
439
+ 4. Wait for ready: `{{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<DEV_PORT> --timeout 30 --interval 2`
440
+ 5. Open: `opencli browser open http://localhost:<DEV_PORT>`; then inspect: `opencli browser state`
482
441
 
483
442
  **Step 2 — Verification**:
484
443
 
485
444
  Use `opencli browser state` to discover elements with `[N]` indices, then verify:
486
445
  {{BROWSER_VERIFY_STEPS}}
487
446
 
488
- Chain commands: `opencli browser click <N> && opencli browser wait time 1 && opencli browser state`
447
+ Run page-changing commands sequentially, then run `opencli browser state` to refresh indices.
489
448
 
490
449
  **Step 3 — Cleanup**:
491
450
  1. `opencli browser close`
492
- 2. `kill $DEV_SERVER_PID 2>/dev/null || true`
493
- 3. `lsof -ti:$DEV_PORT | xargs kill -9 2>/dev/null || true`
451
+ 2. `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
452
+ 3. `{{RUNTIME_HELPER_CMD}} process cleanup-port $DEV_PORT`
494
453
  {{END_IF_BROWSER_TOOL_OPENCLI}}
495
454
  {{IF_BROWSER_TOOL_AUTO}}
496
455
  **Tool Selection**: Choose the best browser tool at runtime.
497
456
 
498
457
  **Step 0 — Detect available tools**:
499
458
  ```bash
500
- echo "=== playwright-cli ===" && which playwright-cli 2>/dev/null && playwright-cli --version 2>/dev/null || echo "NOT_INSTALLED"
501
- echo "=== opencli ===" && which opencli 2>/dev/null && opencli --version 2>/dev/null || echo "NOT_INSTALLED"
459
+ {{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
460
+ {{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
502
461
  ```
503
- If opencli installed: `opencli doctor 2>/dev/null || echo "OPENCLI_BRIDGE_FAILED"`
462
+ If opencli is installed, run `opencli doctor`. If it fails, mark OpenCLI unusable and choose playwright-cli or skip browser verification.
504
463
 
505
464
  **Decision table**:
506
465
  | Condition | Tool |
@@ -40,20 +40,17 @@ You are the **bug fix session agent**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}".
40
40
 
41
41
  {{GLOBAL_CONTEXT}}
42
42
 
43
- ### Project Conventions
44
-
45
- > Read {{PLATFORM_CONVENTIONS}} for project-level coding standards, architecture decisions, and development rules.
46
43
 
47
44
  ## ⚠️ Context Budget Rules (CRITICAL)
48
45
 
49
46
  0. **NON-INTERACTIVE MODE** — NEVER ask for confirmation. Proceed autonomously.
50
47
  1. **context-snapshot.md is your single source of truth** — After it is built, read context-snapshot.md instead of re-reading individual source files.
51
48
  2. **Never re-read your own writes** — Trust your write was correct.
52
- 3. **Stay focused** — Do NOT explore code unrelated to this bug.
49
+ 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 after your last read. Use `grep -n` or `sed -n` for targeted lookups instead of full-file Read. Before issuing a Read, ask: "Have I read this file before, and has it changed since?" If no — do NOT read it. Subagents must rely on context-snapshot.md rather than re-reading files the orchestrator already read.
50
+ 4. **Stay focused** — Do NOT explore code unrelated to this bug.
53
51
  4. **Minimize tool output** — Capture to temp file, scan head/tail, filter with grep/sed/awk. Never load full output.
54
52
  5. **No intermediate commits** — All changes committed once at the end via `/prizmkit-committer`.
55
53
 
56
- {{LOG_SIZE_AWARENESS}}
57
54
  ## Bug Fix Artifacts Directory
58
55
 
59
56
  ```
@@ -64,16 +61,7 @@ You are the **bug fix session agent**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}".
64
61
  └── fix-report.md ← Final bug resolution report
65
62
  ```
66
63
 
67
- ## Workflow Checkpoint System
68
-
69
- **Path**: `{{CHECKPOINT_PATH}}`
70
-
71
- **Rules**:
72
- 1. **Before each step**: Read `workflow-checkpoint.json`, verify the previous step is `"completed"`. If not, complete it first.
73
- 2. **Starting a step**: Update to `status: "in_progress"`.
74
- 3. **After step completes**: Update to `status: "completed"`.
75
- 4. **On failure**: Set to `status: "failed"` and continue if possible.
76
- 5. **On resume**: Skip `"completed"` steps. Start from first `"pending"` or `"in_progress"` step.
64
+ {{CHECKPOINT_SYSTEM}}
77
65
 
78
66
  ---
79
67
 
@@ -82,7 +70,7 @@ You are the **bug fix session agent**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}".
82
70
  ### Phase 0: Initialize
83
71
 
84
72
  ```bash
85
- mkdir -p .prizmkit/bugfix/{{BUG_ID}}
73
+ {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/bugfix/{{BUG_ID}}
86
74
  ```
87
75
 
88
76
  {{IF_BROWSER_INTERACTION}}
@@ -138,7 +126,7 @@ Run `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
138
126
  - The spec.md should capture: root cause, impact scope, behavior that must be preserved
139
127
  - The plan.md Tasks section **MUST start with a reproduction test task** — a test that FAILS with current code (RED state), proving the bug exists
140
128
  - Subsequent tasks implement the minimal fix to make the test pass (GREEN state)
141
- - Resolve any `[NEEDS CLARIFICATION]` markers autonomously do NOT pause
129
+ - Resolve uncertain fix details autonomously from the bug report, failing behavior, existing code, and conservative existing-project patterns.
142
130
 
143
131
  {{IF_BROWSER_INTERACTION}}
144
132
  - **Browser Verification**: If the bug is UI-reproducible, plan.md should reference the Browser Verification Protocol above instead of redefining browser steps.
@@ -198,7 +186,7 @@ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
198
186
  **Gate Check — Review Report**:
199
187
  After `/prizmkit-code-review` returns, verify the review report:
200
188
  ```bash
201
- 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"
202
190
  ```
203
191
  If GATE:MISSING:
204
192
  - Do not re-run `/prizmkit-code-review` in an unbounded report-repair loop.
@@ -61,9 +61,6 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
61
61
 
62
62
  {{GLOBAL_CONTEXT}}
63
63
 
64
- ### Project Conventions
65
-
66
- > Read {{PLATFORM_CONVENTIONS}} for project-level coding standards, architecture decisions, and development rules.
67
64
 
68
65
  ## Refactor Artifacts Directory
69
66
 
@@ -78,7 +75,6 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
78
75
 
79
76
  ## Execution Instructions
80
77
 
81
- {{LOG_SIZE_AWARENESS}}
82
78
  **YOU are the orchestrator. Execute each phase by spawning the appropriate team agent with run_in_background=false.**
83
79
 
84
80
  **Agent spawn failure policy (all Agent tool calls)**:
@@ -88,15 +84,7 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
88
84
  - Any recovery exception must be recorded in the required report or session status so downstream runs know the normal team path was unavailable.
89
85
  - Apply the same cap to any re-spawn for report repair or resume prompts; do not burn multiple minutes on identical team/config/lock failures.
90
86
 
91
- ## Workflow Checkpoint System
92
-
93
- A checkpoint file tracks your progress through this workflow:
94
-
95
- **Path**: `{{CHECKPOINT_PATH}}`
96
-
97
- **How to use**:
98
- 1. **Before each step**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If not, complete it first.
99
- 2. **After completing a step**: Update the step's `status` to `"completed"` in `workflow-checkpoint.json`.
87
+ {{CHECKPOINT_SYSTEM}}
100
88
 
101
89
  ### Step 1: Initialize
102
90
 
@@ -108,7 +96,7 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
108
96
 
109
97
  Create refactor artifacts directory:
110
98
  ```bash
111
- mkdir -p .prizmkit/refactor/{{REFACTOR_ID}}
99
+ {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/refactor/{{REFACTOR_ID}}
112
100
  ```
113
101
 
114
102
  ### Step 2: Pipeline Phases
@@ -129,7 +117,7 @@ Run `/prizmkit-plan` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`:
129
117
  - Every task ends with "run test suite to verify behavior preserved"
130
118
  - Rollback strategy
131
119
 
132
- Resolve any `[NEEDS CLARIFICATION]` markers using the refactor description do NOT pause for interactive input.
120
+ Resolve uncertain refactor details from the refactor description, existing code, and conservative existing-project patterns.
133
121
 
134
122
  {{IF_BROWSER_INTERACTION}}
135
123
 
@@ -185,7 +173,7 @@ Evidence must cover affected UI render, primary user interactions, behavior-sens
185
173
 
186
174
  {{END_IF_BROWSER_INTERACTION}}
187
175
 
188
- 7. If the refactor involves multiple files: update durable checkpoints/artifacts at the midpoint, minimize output, and rely on runner continuation if context overflow occurs. In an interactive Claude Code session operated manually outside the headless pipeline, `/compact` may be used as an optional convenience only.
176
+ 7. If the refactor involves multiple files: update durable checkpoints/artifacts at the midpoint, minimize output, and rely on runner continuation if context overflow occurs.
189
177
  8. After all tasks complete, run the full test suite one final time
190
178
  "
191
179
  - **Wait for Dev to return**
@@ -220,7 +208,7 @@ Evidence must cover affected UI render, primary user interactions, behavior-sens
220
208
  - **Gate Check — Review Report**:
221
209
  After Reviewer returns, verify the review report contains a verdict:
222
210
  ```bash
223
- 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"
224
212
  ```
225
213
  If GATE:MISSING:
226
214
  - Do not enter an unbounded report-repair loop and do not repeatedly re-spawn Reviewer.
@@ -4,63 +4,29 @@ A checkpoint file tracks your progress through this workflow:
4
4
 
5
5
  **Path**: `{{CHECKPOINT_PATH}}`
6
6
 
7
- ### Rules
8
-
9
- 1. **Before each skill**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If it is still `"pending"` or `"in_progress"`, you MUST complete it first before moving on.
10
-
11
- 2. **Starting a skill**: Use the update script to set the current step to `status: "in_progress"`.
12
-
13
- 3. **After each skill completes**: Use the update script to set the current step to `status: "completed"`.
14
-
15
- 4. **On failure**: Use the update script to set the step to `status: "failed"` and continue to the next step if possible, or halt and write failure-log.md.
7
+ ### Checkpoint Update Helper
16
8
 
17
- 5. **On session exit**: The checkpoint file reflects your actual progress. Do NOT manually set future steps to "completed".
18
-
19
- ### Checkpoint Update Pattern
20
-
21
- **IMPORTANT: NEVER hand-write or edit `workflow-checkpoint.json` directly. Always use the update script.**
22
-
23
- After completing each skill, run:
9
+ Use this helper to update checkpoint status. Do not hand-edit `workflow-checkpoint.json` directly.
24
10
 
25
11
  ```bash
26
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
12
+ {{CHECKPOINT_PYTHON_CMD}} \
27
13
  --checkpoint-path {{CHECKPOINT_PATH}} \
28
- --step <SKILL_NAME> \
29
- --status completed
14
+ --step <step-id-or-skill-name> \
15
+ --status <in_progress|completed|failed|skipped> \
16
+ --note "<optional note>"
30
17
  ```
31
18
 
32
- For example, after completing `prizmkit-implement`:
33
- ```bash
34
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
35
- --checkpoint-path {{CHECKPOINT_PATH}} \
36
- --step prizmkit-implement \
37
- --status completed
38
- ```
19
+ - Use the step `skill` value such as `prizmkit-implement`, or the step id such as `S04`.
20
+ - Omit `--note` when there is no useful failure or handoff note.
39
21
 
40
- Before starting the next skill:
41
- ```bash
42
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
43
- --checkpoint-path {{CHECKPOINT_PATH}} \
44
- --step <NEXT_SKILL_NAME> \
45
- --status in_progress
46
- ```
22
+ ### Rules
47
23
 
48
- On failure:
49
- ```bash
50
- python3 $PIPELINE_DIR/scripts/update-checkpoint.py \
51
- --checkpoint-path {{CHECKPOINT_PATH}} \
52
- --step <SKILL_NAME> \
53
- --status failed \
54
- --note "brief failure reason"
55
- ```
24
+ 1. **Before each skill**: Read `workflow-checkpoint.json`, verify the previous step has `status: "completed"` or `status: "skipped"`. If it is still `"pending"` or `"in_progress"`, complete it first before moving on.
56
25
 
57
- The script outputs JSON: `{"ok": true, ...}` on success, `{"ok": false, "error": "..."}` on failure.
26
+ 2. **Starting a skill**: Use the checkpoint update helper to mark the current step as `status: "in_progress"`.
58
27
 
59
- ### Resume Behavior
28
+ 3. **After each skill completes**: Use the checkpoint update helper to mark the current step as `status: "completed"`.
60
29
 
61
- **Checkpoint is the primary source of truth for resume.** On retry sessions:
30
+ 4. **On failure**: Use the checkpoint update helper to mark the step as `status: "failed"`, write `failure-log.md` with the reason, and continue only when the workflow rules allow it.
62
31
 
63
- 1. Read `workflow-checkpoint.json` steps already `"completed"` or `"skipped"` are skipped
64
- 2. Start from the first `"pending"` or `"in_progress"` step
65
- 3. If `failure-log.md` exists, read it for diagnostic context (why the previous session failed, what approach to try differently) — but do NOT use it to determine which step to resume from
66
- 4. If `workflow-checkpoint.json` is missing or corrupted, fall back to `failure-log.md` + the resume phase as the legacy mechanism
32
+ 5. **On session exit**: The checkpoint file reflects your actual progress. Do NOT manually set future steps to `"completed"`.
@@ -6,18 +6,12 @@ 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. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
10
- 4. **One task at a time** Complete and test one task before starting the next.
11
- 5. **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. **No intermediate commits** — Do NOT run `git add`/`git commit` during implementation phases. All changes are committed once at the end via `/prizmkit-committer`.
13
- 7. **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. **Scaffold / generated file awareness (CRITICAL)** — When you run a scaffolding tool or package manager init command (`npm init`, `npx create-*`, `vite create`, `cargo init`, `go mod init`, `rails new`, `django-admin startproject`, `npx shadcn-ui init`, etc.), the output files are **generated boilerplate**. You MUST:
15
- - Identify and mentally tag all files created by the tool as "scaffold files"
16
- - Record the list of scaffold-generated files in context-snapshot.md under a `### Scaffold Files (do not re-read)` section
17
- - **NEVER re-read scaffold files** after initial creation. Their content is standard boilerplate — you already know what they contain from the tool that generated them
18
- - If you need to modify a scaffold file, make the edit directly without reading it first (you know the standard template content)
19
- - This applies equally to `node_modules/`, `package-lock.json`, generated config files (`tsconfig.json`, `vite.config.ts`, `tailwind.config.js`, `.eslintrc`, etc.) produced by init commands
20
- - When passing context to subagents, explicitly tell them which files are scaffold-generated so they skip reading them too
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.
10
+ 4. **Stay focused** Do NOT explore code unrelated to this feature. No curiosity-driven reads.
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.
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.
21
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:
22
16
  - You MUST verify the real version exists by querying the package registry first:
23
17
  - npm/Node.js: `npm view <package> dist-tags.latest 2>/dev/null`
@@ -32,4 +26,4 @@ You are running in **headless non-interactive mode** with a FINITE context windo
32
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
33
27
  - Batch version lookups: query multiple packages in parallel to save time (e.g., run multiple `npm view` commands concurrently)
34
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.
35
- 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` 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. 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.
@@ -14,8 +14,4 @@ Use this material according to the following priority:
14
14
  ### App Global Context
15
15
 
16
16
  {{GLOBAL_CONTEXT}}
17
-
18
- ### Project Conventions
19
-
20
- > Read {{PLATFORM_CONVENTIONS}} for project-level coding standards and architecture decisions.
21
17
  </feature-context>