prizmkit 1.1.191 → 1.1.193

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 (165) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/antigravity/skill-adapter.js +13 -4
  3. package/bundled/adapters/codex/skill-adapter.js +28 -8
  4. package/bundled/adapters/cursor/skill-adapter.js +13 -4
  5. package/bundled/adapters/pi/skill-adapter.js +28 -7
  6. package/bundled/dev-pipeline/.env.example +4 -12
  7. package/bundled/dev-pipeline/README.md +28 -44
  8. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  9. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +6 -6
  10. package/bundled/dev-pipeline/prizmkit_runtime/atomic_io.py +48 -0
  11. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +66 -23
  12. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +10 -7
  13. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +2 -21
  14. package/bundled/dev-pipeline/prizmkit_runtime/config.py +48 -78
  15. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +127 -67
  16. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +158 -462
  17. package/bundled/dev-pipeline/prizmkit_runtime/heartbeat.py +102 -50
  18. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -25
  19. package/bundled/dev-pipeline/prizmkit_runtime/paths.py +0 -6
  20. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +47 -21
  21. package/bundled/dev-pipeline/prizmkit_runtime/processes.py +217 -156
  22. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +39 -27
  23. package/bundled/dev-pipeline/prizmkit_runtime/reset_preserve.py +34 -174
  24. package/bundled/dev-pipeline/prizmkit_runtime/results.py +25 -0
  25. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +133 -110
  26. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +15 -5
  27. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +1 -95
  28. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +0 -2
  29. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +7 -2
  30. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +540 -262
  31. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +175 -135
  32. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +90 -9
  33. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +214 -133
  34. package/bundled/dev-pipeline/prizmkit_runtime/status.py +1 -3
  35. package/bundled/dev-pipeline/prizmkit_runtime/stream_progress.py +2783 -0
  36. package/bundled/dev-pipeline/prizmkit_runtime/task_checkout.py +27 -102
  37. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +58 -4
  38. package/bundled/dev-pipeline/scripts/check-session-status.py +56 -20
  39. package/bundled/dev-pipeline/scripts/continuation.py +8 -7
  40. package/bundled/dev-pipeline/scripts/detect-stuck.py +47 -33
  41. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +13 -16
  42. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +20 -10
  43. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +10 -7
  44. package/bundled/dev-pipeline/scripts/init-change-artifact.py +25 -4
  45. package/bundled/dev-pipeline/scripts/init-pipeline.py +14 -69
  46. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +31 -2616
  47. package/bundled/dev-pipeline/scripts/patch-completion-notes.py +4 -24
  48. package/bundled/dev-pipeline/scripts/prompt_framework.py +85 -20
  49. package/bundled/dev-pipeline/scripts/status_common.py +591 -0
  50. package/bundled/dev-pipeline/scripts/update-bug-status.py +85 -463
  51. package/bundled/dev-pipeline/scripts/update-checkpoint.py +254 -65
  52. package/bundled/dev-pipeline/scripts/update-feature-status.py +76 -509
  53. package/bundled/dev-pipeline/scripts/utils.py +5 -12
  54. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -5
  55. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +7 -0
  56. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +7 -7
  57. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +1 -1
  58. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +1 -1
  59. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
  60. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -1
  61. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +1 -1
  62. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +1 -1
  63. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +2 -2
  64. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +2 -2
  65. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +2 -1
  66. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -1
  67. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -6
  68. package/bundled/dev-pipeline/templates/session-status-schema.json +2 -5
  69. package/bundled/skills/_metadata.json +9 -63
  70. package/bundled/skills/app-planner/SKILL.md +32 -303
  71. package/bundled/skills/app-planner/references/app-design-guide.md +0 -4
  72. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  73. package/bundled/skills/app-planner/references/project-brief-guide.md +14 -0
  74. package/bundled/skills/app-planner/references/project-conventions-discovery.md +4 -6
  75. package/bundled/skills/app-planner/references/project-state-detection.md +2 -3
  76. package/bundled/skills/bug-fix-workflow/SKILL.md +1 -2
  77. package/bundled/skills/bug-fix-workflow/references/bug-diagnosis.md +4 -7
  78. package/bundled/skills/bug-planner/SKILL.md +54 -435
  79. package/bundled/skills/bug-planner/references/generated-plan-review.md +3 -2
  80. package/bundled/skills/bug-planner/references/input-formats.md +32 -0
  81. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +4 -6
  82. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +4 -28
  83. package/bundled/skills/feature-pipeline-launcher/SKILL.md +4 -6
  84. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +4 -28
  85. package/bundled/skills/feature-planner/SKILL.md +60 -439
  86. package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
  87. package/bundled/skills/feature-planner/references/completeness-review.md +34 -0
  88. package/bundled/skills/feature-planner/references/decomposition-patterns.md +2 -2
  89. package/bundled/skills/feature-planner/references/error-recovery.md +1 -1
  90. package/bundled/skills/feature-planner/references/generated-plan-review.md +3 -2
  91. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +3 -1
  92. package/bundled/skills/feature-workflow/SKILL.md +1 -2
  93. package/bundled/skills/prizmkit/SKILL.md +7 -1
  94. package/bundled/skills/prizmkit-code-review/SKILL.md +14 -6
  95. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +7 -4
  96. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +16 -0
  97. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +58 -20
  98. package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
  99. package/bundled/skills/prizmkit-init/SKILL.md +24 -127
  100. package/bundled/skills/prizmkit-init/assets/project-brief-template.md +3 -3
  101. package/bundled/skills/prizmkit-plan/SKILL.md +6 -8
  102. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +1 -1
  103. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +5 -2
  104. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +6 -5
  105. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +1 -13
  106. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +1 -1
  107. package/bundled/skills/prizmkit-retrospective/SKILL.md +6 -4
  108. package/bundled/skills/prizmkit-test/SKILL.md +25 -133
  109. package/bundled/skills/prizmkit-test/references/independent-test-review.md +5 -2
  110. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +6 -0
  111. package/bundled/skills/prizmkit-workflow/SKILL.md +2 -3
  112. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +4 -3
  113. package/bundled/skills/recovery-workflow/SKILL.md +7 -7
  114. package/bundled/skills/recovery-workflow/evals/evals.json +1 -1
  115. package/bundled/skills/recovery-workflow/references/detection.md +1 -3
  116. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +0 -6
  117. package/bundled/templates/project-memory-template.md +1 -2
  118. package/package.json +1 -1
  119. package/src/scaffold.js +28 -7
  120. package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +0 -53
  121. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +0 -649
  122. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +0 -463
  123. package/bundled/dev-pipeline/scripts/update-refactor-status.py +0 -1512
  124. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +0 -240
  125. package/bundled/dev-pipeline/templates/refactor-list-schema.json +0 -266
  126. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +0 -15
  127. package/bundled/dev-pipeline/templates/sections/refactor-mission.md +0 -9
  128. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +0 -24
  129. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +0 -16
  130. package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +0 -9
  131. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +0 -22
  132. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +0 -19
  133. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +0 -24
  134. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +0 -12
  135. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -6
  136. package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +0 -52
  137. package/bundled/dev-pipeline/tests/conftest.py +0 -29
  138. package/bundled/dev-pipeline/tests/live_ai_cli_log_smoke.py +0 -208
  139. package/bundled/dev-pipeline/tests/test_auto_skip.py +0 -1871
  140. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +0 -1314
  141. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +0 -1712
  142. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +0 -627
  143. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +0 -478
  144. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +0 -5641
  145. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +0 -322
  146. package/bundled/dev-pipeline/tests/test_repository_bootstrap.py +0 -252
  147. package/bundled/dev-pipeline/tests/test_reset_modes.py +0 -1208
  148. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -957
  149. package/bundled/dev-pipeline/tests/test_runtime_commit.py +0 -1113
  150. package/bundled/dev-pipeline/tests/test_runtime_helper.py +0 -303
  151. package/bundled/dev-pipeline/tests/test_unified_cli.py +0 -5504
  152. package/bundled/dev-pipeline/tests/test_utils.py +0 -170
  153. package/bundled/skills/feature-planner/assets/evaluation-guide.md +0 -44
  154. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +0 -219
  155. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +0 -78
  156. package/bundled/skills/refactor-planner/SKILL.md +0 -467
  157. package/bundled/skills/refactor-planner/assets/planning-guide.md +0 -291
  158. package/bundled/skills/refactor-planner/references/behavior-preservation.md +0 -187
  159. package/bundled/skills/refactor-planner/references/error-recovery.md +0 -45
  160. package/bundled/skills/refactor-planner/references/fast-path.md +0 -59
  161. package/bundled/skills/refactor-planner/references/generated-plan-review.md +0 -107
  162. package/bundled/skills/refactor-planner/references/planning-phases.md +0 -172
  163. package/bundled/skills/refactor-planner/references/refactor-scoping-guide.md +0 -230
  164. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +0 -1120
  165. package/bundled/skills/refactor-workflow/SKILL.md +0 -205
@@ -1,240 +0,0 @@
1
- # Dev-Pipeline Refactor Session Bootstrap
2
-
3
- ## Session Context
4
-
5
- - **Refactor ID**: {{REFACTOR_ID}}
6
- - **Refactor Title**: {{REFACTOR_TITLE}}
7
- - **Refactor Type**: {{REFACTOR_TYPE}}
8
- - **Priority**: {{PRIORITY}}
9
- - **Complexity**: {{COMPLEXITY}}
10
-
11
- ## Your Mission
12
-
13
- You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}: "{{REFACTOR_TITLE}}".
14
-
15
- **CRITICAL SESSION LIFECYCLE RULE**: Do not claim success until all refactor work and authoritative artifacts are complete. The Python runtime exclusively writes session status.
16
-
17
- **NON-INTERACTIVE MODE**: You are running in headless non-interactive mode. There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, and NEVER use interactive prompts. Resolve uncertainty from existing code, project docs, and conservative behavior-preserving defaults.
18
-
19
- **Execution model**: Follow the active skills and runtime contracts for planning, implementation, review, recovery, and commit. Those contracts determine the execution topology, permissions, and delegation boundaries.
20
-
21
- **REFACTOR DOCUMENTATION POLICY**:
22
- - Default: run `/prizmkit-retrospective` with full sync because refactoring changes structure and interfaces.
23
- - Skip architecture knowledge injection only for a pure rename with no interface or dependency changes.
24
- - Commit with `refactor(<scope>):`, not `feat:` or `fix:`.
25
-
26
- ### Refactor Description
27
-
28
- {{REFACTOR_DESCRIPTION}}
29
-
30
- {{USER_CONTEXT}}
31
-
32
- ### Scope
33
-
34
- **Files:**
35
- {{SCOPE_FILES}}
36
-
37
- **Modules:**
38
- {{SCOPE_MODULES}}
39
-
40
- ### Behavior Preservation
41
-
42
- {{BEHAVIOR_PRESERVATION}}
43
-
44
- ### Acceptance Criteria
45
-
46
- {{ACCEPTANCE_CRITERIA}}
47
-
48
- ### Dependencies
49
-
50
- {{DEPENDENCIES}}
51
-
52
- ### App Global Context
53
-
54
- {{GLOBAL_CONTEXT}}
55
-
56
- ## Refactor Artifact Manifest
57
-
58
- Always use `.prizmkit/refactor/{{REFACTOR_ID}}/`:
59
-
60
- ```
61
- .prizmkit/refactor/{{REFACTOR_ID}}/
62
- ├── spec.md
63
- ├── plan.md
64
- ├── context-snapshot.md
65
- ├── review-report.md
66
- ├── test-report.md
67
- ├── test-result.json
68
- ├── refactor-report.md
69
- ├── completion-summary.json
70
- ├── retrospective-result.json
71
- ├── failure-log.md
72
- ├── workflow-checkpoint.json
73
- └── runtime-commit-request.json
74
- ```
75
-
76
- Use `context-snapshot.md` for navigation, not as a substitute for current source, diffs, or authoritative artifacts. Verify writes with bounded reads/diffs/checks. `/prizmkit-test` exclusively owns the complete test repair loop. Do not stage, commit, amend, merge, push, reset, clean, or hand-edit runner-owned state.
77
-
78
- {{CHECKPOINT_SYSTEM}}
79
-
80
- ## Execution
81
-
82
- ### Phase 0: Initialize
83
-
84
- Create refactor artifacts directory:
85
-
86
- ```bash
87
- {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/refactor/{{REFACTOR_ID}}
88
- ```
89
-
90
- **Checkpoint update**: set step `prizmkit-init` to `completed` in `{{CHECKPOINT_PATH}}`.
91
-
92
- ---
93
-
94
- ### Phase 1: Plan — Specification & Plan Generation
95
-
96
- Invoke `/prizmkit-plan` once with the exact artifact root, refactor requirement, and behavior-preservation context. It returns only `PLAN_READY` or `PLAN_BLOCKED`.
97
-
98
- The generated `spec.md` MUST include:
99
- - goals with acceptance criteria;
100
- - scope files/modules;
101
- - behavior preservation strategy;
102
- - interfaces or observable behavior that must not change.
103
-
104
- The generated `plan.md` MUST include:
105
- - behavior-preserving task order;
106
- - test strategy before, during, and after refactor;
107
- - rollback strategy;
108
- - explicit risks and mitigations.
109
-
110
- Resolve uncertain refactor details from existing code and conservative existing-project patterns.
111
-
112
- {{IF_BROWSER_INTERACTION}}
113
-
114
- #### Browser Behavior Preservation Protocol
115
-
116
- The refactor may affect UI behavior. Browser verification is a mandatory attempt by default, but it blocks only when the task explicitly marks browser verification as blocking.
117
-
118
- **Browser Verification Goals**:
119
- {{BROWSER_VERIFY_STEPS}}
120
-
121
- If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
122
-
123
- {{END_IF_BROWSER_INTERACTION}}
124
-
125
- **Checkpoint update**: this injected session maps `PLAN_READY` to a completed planning step after artifact validation and stops on `PLAN_BLOCKED`.
126
-
127
- ---
128
-
129
- ### Phase 3: Implement — Behavior-Preserving Refactoring
130
-
131
- Invoke `/prizmkit-implement` with the exact artifact root, reviewed spec/plan, and any explicit repair findings. It returns only `IMPLEMENTED` or `IMPLEMENT_BLOCKED`.
132
-
133
- Implementation requirements:
134
- 1. Establish a green baseline before changes when tests exist.
135
- 2. Execute plan tasks in order.
136
- 3. Preserve existing behavior; do not mix unrelated feature work or bug fixes into the refactor.
137
- 4. Run the smallest focused checks needed during implementation; the authoritative affected-module test gate runs only after review and configured Browser verification.
138
- 5. Mark each completed task `[x]` in plan.md.
139
-
140
- **Checkpoint update**: this injected session maps `IMPLEMENTED` to completed after artifact/evidence validation and stops on `IMPLEMENT_BLOCKED`.
141
-
142
- ---
143
-
144
- ### Phase 4: Review — Code Review & Behavior Verification
145
-
146
- Invoke `/prizmkit-code-review` with the exact artifact root, spec, plan, and complete current change. It returns only `PASS` or `NEEDS_FIXES`. The Skill runs up to ten Main-Agent review rounds, directly repairs accepted findings, and verifies each repair. Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`.
147
-
148
- Review requirements:
149
- - verify refactor quality against spec.md and plan.md;
150
- - verify behavior preservation evidence;
151
- - run or confirm relevant tests;
152
- - preserve append-only progress in `.prizmkit/refactor/{{REFACTOR_ID}}/review-report.md`.
153
-
154
- **Gate Check — Final Review Result**:
155
- ```bash
156
- {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/refactor/{{REFACTOR_ID}}/review-report.md
157
- ```
158
- This injected session maps Skill `PASS`/`NEEDS_FIXES` to `REVIEW_PASS`/`REVIEW_NEEDS_FIXES`. `REVIEW_PASS` proceeds to configured verification. For `REVIEW_NEEDS_FIXES`, classify concrete findings into an allowed `repair_scope`; safe in-budget repair re-enters Implement through the helper, while unknown/unsafe scope or exhausted budget records `WORKFLOW_BLOCKED`. It must never proceed as a pass. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or replace required independent review with Main-Agent self-review.
159
-
160
- **Checkpoint update**: set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete it for incomplete or invalid reports.
161
-
162
- ---
163
-
164
- {{IF_BROWSER_INTERACTION}}
165
- ### Phase 5: Browser Verification
166
-
167
- After valid code-review PASS and before the authoritative Test stage, attempt browser verification for affected UI behavior. If no usable browser tool/server/port can be found and browser verification is non-blocking, mark browser verification `skipped` and continue. If explicit policy marks browser verification as blocking, mark it `failed`, write `failure-log.md`, and stop before Test.
168
-
169
- Record tool choice, URL, steps, screenshot path if available, result, and cleanup status in `.prizmkit/refactor/{{REFACTOR_ID}}/context-snapshot.md`.
170
-
171
- **Checkpoint update**: set step `browser-verification` to `completed`, `skipped`, or `failed` according to the evidence.
172
-
173
- ---
174
-
175
- {{END_IF_BROWSER_INTERACTION}}
176
- ### Phase 5: Post-Review Test Gate — PrizmKit Test
177
-
178
- After valid code-review PASS and configured Browser verification, run the mandatory test gate against the same artifact root:
179
-
180
- ```text
181
- /prizmkit-test scope=this-change artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/
182
- ```
183
-
184
- Behavior-preservation context remains supporting input. Read the sibling `test-report.md` and `test-result.json`; they must agree. `TEST_PASS` proceeds to reports and retrospective. For `TEST_NEEDS_FIXES`, classify the concrete correction into an allowed `repair_scope`; safe in-budget repair re-enters Implement through the helper and requires fresh Review, configured verification, and Test, while unknown/unsafe scope or exhausted budget blocks. `TEST_BLOCKED` preserves its blocker and records `WORKFLOW_BLOCKED`. Do not require a manifest/attestation package, reinterpret the testing result as a runtime crash, or recreate the skill's internal loops.
185
-
186
- Only `TEST_PASS` may proceed to reports, retrospective, or commit preparation.
187
-
188
- ---
189
-
190
-
191
- ### Phase 6: Reports, Retrospective & Runtime Commit Handoff
192
-
193
- After `TEST_PASS`, write `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` with:
194
- - refactor summary;
195
- - files/modules changed;
196
- - behavior-preservation evidence before/after;
197
- - review findings;
198
- - browser evidence when applicable;
199
- - acceptance criteria checklist.
200
-
201
- Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` for downstream refactor context:
202
-
203
- ```json
204
- {
205
- "completion_notes": [
206
- "<key structural change, moved/renamed interface, or new module boundary>"
207
- ]
208
- }
209
- ```
210
-
211
- Complete `refactor-report` and `completion-summary` before retrospective. Then invoke `/prizmkit-retrospective` with the exact artifact root, exact non-`.prizmkit/` `change_paths`, and a concise `change_summary`. Validate `outcome=RETRO_COMPLETE`; do not stage or commit.
212
-
213
- After this injected session validates every required artifact and confirms final Review/Test authority covers the complete behavior-affecting Git-visible workspace, invoke `/prizmkit-committer operation=prepare-runtime-commit artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/ evidence_paths=<exact paths> request_path=.prizmkit/refactor/{{REFACTOR_ID}}/runtime-commit-request.json`. Require a schema-v2 pathless request and `COMMIT_REQUEST_READY`, then stop without another committer checkpoint update or request validator. Ignored files remain local. The Python Runtime validates the request, publishes commit readiness, commits the complete non-ignored workspace with only exact causal request/checkpoint bookkeeping omitted, verifies the local commit, finalizes checkpoint `COMMITTED`, and controls any later publication.
214
-
215
- ---
216
-
217
- Runtime session status is written by the Python runtime. Do not write or edit `session-status.json`.
218
-
219
- ## Critical Paths
220
-
221
- | Resource | Path |
222
- |----------|------|
223
- | Refactor Artifacts Dir | `.prizmkit/refactor/{{REFACTOR_ID}}/` |
224
- | Spec | `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` |
225
- | Plan | `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md` |
226
- | Review Report | `.prizmkit/refactor/{{REFACTOR_ID}}/review-report.md` |
227
- | Refactor Report | `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` |
228
- | Completion Summary | `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json` |
229
- | Workflow Checkpoint | {{CHECKPOINT_PATH}} |
230
- | Project Root | {{PROJECT_ROOT}} |
231
-
232
- ## Reminders
233
-
234
- - Use every formal atomic stage: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-test`, `/prizmkit-retrospective`, `/prizmkit-committer` preparation.
235
- - Follow the active skills and runtime contracts; they determine execution topology, review ownership, and delegation boundaries
236
- - On execution-unit timeout, preserve the active checkout and artifacts and follow the owning contract's recovery or downgrade path
237
- - Behavior preservation is the first priority.
238
- - Browser verification is a mandatory attempt by default; it blocks only when explicitly required.
239
- - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.
240
- - Runtime owns session-status.json; never hand-edit it.
@@ -1,266 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Dev-Pipeline Refactor List",
4
- "description": "Schema for .prizmkit/plans/refactor-list.json — standardized input for the Refactor Pipeline",
5
- "type": "object",
6
- "required": [
7
- "$schema",
8
- "project_name",
9
- "refactors"
10
- ],
11
- "properties": {
12
- "$schema": {
13
- "type": "string",
14
- "const": "dev-pipeline-refactor-list-v1"
15
- },
16
- "project_name": {
17
- "type": "string",
18
- "minLength": 1
19
- },
20
- "project_description": {
21
- "type": "string"
22
- },
23
- "created_at": {
24
- "type": "string",
25
- "format": "date-time"
26
- },
27
- "created_by": {
28
- "type": "string"
29
- },
30
- "refactors": {
31
- "type": "array",
32
- "minItems": 1,
33
- "items": {
34
- "type": "object",
35
- "required": [
36
- "id",
37
- "title",
38
- "description",
39
- "scope",
40
- "type",
41
- "priority",
42
- "complexity",
43
- "behavior_preservation",
44
- "acceptance_criteria",
45
- "dependencies",
46
- "status"
47
- ],
48
- "properties": {
49
- "id": {
50
- "type": "string",
51
- "pattern": "^R-\\d{3}$",
52
- "description": "Refactor ID, format R-001, R-002..."
53
- },
54
- "title": {
55
- "type": "string",
56
- "minLength": 1,
57
- "description": "Refactor title — brief description of the change"
58
- },
59
- "description": {
60
- "type": "string",
61
- "minLength": 1,
62
- "description": "Detailed description: what is being refactored and why"
63
- },
64
- "scope": {
65
- "type": "object",
66
- "description": "Files and modules affected by this refactor",
67
- "properties": {
68
- "files": {
69
- "type": "array",
70
- "items": {
71
- "type": "string"
72
- },
73
- "description": "File paths affected by this refactor"
74
- },
75
- "modules": {
76
- "type": "array",
77
- "items": {
78
- "type": "string"
79
- },
80
- "description": "Module names affected by this refactor"
81
- }
82
- }
83
- },
84
- "type": {
85
- "type": "string",
86
- "enum": [
87
- "extract",
88
- "rename",
89
- "restructure",
90
- "simplify",
91
- "decouple",
92
- "migrate"
93
- ],
94
- "description": "extract=extract-function/module; rename=rename-symbols; restructure=move/reorganize; simplify=reduce-complexity; decouple=remove-dependencies; migrate=tech-migration"
95
- },
96
- "priority": {
97
- "type": "string",
98
- "enum": [
99
- "critical",
100
- "high",
101
- "medium",
102
- "low"
103
- ],
104
- "description": "Refactor priority. Pipeline processes critical before high before medium before low; within same level, array order determines sequence."
105
- },
106
- "complexity": {
107
- "type": "string",
108
- "enum": [
109
- "low",
110
- "medium",
111
- "high"
112
- ],
113
- "description": "Estimated complexity of the refactor"
114
- },
115
- "behavior_preservation": {
116
- "type": "object",
117
- "required": [
118
- "strategy"
119
- ],
120
- "description": "Strategy for ensuring no behavior changes",
121
- "properties": {
122
- "strategy": {
123
- "type": "string",
124
- "enum": [
125
- "test-gate",
126
- "snapshot",
127
- "manual"
128
- ],
129
- "description": "test-gate=existing-tests-must-pass; snapshot=before/after-snapshot-comparison; manual=human-verification"
130
- },
131
- "existing_tests": {
132
- "type": "boolean",
133
- "description": "Whether existing tests cover the refactored code"
134
- },
135
- "new_tests_needed": {
136
- "type": "array",
137
- "items": {
138
- "type": "string"
139
- },
140
- "description": "New tests that should be written before refactoring"
141
- }
142
- }
143
- },
144
- "acceptance_criteria": {
145
- "type": "array",
146
- "minItems": 1,
147
- "items": {
148
- "type": "string"
149
- },
150
- "description": "Conditions that must be met for the refactor to be considered complete"
151
- },
152
- "dependencies": {
153
- "type": "array",
154
- "items": {
155
- "type": "string",
156
- "pattern": "^R-\\d{3}$"
157
- },
158
- "description": "IDs of refactors that must be completed before this one"
159
- },
160
- "status": {
161
- "type": "string",
162
- "enum": [
163
- "pending",
164
- "in_progress",
165
- "completed",
166
- "failed",
167
- "skipped",
168
- "auto_skipped"
169
- ],
170
- "description": "Refactor status. Subset of feature status enum."
171
- },
172
- "model": {
173
- "type": "string",
174
- "description": "AI model ID for this refactor. Overrides $MODEL env var."
175
- },
176
- "estimated_lines": {
177
- "type": "integer",
178
- "description": "Estimated number of lines affected by this refactor"
179
- },
180
- "completion_notes": {
181
- "type": "array",
182
- "items": {
183
- "type": "string"
184
- },
185
- "description": "AI-generated summary of key changes from this refactor session. Used to provide rich dependency context to downstream refactors. Each item is a concise statement about what was refactored (e.g. modules extracted, files restructured, interfaces changed)."
186
- },
187
- "user_context": {
188
- "type": "array",
189
- "items": {
190
- "type": "string"
191
- },
192
- "description": "User-provided supplementary materials, preserved verbatim. Each entry is either inline content/rules (stored as-is) or a file reference (e.g. 'src/auth/login.ts:42-78', 'src/utils/ — focus on validation logic')."
193
- },
194
- "browser_interaction": {
195
- "type": "object",
196
- "description": "Browser verification config for refactors affecting UI behavior. Supports playwright-cli and opencli. AI auto-detects dev server command, URL, and port from project config at runtime.",
197
- "properties": {
198
- "tool": {
199
- "type": "string",
200
- "enum": [
201
- "playwright-cli",
202
- "opencli",
203
- "auto"
204
- ],
205
- "default": "auto",
206
- "description": "Browser tool to use. 'auto' (default) = AI chooses at runtime. 'playwright-cli' = local dev server verification in isolated browser. 'opencli' = reuses Chrome logged-in session, ideal for verifying refactors involving third-party integrations or OAuth flows."
207
- },
208
- "verify_steps": {
209
- "type": "array",
210
- "description": "Verification goals describing WHAT to verify after refactoring (e.g., 'Navigation still works', 'Form submission succeeds', 'UI renders identically'). AI decides concrete browser tool actions at runtime. If omitted, AI explores the app and verifies no visual or behavioral regressions.",
211
- "items": {
212
- "type": "string"
213
- }
214
- }
215
- }
216
- }
217
- },
218
- "additionalProperties": false
219
- }
220
- },
221
- "global_context": {
222
- "type": "object",
223
- "description": "Global context for all refactors in this batch",
224
- "properties": {
225
- "tech_stack": {
226
- "type": "string"
227
- },
228
- "language": {
229
- "type": "string"
230
- },
231
- "runtime": {
232
- "type": "string"
233
- },
234
- "frontend_framework": {
235
- "type": "string"
236
- },
237
- "frontend_styling": {
238
- "type": "string"
239
- },
240
- "backend_framework": {
241
- "type": "string"
242
- },
243
- "database": {
244
- "type": "string"
245
- },
246
- "orm": {
247
- "type": "string"
248
- },
249
- "testing_strategy": {
250
- "type": "string"
251
- },
252
- "bundler": {
253
- "type": "string"
254
- },
255
- "project_type": {
256
- "type": "string"
257
- },
258
- "ci_pipeline": {
259
- "type": "string"
260
- }
261
- },
262
- "additionalProperties": false
263
- }
264
- },
265
- "additionalProperties": false
266
- }
@@ -1,15 +0,0 @@
1
- ## Critical Paths
2
-
3
- | Resource | Path |
4
- |----------|------|
5
- | Refactor Artifacts Dir | `.prizmkit/refactor/{{REFACTOR_ID}}/` |
6
- | Spec | `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` |
7
- | Plan | `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md` |
8
- | Review Report | `.prizmkit/refactor/{{REFACTOR_ID}}/review-report.md` |
9
- | Refactor Report | `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` |
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` |
14
- | Workflow Checkpoint | `{{CHECKPOINT_PATH}}` |
15
- | Project Root | `{{PROJECT_ROOT}}` |
@@ -1,9 +0,0 @@
1
- ## Your Mission
2
-
3
- You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}: "{{REFACTOR_TITLE}}".
4
-
5
- **CRITICAL**: Preserve observable behavior. Do not change product behavior unless the refactor contract explicitly requires it.
6
-
7
- **Execution model**: Follow the active skills and runtime contracts for planning, implementation, review, recovery, and commit. Those contracts determine the execution topology, permissions, and delegation boundaries.
8
-
9
- **NON-INTERACTIVE MODE**: There is NO human on the other end. Resolve uncertainty from existing code and conservative project patterns.
@@ -1,24 +0,0 @@
1
- ### Refactor Report and Completion Summary
2
-
3
- After `TEST_PASS`, create both family artifacts before retrospective and runtime commit preparation.
4
-
5
- Write `.prizmkit/refactor/{{REFACTOR_ID}}/refactor-report.md` with:
6
-
7
- - refactor summary and changed module boundaries;
8
- - files/modules changed;
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.
13
-
14
- Write `.prizmkit/refactor/{{REFACTOR_ID}}/completion-summary.json`:
15
-
16
- ```json
17
- {
18
- "completion_notes": [
19
- "<key structural change, moved/renamed interface, or new module boundary>"
20
- ]
21
- }
22
- ```
23
-
24
- Do not stage or commit. Mark `refactor-report` and `completion-summary` completed only after both artifacts are current and valid.
@@ -1,16 +0,0 @@
1
- ### Phase 2: Implement — Plan Execution
2
-
3
- **Goal**: execute the refactor plan while preserving behavior.
4
-
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
-
7
- Rules:
8
- - Follow the implementation skill's current execution and delegation contract.
9
- - Establish a baseline test result before structural changes when feasible.
10
- - Execute plan tasks in order and mark each `[x]` immediately.
11
- - After each behavior-sensitive task, run the smallest relevant behavior-preservation check.
12
- - Add or update tests only to lock existing behavior, not to change expected behavior.
13
- - If tests fail unexpectedly, treat it as a behavior-preservation failure and fix before proceeding.
14
- - Document changed module boundaries and any deviations from the plan in `context-snapshot.md`.
15
-
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.
@@ -1,9 +0,0 @@
1
- ### Phase 0: Initialize
2
-
3
- Create the refactor artifact directory:
4
-
5
- ```bash
6
- {{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/refactor/{{REFACTOR_ID}}
7
- ```
8
-
9
- **Checkpoint update**: Set step `prizmkit-init` to `completed` after the directory exists.
@@ -1,22 +0,0 @@
1
- ### Phase 1: Plan — Specification & Plan Generation
2
-
3
- **Goal**: produce a behavior-preserving refactor plan before editing code.
4
-
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
-
7
- The spec.md must include:
8
- - refactor goals and acceptance criteria;
9
- - explicit scope boundaries;
10
- - behavior preservation contract;
11
- - existing tests and gaps.
12
-
13
- The plan.md must include:
14
- - safe task ordering: baseline checks → safe renames/moves → extractions → structural changes;
15
- - files/modules to touch;
16
- - behavior-preservation checks for each task;
17
- - rollback strategy;
18
- - Tasks section with `[ ]` checkboxes.
19
-
20
- Resolve uncertain refactor details from existing code and conservative project patterns. Do not expand scope beyond the task contract.
21
-
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,19 +0,0 @@
1
- ### Phase 3: Review — Code Review & Behavior Verification
2
-
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
-
5
- Missing required evidence, an unsafe repair, a failed verification, or failure to converge under the review contract produces `NEEDS_FIXES`.
6
-
7
- **Gate Check — Final Review Result**:
8
-
9
- ```bash
10
- {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/refactor/{{REFACTOR_ID}}/review-report.md
11
- ```
12
-
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
- - `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
-
17
- Verify directly that the review checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
18
-
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. Do not complete the checkpoint for incomplete or invalid reports.
@@ -1,24 +0,0 @@
1
- ### Refactor Test Gate — PrizmKit Test
2
-
3
- After Main-Agent Code Review returns `PASS`, run the mandatory test stage against the same Refactor artifact root. Existing behavior-preservation context is input to testing; the final current-state native executions remain required.
4
-
5
- ```text
6
- /prizmkit-test scope=this-change artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/
7
- ```
8
-
9
- Consume the sibling terminal artifacts:
10
-
11
- - `.prizmkit/refactor/{{REFACTOR_ID}}/test-report.md`
12
- - `.prizmkit/refactor/{{REFACTOR_ID}}/test-result.json`
13
-
14
- They must agree on the testing result and unresolved items. Do not require an evidence package, manifest, hashes, attestation, or test-internal checkpoint.
15
-
16
- Gate outcomes:
17
-
18
- - `TEST_PASS`: verify required behavior-preservation coverage is included, mark the test step completed, and continue to retrospective.
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
- - `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
-
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
-
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 +0,0 @@
1
- ## Reminders
2
-
3
- - Use every formal atomic stage: `/prizmkit-plan`, `/prizmkit-implement`, `/prizmkit-code-review`, `/prizmkit-test`, `/prizmkit-retrospective`, `/prizmkit-committer` preparation.
4
- - All refactor skills use `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
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 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
- - If `DEV_PORT` is unknown, discover it from project config; do not guess port 3000.