prizmkit 1.1.154 → 1.1.156

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 (164) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codex/skill-adapter.js +1 -1
  3. package/bundled/adapters/pi/skill-adapter.js +2 -1
  4. package/bundled/dev-pipeline/.env.example +2 -6
  5. package/bundled/dev-pipeline/README.md +21 -27
  6. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
  7. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
  9. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
  12. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  13. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
  14. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  16. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  17. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  18. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  19. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  20. package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
  21. package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
  22. package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
  23. package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
  24. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  25. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  26. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  27. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  28. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  32. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  34. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  35. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  36. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  37. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  38. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  39. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  40. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  41. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  43. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  44. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  45. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  47. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  48. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  50. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  51. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  53. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  54. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  55. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  56. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
  57. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
  58. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  59. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  60. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
  61. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
  62. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
  63. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  64. package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
  65. package/bundled/skills/_metadata.json +9 -9
  66. package/bundled/skills/app-planner/SKILL.md +3 -3
  67. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  68. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  69. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  70. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  71. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  72. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  73. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  74. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  75. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  76. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  77. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  78. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  79. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  80. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  81. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  82. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  83. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  84. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  85. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  86. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  87. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  88. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  89. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  90. package/bundled/skills/prizmkit/SKILL.md +17 -18
  91. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  92. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  93. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  94. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  95. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  96. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  97. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  98. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  99. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  100. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  101. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  102. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  103. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  104. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  105. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  106. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  107. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  108. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  109. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  110. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  111. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  112. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  113. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  114. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  115. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +75 -11
  116. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +191 -56
  117. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +18 -18
  118. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +14 -8
  119. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +12 -5
  120. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +23 -12
  121. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -9
  122. package/bundled/skills/prizmkit-retrospective/SKILL.md +94 -97
  123. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +79 -37
  124. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  125. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +111 -54
  126. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  127. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  128. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  129. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  130. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  131. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  132. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  133. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  134. package/bundled/skills/recovery-workflow/SKILL.md +2 -1
  135. package/bundled/skills/recovery-workflow/references/detection.md +4 -3
  136. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
  137. package/bundled/templates/hooks/validate-prizm-docs.py +124 -12
  138. package/package.json +1 -1
  139. package/src/scaffold.js +33 -22
  140. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  141. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  142. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  143. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  144. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  145. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  146. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  147. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  148. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  149. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  150. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  151. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  152. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  153. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  154. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  155. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  156. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  157. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  158. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  159. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  160. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  161. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  162. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  163. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  164. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
@@ -2,7 +2,7 @@
2
2
 
3
3
  Code review is mandatory for every committable Bugfix, including small or obvious fixes. Do not create a FAST_PATH that skips this gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/` and follow the skill's complete review contract for review execution, repairs, verification, evidence, and handoff. Do not invoke another review skill or add a second review path outside that contract.
5
+ Invoke `/prizmkit-code-review` with the exact `artifact_dir`, spec, plan, and current change. The Skill returns only `PASS` or `NEEDS_FIXES`; this injected session validates `review-report.md`, maps the result, updates the checkpoint, and chooses routing.
6
6
 
7
7
  Missing required evidence, an unsafe repair, a failed verification, or failure to converge under the review contract produces `NEEDS_FIXES`.
8
8
 
@@ -12,8 +12,8 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
12
12
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/bugfix/{{BUG_ID}}/review-report.md
13
13
  ```
14
14
 
15
- - `REVIEW_PASS` → proceed to the mandatory post-review test gate.
16
- - `REVIEW_NEEDS_FIXES` → route through bounded implementation/review/test repair; do not commit.
15
+ - Skill `PASS` with a valid report map to `REVIEW_PASS` and proceed to configured verification.
16
+ - Skill `NEEDS_FIXES` with a valid report map to `REVIEW_NEEDS_FIXES`, classify the concrete findings into an allowed `repair_scope`, record both values, and route through the bounded repair path. If no safe scope exists, block instead of guessing; do not commit.
17
17
  - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text and do not synthesize a passing result outside the skill.
18
18
 
19
19
  **Checkpoint update**: Set step `prizmkit-code-review` to `completed` with `stage_result=REVIEW_PASS` only for an accepted valid Final Result. Set it to `failed` with `stage_result=REVIEW_NEEDS_FIXES` when the review returns known unresolved findings.
@@ -16,9 +16,9 @@ They must agree on the testing result and unresolved items. Do not require an ev
16
16
  Gate outcomes:
17
17
 
18
18
  - `TEST_PASS`: mark the test checkpoint step completed and continue to retrospective.
19
- - `TEST_NEEDS_FIXES`: preserve the report/result and stop truthfully. A high-risk production repair reports `review_required=true` and `review_scope=delta`; the caller owns any review-and-retest route.
19
+ - `TEST_NEEDS_FIXES`: this injected session classifies the exact unresolved correction into an allowed `repair_scope` and records both on the failed test step. If scope and outer budget permit, start `prizmkit-implement` with that explicit repair input; the helper rewinds stale downstream steps, then fresh review, configured verification, and test results are mandatory. If scope is unsafe/unknown or budget is exhausted, record terminal `WORKFLOW_BLOCKED`. Never recreate the testing-local repair loop.
20
20
  - `TEST_BLOCKED`: preserve the report/result and blocker, then record terminal `WORKFLOW_BLOCKED`. Do not reinterpret the result as a runtime crash or make speculative production edits.
21
21
 
22
22
  The skill itself diagnoses and repairs valid execution failures for at most three rounds before returning. The caller must not recreate that repair loop or maintain test-internal state.
23
23
 
24
- **Checkpoint update**: Only `TEST_PASS` plus `test-report.md` and `test-result.json` completes `prizmkit-test` and allows retrospective.
24
+ **Checkpoint update**: This injected session completes `prizmkit-test` only for `TEST_PASS` plus valid `test-report.md` and `test-result.json`; non-pass results follow the routing above.
@@ -1,12 +1,12 @@
1
1
  ## Reminders
2
2
 
3
- - Use the atomic skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
3
+ - Use every formal atomic stage: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-test`, `/prizmkit-retrospective`, `/prizmkit-committer` preparation.
4
4
  - All bugfix skills use `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`.
5
5
  - The first plan task must prove the bug with a reproduction test when feasible.
6
- - Commit with `fix(<scope>):`, not `feat:`.
6
+ - Use a `fix(<scope>):` Conventional Commit message in the runtime commit request.
7
7
  - Do not write TRAP dates into `.prizmkit/prizm-docs/`.
8
8
  - Follow the active skills and runtime contracts; they determine execution topology, review ownership, and delegation boundaries.
9
9
  - On execution-unit timeout, preserve the active checkout and artifacts and follow the owning contract's recovery or downgrade path.
10
- - Checkpoint state is the recovery truth; skipped steps must be marked `skipped`.
11
- - Browser verification is a mandatory attempt by default; it blocks only when explicitly required.
10
+ - Checkpoint state is recovery guidance; mandatory stage results and their authoritative artifacts remain required.
11
+ - Browser verification is present only when configured; follow its configured blocking policy.
12
12
  - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
@@ -3,5 +3,4 @@
3
3
  - **Bug ID**: {{BUG_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
4
4
  - **Bug Title**: {{BUG_TITLE}}
5
5
  - **Severity**: {{SEVERITY}}
6
- - **Mode**: {{PIPELINE_MODE}}
7
6
  - **Verification Type**: {{VERIFICATION_TYPE}}
@@ -19,20 +19,23 @@ Use this helper to update checkpoint status. Do not hand-edit `workflow-checkpoi
19
19
 
20
20
  - Use the step `skill` value such as `prizmkit-implement`, or the step id such as `S04`.
21
21
  - Omit `--stage-result` for stages without a domain result.
22
- - Complete `prizmkit-plan` with `--status completed --stage-result PLAN_READY`.
22
+ - Complete the checkpoint's planning step (`context-snapshot-and-plan`, `bug-diagnosis-and-plan`, or `prizmkit-plan`) with `--status completed --stage-result PLAN_READY`.
23
23
  - Complete `prizmkit-implement` with `--status completed --stage-result IMPLEMENTED`.
24
24
  - Complete `prizmkit-code-review` only with `--status completed --stage-result REVIEW_PASS`.
25
25
  - Complete `prizmkit-test` only after validating the sibling report/result pair, with `--status completed --stage-result TEST_PASS`.
26
26
  - Complete `prizmkit-retrospective` with `--status completed --stage-result RETRO_COMPLETE`.
27
- - Record commit authorization wait with `--status in_progress --stage-result COMMIT_PENDING`; after the local commit, use `--status completed --stage-result COMMITTED`.
28
- - For `TEST_NEEDS_FIXES` or `TEST_BLOCKED`, use `--status failed --stage-result <result>` and preserve its report/result and blocker; never mark the test step completed.
27
+ - After this injected session validates required gates and `/prizmkit-committer` returns `COMMIT_REQUEST_READY` with `runtime-commit-request.json`, record `--status in_progress --stage-result COMMIT_PENDING` and stop normal work. The Python runtime executes the local commit and alone advances this step to `completed/COMMITTED`.
28
+ - For `REVIEW_NEEDS_FIXES` or `TEST_NEEDS_FIXES`, classify the concrete correction into one allowed `--repair-scope`, record the failed step and result, and let the helper select the bounded implementation route. If the scope cannot be established safely, record `WORKFLOW_BLOCKED` rather than guessing.
29
+ - Record `PLAN_BLOCKED`, `IMPLEMENT_BLOCKED`, `TEST_BLOCKED`, `RETRO_BLOCKED`, or `COMMIT_BLOCKED` with `--status failed --stage-result <result>` and a useful note. The helper records terminal `WORKFLOW_BLOCKED`; never mark the failed step completed.
30
+ - When the routed implementation step is marked `in_progress`, the helper rewinds later checkpoint steps to pending while preserving their stage-owned reports for historical evidence. Fresh Review, configured verification, and Test results are still mandatory.
31
+ - Complete `manual-verification` when configured; do not skip a required manual/hybrid evidence gate.
29
32
  - Omit `--note` when there is no useful failure or handoff note.
30
33
 
31
34
  ### Rules
32
35
 
33
36
  1. Before each skill, verify its predecessor is `completed` or `skipped`.
34
37
  2. Starting a skill marks its step `in_progress`; a valid success marks it `completed`; a non-pass records its truthful `stage_result` and leaves later stages incomplete.
35
- 3. Pipeline metadata owns only `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, `blocked_reason`, and `terminal_status`; lifecycle `status` belongs to each checkpoint step.
38
+ 3. Pipeline metadata owns only `current_stage`, `next_stage`, `stage_result`, `repair_scope`, `repair_round`, `blocked_reason`, `terminal_status`, and runtime commit readiness; lifecycle `status` belongs to each checkpoint step.
36
39
  4. Skills own their reports and terminal results. The pipeline must not duplicate a skill's internal state machine or require evidence manifests, hashes, or attestations.
37
40
  5. Preserve all reports and session artifacts on recovery. Never replace skill artifacts with the pipeline checkpoint or merge their schemas.
38
41
  6. `TEST_NEEDS_FIXES` is a known testing-domain non-pass. `TEST_BLOCKED` records terminal `WORKFLOW_BLOCKED` with a deterministic reason. Neither is an AI CLI crash.
@@ -1,29 +1,16 @@
1
- ## Context Budget Rules (CRITICAL — read before any phase)
1
+ ## Context and Execution Rules
2
2
 
3
- You are running in **headless non-interactive mode** with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
3
+ This is a finite, headless, non-interactive session. Preserve correctness first, then minimize unnecessary context use.
4
4
 
5
- 0. **NON-INTERACTIVE MODE** — There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
6
-
7
- 1. **context-snapshot.md is your single source of truth** — After it is available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to an execution unit.
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 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 summarized in context-snapshot.md Section 4. Follow the active skill and runtime contracts when an execution unit is created; do not infer its permissions, continuation, or retry behavior from this prompt.
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 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
- 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 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
- 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
- - You MUST verify the real version exists by querying the package registry first:
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
- - **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
- - If the registry query fails (network issue, package not found), you MUST either:
23
- (a) Use a known-safe version you have high confidence in, OR
24
- (b) Skip that dependency and document it as a manual step, OR
25
- (c) Use no version constraint (e.g., `"express": "*"`)
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
- - Batch version lookups: query multiple packages in parallel to save time (e.g., run multiple `npm view` commands concurrently)
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. 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.
5
+ 1. **Non-interactive behavior** — Do not ask a question or wait for user input. Resolve safe uncertainty from the task contract, current code, project documentation, and conservative existing patterns. When no safe deterministic choice exists, write the blocker and return the owning stage's truthful blocked result.
6
+ 2. **Progressive context loading** — Read `root.prizm`, then only relevant module/detail docs and source files. Use `context-snapshot.md` as a navigation and handoff summary, not as a substitute for current source, diffs, or authoritative stage artifacts.
7
+ 3. **Targeted rereads are allowed** — Avoid repeating unchanged full-file reads, but reread the smallest relevant range when a file changed, context was compacted, an artifact may be stale, or verification requires the actual final content. Never rely on “trusting” an unverified write.
8
+ 4. **Verify modifications** — After edits, use the smallest appropriate diff, parser, formatter, type check, focused test, or bounded file read to verify the result. Code Review, Test, Retrospective, and Commit preparation must inspect the actual final state required by their own contracts.
9
+ 5. **Scope discipline** — Read and change only files justified by the Task Contract, concrete dependency/caller evidence, or a mandatory lifecycle gate. Do not perform curiosity-driven repository sweeps.
10
+ 6. **Implementation versus test gate** — During implementation, use focused local verification and TDD where appropriate. The complete affected-module and Regression Ring test gate remains owned by `/prizmkit-test` after Code Review; do not create a second caller-owned test-repair loop.
11
+ 7. **Bound command output** — Prefer commands and tool options that limit output. When a command is verbose, capture it using a host-appropriate temporary location and inspect only relevant summaries or matched ranges. Do not require a POSIX-only fixed path.
12
+ 8. **Dependency integrity** — Follow the target project's package manager, lockfile, registry, and version-pinning conventions. Verify new versions from an authoritative registry when network access is safe; do not introduce wildcard or guessed versions merely to bypass verification.
13
+ 9. **Build artifact hygiene** — Keep generated binaries, caches, bundles, and temporary output out of the intended commit unless the project explicitly treats them as source artifacts.
14
+ 10. **Commit boundary** — Do not create implementation, review, test, or retrospective commits. In a pipeline session, `/prizmkit-committer` prepares the exact commit request and the Python runtime executes the local commit.
15
+ 11. **State ownership boundary** Atomic Skills never read or mutate orchestration state. This injected session updates `workflow-checkpoint.json` only through the declared helper; runtime helpers may manage their declared PID files. Never hand-edit runner-owned family/session/lock/heartbeat/progress/retry/checkout/daemon/log state.
16
+ 12. **Read failure handling** After a failed bounded read, locate a stable anchor or refresh file length before another attempt. Do not repeat the same invalid offset or guess a new one.
@@ -0,0 +1,20 @@
1
+ ### Feature Completion Summary
2
+
3
+ After `TEST_PASS` and any configured browser verification, write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` before retrospective and commit preparation:
4
+
5
+ ```json
6
+ {
7
+ "completion_notes": [
8
+ "<key API, model, exported function, or integration point needed by downstream features>"
9
+ ]
10
+ }
11
+ ```
12
+
13
+ Requirements:
14
+
15
+ - Include 3–8 concise, self-contained notes when meaningful.
16
+ - Prefer public interfaces, models, integration points, and important file paths.
17
+ - Exclude routine test/config details unless downstream work depends on them.
18
+ - When no downstream dependency exists, still summarize the durable delivered capability.
19
+
20
+ **Checkpoint update**: Mark `completion-summary` completed only after the JSON is valid and non-empty.
@@ -1,75 +1,12 @@
1
- ### Architecture Sync & Commit (SINGLE COMMIT) DO NOT SKIP
1
+ ### RetrospectiveDurable Documentation Sync
2
2
 
3
- **a.** Check if feature already committed by inspecting recent git history for `{{FEATURE_ID}}`:
4
- ```bash
5
- git log --oneline
6
- ```
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
- - If no existing commit → proceed normally with b–d.
3
+ After validating Code Review, configured verification, `TEST_PASS`, and the Feature completion summary, invoke `/prizmkit-retrospective` with the exact artifact root, exact non-`.prizmkit/` `change_paths`, and a concise `change_summary`. It returns only `RETRO_COMPLETE` or `RETRO_BLOCKED`.
9
4
 
10
- **Feature Documentation Policy**:
11
- - Run `/prizmkit-retrospective` before commit to update `.prizmkit/prizm-docs/` with durable structural knowledge from this feature.
12
- - Capture architecture knowledge when the feature adds interfaces, dependencies, observable behavior, modules, or durable TRAPS/RULES/DECISIONS.
13
- - Commit prefix: `feat({{FEATURE_ID}}):`.
5
+ Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The retrospective must:
14
6
 
15
- **b.** Run `/prizmkit-retrospective` (**before commit**, maintains `.prizmkit/prizm-docs/` architecture index):
16
- 1. **Structural sync**: update KEY_FILES/INTERFACES/DEPENDENCIES/file counts for changed modules
17
- 2. **Architecture knowledge**: extract TRAPS, RULES, DECISIONS from completed work into `.prizmkit/prizm-docs/`
18
- 3. **Detail-doc coverage check**: For any module/sub-module with source files created or significantly modified in this session but no detail `.prizm` doc — evaluate whether one is warranted and create it when needed. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
19
- 4. Stage doc changes: `git add .prizmkit/prizm-docs/`
20
- ⚠️ Do NOT commit here. Only stage.
7
+ 1. Treat only the exact supplied non-`.prizmkit/` `change_paths` as authoritative input; do not expand scope.
8
+ 2. Synchronize `.prizmkit/prizm-docs/` only when durable structure, interfaces, dependencies, behavior, TRAPS, RULES, or DECISIONS changed.
9
+ 3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/retrospective-result.json` with `outcome=RETRO_COMPLETE` and `result=DOCS_UPDATED|NO_DOC_CHANGE`.
10
+ 4. Validate any changed Prizm docs.
21
11
 
22
- **c.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
23
- ```bash
24
- git add <specific-files-created-or-modified>
25
- git add .prizmkit/prizm-docs/
26
- ```
27
-
28
- **d.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
29
- `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
30
- This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates.
31
- - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
32
- - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
33
-
34
- **e.** Final verification:
35
- ```bash
36
- git status --short
37
- ```
38
- 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.
39
-
40
- **Exception**: `session-summary.md` in the artifact directory is a local cross-session artifact generated by `/prizmkit-committer` — it is NOT committed to git. Ignore it in the clean-tree check.
41
-
42
- **f.** Write completion summary for downstream dependency context:
43
-
44
- Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
45
-
46
- ```json
47
- {
48
- "completion_notes": [
49
- "<each item: one key change, API, model, or integration point that downstream features may need>",
50
- "Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
51
- "Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
52
- "Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
53
- ]
54
- }
55
- ```
56
-
57
- Rules for writing completion notes:
58
- - Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
59
- - Each note should be self-contained and concise (one line, under 120 characters preferred)
60
- - Include 3-8 notes covering the most important changes
61
- - Do NOT include test files, config changes, or internal implementation details unless they affect other features
62
- - If this feature has no downstream dependents, still write the summary (it serves as documentation)
63
-
64
-
65
-
66
- ### TERMINAL STOP — Commit Completed
67
-
68
- After all of the following are true, the session is **TERMINAL**:
69
-
70
- - `/prizmkit-committer` has completed
71
- - `git status --short` is clean (except ignored/local-only pipeline artifacts)
72
- - `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` is written
73
- - the `prizmkit-committer` checkpoint is marked `completed`
74
-
75
- At that point, stop immediately. Do **not** process delayed normal-work results, edit files, amend the commit, or start any new tool calls. Code Review must end its optional Reviewer lifecycle before Final Result, so no independent-review response remains pending. Any normal-work result that arrives after S09 is completed is follow-up work for a later session, not part of this feature commit.
12
+ Do not stage or commit. This injected session validates `retrospective-result.json`, maps `RETRO_COMPLETE` to the completed checkpoint step, and stops on `RETRO_BLOCKED`.
@@ -1,27 +1,27 @@
1
1
  ### Implement — Plan Execution
2
2
 
3
- Execute the reviewed plan through the active implementation skill. The skill and runtime determine the execution topology; preserve the shared artifact directory, active checkout, and task checkpoints.
3
+ Invoke the implementation Skill with the reviewed `spec.md`, `plan.md`, and any explicit repair scope. The Skill returns only `IMPLEMENTED` or `IMPLEMENT_BLOCKED`; this injected session preserves the artifact directory/checkout and updates the checkpoint after validating the result.
4
4
 
5
5
  Before starting, check plan.md Tasks:
6
6
  ```bash
7
7
  {{RUNTIME_HELPER_CMD}} text count .prizmkit/specs/{{FEATURE_SLUG}}/plan.md --pattern "- [ ]"
8
8
  ```
9
- - If result is `0` (all tasks already `[x]`) **SKIP to Review**.
10
- - If non-zero execute the remaining tasks below.
9
+ - If result is `0`, proceed only when the current checkpoint already has a valid `IMPLEMENTED` result and the implementation evidence still matches; otherwise invoke the implementation Skill to reconcile and validate the supplied work.
10
+ - If non-zero, invoke the implementation Skill for the remaining tasks.
11
11
 
12
12
  **Build artifacts rule**: After any build/compile command, ensure output is in `.gitignore`. Never commit binaries/build output.
13
13
 
14
14
  **3a.** Run `/prizmkit-implement` directly:
15
15
  - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
16
16
  - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
17
- - Follow the implementation skill's current execution and delegation contract
17
+ - Follow the implementation skill's stage-local execution contract
18
18
  - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
19
- - Implements task-by-task, marking each `[x]` immediately
20
- - Remember to update checkpoints after finishing a series of tasks
19
+ - Implement task-by-task, marking each `[x]` immediately
20
+ - Return the stage result; only this injected session updates the checkpoint
21
21
 
22
22
  **3b. Focused checks only (no test gate here)**:
23
23
  - During implementation, do not run mandatory periodic or full-suite tests.
24
- - If a tiny targeted check is needed to understand a local failure, run only the smallest relevant command and capture output to `/tmp/test-out.txt`.
24
+ - If a tiny targeted check is needed to understand a local failure, run only the smallest relevant command and bound its output using a host-appropriate temporary location.
25
25
  - The scoped feature test gate runs after code review; do not declare implementation success based on an early full-suite run.
26
26
 
27
27
  **3c. Verification Gate Self-Check (BLOCKING — before declaring implement done)**:
@@ -1,6 +1,6 @@
1
1
  ### Scoped Feature Test Gate — PrizmKit Test
2
2
 
3
- **Goal**: After Code Review completes, use `/prizmkit-test` to analyze the complete affected business module and Regression Ring, add project-native tests, repair valid failures within the skill's bounded loop, and produce the terminal report/result pair.
3
+ **Goal**: After Code Review and all configured Browser/Manual verification complete, use `/prizmkit-test` to analyze the complete affected business module and Regression Ring, add project-native tests, repair valid failures within the skill's bounded loop, and produce the terminal report/result pair.
4
4
 
5
5
  Run the skill with the current Feature artifact directory:
6
6
 
@@ -15,14 +15,14 @@ Consume these sibling terminal artifacts:
15
15
  - `.prizmkit/specs/{{FEATURE_SLUG}}/test-report.md`
16
16
  - `.prizmkit/specs/{{FEATURE_SLUG}}/test-result.json`
17
17
 
18
- The JSON is the minimal terminal result projection and the report contains semantic coverage, native execution, Main-Agent review, optional independent Test Reviewer, and repair details. They must agree. Do not require an evidence package, manifest, hashes, attestation, package lifecycle, or test-internal checkpoint.
18
+ The JSON is the minimal terminal result projection and the report contains semantic coverage, native execution, Main-Agent review, optional independent Test Reviewer, and repair details. They must agree. Do not require an evidence package, manifest, hashes, attestation, package state, or test-internal checkpoint.
19
19
 
20
20
  ## Caller Routing
21
21
 
22
22
  The caller checkpoint records only the returned testing result and caller-owned routing state. It must not ask the skill to manage sessions or checkpoints.
23
23
 
24
24
  - `TEST_PASS` → mark `prizmkit-test` completed and continue to retrospective.
25
- - `TEST_NEEDS_FIXES` → stop the current caller path truthfully. If `review_required=true` and `review_scope=delta`, a caller may route the repaired delta through Code Review before invoking test again. Any continuation policy is caller-owned, not part of the test skill.
25
+ - `TEST_NEEDS_FIXES` → this injected session classifies the exact unresolved correction into an allowed `repair_scope` and records both on the failed test step. If scope and outer budget permit, start `prizmkit-implement` with that explicit repair input; the checkpoint helper rewinds stale downstream steps, after which fresh `prizmkit-code-review`, configured verification, and `prizmkit-test` results are mandatory. If scope is unsafe/unknown or budget is exhausted, record terminal `WORKFLOW_BLOCKED`. Never recreate the testing-local repair loop.
26
26
  - `TEST_BLOCKED` → preserve the report, result, and blocker; record terminal `WORKFLOW_BLOCKED`. Do not reinterpret it as an AI CLI crash or perform speculative production edits.
27
27
 
28
28
  A test execution failure inside the skill is not automatically terminal: `/prizmkit-test` owns up to three direct diagnosis-and-repair rounds. The caller handles only the terminal result returned after that loop.
@@ -2,10 +2,10 @@
2
2
 
3
3
  Review the completed implementation before the full Feature test gate runs. A review result is a required predecessor; never accept or route around testing as if a review had passed.
4
4
 
5
- Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so `/prizmkit-code-review` can read the spec, plan, context snapshot, implementation log, and current diff. Follow the skill's current review contract for review execution, repairs, verification, evidence, and handoff. Do not invoke another review skill or add a second review path outside that contract.
5
+ Invoke `/prizmkit-code-review` with the exact `artifact_dir`, spec, plan, and current change. The Skill owns review/repair and returns only `PASS` or `NEEDS_FIXES`; this injected session validates `review-report.md`, maps the result, updates checkpoint state, and chooses routing.
6
6
 
7
- - `REVIEW_PASS` update checkpoint metadata with `stage=code-review`, `status=completed`, `stage_result=REVIEW_PASS`, `next_stage=prizmkit-test`, and `resume_from=prizmkit-test`; then run the full test gate.
8
- - `REVIEW_NEEDS_FIXES` → update the review step with `status=failed` and `stage_result=REVIEW_NEEDS_FIXES`, preserve findings, increment the shared outer `repair_round`, route `prizmkit-implement` → `prizmkit-code-review` → `prizmkit-test`, and do not accept any test result from before the repaired review.
7
+ - Skill `PASS` with a valid report map to `REVIEW_PASS`, mark the review checkpoint step completed, and continue to the next configured Browser/Manual verification step; invoke `prizmkit-test` only after those configured checks finish.
8
+ - Skill `NEEDS_FIXES` with a valid report map to `REVIEW_NEEDS_FIXES`, classify the concrete findings into an allowed `repair_scope`, and update the failed review step with both values. The checkpoint helper increments the shared outer `repair_round`; then route `prizmkit-implement` → `prizmkit-code-review` → configured verification → `prizmkit-test`, and do not accept any result from before the repaired review. If no safe scope can be established, block instead of guessing.
9
9
  - If the outer repair round is already three, record `WORKFLOW_BLOCKED`; do not start another repair route.
10
10
 
11
11
  Missing required evidence, unsafe repair, failed verification, or failure to converge under the review contract produces `REVIEW_NEEDS_FIXES`.
@@ -18,7 +18,7 @@ Missing required evidence, unsafe repair, failed verification, or failure to con
18
18
 
19
19
  Handle the marker:
20
20
 
21
- - `REVIEW_PASS` → proceed to the structured test gate.
21
+ - `REVIEW_PASS` → proceed through configured Browser/Manual verification, then the structured test gate.
22
22
  - `REVIEW_NEEDS_FIXES` → follow the repair route above; do not externally restart the review loop.
23
23
  - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect append-only progress once, write `failure-log.md`, and stop. Do not accept old/incidental verdict text or synthesize a pass.
24
24
 
@@ -5,9 +5,9 @@ Check existing artifacts first:
5
5
  {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}
6
6
  ```
7
7
 
8
- - Both (spec.md, plan.md) exist → **SKIP to CP-1**
9
- - `context-snapshot.md` exists → use it directly, skip context snapshot building
10
- - Some missing → generate only missing files
8
+ - Both `spec.md` and `plan.md` exist → preserve them; the planning Skill still validates them and returns the local result
9
+ - `context-snapshot.md` exists → use it directly and skip snapshot rebuilding
10
+ - Some planning artifacts are missing → let the planning Skill generate only the missing files
11
11
 
12
12
  Before planning, check whether feature code already exists in the project (use the helper to search source directories identified from `root.prizm` or the project tree scan):
13
13
  ```bash
@@ -55,8 +55,7 @@ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing
55
55
  {{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/plan.md
56
56
  ```
57
57
 
58
- - spec.md missing: Run `/prizmkit-plan` generate spec.md. Resolve uncertain requirements from the task description, existing code, and conservative existing-project patterns.
59
- - plan.md missing: Run `/prizmkit-plan` → generate plan.md (change approach, components, interface design, data model, testing strategy, risk assessment, and Tasks section with `[ ]` checkboxes)
58
+ Invoke `/prizmkit-plan` once with the exact `artifact_dir`, requirement description, and loaded project context. The Skill creates or validates both artifacts and returns only `PLAN_READY` or `PLAN_BLOCKED`. This injected session records `PLAN_READY` on checkpoint step `context-snapshot-and-plan`; `PLAN_BLOCKED` records the failed planning result and stops.
60
59
 
61
60
  > All files go under `.prizmkit/specs/{{FEATURE_SLUG}}/`. Confirm each with `ls` after writing.
62
61
 
@@ -67,17 +66,6 @@ Before proceeding past CP-1, verify:
67
66
  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.
68
67
  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.
69
68
 
70
- **CP-1**: Both spec.md and plan.md exist.
71
-
72
- ### Plan Self-Check — Orchestrator Direct
73
-
74
- The active planning skill and runtime determine whether any additional planning execution is appropriate. Do not treat this bounded self-check as a substitute for the planning skill's own review contract.
75
-
76
- 1. Re-read only `context-snapshot.md`, `spec.md`, and `plan.md`.
77
- 2. Cross-check spec.md and plan.md Tasks against the feature description and Verification Gates in the Task Contract.
78
- 3. Verify the plan references the File Manifest and avoids unrelated work.
79
- 4. If you find CRITICAL issues, fix ONLY those issues in spec.md/plan.md before continuing.
80
-
81
- **CP-1.5**: Plan self-check complete; no CRITICAL plan issues remain.
69
+ **CP-1**: The Skill returned `PLAN_READY`; spec.md and plan.md exist and passed its planning review. The injected session validates artifact presence but does not perform a second planning review.
82
70
 
83
71
 
@@ -8,6 +8,8 @@
8
8
  | Review Report | `.prizmkit/refactor/{{REFACTOR_ID}}/review-report.md` |
9
9
  | Refactor Report | `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` |
10
10
  | Completion Summary | `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` |
11
+ | Test Result | `.prizmkit/refactor/{{REFACTOR_ID}}/test-result.json` |
12
+ | Retrospective Result | `.prizmkit/refactor/{{REFACTOR_ID}}/retrospective-result.json` |
13
+ | Runtime Commit Request | `.prizmkit/refactor/{{REFACTOR_ID}}/runtime-commit-request.json` |
11
14
  | Workflow Checkpoint | `{{CHECKPOINT_PATH}}` |
12
- | Session Status Output | `{{SESSION_STATUS_PATH}}` |
13
15
  | Project Root | `{{PROJECT_ROOT}}` |
@@ -1,30 +1,17 @@
1
- ### Phase 4: Commit, Report & Completion Summary
1
+ ### Refactor Report and Completion Summary
2
2
 
3
- **Refactor Documentation Policy**:
4
- - Default: run `/prizmkit-retrospective` with full sync because refactoring changes structure and interfaces.
5
- - Skip architecture knowledge injection only for a pure rename with no interface or dependency changes.
6
-
7
- Run `/prizmkit-retrospective` using the current working tree and staged changes as input context. Do not rely only on `git diff --cached`.
8
-
9
- Stage changed files explicitly; never use `git add -A` or `git add .`.
10
-
11
- Run `/prizmkit-committer` with commit prefix:
12
-
13
- ```text
14
- refactor({{REFACTOR_ID}}): {{REFACTOR_TITLE}}
15
- ```
16
-
17
- The runtime controls any optional remote publication after this local commit; do not make a publication decision in this session.
3
+ After `TEST_PASS`, create both family artifacts before retrospective and runtime commit preparation.
18
4
 
19
5
  Write `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` with:
20
- - refactor summary;
6
+
7
+ - refactor summary and changed module boundaries;
21
8
  - files/modules changed;
22
- - behavior-preservation evidence before/after;
23
- - review findings;
24
- - browser evidence when applicable;
25
- - acceptance criteria checklist.
9
+ - behavior-preservation evidence before and after;
10
+ - Code Review and Test results;
11
+ - configured browser verification evidence and limitations;
12
+ - final acceptance-criteria checklist.
26
13
 
27
- Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` for downstream refactor context:
14
+ Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json`:
28
15
 
29
16
  ```json
30
17
  {
@@ -34,4 +21,4 @@ Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` for downstrea
34
21
  }
35
22
  ```
36
23
 
37
- **Checkpoint update**: Set `prizmkit-retrospective`, `prizmkit-committer`, `refactor-report`, and `completion-summary` to `completed` as each finishes.
24
+ Do not stage or commit. Mark `refactor-report` and `completion-summary` completed only after both artifacts are current and valid.
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Goal**: execute the refactor plan while preserving behavior.
4
4
 
5
- Run `/prizmkit-implement` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
5
+ Invoke `/prizmkit-implement` with the exact `artifact_dir`, reviewed spec/plan, and any explicit repair findings. It returns only `IMPLEMENTED` or `IMPLEMENT_BLOCKED`.
6
6
 
7
7
  Rules:
8
8
  - Follow the implementation skill's current execution and delegation contract.
@@ -13,4 +13,4 @@ Rules:
13
13
  - If tests fail unexpectedly, treat it as a behavior-preservation failure and fix before proceeding.
14
14
  - Document changed module boundaries and any deviations from the plan in `context-snapshot.md`.
15
15
 
16
- **Checkpoint update**: Set step `prizmkit-implement` to `completed` when all tasks are `[x]` and behavior-preservation evidence is recorded.
16
+ **Checkpoint update**: This injected session maps `IMPLEMENTED` to a completed step when all tasks are `[x]` and behavior-preservation evidence is valid. `IMPLEMENT_BLOCKED` records the blocker and stops.
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Goal**: produce a behavior-preserving refactor plan before editing code.
4
4
 
5
- Run `/prizmkit-plan` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
5
+ Invoke `/prizmkit-plan` once with the exact `artifact_dir`, refactor requirement, behavior-preservation input, and project context. It returns only `PLAN_READY` or `PLAN_BLOCKED`.
6
6
 
7
7
  The spec.md must include:
8
8
  - refactor goals and acceptance criteria;
@@ -19,4 +19,4 @@ The plan.md must include:
19
19
 
20
20
  Resolve uncertain refactor details from existing code and conservative project patterns. Do not expand scope beyond the task contract.
21
21
 
22
- **Checkpoint update**: Set step `prizmkit-plan` to `completed` after `spec.md` and `plan.md` exist.
22
+ **Checkpoint update**: This injected session sets `prizmkit-plan` to `completed` only after `PLAN_READY` and validation of `spec.md`/`plan.md`; `PLAN_BLOCKED` records the blocker and stops.
@@ -1,6 +1,6 @@
1
1
  ### Phase 3: Review — Code Review & Behavior Verification
2
2
 
3
- Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` and follow the skill's complete review contract for review execution, repairs, verification, evidence, and handoff. Do not invoke another review skill or add a second review path outside that contract.
3
+ Invoke `/prizmkit-code-review` with the exact `artifact_dir`, spec, plan, and current change. The Skill returns only `PASS` or `NEEDS_FIXES`; this injected session validates `review-report.md`, maps the result, updates the checkpoint, and chooses routing.
4
4
 
5
5
  Missing required evidence, an unsafe repair, a failed verification, or failure to converge under the review contract produces `NEEDS_FIXES`.
6
6
 
@@ -10,8 +10,8 @@ Missing required evidence, an unsafe repair, a failed verification, or failure t
10
10
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/refactor/{{REFACTOR_ID}}/review-report.md
11
11
  ```
12
12
 
13
- - `REVIEW_PASS` → proceed.
14
- - `REVIEW_NEEDS_FIXES` → log unresolved findings and proceed only when they do not block behavior preservation under explicit task policy.
13
+ - Skill `PASS` with a valid report map to `REVIEW_PASS` and proceed to configured verification and the authoritative Test gate.
14
+ - Skill `NEEDS_FIXES` with a valid report map to `REVIEW_NEEDS_FIXES`, classify the concrete findings into an allowed `repair_scope`, mark the review step failed with both values, preserve findings, and route through the bounded repair path. If scope is unsafe/unknown or the outer repair budget is exhausted, record `WORKFLOW_BLOCKED`. Never continue as though review passed.
15
15
  - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or synthesize a passing result outside the skill.
16
16
 
17
17
  Verify directly that the review checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
@@ -16,9 +16,9 @@ They must agree on the testing result and unresolved items. Do not require an ev
16
16
  Gate outcomes:
17
17
 
18
18
  - `TEST_PASS`: verify required behavior-preservation coverage is included, mark the test step completed, and continue to retrospective.
19
- - `TEST_NEEDS_FIXES`: preserve the report/result and stop truthfully. A high-risk production repair reports `review_required=true` and `review_scope=delta`; the caller owns any review-and-retest route.
19
+ - `TEST_NEEDS_FIXES`: this injected session classifies the exact unresolved correction into an allowed `repair_scope` and records both on the failed test step. If scope and outer budget permit, start `prizmkit-implement` with that explicit repair input; the helper rewinds stale downstream steps, then fresh review, configured verification, and test results are mandatory. If scope is unsafe/unknown or budget is exhausted, record terminal `WORKFLOW_BLOCKED`. Never recreate the testing-local repair loop.
20
20
  - `TEST_BLOCKED`: preserve the report/result and blocker, then record terminal `WORKFLOW_BLOCKED`. Do not reinterpret the result as a runtime crash or make speculative production edits.
21
21
 
22
22
  The skill itself diagnoses and repairs valid execution failures for at most three rounds before returning. The caller must not recreate that repair loop or maintain test-internal state.
23
23
 
24
- **Checkpoint update**: Only `TEST_PASS` plus `test-report.md` and `test-result.json` completes `prizmkit-test` and allows retrospective.
24
+ **Checkpoint update**: This injected session completes `prizmkit-test` only for `TEST_PASS` plus valid `test-report.md` and `test-result.json`; non-pass results follow the routing above.
@@ -1,12 +1,12 @@
1
1
  ## Reminders
2
2
 
3
- - Use the atomic skills: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-retrospective`, `/prizmkit-committer`.
3
+ - Use every formal atomic stage: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-test`, `/prizmkit-retrospective`, `/prizmkit-committer` preparation.
4
4
  - All refactor skills use `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
5
5
  - Behavior preservation is the first priority.
6
- - Follow the active skills and runtime contracts; they determine execution topology, review ownership, and delegation boundaries
7
- - On execution-unit timeout, preserve the active checkout and artifacts and follow the owning contract's recovery or downgrade path
8
- - Main orchestrator runs `/prizmkit-code-review` directly.
9
- - Commit with `refactor(<scope>):`, not `feat:` or `fix:`.
10
- - Checkpoint state is the recovery truth; skipped steps must be marked `skipped`.
11
- - Browser verification is a mandatory attempt by default; it blocks only when explicitly required.
6
+ - Follow the active skills and runtime contracts; they determine execution topology, review ownership, and delegation boundaries.
7
+ - On execution-unit timeout, preserve the active checkout and artifacts and follow the owning contract's recovery or downgrade path.
8
+ - Main orchestrator runs `/prizmkit-code-review` directly and never routes around `REVIEW_NEEDS_FIXES`.
9
+ - Use a `refactor(<scope>):` Conventional Commit message in the runtime commit request.
10
+ - Checkpoint state is recovery guidance; mandatory stage results and their authoritative artifacts remain required.
11
+ - Browser verification is present only when configured; follow its configured blocking policy.
12
12
  - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
@@ -4,4 +4,3 @@
4
4
  - **Title**: {{REFACTOR_TITLE}}
5
5
  - **Type**: {{REFACTOR_TYPE}}
6
6
  - **Priority**: {{PRIORITY}} | **Complexity**: {{COMPLEXITY}}
7
- - **Mode**: {{PIPELINE_MODE}}
@@ -0,0 +1,12 @@
1
+ ### Retrospective — Durable Documentation Sync
2
+
3
+ After validating Code Review, configured verification, `TEST_PASS`, and family reports/summaries, invoke `/prizmkit-retrospective` with the exact `artifact_dir`, exact non-`.prizmkit/` `change_paths`, and a concise `change_summary`. The Skill returns only `RETRO_COMPLETE` or `RETRO_BLOCKED`.
4
+
5
+ The retrospective must:
6
+
7
+ 1. Treat only the exact supplied non-`.prizmkit/` `change_paths` as authoritative input; do not expand scope.
8
+ 2. Synchronize `.prizmkit/prizm-docs/` only for durable structure, interfaces, dependencies, behavior, TRAPS, RULES, or DECISIONS.
9
+ 3. Write `{{ARTIFACT_DIR}}/retrospective-result.json` with `outcome=RETRO_COMPLETE` and `result=DOCS_UPDATED|NO_DOC_CHANGE`.
10
+ 4. Validate any changed Prizm docs.
11
+
12
+ Do not stage or commit. This injected session validates `retrospective-result.json` and maps `RETRO_COMPLETE` to the completed checkpoint step. `RETRO_BLOCKED` records the blocker and stops.