prizmkit 1.1.7 → 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.
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/README.md +64 -64
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +11 -10
- package/bundled/dev-pipeline/launch-feature-daemon.sh +12 -11
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +11 -10
- package/bundled/dev-pipeline/reset-bug.sh +10 -9
- package/bundled/dev-pipeline/reset-feature.sh +9 -8
- package/bundled/dev-pipeline/reset-refactor.sh +10 -9
- package/bundled/dev-pipeline/retry-bugfix.sh +7 -6
- package/bundled/dev-pipeline/retry-feature.sh +7 -6
- package/bundled/dev-pipeline/retry-refactor.sh +7 -6
- package/bundled/dev-pipeline/run-bugfix.sh +16 -15
- package/bundled/dev-pipeline/run-feature.sh +18 -17
- package/bundled/dev-pipeline/run-refactor.sh +16 -15
- package/bundled/dev-pipeline/scripts/cleanup-logs.py +2 -2
- package/bundled/dev-pipeline/scripts/detect-stuck.py +3 -3
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +26 -14
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +6 -6
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +6 -6
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +4 -4
- package/bundled/dev-pipeline/scripts/init-pipeline.py +7 -7
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +4 -4
- package/bundled/dev-pipeline/scripts/update-bug-status.py +8 -8
- package/bundled/dev-pipeline/scripts/update-feature-status.py +25 -25
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +8 -8
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +1 -1
- package/bundled/dev-pipeline/templates/feature-list-schema.json +88 -22
- package/bundled/dev-pipeline/templates/refactor-list-schema.json +1 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +11 -11
- package/bundled/skills/app-planner/references/project-brief-guide.md +1 -1
- package/bundled/skills/bug-fix-workflow/SKILL.md +5 -5
- package/bundled/skills/bug-planner/SKILL.md +21 -21
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +3 -3
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +29 -29
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +33 -33
- package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +3 -3
- package/bundled/skills/feature-planner/SKILL.md +27 -27
- package/bundled/skills/feature-planner/references/error-recovery.md +8 -8
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +18 -18
- package/bundled/skills/feature-workflow/SKILL.md +21 -21
- package/bundled/skills/prizmkit-verify/SKILL.md +1 -1
- package/bundled/skills/recovery-workflow/SKILL.md +14 -14
- package/bundled/skills/recovery-workflow/evals/evals.json +5 -5
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +43 -10
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +31 -31
- package/bundled/skills/refactor-planner/SKILL.md +23 -23
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +17 -17
- package/bundled/skills/refactor-workflow/SKILL.md +22 -22
- package/package.json +1 -1
- package/src/clean.js +4 -4
- package/src/gitignore-template.js +7 -8
- package/src/scaffold.js +4 -2
|
@@ -85,7 +85,14 @@ def detect_workflow_type(project_root):
|
|
|
85
85
|
return ("refactor-workflow", {"branch": branch})
|
|
86
86
|
|
|
87
87
|
# Priority 4: refactor-list.json exists → refactor-workflow
|
|
88
|
-
|
|
88
|
+
# Check both new and old paths for backward compatibility
|
|
89
|
+
new_refactor = os.path.join(project_root, ".prizmkit", "plans", "refactor-list.json")
|
|
90
|
+
old_refactor = os.path.join(project_root, "refactor-list.json")
|
|
91
|
+
if os.path.isfile(new_refactor):
|
|
92
|
+
return ("refactor-workflow", {"branch": branch})
|
|
93
|
+
elif os.path.isfile(old_refactor):
|
|
94
|
+
print(f"⚠️ Migration notice: refactor-list.json found in root. "
|
|
95
|
+
f"Please move to .prizmkit/plans/refactor-list.json", file=sys.stderr)
|
|
89
96
|
return ("refactor-workflow", {"branch": branch})
|
|
90
97
|
|
|
91
98
|
# Priority 5: feat/* branch → feature-workflow
|
|
@@ -93,7 +100,14 @@ def detect_workflow_type(project_root):
|
|
|
93
100
|
return ("feature-workflow", {"branch": branch})
|
|
94
101
|
|
|
95
102
|
# Priority 6: feature-list.json exists → feature-workflow
|
|
96
|
-
|
|
103
|
+
# Check both new and old paths for backward compatibility
|
|
104
|
+
new_feature = os.path.join(project_root, ".prizmkit", "plans", "feature-list.json")
|
|
105
|
+
old_feature = os.path.join(project_root, "feature-list.json")
|
|
106
|
+
if os.path.isfile(new_feature):
|
|
107
|
+
return ("feature-workflow", {"branch": branch})
|
|
108
|
+
elif os.path.isfile(old_feature):
|
|
109
|
+
print(f"⚠️ Migration notice: feature-list.json found in root. "
|
|
110
|
+
f"Please move to .prizmkit/plans/feature-list.json", file=sys.stderr)
|
|
97
111
|
return ("feature-workflow", {"branch": branch})
|
|
98
112
|
|
|
99
113
|
# No match
|
|
@@ -164,10 +178,27 @@ def _infer_pipeline_workflow_phase(project_root, list_filename, state_subdir, wo
|
|
|
164
178
|
No list file → Phase 1: Brainstorm
|
|
165
179
|
List file, no pipeline state → Phase 3: Launch
|
|
166
180
|
List file + pipeline state → Phase 4: Monitor
|
|
181
|
+
|
|
182
|
+
Checks new path (.prizmkit/plans/<list_filename>) first, then falls back
|
|
183
|
+
to old root-level path with a migration warning.
|
|
167
184
|
"""
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
185
|
+
# Check new path first, then old path with fallback warning
|
|
186
|
+
new_list_path = os.path.join(project_root, ".prizmkit", "plans", list_filename)
|
|
187
|
+
old_list_path = os.path.join(project_root, list_filename)
|
|
188
|
+
has_list = os.path.isfile(new_list_path)
|
|
189
|
+
if not has_list and os.path.isfile(old_list_path):
|
|
190
|
+
has_list = True
|
|
191
|
+
print(f"⚠️ Migration notice: {list_filename} found in root. "
|
|
192
|
+
f"Please move to .prizmkit/plans/{list_filename}", file=sys.stderr)
|
|
193
|
+
|
|
194
|
+
# Check new state path first, then old path with fallback warning
|
|
195
|
+
new_state_dir = os.path.join(project_root, ".prizmkit", "state", state_subdir)
|
|
196
|
+
old_state_dir = os.path.join(project_root, "dev-pipeline", "state", state_subdir)
|
|
197
|
+
has_pipeline_state = os.path.isdir(new_state_dir) and bool(os.listdir(new_state_dir))
|
|
198
|
+
if not has_pipeline_state and os.path.isdir(old_state_dir) and bool(os.listdir(old_state_dir)):
|
|
199
|
+
has_pipeline_state = True
|
|
200
|
+
print(f"⚠️ Migration notice: pipeline state found at dev-pipeline/state/{state_subdir}. "
|
|
201
|
+
f"Please move to .prizmkit/state/{state_subdir}", file=sys.stderr)
|
|
171
202
|
|
|
172
203
|
artifacts = {
|
|
173
204
|
f"{workflow_label}_list_exists": has_list,
|
|
@@ -176,16 +207,16 @@ def _infer_pipeline_workflow_phase(project_root, list_filename, state_subdir, wo
|
|
|
176
207
|
|
|
177
208
|
if has_list and has_pipeline_state:
|
|
178
209
|
return 4, "Monitor", artifacts, \
|
|
179
|
-
f"{list_filename} + pipeline state exist", \
|
|
210
|
+
f".prizmkit/plans/{list_filename} + pipeline state exist", \
|
|
180
211
|
"check pipeline status and report results"
|
|
181
212
|
|
|
182
213
|
if has_list:
|
|
183
214
|
return 3, "Launch", artifacts, \
|
|
184
|
-
f"{list_filename} exists, no pipeline state", \
|
|
215
|
+
f".prizmkit/plans/{list_filename} exists, no pipeline state", \
|
|
185
216
|
"launch pipeline → monitor progress"
|
|
186
217
|
|
|
187
218
|
return 1, "Brainstorm", artifacts, \
|
|
188
|
-
f"no {list_filename} found", \
|
|
219
|
+
f"no .prizmkit/plans/{list_filename} found", \
|
|
189
220
|
f"{workflow_label} goal clarification → plan → launch → monitor"
|
|
190
221
|
|
|
191
222
|
|
|
@@ -199,7 +230,7 @@ def infer_feature_phase(project_root):
|
|
|
199
230
|
def infer_refactor_phase(project_root):
|
|
200
231
|
"""Infer refactor-workflow phase from artifacts and pipeline state."""
|
|
201
232
|
return _infer_pipeline_workflow_phase(
|
|
202
|
-
project_root, "refactor-list.json", "
|
|
233
|
+
project_root, "refactor-list.json", "refactor", "refactor"
|
|
203
234
|
)
|
|
204
235
|
|
|
205
236
|
|
|
@@ -256,6 +287,9 @@ def detect_code_changes(project_root, main_branch="main"):
|
|
|
256
287
|
files that represent actual implementation work.
|
|
257
288
|
"""
|
|
258
289
|
IGNORED_FILES = {
|
|
290
|
+
".prizmkit/plans/feature-list.json",
|
|
291
|
+
".prizmkit/plans/bug-fix-list.json",
|
|
292
|
+
".prizmkit/plans/refactor-list.json",
|
|
259
293
|
"feature-list.json",
|
|
260
294
|
"bug-fix-list.json",
|
|
261
295
|
"refactor-list.json",
|
|
@@ -265,7 +299,6 @@ def detect_code_changes(project_root, main_branch="main"):
|
|
|
265
299
|
}
|
|
266
300
|
IGNORED_PREFIXES = (
|
|
267
301
|
".prizmkit/",
|
|
268
|
-
"dev-pipeline/state/",
|
|
269
302
|
".prizm-docs/",
|
|
270
303
|
".claude/",
|
|
271
304
|
".codebuddy/",
|
|
@@ -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**:
|
|
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
|
|
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
|
|
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
|
|
|
@@ -177,34 +177,34 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
177
177
|
|
|
178
178
|
**Foreground command:**
|
|
179
179
|
```bash
|
|
180
|
-
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
|
|
181
181
|
```
|
|
182
182
|
With all options:
|
|
183
183
|
```bash
|
|
184
184
|
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 SESSION_TIMEOUT=3600 \
|
|
185
|
-
dev-pipeline/run-refactor.sh run refactor-list.json
|
|
185
|
+
dev-pipeline/run-refactor.sh run .prizmkit/plans/refactor-list.json
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
**Background daemon command:**
|
|
189
189
|
```bash
|
|
190
|
-
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"
|
|
191
191
|
```
|
|
192
192
|
With all options:
|
|
193
193
|
```bash
|
|
194
|
-
dev-pipeline/launch-refactor-daemon.sh start refactor-list.json \
|
|
194
|
+
dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json \
|
|
195
195
|
--env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5"
|
|
196
196
|
```
|
|
197
197
|
|
|
198
198
|
**Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 8.
|
|
199
199
|
```
|
|
200
200
|
# To run in foreground:
|
|
201
|
-
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
|
|
202
202
|
|
|
203
203
|
# To run in background (detached):
|
|
204
|
-
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"
|
|
205
205
|
|
|
206
206
|
# To check status:
|
|
207
|
-
dev-pipeline/run-refactor.sh status refactor-list.json
|
|
207
|
+
dev-pipeline/run-refactor.sh status .prizmkit/plans/refactor-list.json
|
|
208
208
|
```
|
|
209
209
|
|
|
210
210
|
8. **Confirm and launch** (Foreground and Background only — Manual mode ends at step 7):
|
|
@@ -227,7 +227,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
227
227
|
```
|
|
228
228
|
2. Start log monitoring — Use the Bash tool with `run_in_background: true`:
|
|
229
229
|
```bash
|
|
230
|
-
tail -f
|
|
230
|
+
tail -f .prizmkit/state/refactor/pipeline-daemon.log
|
|
231
231
|
```
|
|
232
232
|
3. Report to user:
|
|
233
233
|
- Pipeline PID
|
|
@@ -247,14 +247,14 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
247
247
|
2. **Show refactor-level progress**:
|
|
248
248
|
```bash
|
|
249
249
|
python3 dev-pipeline/scripts/update-refactor-status.py \
|
|
250
|
-
--refactor-list refactor-list.json \
|
|
251
|
-
--state-dir
|
|
250
|
+
--refactor-list .prizmkit/plans/refactor-list.json \
|
|
251
|
+
--state-dir .prizmkit/state/refactor \
|
|
252
252
|
--action status
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
3. **Show recent log activity** (last 20 lines):
|
|
256
256
|
```bash
|
|
257
|
-
tail -20
|
|
257
|
+
tail -20 .prizmkit/state/refactor/pipeline-daemon.log
|
|
258
258
|
```
|
|
259
259
|
|
|
260
260
|
4. **Summarize** to user: total refactors, completed, in-progress, failed, pending.
|
|
@@ -286,20 +286,20 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
286
286
|
|
|
287
287
|
2. **If running** -- Start live tail with Bash tool `run_in_background: true`:
|
|
288
288
|
```bash
|
|
289
|
-
tail -f
|
|
289
|
+
tail -f .prizmkit/state/refactor/pipeline-daemon.log
|
|
290
290
|
```
|
|
291
291
|
|
|
292
292
|
3. **If not running** -- Show last 50 lines:
|
|
293
293
|
```bash
|
|
294
|
-
tail -50
|
|
294
|
+
tail -50 .prizmkit/state/refactor/pipeline-daemon.log
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
4. **For per-refactor session logs** (when user asks about a specific refactor):
|
|
298
298
|
```bash
|
|
299
299
|
# Check refactor status for last session ID
|
|
300
|
-
cat
|
|
300
|
+
cat .prizmkit/state/refactor/refactors/<REFACTOR_ID>/status.json 2>/dev/null
|
|
301
301
|
# Then tail that refactor's session log
|
|
302
|
-
tail -100
|
|
302
|
+
tail -100 .prizmkit/state/refactor/refactors/<REFACTOR_ID>/sessions/<SESSION_ID>/logs/session.log
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
---
|
|
@@ -309,18 +309,18 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
309
309
|
When user says "retry R-001":
|
|
310
310
|
|
|
311
311
|
```bash
|
|
312
|
-
dev-pipeline/retry-refactor.sh R-001 refactor-list.json
|
|
312
|
+
dev-pipeline/retry-refactor.sh R-001 .prizmkit/plans/refactor-list.json
|
|
313
313
|
```
|
|
314
314
|
|
|
315
315
|
When user says "clean retry R-001" or "retry R-001 from scratch":
|
|
316
316
|
|
|
317
317
|
```bash
|
|
318
|
-
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
|
|
319
319
|
```
|
|
320
320
|
|
|
321
321
|
Environment variables (optional):
|
|
322
322
|
```bash
|
|
323
|
-
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
|
|
324
324
|
```
|
|
325
325
|
|
|
326
326
|
Notes:
|
|
@@ -334,23 +334,23 @@ Notes:
|
|
|
334
334
|
|
|
335
335
|
| Error | Action |
|
|
336
336
|
|-------|--------|
|
|
337
|
-
|
|
|
338
|
-
| Circular dependencies in refactor list | Fix dependency graph in
|
|
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 |
|
|
339
339
|
| Test baseline failing | Fix failing tests before starting refactoring -- behavior preservation requires a green baseline |
|
|
340
340
|
| `jq` not installed | Suggest: `brew install jq` |
|
|
341
341
|
| `cbc`/`claude` not in PATH | Check AI CLI installation |
|
|
342
342
|
| Refactor pipeline already running | Show status, ask if user wants to stop and restart |
|
|
343
343
|
| 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
|
|
344
|
+
| Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 .prizmkit/state/refactor/pipeline-daemon.log` |
|
|
345
345
|
| 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` |
|
|
346
|
+
| All refactors blocked/failed | Show status, suggest recovery: `dev-pipeline/reset-refactor.sh <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` |
|
|
347
347
|
| Permission denied on script | Run `chmod +x dev-pipeline/launch-refactor-daemon.sh dev-pipeline/run-refactor.sh` |
|
|
348
348
|
|
|
349
349
|
### Integration Notes
|
|
350
350
|
|
|
351
|
-
- **After refactor-planner**: This is the natural next step. When user finishes refactor planning and has
|
|
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.
|
|
352
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.
|
|
353
353
|
- **Single instance**: Only one refactor pipeline can run at a time. The PID file prevents duplicates.
|
|
354
|
-
- **Pipeline coexistence**: Refactor pipeline uses
|
|
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.
|
|
355
355
|
- **State preservation**: Stopping and restarting the pipeline resumes from where it left off -- completed refactors are not re-run.
|
|
356
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
|
|
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
|
|
34
|
+
- Execute any implementation action beyond writing `.prizmkit/plans/refactor-list.json`
|
|
35
35
|
|
|
36
36
|
**Your ONLY writable outputs are:**
|
|
37
|
-
1.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
265
|
+
**Goal**: Produce `.prizmkit/plans/refactor-list.json` and validate it.
|
|
266
266
|
|
|
267
|
-
1. Generate
|
|
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**:
|
|
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 |
|
|
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
|
|
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
|
-
|
|
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`, ...
|
|
@@ -428,7 +428,7 @@ Recommend these three options in this strict order:
|
|
|
428
428
|
1. **Preferred**: invoke `refactor-pipeline-launcher` skill (natural-language handoff)
|
|
429
429
|
2. **Fallback A**: run daemon wrapper
|
|
430
430
|
```bash
|
|
431
|
-
./dev-pipeline/launch-refactor-daemon.sh start refactor-list.json
|
|
431
|
+
./dev-pipeline/launch-refactor-daemon.sh start .prizmkit/plans/refactor-list.json
|
|
432
432
|
./dev-pipeline/launch-refactor-daemon.sh status
|
|
433
433
|
```
|
|
434
434
|
3. **Fallback B**: run direct foreground script
|
|
@@ -445,7 +445,7 @@ Key behaviors:
|
|
|
445
445
|
- Warnings only -> proceed with user approval
|
|
446
446
|
- Critical errors -> group by type, auto-fix where possible, max 3 total attempts
|
|
447
447
|
- Interrupted session -> detect checkpoint from existing artifacts, offer resume or restart
|
|
448
|
-
-
|
|
448
|
+
- `.prizmkit/plans/refactor-list.json` MUST be written to `.prizmkit/plans/` (project root level: `./{root}/.prizmkit/plans/refactor-list.json`)
|
|
449
449
|
|
|
450
450
|
### Resume Detection
|
|
451
451
|
|
|
@@ -453,8 +453,8 @@ Key behaviors:
|
|
|
453
453
|
|---------------|------------|
|
|
454
454
|
| Nothing | Phase 1: Project Context |
|
|
455
455
|
| Draft in `.prizmkit/planning/` | Phase matching draft state |
|
|
456
|
-
| Partial
|
|
457
|
-
| Valid
|
|
456
|
+
| Partial `.prizmkit/plans/refactor-list.json` | Phase 6: Completeness Review |
|
|
457
|
+
| Valid `.prizmkit/plans/refactor-list.json` | Mode D: Summary |
|
|
458
458
|
|
|
459
459
|
## Session Exit Gate
|
|
460
460
|
|
|
@@ -464,11 +464,11 @@ Prevent accidental session exit without deliverable completion.
|
|
|
464
464
|
Activate exit gate when ALL are true:
|
|
465
465
|
- User invoked `/refactor-planner` (not just mentioned refactoring)
|
|
466
466
|
- Current phase < Phase 7 (validation not yet passed)
|
|
467
|
-
- No valid
|
|
467
|
+
- No valid `.prizmkit/plans/refactor-list.json` has been written in this session
|
|
468
468
|
|
|
469
469
|
### Gate Behavior
|
|
470
470
|
When the session appears to be ending:
|
|
471
|
-
1. **Remind**: "You set out to produce
|
|
471
|
+
1. **Remind**: "You set out to produce `.prizmkit/plans/refactor-list.json` but we haven't completed it yet."
|
|
472
472
|
2. **Offer 3 options**:
|
|
473
473
|
- **(a) Continue to completion** — resume from current phase
|
|
474
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",
|