prizmkit 1.1.6 → 1.1.8

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 (63) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/README.md +65 -65
  3. package/bundled/dev-pipeline/assets/feature-list-example.json +2 -2
  4. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +11 -10
  5. package/bundled/dev-pipeline/launch-feature-daemon.sh +12 -11
  6. package/bundled/dev-pipeline/launch-refactor-daemon.sh +11 -10
  7. package/bundled/dev-pipeline/reset-bug.sh +305 -0
  8. package/bundled/dev-pipeline/reset-feature.sh +9 -8
  9. package/bundled/dev-pipeline/reset-refactor.sh +10 -9
  10. package/bundled/dev-pipeline/retry-bugfix.sh +7 -6
  11. package/bundled/dev-pipeline/retry-feature.sh +7 -6
  12. package/bundled/dev-pipeline/retry-refactor.sh +7 -6
  13. package/bundled/dev-pipeline/run-bugfix.sh +71 -23
  14. package/bundled/dev-pipeline/run-feature.sh +30 -21
  15. package/bundled/dev-pipeline/run-refactor.sh +21 -17
  16. package/bundled/dev-pipeline/scripts/cleanup-logs.py +2 -2
  17. package/bundled/dev-pipeline/scripts/detect-stuck.py +3 -3
  18. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +26 -14
  19. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +6 -6
  20. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +6 -6
  21. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +4 -4
  22. package/bundled/dev-pipeline/scripts/init-pipeline.py +26 -12
  23. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +4 -4
  24. package/bundled/dev-pipeline/scripts/update-bug-status.py +10 -10
  25. package/bundled/dev-pipeline/scripts/update-feature-status.py +31 -31
  26. package/bundled/dev-pipeline/scripts/update-refactor-status.py +8 -8
  27. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +111 -31
  28. package/bundled/dev-pipeline/templates/feature-list-schema.json +91 -25
  29. package/bundled/dev-pipeline/templates/refactor-list-schema.json +107 -28
  30. package/bundled/dev-pipeline/tests/test_auto_skip.py +1 -1
  31. package/bundled/skills/_metadata.json +10 -2
  32. package/bundled/skills/app-planner/SKILL.md +24 -13
  33. package/bundled/skills/app-planner/references/project-brief-guide.md +1 -1
  34. package/bundled/skills/bug-fix-workflow/SKILL.md +7 -5
  35. package/bundled/skills/bug-planner/SKILL.md +80 -25
  36. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +3 -3
  37. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +38 -33
  38. package/bundled/skills/feature-pipeline-launcher/SKILL.md +33 -33
  39. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +3 -3
  40. package/bundled/skills/feature-planner/SKILL.md +96 -24
  41. package/bundled/skills/feature-planner/references/error-recovery.md +9 -9
  42. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +25 -24
  43. package/bundled/skills/feature-workflow/SKILL.md +23 -20
  44. package/bundled/skills/prizmkit-committer/SKILL.md +1 -0
  45. package/bundled/skills/prizmkit-deploy/SKILL.md +1 -0
  46. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  47. package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
  48. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +4 -4
  49. package/bundled/skills/prizmkit-plan/SKILL.md +3 -3
  50. package/bundled/skills/prizmkit-retrospective/SKILL.md +40 -3
  51. package/bundled/skills/prizmkit-verify/SKILL.md +281 -0
  52. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +402 -0
  53. package/bundled/skills/recovery-workflow/SKILL.md +15 -14
  54. package/bundled/skills/recovery-workflow/evals/evals.json +5 -5
  55. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +43 -10
  56. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +38 -34
  57. package/bundled/skills/refactor-planner/SKILL.md +74 -24
  58. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +17 -17
  59. package/bundled/skills/refactor-workflow/SKILL.md +24 -20
  60. package/package.json +1 -1
  61. package/src/clean.js +4 -4
  62. package/src/gitignore-template.js +7 -8
  63. package/src/scaffold.js +4 -2
@@ -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,16 +135,20 @@ 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 — Verbose logging** (multiSelect: false):
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):
139
143
  - On (default) — Detailed AI session logs including tool calls and subagent activity
140
144
  - Off — Minimal logging
141
145
 
142
- **Question 2 — Max retries** (multiSelect: false):
146
+ **Question 3 — Max retries** (multiSelect: false):
143
147
  - 3 (default)
144
148
  - 1
145
149
  - 5
146
150
 
147
- **Question 3 — Session timeout** (multiSelect: false):
151
+ **Question 4 — Session timeout** (multiSelect: false):
148
152
  - None (default) — No timeout
149
153
  - 30 min — `SESSION_TIMEOUT=1800`
150
154
  - 1 hour — `SESSION_TIMEOUT=3600`
@@ -173,34 +177,34 @@ Detect user intent from their message, then follow the corresponding workflow:
173
177
 
174
178
  **Foreground command:**
175
179
  ```bash
176
- VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run refactor-list.json
180
+ VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
177
181
  ```
178
182
  With all options:
179
183
  ```bash
180
184
  VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 SESSION_TIMEOUT=3600 \
181
- dev-pipeline/run-refactor.sh run refactor-list.json
185
+ dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
182
186
  ```
183
187
 
184
188
  **Background daemon command:**
185
189
  ```bash
186
- dev-pipeline/launch-refactor-daemon.sh start refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
190
+ dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
187
191
  ```
188
192
  With all options:
189
193
  ```bash
190
- dev-pipeline/launch-refactor-daemon.sh start refactor-list.json \
194
+ dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json \
191
195
  --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5"
192
196
  ```
193
197
 
194
198
  **Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 8.
195
199
  ```
196
200
  # To run in foreground:
197
- VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run refactor-list.json
201
+ VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
198
202
 
199
203
  # To run in background (detached):
200
- dev-pipeline/launch-refactor-daemon.sh start refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
204
+ dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
201
205
 
202
206
  # To check status:
203
- dev-pipeline/run-refactor.sh status refactor-list.json
207
+ dev-pipeline/run-refactor.sh status .prizmkit/plans/refactor-list.json
204
208
  ```
205
209
 
206
210
  8. **Confirm and launch** (Foreground and Background only — Manual mode ends at step 7):
@@ -223,7 +227,7 @@ Detect user intent from their message, then follow the corresponding workflow:
223
227
  ```
224
228
  2. Start log monitoring — Use the Bash tool with `run_in_background: true`:
225
229
  ```bash
226
- tail -f dev-pipeline/refactor-state/pipeline-daemon.log
230
+ tail -f .prizmkit/state/refactor/pipeline-daemon.log
227
231
  ```
228
232
  3. Report to user:
229
233
  - Pipeline PID
@@ -243,14 +247,14 @@ Detect user intent from their message, then follow the corresponding workflow:
243
247
  2. **Show refactor-level progress**:
244
248
  ```bash
245
249
  python3 dev-pipeline/scripts/update-refactor-status.py \
246
- --refactor-list refactor-list.json \
247
- --state-dir dev-pipeline/refactor-state \
250
+ --refactor-list .prizmkit/plans/refactor-list.json \
251
+ --state-dir .prizmkit/state/refactor \
248
252
  --action status
249
253
  ```
250
254
 
251
255
  3. **Show recent log activity** (last 20 lines):
252
256
  ```bash
253
- tail -20 dev-pipeline/refactor-state/pipeline-daemon.log
257
+ tail -20 .prizmkit/state/refactor/pipeline-daemon.log
254
258
  ```
255
259
 
256
260
  4. **Summarize** to user: total refactors, completed, in-progress, failed, pending.
@@ -282,20 +286,20 @@ Detect user intent from their message, then follow the corresponding workflow:
282
286
 
283
287
  2. **If running** -- Start live tail with Bash tool `run_in_background: true`:
284
288
  ```bash
285
- tail -f dev-pipeline/refactor-state/pipeline-daemon.log
289
+ tail -f .prizmkit/state/refactor/pipeline-daemon.log
286
290
  ```
287
291
 
288
292
  3. **If not running** -- Show last 50 lines:
289
293
  ```bash
290
- tail -50 dev-pipeline/refactor-state/pipeline-daemon.log
294
+ tail -50 .prizmkit/state/refactor/pipeline-daemon.log
291
295
  ```
292
296
 
293
297
  4. **For per-refactor session logs** (when user asks about a specific refactor):
294
298
  ```bash
295
299
  # Check refactor status for last session ID
296
- cat dev-pipeline/refactor-state/refactors/<REFACTOR_ID>/status.json 2>/dev/null
300
+ cat .prizmkit/state/refactor/refactors/<REFACTOR_ID>/status.json 2>/dev/null
297
301
  # Then tail that refactor's session log
298
- tail -100 dev-pipeline/refactor-state/refactors/<REFACTOR_ID>/sessions/<SESSION_ID>/logs/session.log
302
+ tail -100 .prizmkit/state/refactor/refactors/<REFACTOR_ID>/sessions/<SESSION_ID>/logs/session.log
299
303
  ```
300
304
 
301
305
  ---
@@ -305,18 +309,18 @@ Detect user intent from their message, then follow the corresponding workflow:
305
309
  When user says "retry R-001":
306
310
 
307
311
  ```bash
308
- dev-pipeline/retry-refactor.sh R-001 refactor-list.json
312
+ dev-pipeline/retry-refactor.sh R-001 .prizmkit/plans/refactor-list.json
309
313
  ```
310
314
 
311
315
  When user says "clean retry R-001" or "retry R-001 from scratch":
312
316
 
313
317
  ```bash
314
- dev-pipeline/reset-refactor.sh R-001 --clean --run refactor-list.json
318
+ dev-pipeline/reset-refactor.sh R-001 --clean --run .prizmkit/plans/refactor-list.json
315
319
  ```
316
320
 
317
321
  Environment variables (optional):
318
322
  ```bash
319
- SESSION_TIMEOUT=3600 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/retry-refactor.sh R-001 refactor-list.json
323
+ SESSION_TIMEOUT=3600 STRICT_BEHAVIOR_CHECK=1 dev-pipeline/retry-refactor.sh R-001 .prizmkit/plans/refactor-list.json
320
324
  ```
321
325
 
322
326
  Notes:
@@ -330,23 +334,23 @@ Notes:
330
334
 
331
335
  | Error | Action |
332
336
  |-------|--------|
333
- | `refactor-list.json` not found | Tell user to run `refactor-planner` skill first |
334
- | Circular dependencies in refactor list | Fix dependency graph in `refactor-list.json` before launching |
337
+ | `.prizmkit/plans/refactor-list.json` not found | Tell user to run `refactor-planner` skill first |
338
+ | Circular dependencies in refactor list | Fix dependency graph in `.prizmkit/plans/refactor-list.json` before launching |
335
339
  | Test baseline failing | Fix failing tests before starting refactoring -- behavior preservation requires a green baseline |
336
340
  | `jq` not installed | Suggest: `brew install jq` |
337
341
  | `cbc`/`claude` not in PATH | Check AI CLI installation |
338
342
  | Refactor pipeline already running | Show status, ask if user wants to stop and restart |
339
343
  | PID file stale (process dead) | `launch-refactor-daemon.sh` auto-cleans, retry start |
340
- | Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 dev-pipeline/refactor-state/pipeline-daemon.log` |
344
+ | Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 .prizmkit/state/refactor/pipeline-daemon.log` |
341
345
  | Refactor stuck/blocked | Use `retry-refactor.sh <R-XXX>` to retry; use `reset-refactor.sh <R-XXX> --clean --run` for fresh start |
342
- | All refactors blocked/failed | Show status, suggest recovery: `dev-pipeline/reset-refactor.sh <R-XXX> --clean --run refactor-list.json` |
346
+ | All refactors blocked/failed | Show status, suggest recovery: `dev-pipeline/reset-refactor.sh <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` |
343
347
  | Permission denied on script | Run `chmod +x dev-pipeline/launch-refactor-daemon.sh dev-pipeline/run-refactor.sh` |
344
348
 
345
349
  ### Integration Notes
346
350
 
347
- - **After refactor-planner**: This is the natural next step. When user finishes refactor planning and has `refactor-list.json`, suggest launching the refactor pipeline.
351
+ - **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.
348
352
  - **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.
349
353
  - **Single instance**: Only one refactor pipeline can run at a time. The PID file prevents duplicates.
350
- - **Pipeline coexistence**: Refactor pipeline uses `refactor-state/` separate from `state/` (features) and `bugfix-state/` (bugs), so all three pipelines can run simultaneously without conflict.
354
+ - **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.
351
355
  - **State preservation**: Stopping and restarting the pipeline resumes from where it left off -- completed refactors are not re-run.
352
356
  - **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)
37
+ 1. `.prizmkit/plans/refactor-list.json` (`.prizmkit/plans/`)
38
38
  2. Draft backups in `.prizmkit/planning/`
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
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`
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
@@ -262,17 +262,17 @@ If issues found, discuss with user and resolve before proceeding.
262
262
 
263
263
  ### Phase 7: Generate & Validate
264
264
 
265
- **Goal**: Produce `refactor-list.json` and validate it.
265
+ **Goal**: Produce `.prizmkit/plans/refactor-list.json` and validate it.
266
266
 
267
- 1. Generate `refactor-list.json` at project root
267
+ 1. Generate `.prizmkit/plans/refactor-list.json` at `.prizmkit/plans/`
268
268
  2. Run validation:
269
269
  ```bash
270
- python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input refactor-list.json
270
+ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json
271
271
  ```
272
272
  3. If validation fails -> fix issues and re-validate (max 3 attempts)
273
273
  4. If validation passes -> present final summary
274
274
 
275
- **CHECKPOINT CP-RP-6**: `refactor-list.json` generated and validated.
275
+ **CHECKPOINT CP-RP-6**: `.prizmkit/plans/refactor-list.json` generated and validated.
276
276
 
277
277
  ## Checkpoints (Mandatory Gates)
278
278
 
@@ -284,13 +284,13 @@ If issues found, discuss with user and resolve before proceeding.
284
284
  | **CP-RP-3** | Items Decomposed | All items have deps, complexity, preservation strategy | 4 |
285
285
  | **CP-RP-4** | Items Confirmed | User confirmed/modified/skipped each item | 5 |
286
286
  | **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 |
287
+ | **CP-RP-6** | Output Valid | `.prizmkit/plans/refactor-list.json` passes validation script | 7 |
288
288
 
289
- **Resume Detection**: If existing artifacts found (partial `refactor-list.json`, draft in `.prizmkit/planning/`), offer to resume from the appropriate checkpoint.
289
+ **Resume Detection**: If existing artifacts found (partial `.prizmkit/plans/refactor-list.json`, draft in `.prizmkit/planning/`), offer to resume from the appropriate checkpoint.
290
290
 
291
291
  ## Output Rules
292
292
 
293
- `refactor-list.json` must satisfy:
293
+ `.prizmkit/plans/refactor-list.json` must satisfy:
294
294
  - `$schema` = `dev-pipeline-refactor-list-v1`
295
295
  - Non-empty `refactors` array
296
296
  - Sequential IDs: `R-001`, `R-002`, ...
@@ -302,7 +302,31 @@ If issues found, discuss with user and resolve before proceeding.
302
302
  - `type` field must be one of: `extract`, `rename`, `restructure`, `simplify`, `decouple`, `migrate`
303
303
  - Descriptions minimum 15 words (error). Recommended: 30/50/80 words for low/medium/high complexity (warning).
304
304
  - `model` field is optional — omitting it means the pipeline uses $MODEL env or CLI default
305
- - `scope` array lists target file/directory paths
305
+ - `scope` object with nested structure: `files` array (target file paths) and `modules` array (module names)
306
+
307
+ ## Adversarial Critic Review
308
+
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.
310
+
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.
328
+
329
+ ---
306
330
 
307
331
  ## Fast Path
308
332
 
@@ -342,6 +366,32 @@ AI: [Validates immediately]
342
366
  AI: "Ready to proceed to dev-pipeline."
343
367
  ```
344
368
 
369
+ ## Browser Verification
370
+
371
+ **Browser verification is a feature-pipeline capability only.** Refactors use `behavior_preservation` strategy instead to ensure no external behavior changes:
372
+
373
+ - `strategy: test-gate` — Rely on existing test suite. Pipeline runs tests before and after refactoring.
374
+ - `strategy: snapshot` — Compare behavior before/after refactoring using executable snapshots (outputs, API responses, side effects)
375
+ - `strategy: manual` — Require human verification that behavior is preserved
376
+
377
+ For refactors that modify UI code (e.g., component restructuring), the test-gate or snapshot strategy ensures visual appearance is preserved. You can optionally note browser verification needs in your description or acceptance criteria:
378
+
379
+ Example:
380
+ ```
381
+ Refactor Title: Extract UserProfile component from AccountSettings
382
+ Type: extract
383
+ Strategy: snapshot
384
+ Acceptance Criteria:
385
+ 1. UserProfile component renders identically to inline version (compare snapshots)
386
+ 2. All props are correctly forwarded (unit tests pass)
387
+ 3. No visual regression (screenshot comparison)
388
+ 4. Component is reusable in other views
389
+ ```
390
+
391
+ The refactor pipeline AI will use the snapshot strategy to verify external behavior is preserved during refactoring.
392
+
393
+ ---
394
+
345
395
  ## Refactoring-Specific Features
346
396
 
347
397
  ### Behavior Preservation Check
@@ -378,7 +428,7 @@ Recommend these three options in this strict order:
378
428
  1. **Preferred**: invoke `refactor-pipeline-launcher` skill (natural-language handoff)
379
429
  2. **Fallback A**: run daemon wrapper
380
430
  ```bash
381
- ./dev-pipeline/launch-refactor-daemon.sh start refactor-list.json
431
+ ./dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json
382
432
  ./dev-pipeline/launch-refactor-daemon.sh status
383
433
  ```
384
434
  3. **Fallback B**: run direct foreground script
@@ -395,7 +445,7 @@ Key behaviors:
395
445
  - Warnings only -> proceed with user approval
396
446
  - Critical errors -> group by type, auto-fix where possible, max 3 total attempts
397
447
  - Interrupted session -> detect checkpoint from existing artifacts, offer resume or restart
398
- - `refactor-list.json` MUST be written to project root (same level as `package.json` / `.git`)
448
+ - `.prizmkit/plans/refactor-list.json` MUST be written to `.prizmkit/plans/` (project root level: `./{root}/.prizmkit/plans/refactor-list.json`)
399
449
 
400
450
  ### Resume Detection
401
451
 
@@ -403,8 +453,8 @@ Key behaviors:
403
453
  |---------------|------------|
404
454
  | Nothing | Phase 1: Project Context |
405
455
  | Draft in `.prizmkit/planning/` | Phase matching draft state |
406
- | Partial `refactor-list.json` | Phase 6: Completeness Review |
407
- | Valid `refactor-list.json` | Mode D: Summary |
456
+ | Partial `.prizmkit/plans/refactor-list.json` | Phase 6: Completeness Review |
457
+ | Valid `.prizmkit/plans/refactor-list.json` | Mode D: Summary |
408
458
 
409
459
  ## Session Exit Gate
410
460
 
@@ -414,11 +464,11 @@ Prevent accidental session exit without deliverable completion.
414
464
  Activate exit gate when ALL are true:
415
465
  - User invoked `/refactor-planner` (not just mentioned refactoring)
416
466
  - Current phase < Phase 7 (validation not yet passed)
417
- - No valid `refactor-list.json` has been written in this session
467
+ - No valid `.prizmkit/plans/refactor-list.json` has been written in this session
418
468
 
419
469
  ### Gate Behavior
420
470
  When the session appears to be ending:
421
- 1. **Remind**: "You set out to produce `refactor-list.json` but we haven't completed it yet."
471
+ 1. **Remind**: "You set out to produce `.prizmkit/plans/refactor-list.json` but we haven't completed it yet."
422
472
  2. **Offer 3 options**:
423
473
  - **(a) Continue to completion** — resume from current phase
424
474
  - **(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",