prizmkit 1.1.7 → 1.1.9

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 (132) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/skill-adapter.js +21 -7
  3. package/bundled/agents/prizm-dev-team-reviewer.md +53 -173
  4. package/bundled/dev-pipeline/.env.example +45 -0
  5. package/bundled/dev-pipeline/README.md +64 -64
  6. package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +535 -0
  7. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  8. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +64 -18
  9. package/bundled/dev-pipeline/launch-feature-daemon.sh +15 -12
  10. package/bundled/dev-pipeline/launch-refactor-daemon.sh +64 -18
  11. package/bundled/dev-pipeline/lib/branch.sh +6 -1
  12. package/bundled/dev-pipeline/lib/common.sh +71 -0
  13. package/bundled/dev-pipeline/lib/heartbeat.sh +2 -2
  14. package/bundled/dev-pipeline/reset-bug.sh +10 -9
  15. package/bundled/dev-pipeline/reset-feature.sh +9 -8
  16. package/bundled/dev-pipeline/reset-refactor.sh +10 -9
  17. package/bundled/dev-pipeline/retry-bugfix.sh +67 -29
  18. package/bundled/dev-pipeline/retry-feature.sh +54 -18
  19. package/bundled/dev-pipeline/retry-refactor.sh +112 -29
  20. package/bundled/dev-pipeline/run-bugfix.sh +281 -59
  21. package/bundled/dev-pipeline/run-feature.sh +53 -18
  22. package/bundled/dev-pipeline/run-refactor.sh +392 -66
  23. package/bundled/dev-pipeline/scripts/check-session-status.py +24 -1
  24. package/bundled/dev-pipeline/scripts/cleanup-logs.py +2 -2
  25. package/bundled/dev-pipeline/scripts/detect-stuck.py +195 -85
  26. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +57 -33
  27. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +25 -9
  28. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +104 -17
  29. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -9
  30. package/bundled/dev-pipeline/scripts/init-pipeline.py +10 -10
  31. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +19 -8
  32. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -5
  33. package/bundled/dev-pipeline/scripts/patch-completion-notes.py +191 -0
  34. package/bundled/dev-pipeline/scripts/update-bug-status.py +167 -22
  35. package/bundled/dev-pipeline/scripts/update-feature-status.py +104 -62
  36. package/bundled/dev-pipeline/scripts/update-refactor-status.py +351 -21
  37. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +1 -1
  38. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +7 -11
  39. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +41 -7
  40. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +27 -3
  41. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +43 -19
  42. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -26
  43. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +6 -15
  44. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +36 -25
  45. package/bundled/dev-pipeline/templates/feature-list-schema.json +109 -31
  46. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +270 -0
  47. package/bundled/dev-pipeline/templates/refactor-list-schema.json +11 -3
  48. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +3 -1
  49. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +1 -0
  50. package/bundled/dev-pipeline/templates/sections/feature-context.md +2 -0
  51. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +29 -2
  52. package/bundled/dev-pipeline/templates/sections/phase-commit.md +22 -0
  53. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +2 -2
  54. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +8 -6
  55. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -5
  56. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  57. package/bundled/skills/_metadata.json +5 -22
  58. package/bundled/skills/app-planner/SKILL.md +98 -72
  59. package/bundled/skills/app-planner/assets/app-design-guide.md +1 -1
  60. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
  61. package/bundled/skills/app-planner/references/project-brief-guide.md +69 -66
  62. package/bundled/skills/bug-fix-workflow/SKILL.md +52 -9
  63. package/bundled/skills/bug-planner/SKILL.md +139 -197
  64. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +43 -0
  65. package/bundled/skills/bug-planner/references/critic-and-verification.md +44 -0
  66. package/bundled/skills/bug-planner/references/error-recovery.md +73 -0
  67. package/bundled/skills/bug-planner/references/input-formats.md +53 -0
  68. package/bundled/skills/bug-planner/references/schema-validation.md +25 -0
  69. package/bundled/skills/bug-planner/references/severity-rules.md +16 -0
  70. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +4 -8
  71. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +34 -39
  72. package/bundled/skills/feature-pipeline-launcher/SKILL.md +49 -36
  73. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +3 -3
  74. package/bundled/skills/feature-planner/SKILL.md +53 -142
  75. package/bundled/skills/feature-planner/assets/evaluation-guide.md +1 -1
  76. package/bundled/skills/feature-planner/assets/planning-guide.md +21 -5
  77. package/bundled/skills/feature-planner/references/browser-interaction.md +2 -4
  78. package/bundled/skills/feature-planner/references/completeness-review.md +57 -0
  79. package/bundled/skills/feature-planner/references/error-recovery.md +16 -35
  80. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +1 -1
  81. package/bundled/skills/feature-planner/references/new-project-planning.md +2 -2
  82. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +19 -20
  83. package/bundled/skills/feature-workflow/SKILL.md +24 -25
  84. package/bundled/skills/prizm-kit/SKILL.md +39 -49
  85. package/bundled/skills/prizmkit-code-review/SKILL.md +51 -64
  86. package/bundled/skills/prizmkit-code-review/rules/dimensions.md +85 -0
  87. package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +11 -11
  88. package/bundled/skills/prizmkit-committer/SKILL.md +3 -31
  89. package/bundled/skills/prizmkit-deploy/SKILL.md +34 -31
  90. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  91. package/bundled/skills/prizmkit-implement/SKILL.md +35 -68
  92. package/bundled/skills/prizmkit-init/SKILL.md +112 -65
  93. package/bundled/skills/prizmkit-init/assets/project-brief-template.md +82 -0
  94. package/bundled/skills/prizmkit-plan/SKILL.md +120 -79
  95. package/bundled/skills/prizmkit-plan/assets/plan-template.md +28 -18
  96. package/bundled/skills/prizmkit-plan/assets/spec-template.md +28 -11
  97. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +3 -3
  98. package/bundled/skills/prizmkit-plan/references/verification-checklist.md +60 -0
  99. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +10 -81
  100. package/bundled/skills/prizmkit-prizm-docs/assets/{PRIZM-SPEC.md → prizm-docs-format.md} +41 -526
  101. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +46 -0
  102. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +16 -0
  103. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +14 -0
  104. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +19 -0
  105. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +17 -0
  106. package/bundled/skills/prizmkit-retrospective/SKILL.md +27 -65
  107. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -4
  108. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +7 -25
  109. package/bundled/skills/recovery-workflow/SKILL.md +22 -22
  110. package/bundled/skills/recovery-workflow/evals/evals.json +5 -5
  111. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +43 -10
  112. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +48 -40
  113. package/bundled/skills/refactor-planner/SKILL.md +43 -61
  114. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +17 -17
  115. package/bundled/skills/refactor-workflow/SKILL.md +23 -24
  116. package/bundled/team/prizm-dev-team.json +1 -1
  117. package/bundled/{skills/prizm-kit/assets → templates}/project-memory-template.md +1 -1
  118. package/package.json +1 -1
  119. package/src/clean.js +3 -4
  120. package/src/gitignore-template.js +7 -9
  121. package/src/scaffold.js +14 -5
  122. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +0 -5
  123. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +0 -19
  124. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +0 -19
  125. package/bundled/skills/app-planner/references/project-conventions.md +0 -93
  126. package/bundled/skills/prizmkit-analyze/SKILL.md +0 -207
  127. package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +0 -25
  128. package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +0 -43
  129. package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +0 -25
  130. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +0 -69
  131. package/bundled/skills/prizmkit-verify/SKILL.md +0 -281
  132. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +0 -402
@@ -46,7 +46,7 @@ Three execution modes are available. The user chooses one before configuring oth
46
46
  Before any action, validate:
47
47
 
48
48
  1. **refactor pipeline exists**: Confirm `dev-pipeline/launch-refactor-daemon.sh` and `dev-pipeline/run-refactor.sh` are present and executable
49
- 2. **For start**: `refactor-list.json` must exist in project root (or user-specified path)
49
+ 2. **For start**: `.prizmkit/plans/refactor-list.json` must exist in `.prizmkit/plans/` (or user-specified path)
50
50
  3. **Dependencies**: `jq`, `python3`, AI CLI (`cbc` or `claude`) must be in PATH
51
51
  4. **Python version**: Requires Python 3.8+ for dev-pipeline scripts
52
52
 
@@ -55,8 +55,8 @@ Quick check:
55
55
  command -v jq && command -v python3 && (command -v cbc || command -v claude) && echo "All dependencies OK"
56
56
  ```
57
57
 
58
- If `refactor-list.json` is missing, inform user:
59
- > "No refactor-list.json found. Run the `refactor-planner` skill first to generate one, or provide a path to your refactor list."
58
+ If `.prizmkit/plans/refactor-list.json` is missing, inform user:
59
+ > "No .prizmkit/plans/refactor-list.json found. Run the `refactor-planner` skill first to generate one, or provide a path to your refactor list."
60
60
 
61
61
  ### Workflow
62
62
 
@@ -68,7 +68,7 @@ Detect user intent from their message, then follow the corresponding workflow:
68
68
 
69
69
  1. **Check prerequisites**:
70
70
  ```bash
71
- ls refactor-list.json 2>/dev/null && echo "Found" || echo "Missing"
71
+ ls .prizmkit/plans/refactor-list.json 2>/dev/null && echo "Found" || echo "Missing"
72
72
  ```
73
73
 
74
74
  2. **Check not already running**:
@@ -81,7 +81,7 @@ Detect user intent from their message, then follow the corresponding workflow:
81
81
  ```bash
82
82
  python3 -c "
83
83
  import json
84
- with open('refactor-list.json') as f:
84
+ with open('.prizmkit/plans/refactor-list.json') as f:
85
85
  data = json.load(f)
86
86
  refactors = data.get('refactors', [])
87
87
  print(f'Total refactor tasks: {len(refactors)}')
@@ -101,8 +101,8 @@ Detect user intent from their message, then follow the corresponding workflow:
101
101
  If pipeline state already exists, use the status command instead:
102
102
  ```bash
103
103
  python3 dev-pipeline/scripts/update-refactor-status.py \
104
- --refactor-list refactor-list.json \
105
- --state-dir dev-pipeline/refactor-state \
104
+ --refactor-list .prizmkit/plans/refactor-list.json \
105
+ --state-dir .prizmkit/state/refactor \
106
106
  --action status 2>/dev/null
107
107
  ```
108
108
 
@@ -135,20 +135,16 @@ Detect user intent from their message, then follow the corresponding workflow:
135
135
 
136
136
  Use `AskUserQuestion` to present the following configuration choices. Each question is a separate selectable option:
137
137
 
138
- **Question 1 — Critic review** (multiSelect: false):
139
- - Off (default) — Skip adversarial review
140
- - On — Enable critic review after refactoring (+3-8 min/refactor for critical/high complexity)
141
-
142
- **Question 2 — Verbose logging** (multiSelect: false):
138
+ **Question 1 — Verbose logging** (multiSelect: false):
143
139
  - On (default) — Detailed AI session logs including tool calls and subagent activity
144
140
  - Off — Minimal logging
145
141
 
146
- **Question 3 — Max retries** (multiSelect: false):
142
+ **Question 2 — Max retries** (multiSelect: false):
147
143
  - 3 (default)
148
144
  - 1
149
145
  - 5
150
146
 
151
- **Question 4 — Session timeout** (multiSelect: false):
147
+ **Question 3 — Session timeout** (multiSelect: false):
152
148
  - None (default) — No timeout
153
149
  - 30 min — `SESSION_TIMEOUT=1800`
154
150
  - 1 hour — `SESSION_TIMEOUT=3600`
@@ -171,40 +167,53 @@ Detect user intent from their message, then follow the corresponding workflow:
171
167
  | Strict behavior: On | `STRICT_BEHAVIOR_CHECK=1` |
172
168
  | Strict behavior: Off | `STRICT_BEHAVIOR_CHECK=0` |
173
169
 
170
+ **Advanced environment variables** (not exposed in interactive menu, pass via `--env`):
171
+
172
+ | Variable | Default | Purpose |
173
+ |----------|---------|---------|
174
+ | `MODEL` | (none) | AI model override (e.g. `claude-opus-4.6`) |
175
+ | `AUTO_PUSH` | `0` | Auto-push to remote after successful refactor (`1` to enable) |
176
+ | `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `refactor/pipeline-{run_id}`) |
177
+ | `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
178
+ | `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
179
+ | `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
180
+ | `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
181
+ | `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
182
+
174
183
  ⚠️ STOP HERE and wait for user response before continuing to step 7.
175
184
 
176
185
  7. **Show final command**: After user confirms configuration in step 6, assemble the complete command from execution mode + user-confirmed configuration, and present it to the user.
177
186
 
178
187
  **Foreground command:**
179
188
  ```bash
180
- VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run refactor-list.json
189
+ VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
181
190
  ```
182
191
  With all options:
183
192
  ```bash
184
193
  VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 SESSION_TIMEOUT=3600 \
185
- dev-pipeline/run-refactor.sh run refactor-list.json
194
+ dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
186
195
  ```
187
196
 
188
197
  **Background daemon command:**
189
198
  ```bash
190
- dev-pipeline/launch-refactor-daemon.sh start refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
199
+ dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
191
200
  ```
192
201
  With all options:
193
202
  ```bash
194
- dev-pipeline/launch-refactor-daemon.sh start refactor-list.json \
203
+ dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json \
195
204
  --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5"
196
205
  ```
197
206
 
198
207
  **Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 8.
199
208
  ```
200
209
  # To run in foreground:
201
- VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run refactor-list.json
210
+ VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
202
211
 
203
212
  # To run in background (detached):
204
- dev-pipeline/launch-refactor-daemon.sh start refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
213
+ dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
205
214
 
206
215
  # To check status:
207
- dev-pipeline/run-refactor.sh status refactor-list.json
216
+ dev-pipeline/run-refactor.sh status .prizmkit/plans/refactor-list.json
208
217
  ```
209
218
 
210
219
  8. **Confirm and launch** (Foreground and Background only — Manual mode ends at step 7):
@@ -227,7 +236,7 @@ Detect user intent from their message, then follow the corresponding workflow:
227
236
  ```
228
237
  2. Start log monitoring — Use the Bash tool with `run_in_background: true`:
229
238
  ```bash
230
- tail -f dev-pipeline/refactor-state/pipeline-daemon.log
239
+ tail -f .prizmkit/state/refactor/pipeline-daemon.log
231
240
  ```
232
241
  3. Report to user:
233
242
  - Pipeline PID
@@ -247,14 +256,14 @@ Detect user intent from their message, then follow the corresponding workflow:
247
256
  2. **Show refactor-level progress**:
248
257
  ```bash
249
258
  python3 dev-pipeline/scripts/update-refactor-status.py \
250
- --refactor-list refactor-list.json \
251
- --state-dir dev-pipeline/refactor-state \
259
+ --refactor-list .prizmkit/plans/refactor-list.json \
260
+ --state-dir .prizmkit/state/refactor \
252
261
  --action status
253
262
  ```
254
263
 
255
264
  3. **Show recent log activity** (last 20 lines):
256
265
  ```bash
257
- tail -20 dev-pipeline/refactor-state/pipeline-daemon.log
266
+ tail -20 .prizmkit/state/refactor/pipeline-daemon.log
258
267
  ```
259
268
 
260
269
  4. **Summarize** to user: total refactors, completed, in-progress, failed, pending.
@@ -286,20 +295,20 @@ Detect user intent from their message, then follow the corresponding workflow:
286
295
 
287
296
  2. **If running** -- Start live tail with Bash tool `run_in_background: true`:
288
297
  ```bash
289
- tail -f dev-pipeline/refactor-state/pipeline-daemon.log
298
+ tail -f .prizmkit/state/refactor/pipeline-daemon.log
290
299
  ```
291
300
 
292
301
  3. **If not running** -- Show last 50 lines:
293
302
  ```bash
294
- tail -50 dev-pipeline/refactor-state/pipeline-daemon.log
303
+ tail -50 .prizmkit/state/refactor/pipeline-daemon.log
295
304
  ```
296
305
 
297
306
  4. **For per-refactor session logs** (when user asks about a specific refactor):
298
307
  ```bash
299
308
  # Check refactor status for last session ID
300
- cat dev-pipeline/refactor-state/refactors/<REFACTOR_ID>/status.json 2>/dev/null
309
+ cat .prizmkit/state/refactor/refactors/<REFACTOR_ID>/status.json 2>/dev/null
301
310
  # Then tail that refactor's session log
302
- tail -100 dev-pipeline/refactor-state/refactors/<REFACTOR_ID>/sessions/<SESSION_ID>/logs/session.log
311
+ tail -100 .prizmkit/state/refactor/refactors/<REFACTOR_ID>/sessions/<SESSION_ID>/logs/session.log
303
312
  ```
304
313
 
305
314
  ---
@@ -309,23 +318,22 @@ Detect user intent from their message, then follow the corresponding workflow:
309
318
  When user says "retry R-001":
310
319
 
311
320
  ```bash
312
- dev-pipeline/retry-refactor.sh R-001 refactor-list.json
321
+ dev-pipeline/retry-refactor.sh R-001 .prizmkit/plans/refactor-list.json
313
322
  ```
314
323
 
315
324
  When user says "clean retry R-001" or "retry R-001 from scratch":
316
325
 
317
326
  ```bash
318
- dev-pipeline/reset-refactor.sh R-001 --clean --run refactor-list.json
327
+ dev-pipeline/reset-refactor.sh R-001 --clean --run .prizmkit/plans/refactor-list.json
319
328
  ```
320
329
 
321
330
  Environment variables (optional):
322
331
  ```bash
323
- SESSION_TIMEOUT=3600 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/retry-refactor.sh R-001 refactor-list.json
332
+ SESSION_TIMEOUT=3600 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/retry-refactor.sh R-001 .prizmkit/plans/refactor-list.json
324
333
  ```
325
334
 
326
335
  Notes:
327
- - `retry-refactor.sh` runs exactly one refactor session and exits.
328
- - `reset-refactor.sh --clean --run` clears the refactor state before retrying (fresh start).
336
+ - `retry-refactor.sh` runs exactly one refactor session and exits. It **preserves prior session artifacts and checkpoint state** — reads `retry_count` and `resume_from_phase` from `status.json` so the AI session can resume from where it left off. For a full clean retry, use `dev-pipeline/reset-refactor.sh <R-XXX> --clean --run`.
329
337
  - Keep pipeline daemon mode for main run management (`launch-refactor-daemon.sh`).
330
338
 
331
339
  ---
@@ -334,23 +342,23 @@ Notes:
334
342
 
335
343
  | Error | Action |
336
344
  |-------|--------|
337
- | `refactor-list.json` not found | Tell user to run `refactor-planner` skill first |
338
- | Circular dependencies in refactor list | Fix dependency graph in `refactor-list.json` before launching |
345
+ | `.prizmkit/plans/refactor-list.json` not found | Tell user to run `refactor-planner` skill first |
346
+ | Circular dependencies in refactor list | Fix dependency graph in `.prizmkit/plans/refactor-list.json` before launching |
339
347
  | Test baseline failing | Fix failing tests before starting refactoring -- behavior preservation requires a green baseline |
340
348
  | `jq` not installed | Suggest: `brew install jq` |
341
349
  | `cbc`/`claude` not in PATH | Check AI CLI installation |
342
350
  | Refactor pipeline already running | Show status, ask if user wants to stop and restart |
343
351
  | PID file stale (process dead) | `launch-refactor-daemon.sh` auto-cleans, retry start |
344
- | Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 dev-pipeline/refactor-state/pipeline-daemon.log` |
352
+ | Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 .prizmkit/state/refactor/pipeline-daemon.log` |
345
353
  | Refactor stuck/blocked | Use `retry-refactor.sh <R-XXX>` to retry; use `reset-refactor.sh <R-XXX> --clean --run` for fresh start |
346
- | All refactors blocked/failed | Show status, suggest recovery: `dev-pipeline/reset-refactor.sh <R-XXX> --clean --run refactor-list.json` |
354
+ | All refactors blocked/failed | Show status, suggest recovery: `dev-pipeline/reset-refactor.sh <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` |
347
355
  | Permission denied on script | Run `chmod +x dev-pipeline/launch-refactor-daemon.sh dev-pipeline/run-refactor.sh` |
348
356
 
349
357
  ### Integration Notes
350
358
 
351
- - **After refactor-planner**: This is the natural next step. When user finishes refactor planning and has `refactor-list.json`, suggest launching the refactor pipeline.
359
+ - **After refactor-planner**: This is the natural next step. When user finishes refactor planning and has `.prizmkit/plans/refactor-list.json`, suggest launching the refactor pipeline.
352
360
  - **Session independence**: The pipeline runs completely detached. User can close the AI CLI session, open a new session later, and use this skill to check progress or stop the pipeline.
353
361
  - **Single instance**: Only one refactor pipeline can run at a time. The PID file prevents duplicates.
354
- - **Pipeline coexistence**: Refactor pipeline uses `refactor-state/` separate from `state/` (features) and `bugfix-state/` (bugs), so all three pipelines can run simultaneously without conflict.
362
+ - **Pipeline coexistence**: Refactor pipeline uses `.prizmkit/state/refactor/` separate from `.prizmkit/state/features/` (features) and `.prizmkit/state/bugfix/` (bugs), so all three pipelines can run simultaneously without conflict.
355
363
  - **State preservation**: Stopping and restarting the pipeline resumes from where it left off -- completed refactors are not re-run.
356
364
  - **HANDOFF**: After pipeline completes all refactors, each session has already run `prizmkit-retrospective` internally. Ask user what's next.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "refactor-planner"
3
- description: "Interactive refactoring planner. Understands refactoring intent through dialogue, analyzes current code structure, produces validated refactor-list.json for dev-pipeline execution. Use whenever users discuss refactoring planning, code restructuring scope, or preparing refactor-list.json."
3
+ description: "Interactive refactoring planner. Understands refactoring intent through dialogue, analyzes current code structure, produces validated .prizmkit/plans/refactor-list.json for dev-pipeline execution. Use whenever users discuss refactoring planning, code restructuring scope, or preparing .prizmkit/plans/refactor-list.json."
4
4
  ---
5
5
 
6
6
  # refactor planner
@@ -9,7 +9,7 @@ Plan executable refactoring items for dev-pipeline:
9
9
  - **Scope Assessment**: analyze current code structure and identify refactoring targets
10
10
  - **Item Decomposition**: break refactoring goals into well-ordered, behavior-preserving items
11
11
 
12
- Always produce a validated `refactor-list.json` that conforms to `dev-pipeline-refactor-list-v1`.
12
+ Always produce a validated `.prizmkit/plans/refactor-list.json` that conforms to `dev-pipeline-refactor-list-v1`.
13
13
 
14
14
  ## Invocation Commitment (Hard Rule)
15
15
 
@@ -31,24 +31,24 @@ The user chose this skill intentionally. Respect that choice.
31
31
  - Create, modify, or delete source code files (*.js, *.ts, *.py, *.go, *.html, *.css, etc.)
32
32
  - Execute refactoring operations (rename, move, extract, etc.)
33
33
  - Run build/install/test commands
34
- - Execute any implementation action beyond writing `refactor-list.json`
34
+ - Execute any implementation action beyond writing `.prizmkit/plans/refactor-list.json`
35
35
 
36
36
  **Your ONLY writable outputs are:**
37
- 1. `refactor-list.json` (project root)
38
- 2. Draft backups in `.prizmkit/planning/`
37
+ 1. `.prizmkit/plans/refactor-list.json` (`.prizmkit/plans/`)
38
+ 2. Draft backups in `.prizmkit/plans/` (e.g., `refactor-list.draft.json`)
39
39
 
40
40
  **After planning is complete**, you MUST:
41
41
  1. Present the summary and recommended next step
42
42
  2. **Ask the user explicitly** whether they want to proceed to execution
43
- 3. If the user agrees -> recommend invoking `refactor-pipeline-launcher` or running `run-refactor.sh` (do NOT execute it yourself)
44
- 4. If the user wants to adjust -> continue refining `refactor-list.json`
43
+ 3. If the user agrees recommend invoking `refactor-pipeline-launcher` (do NOT execute it yourself)
44
+ 4. If the user wants to adjust continue refining `.prizmkit/plans/refactor-list.json`
45
45
  5. **NEVER auto-execute** the pipeline, launcher, or any implementation step
46
46
 
47
47
  ## When to Use
48
48
 
49
49
  Trigger this skill for requests like:
50
50
  - "Plan refactoring", "Scope a restructuring"
51
- - "Prepare refactor-list.json", "Prepare dev-pipeline input for refactoring"
51
+ - "Prepare .prizmkit/plans/refactor-list.json", "Prepare dev-pipeline input for refactoring"
52
52
  - "Assess code for refactoring", "Identify refactoring targets"
53
53
  - "Plan a code migration", "Decompose a large refactor"
54
54
 
@@ -86,7 +86,7 @@ Before questions, check optional context files (never block if absent):
86
86
  - `.prizm-docs/root.prizm` (architecture/project context)
87
87
  - `.prizmkit/config.json` (existing stack preferences and detected tech stack)
88
88
  - Existing test suite (critical for behavior preservation assessment)
89
- - Existing `refactor-list.json` (if appending additional items)
89
+ - Existing `.prizmkit/plans/refactor-list.json` (if appending additional items)
90
90
  - If `.prizm-docs/root.prizm` is absent and the project has existing source code, scan the directory structure:
91
91
  ```bash
92
92
  find . -maxdepth 2 -type d -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/__pycache__/*' -not -path '*/vendor/*' | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
@@ -106,13 +106,13 @@ Full Q&A -> code analysis -> item generation. Used when starting from scratch or
106
106
  When an existing analysis report (e.g., `refactor-analysis.md`) is available, skip the analysis phase and proceed directly to item decomposition.
107
107
 
108
108
  ### Mode C: Validate
109
- Validate an existing `refactor-list.json` without regenerating it:
109
+ Validate an existing `.prizmkit/plans/refactor-list.json` without regenerating it:
110
110
  ```bash
111
- python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input refactor-list.json
111
+ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json
112
112
  ```
113
113
 
114
114
  ### Mode D: Summary
115
- Display a human-readable summary of an existing `refactor-list.json`:
115
+ Display a human-readable summary of an existing `.prizmkit/plans/refactor-list.json`:
116
116
  - Item count, dependency graph, complexity distribution, behavior preservation strategies
117
117
 
118
118
  ## Interactive Mode — Core Workflow
@@ -240,12 +240,19 @@ Continue until all items are confirmed or skipped.
240
240
 
241
241
  ### Phase 6: Completeness Review
242
242
 
243
- **Goal**: Check the full item set for consistency and gaps.
243
+ **Goal**: Check the full item set for consistency, gaps, and headless execution readiness.
244
244
 
245
245
  1. **Dependency ordering check**: Verify items form a valid DAG (no cycles). Items should be ordered: safe renames -> extract/inline -> structural changes -> migrations
246
246
  2. **Behavior preservation check**: Every item must have a declared preservation strategy. Flag any item with `manual` strategy and no test coverage.
247
247
  3. **Gap detection**: Are there intermediate steps needed between items? Does item A's output match item B's input assumption?
248
248
  4. **Cross-module impact**: Do any items affect modules outside the declared scope?
249
+ 5. **Headless Execution Readiness**: The refactor pipeline runs each item through an autonomous AI session with NO human interaction. For each item, verify:
250
+ - **Scope clarity**: Are all affected files explicitly listed? The AI must know exactly where to look.
251
+ - **Refactoring instructions**: Is the description specific enough to execute without ambiguity?
252
+ - ❌ "Clean up the utils module" — what exactly should change?
253
+ - ✅ "Extract validation functions (validateEmail, validatePhone, validateUrl) from src/utils/helpers.ts into src/utils/validation.ts. Update all 12 import sites. Preserve existing function signatures."
254
+ - **Behavior preservation**: Is it clear what tests to run and what behavior must be preserved?
255
+ - **Dependency context**: If item depends on earlier refactors, does the description reference what changed?
249
256
 
250
257
  Present review summary:
251
258
  ```
@@ -262,17 +269,17 @@ If issues found, discuss with user and resolve before proceeding.
262
269
 
263
270
  ### Phase 7: Generate & Validate
264
271
 
265
- **Goal**: Produce `refactor-list.json` and validate it.
272
+ **Goal**: Produce `.prizmkit/plans/refactor-list.json` and validate it.
266
273
 
267
- 1. Generate `refactor-list.json` at project root
274
+ 1. Generate `.prizmkit/plans/refactor-list.json` at `.prizmkit/plans/`
268
275
  2. Run validation:
269
276
  ```bash
270
- python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input refactor-list.json
277
+ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json
271
278
  ```
272
279
  3. If validation fails -> fix issues and re-validate (max 3 attempts)
273
280
  4. If validation passes -> present final summary
274
281
 
275
- **CHECKPOINT CP-RP-6**: `refactor-list.json` generated and validated.
282
+ **CHECKPOINT CP-RP-6**: `.prizmkit/plans/refactor-list.json` generated and validated.
276
283
 
277
284
  ## Checkpoints (Mandatory Gates)
278
285
 
@@ -284,18 +291,18 @@ If issues found, discuss with user and resolve before proceeding.
284
291
  | **CP-RP-3** | Items Decomposed | All items have deps, complexity, preservation strategy | 4 |
285
292
  | **CP-RP-4** | Items Confirmed | User confirmed/modified/skipped each item | 5 |
286
293
  | **CP-RP-5** | Completeness OK | DAG valid, preservation strategies declared, no gaps | 6 |
287
- | **CP-RP-6** | Output Valid | `refactor-list.json` passes validation script | 7 |
294
+ | **CP-RP-6** | Output Valid | `.prizmkit/plans/refactor-list.json` passes validation script | 7 |
288
295
 
289
- **Resume Detection**: If existing artifacts found (partial `refactor-list.json`, draft in `.prizmkit/planning/`), offer to resume from the appropriate checkpoint.
296
+ **Resume Detection**: If existing artifacts found (partial `.prizmkit/plans/refactor-list.json`, draft `refactor-list.draft.json` in `.prizmkit/plans/`), offer to resume from the appropriate checkpoint.
290
297
 
291
298
  ## Output Rules
292
299
 
293
- `refactor-list.json` must satisfy:
300
+ `.prizmkit/plans/refactor-list.json` must satisfy:
294
301
  - `$schema` = `dev-pipeline-refactor-list-v1`
295
302
  - Non-empty `refactors` array
296
303
  - Sequential IDs: `R-001`, `R-002`, ...
297
304
  - Valid dependency DAG (no cycles)
298
- - Each item has a declared `behavior_preservation` strategy: `test-gate`, `snapshot`, or `manual`
305
+ - Each item has a declared `behavior_preservation` object with `strategy` field: `"test-gate"`, `"snapshot"`, or `"manual"`. Optional fields: `existing_tests` (boolean), `new_tests_needed` (string array). See `dev-pipeline/templates/refactor-list-schema.json` for the full schema.
299
306
  - `priority` must be a string: `"critical"`, `"high"`, `"medium"`, or `"low"`
300
307
  - New items default `status: "pending"`
301
308
  - English titles for stable slug generation
@@ -304,27 +311,16 @@ If issues found, discuss with user and resolve before proceeding.
304
311
  - `model` field is optional — omitting it means the pipeline uses $MODEL env or CLI default
305
312
  - `scope` object with nested structure: `files` array (target file paths) and `modules` array (module names)
306
313
 
307
- ## Adversarial Critic Review
314
+ ## Adversarial Critic Defaults
308
315
 
309
- All refactoring items support optional critic review for additional quality assurance. The critic mechanism helps validate that refactoring preserves behavior while improving code quality.
316
+ Set default critic fields for each refactor item. The user can override per-item.
310
317
 
311
- ### Default Critic Behavior
312
-
313
- | Priority | Complexity | `critic` | `critic_count` | Rationale |
314
- |----------|-----------|----------|----------------|-----------|
315
- | critical | high | `true` | `3` | Multi-critic voting for high-risk refactors |
316
- | critical | medium/low | `true` | `1` | Single critic for critical-priority refactors |
317
- | high | high | `true` | `1` | Single critic for high-complexity refactors |
318
- | high | medium/low | `false` | (omitted) | Skip critic for simpler high-priority items |
319
- | medium | any | `false` | (omitted) | Skip critic for medium-priority refactors |
320
- | low | any | `false` | (omitted) | Skip critic for low-priority refactors |
321
-
322
- - `critic: true` — Enable adversarial review after refactoring completion
323
- - `critic_count: 1` — Single critic agent reviews the refactor
324
- - `critic_count: 3` — Three critic agents vote on the refactor quality
325
- - Critic verifies: behavior preservation strategy followed, code quality improved, no regressions, tests passing
326
-
327
- **User Override**: During planning phases, users can opt to enable/disable critic on a per-item basis.
318
+ | Priority | Complexity | `critic` | `critic_count` |
319
+ |----------|-----------|----------|----------------|
320
+ | critical | high | `true` | `3` |
321
+ | critical | medium/low | `true` | `1` |
322
+ | high | high | `true` | `1` |
323
+ | other combinations | any | `false` | (omitted) |
328
324
 
329
325
  ---
330
326
 
@@ -423,21 +419,7 @@ Take the highest of these individual assessments as the item's complexity.
423
419
 
424
420
  ## Next-Step Execution Policy (after planning)
425
421
 
426
- Recommend these three options in this strict order:
427
-
428
- 1. **Preferred**: invoke `refactor-pipeline-launcher` skill (natural-language handoff)
429
- 2. **Fallback A**: run daemon wrapper
430
- ```bash
431
- ./dev-pipeline/launch-refactor-daemon.sh start refactor-list.json
432
- ./dev-pipeline/launch-refactor-daemon.sh status
433
- ```
434
- 3. **Fallback B**: run direct foreground script
435
- ```bash
436
- ./dev-pipeline/run-refactor.sh run
437
- ./dev-pipeline/run-refactor.sh status
438
- ```
439
-
440
- When launcher is available, do not prioritize raw scripts.
422
+ Recommend invoking `refactor-pipeline-launcher` to configure and launch the dev-pipeline. Do NOT recommend running shell scripts directly — that is the launcher's responsibility.
441
423
 
442
424
  ## Error Recovery & Resume
443
425
 
@@ -445,16 +427,16 @@ Key behaviors:
445
427
  - Warnings only -> proceed with user approval
446
428
  - Critical errors -> group by type, auto-fix where possible, max 3 total attempts
447
429
  - Interrupted session -> detect checkpoint from existing artifacts, offer resume or restart
448
- - `refactor-list.json` MUST be written to project root (same level as `package.json` / `.git`)
430
+ - `.prizmkit/plans/refactor-list.json` MUST be written to `.prizmkit/plans/` (project root level: `./{root}/.prizmkit/plans/refactor-list.json`)
449
431
 
450
432
  ### Resume Detection
451
433
 
452
434
  | Artifact Found | Resume From |
453
435
  |---------------|------------|
454
436
  | Nothing | Phase 1: Project Context |
455
- | Draft in `.prizmkit/planning/` | Phase matching draft state |
456
- | Partial `refactor-list.json` | Phase 6: Completeness Review |
457
- | Valid `refactor-list.json` | Mode D: Summary |
437
+ | Draft in `.prizmkit/plans/` | Phase matching draft state |
438
+ | Partial `.prizmkit/plans/refactor-list.json` | Phase 6: Completeness Review |
439
+ | Valid `.prizmkit/plans/refactor-list.json` | Mode D: Summary |
458
440
 
459
441
  ## Session Exit Gate
460
442
 
@@ -464,11 +446,11 @@ Prevent accidental session exit without deliverable completion.
464
446
  Activate exit gate when ALL are true:
465
447
  - User invoked `/refactor-planner` (not just mentioned refactoring)
466
448
  - Current phase < Phase 7 (validation not yet passed)
467
- - No valid `refactor-list.json` has been written in this session
449
+ - No valid `.prizmkit/plans/refactor-list.json` has been written in this session
468
450
 
469
451
  ### Gate Behavior
470
452
  When the session appears to be ending:
471
- 1. **Remind**: "You set out to produce `refactor-list.json` but we haven't completed it yet."
453
+ 1. **Remind**: "You set out to produce `.prizmkit/plans/refactor-list.json` but we haven't completed it yet."
472
454
  2. **Offer 3 options**:
473
455
  - **(a) Continue to completion** — resume from current phase
474
456
  - **(b) Save draft & exit** — write current progress as draft, exit session
@@ -4,14 +4,14 @@ validate-and-generate-refactor.py - Validate and generate refactor-list.json fil
4
4
  for the dev-pipeline system.
5
5
 
6
6
  Commands:
7
- validate Validate an existing refactor-list.json
8
- template Generate a blank template refactor-list.json
9
- summary Print a summary table of refactors from a refactor-list.json
7
+ validate Validate an existing .prizmkit/plans/refactor-list.json
8
+ template Generate a blank template .prizmkit/plans/refactor-list.json
9
+ summary Print a summary table of refactors from a .prizmkit/plans/refactor-list.json
10
10
 
11
11
  Usage:
12
- python3 validate-and-generate-refactor.py validate --input refactor-list.json [--output validated.json]
13
- python3 validate-and-generate-refactor.py template --output refactor-list.json
14
- python3 validate-and-generate-refactor.py summary --input refactor-list.json [--format markdown|json]
12
+ python3 validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json [--output validated.json]
13
+ python3 validate-and-generate-refactor.py template --output .prizmkit/plans/refactor-list.json
14
+ python3 validate-and-generate-refactor.py summary --input .prizmkit/plans/refactor-list.json [--format markdown|json]
15
15
 
16
16
  Python 3.6+ required. No external dependencies.
17
17
  """
@@ -712,15 +712,15 @@ def cmd_summary(args):
712
712
 
713
713
  def main():
714
714
  parser = argparse.ArgumentParser(
715
- description="Validate and generate refactor-list.json files for the dev-pipeline system.",
715
+ description="Validate and generate .prizmkit/plans/refactor-list.json files for the dev-pipeline system.",
716
716
  formatter_class=argparse.RawDescriptionHelpFormatter,
717
717
  epilog=(
718
718
  "Examples:\n"
719
- " %(prog)s validate --input refactor-list.json\n"
720
- " %(prog)s validate --input refactor-list.json --output validated.json\n"
721
- " %(prog)s template --output refactor-list.json\n"
722
- " %(prog)s summary --input refactor-list.json\n"
723
- " %(prog)s summary --input refactor-list.json --format json\n"
719
+ " %(prog)s validate --input .prizmkit/plans/refactor-list.json\n"
720
+ " %(prog)s validate --input .prizmkit/plans/refactor-list.json --output validated.json\n"
721
+ " %(prog)s template --output .prizmkit/plans/refactor-list.json\n"
722
+ " %(prog)s summary --input .prizmkit/plans/refactor-list.json\n"
723
+ " %(prog)s summary --input .prizmkit/plans/refactor-list.json --format json\n"
724
724
  ),
725
725
  )
726
726
 
@@ -729,10 +729,10 @@ def main():
729
729
  # -- validate --
730
730
  p_validate = subparsers.add_parser(
731
731
  "validate",
732
- help="Validate an existing refactor-list.json",
732
+ help="Validate an existing .prizmkit/plans/refactor-list.json",
733
733
  )
734
734
  p_validate.add_argument(
735
- "--input", required=True, help="Path to input refactor-list.json"
735
+ "--input", required=True, help="Path to input .prizmkit/plans/refactor-list.json"
736
736
  )
737
737
  p_validate.add_argument(
738
738
  "--output", help="Path to write validated output (optional)"
@@ -741,7 +741,7 @@ def main():
741
741
  # -- template --
742
742
  p_template = subparsers.add_parser(
743
743
  "template",
744
- help="Generate a blank template refactor-list.json",
744
+ help="Generate a blank template .prizmkit/plans/refactor-list.json",
745
745
  )
746
746
  p_template.add_argument(
747
747
  "--output", required=True, help="Path to write template file"
@@ -750,10 +750,10 @@ def main():
750
750
  # -- summary --
751
751
  p_summary = subparsers.add_parser(
752
752
  "summary",
753
- help="Print a summary table of refactors from a refactor-list.json",
753
+ help="Print a summary table of refactors from a .prizmkit/plans/refactor-list.json",
754
754
  )
755
755
  p_summary.add_argument(
756
- "--input", required=True, help="Path to input refactor-list.json"
756
+ "--input", required=True, help="Path to input .prizmkit/plans/refactor-list.json"
757
757
  )
758
758
  p_summary.add_argument(
759
759
  "--format",