prizmkit 1.1.130 → 1.1.131
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/.env.example +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
- package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +15 -1
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +396 -4
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +54 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +54 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
- package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
- package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +20 -14
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +21 -4
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +18 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -15
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +16 -0
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +12 -8
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +310 -22
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +132 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +411 -18
- package/bundled/dev-pipeline/tests/test_unified_cli.py +3 -3
- package/bundled/skills/_metadata.json +62 -25
- package/bundled/skills/app-planner/SKILL.md +4 -3
- package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
- package/bundled/skills/bug-planner/SKILL.md +12 -27
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
- package/bundled/skills/feature-planner/SKILL.md +27 -22
- package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
- package/bundled/skills/feature-workflow/SKILL.md +94 -121
- package/bundled/skills/prizmkit/SKILL.md +130 -94
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +114 -84
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -1
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +131 -47
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-init/SKILL.md +5 -5
- package/bundled/skills/prizmkit-plan/SKILL.md +132 -105
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-test/SKILL.md +28 -6
- package/bundled/skills/prizmkit-test/references/examples.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/recovery-workflow/SKILL.md +62 -241
- package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
- package/bundled/skills/recovery-workflow/references/detection.md +28 -52
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
- package/bundled/skills/refactor-planner/SKILL.md +12 -57
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
- package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
- package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
- package/bundled/skills/refactor-workflow/SKILL.md +98 -139
- package/bundled/templates/project-memory-template.md +4 -4
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/prompts.js +10 -3
- package/src/scaffold.js +1 -1
- package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
- package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
# Configuration Reference — Refactor Pipeline
|
|
1
|
+
# Configuration Reference — Refactor Pipeline Command Builder
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this reference only to translate confirmed user choices into command fragments. The skill returns commands; it does not execute them.
|
|
4
4
|
|
|
5
|
-
## Configured AI CLI Prerequisite
|
|
5
|
+
## Configured AI CLI Prerequisite Command
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Runtime AI CLI selection is config-driven. Resolve the executable in this order:
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
1. `AI_CLI` environment variable.
|
|
10
|
+
2. `.prizmkit/config.json` `ai_cli`.
|
|
11
|
+
3. `claude` only when neither is configured.
|
|
12
|
+
|
|
13
|
+
Return this check command as part of start-command preparation:
|
|
13
14
|
|
|
14
|
-
Run this quick check from the project root:
|
|
15
15
|
```bash
|
|
16
|
-
command -v python3 >/dev/null && command -v git >/dev/null || { echo "python3 or git missing"; exit 1; }
|
|
17
16
|
AI_CLI="$(
|
|
18
17
|
python3 - <<'PY'
|
|
19
18
|
import json, os, shlex
|
|
20
19
|
from pathlib import Path
|
|
21
20
|
cli = os.environ.get("AI_CLI", "").strip()
|
|
22
21
|
if not cli:
|
|
23
|
-
|
|
24
|
-
if
|
|
22
|
+
path = Path(".prizmkit/config.json")
|
|
23
|
+
if path.is_file():
|
|
25
24
|
try:
|
|
26
|
-
|
|
27
|
-
cli = str(data.get("ai_cli") or "").strip()
|
|
25
|
+
cli = str(json.loads(path.read_text(encoding="utf-8")).get("ai_cli") or "").strip()
|
|
28
26
|
except (OSError, json.JSONDecodeError):
|
|
29
27
|
cli = ""
|
|
30
28
|
cli = cli or "claude"
|
|
@@ -35,79 +33,46 @@ except ValueError:
|
|
|
35
33
|
PY
|
|
36
34
|
)"
|
|
37
35
|
printf 'Configured AI CLI: %s\n' "$AI_CLI"
|
|
38
|
-
command -v "$AI_CLI" >/dev/null
|
|
39
|
-
echo "All dependencies OK"
|
|
36
|
+
command -v "$AI_CLI" >/dev/null
|
|
40
37
|
```
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
##
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
| PID file stale (process dead) | `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json` auto-cleans, retry start |
|
|
83
|
-
| Launch failed (process died immediately) | Show last 20 lines of log: `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 20` |
|
|
84
|
-
| Refactor stuck/blocked | Use `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run` for a fresh retry |
|
|
85
|
-
| All refactors blocked/failed | Show status, suggest recovery: `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` |
|
|
86
|
-
| `playwright-cli` not installed | Browser verification skipped for playwright refactors (non-blocking). Suggest: `npm install -g @playwright/cli@latest && playwright-cli install --skills` |
|
|
87
|
-
| `opencli` not installed | Browser verification skipped for opencli refactors (non-blocking). Install opencli for Chrome session-based browser verification |
|
|
88
|
-
| Deploy session failed | Pipeline completed but deploy session exited non-zero. Check `.prizmkit/state/refactor/deploy/<session_id>/logs/session.log`. Retry manually: `/prizmkit-deploy`. |
|
|
89
|
-
| Permission denied running Python CLI | Ensure Python is installed and the command uses `python3 ./.prizmkit/dev-pipeline/cli.py ...` |
|
|
90
|
-
|
|
91
|
-
## Advanced Configuration Round
|
|
92
|
-
|
|
93
|
-
Only run this when the user answered "Yes" to the **Advanced config?** question in step 6. It applies to a minority of sessions.
|
|
94
|
-
|
|
95
|
-
Ask a second round of `AskUserQuestion` with these 2 questions:
|
|
96
|
-
|
|
97
|
-
**Question 1 — Stop on failure** (multiSelect: false):
|
|
98
|
-
- Off (default) — Pipeline continues to next task after failure
|
|
99
|
-
- On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
|
|
100
|
-
|
|
101
|
-
**Question 2 — Deploy after completion?** (multiSelect: false):
|
|
102
|
-
- No (default) — Skip deployment after pipeline completes
|
|
103
|
-
- Yes — Run /prizmkit-deploy automatically after all refactors complete successfully (`ENABLE_DEPLOY=1`). Deployment is blocked if any refactor did not complete successfully (status not 'completed' or manually 'skipped').
|
|
104
|
-
|
|
105
|
-
Then ask about reasoning effort in a follow-up `AskUserQuestion` call:
|
|
106
|
-
|
|
107
|
-
**Question — Reasoning effort** (multiSelect: false):
|
|
108
|
-
- Default (none) — Use CLI default
|
|
109
|
-
- low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
|
|
110
|
-
- medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
|
|
111
|
-
- high — Thorough reasoning for complex tasks (`PRIZMKIT_EFFORT=high`)
|
|
112
|
-
- xhigh — Extensive reasoning (`PRIZMKIT_EFFORT=xhigh`)
|
|
113
|
-
- max — Maximum reasoning, Claude Code only (`PRIZMKIT_EFFORT=max`)
|
|
39
|
+
Do not claim the configured executable exists until the user supplies successful command output.
|
|
40
|
+
|
|
41
|
+
## Base Configuration Mapping
|
|
42
|
+
|
|
43
|
+
| Choice | Command fragment |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Verbose Off | `VERBOSE=0` |
|
|
46
|
+
| Verbose On | `VERBOSE=1` |
|
|
47
|
+
| Max retries N | `MAX_RETRIES=N` |
|
|
48
|
+
| Strict behavior On | `STRICT_BEHAVIOR_CHECK=1` |
|
|
49
|
+
| Strict behavior Off | `STRICT_BEHAVIOR_CHECK=0` |
|
|
50
|
+
|
|
51
|
+
## Advanced Configuration Questions
|
|
52
|
+
|
|
53
|
+
Ask only when the user selected Advanced config.
|
|
54
|
+
|
|
55
|
+
1. **Stop on failure**
|
|
56
|
+
- Off (default) — continue to other eligible tasks after a task exhausts retries.
|
|
57
|
+
- On — add `STOP_ON_FAILURE=1`.
|
|
58
|
+
2. **Reasoning effort**
|
|
59
|
+
- Default — omit `PRIZMKIT_EFFORT`.
|
|
60
|
+
- `low`, `medium`, `high`, `xhigh`, or `max` — add `PRIZMKIT_EFFORT=<value>` after confirming the configured AI CLI supports it.
|
|
61
|
+
|
|
62
|
+
These are the complete advanced choices for this command builder.
|
|
63
|
+
|
|
64
|
+
## Baseline Command Guidance
|
|
65
|
+
|
|
66
|
+
- Return `git status --short` as a suggested baseline cleanliness check.
|
|
67
|
+
- When the project already declares a test command, return that exact command as an optional baseline command.
|
|
68
|
+
- Do not infer a test command from framework names alone.
|
|
69
|
+
- Do not claim the baseline is green until the user supplies successful output.
|
|
70
|
+
|
|
71
|
+
## Command Construction Rules
|
|
72
|
+
|
|
73
|
+
- Foreground: place environment assignments before `python3`.
|
|
74
|
+
- Background daemon: place assignments inside one `--env "..."` value.
|
|
75
|
+
- Include only confirmed options.
|
|
76
|
+
- Preserve the user-provided list path.
|
|
77
|
+
- Shell-quote custom paths and values.
|
|
78
|
+
- Return one start command for the selected mode, never both.
|
|
@@ -5,7 +5,7 @@ description: "Interactive refactoring planner. Understands refactoring intent th
|
|
|
5
5
|
|
|
6
6
|
# refactor planner
|
|
7
7
|
|
|
8
|
-
Plan executable refactoring items for dev-pipeline:
|
|
8
|
+
Plan executable refactoring items for later autonomous dev-pipeline execution. This skill creates or updates planning artifacts only:
|
|
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
|
|
|
@@ -27,7 +27,7 @@ The user chose this skill intentionally. Respect that choice.
|
|
|
27
27
|
|
|
28
28
|
## Scope Boundary (Hard Rule)
|
|
29
29
|
|
|
30
|
-
**This skill is PLANNING ONLY.** You must NEVER:
|
|
30
|
+
**This skill is PLANNING ONLY.** It may analyze code for planning evidence and create, append, validate, and review refactor planning artifacts, but it must never perform the refactor or start execution. You must NEVER:
|
|
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
|
|
@@ -42,7 +42,8 @@ The user chose this skill intentionally. Respect that choice.
|
|
|
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` (do NOT execute it yourself)
|
|
44
44
|
4. If the user wants to adjust → continue refining `.prizmkit/plans/refactor-list.json`
|
|
45
|
-
5. **NEVER auto-execute** the pipeline, launcher, or any implementation step
|
|
45
|
+
5. **NEVER auto-execute** the pipeline, launcher, composite workflow, or any implementation step
|
|
46
|
+
6. Return the validated refactor list to the caller; only `refactor-pipeline-launcher` prepares the runtime command
|
|
46
47
|
|
|
47
48
|
## User-Provided Content Priority (Hard Rule)
|
|
48
49
|
|
|
@@ -145,7 +146,7 @@ Execute the planning workflow in conversation mode with mandatory checkpoints:
|
|
|
145
146
|
|
|
146
147
|
**Goal**: Understand the current codebase structure and tech stack.
|
|
147
148
|
|
|
148
|
-
1. Read `.prizmkit/prizm-docs/root.prizm` and relevant
|
|
149
|
+
1. Read `.prizmkit/prizm-docs/root.prizm` and the relevant module documents it points to
|
|
149
150
|
2. Read `.prizmkit/config.json` for tech stack info
|
|
150
151
|
3. Identify existing test suite and coverage
|
|
151
152
|
4. Summarize project context to the user: "Here's what I found about your project..."
|
|
@@ -202,10 +203,10 @@ Continue collecting goals until the user says they're done. There is no limit on
|
|
|
202
203
|
|
|
203
204
|
**Goal**: Analyze the target code to inform item decomposition.
|
|
204
205
|
|
|
205
|
-
|
|
206
|
-
- **
|
|
207
|
-
- **
|
|
208
|
-
- **
|
|
206
|
+
Run three parallel read-only analysis perspectives over the target files:
|
|
207
|
+
- **Structure perspective**: File inventory, dependency graph, module boundaries, public API surface
|
|
208
|
+
- **Quality perspective**: Code smells, complexity hotspots, duplication, coupling metrics
|
|
209
|
+
- **Test perspective**: Test coverage of target areas, existing test patterns, behavior contracts
|
|
209
210
|
|
|
210
211
|
Present consolidated findings:
|
|
211
212
|
```
|
|
@@ -287,22 +288,9 @@ See `${SKILL_DIR}/references/planning-phases.md` for the full 5-step review chec
|
|
|
287
288
|
|
|
288
289
|
## Local Generated-Plan Review Gate
|
|
289
290
|
|
|
290
|
-
|
|
291
|
+
Run this gate after `.prizmkit/plans/refactor-list.json` passes generation and validation, and before the final handoff. It applies whenever this session added or changed final refactor entries. For validate-only, summary-only, or draft-save flows with no final content change, report that the gate is not applicable.
|
|
291
292
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
1. **Load the local reference**: read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the source of truth for this planner-output review loop.
|
|
295
|
-
2. **Read actual planning artifacts directly**: inspect `.prizmkit/plans/refactor-list.json`, `.prizmkit/plans/refactor-list.draft.json` when present, and any pre-session or in-memory draft snapshot. Do not rely on `git status`, `git diff`, or `git diff --cached`, because `.prizmkit` planning artifacts are often gitignored or untracked.
|
|
296
|
-
3. **Identify review scope**: compare by stable refactor IDs and item fields against the pre-session list when one existed. Ignore root generator metadata such as `$schema`, `created_at`, and `created_by`. Review only newly added or changed refactor entries; preserve unchanged historical entries except when needed to verify dependency references or behavior-preservation interactions.
|
|
297
|
-
4. **Run the local checklist** from the reference: schema compatibility, dependency/DAG soundness, safe behavior-preserving order, description completeness, headless execution readiness, acceptance criteria measurability, `behavior_preservation` strategy quality, user-provided wording preservation, task-scoped `user_context` isolation, and priority/complexity calibration.
|
|
298
|
-
5. **Keep the review planning-only**: do NOT start `refactor-pipeline-launcher`, do NOT run the refactor pipeline, do NOT run tests/builds/installs, and do NOT implement source-code refactors.
|
|
299
|
-
6. **Apply accepted review fixes through the draft/source plan**: when a finding is accepted, update `.prizmkit/plans/refactor-list.draft.json` or the in-memory draft representation first, then regenerate the final file with:
|
|
300
|
-
```bash
|
|
301
|
-
python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input .prizmkit/plans/refactor-list.draft.json --output .prizmkit/plans/refactor-list.json
|
|
302
|
-
```
|
|
303
|
-
Do not hand-patch the final JSON as the source of truth; map final-output findings back to draft entries before regeneration.
|
|
304
|
-
7. **Revalidate after every accepted fix batch**: the generate script must pass again before the planner can proceed. If validation fails, fix the draft and rerun until pass.
|
|
305
|
-
8. **Report the gate outcome** in the final summary: include local generated-plan review verdict, reviewed refactor IDs, accepted fixes (or "none"), and final validation result.
|
|
293
|
+
Read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the single source of truth. Review the actual draft and final artifacts directly because `.prizmkit` files may be gitignored. Keep the review planning-only, apply accepted findings to the draft/source representation, regenerate the final JSON, and require validation to pass again before reporting the review result.
|
|
306
294
|
|
|
307
295
|
## Output Rules
|
|
308
296
|
|
|
@@ -403,40 +391,7 @@ Recommend invoking `refactor-pipeline-launcher` to configure and launch the dev-
|
|
|
403
391
|
|
|
404
392
|
## Error Recovery & Resume
|
|
405
393
|
|
|
406
|
-
|
|
407
|
-
- Warnings only -> proceed with user approval
|
|
408
|
-
- Critical errors -> group by type, auto-fix where possible, max 3 total attempts
|
|
409
|
-
- Interrupted session -> detect checkpoint from existing artifacts, offer resume or restart
|
|
410
|
-
- `.prizmkit/plans/refactor-list.json` MUST be written to `.prizmkit/plans/` (project root level: `./{root}/.prizmkit/plans/refactor-list.json`)
|
|
411
|
-
|
|
412
|
-
### Resume Detection
|
|
413
|
-
|
|
414
|
-
If existing artifacts are found, offer to resume from the appropriate checkpoint/phase:
|
|
415
|
-
|
|
416
|
-
| Artifact Found | Resume From |
|
|
417
|
-
|---------------|------------|
|
|
418
|
-
| Nothing | Phase 1: Project Context |
|
|
419
|
-
| Draft in `.prizmkit/plans/` | Phase matching draft state |
|
|
420
|
-
| Partial `.prizmkit/plans/refactor-list.json` | Phase 6: Completeness Review |
|
|
421
|
-
| Valid `.prizmkit/plans/refactor-list.json` | Mode D: Summary |
|
|
422
|
-
|
|
423
|
-
### Session Exit Gate
|
|
424
|
-
|
|
425
|
-
Prevent accidental session exit without deliverable completion.
|
|
426
|
-
|
|
427
|
-
**Trigger conditions** — activate the exit gate when ALL are true:
|
|
428
|
-
- User invoked `/refactor-planner` (not just mentioned refactoring)
|
|
429
|
-
- Current phase < Phase 7 (validation not yet passed)
|
|
430
|
-
- No valid `.prizmkit/plans/refactor-list.json` has been written in this session
|
|
431
|
-
|
|
432
|
-
**Gate behavior** — when the session appears to be ending:
|
|
433
|
-
1. **Remind**: "You set out to produce `.prizmkit/plans/refactor-list.json` but we haven't completed it yet."
|
|
434
|
-
2. **Offer 3 options**:
|
|
435
|
-
- **(a) Continue to completion** — resume from current phase
|
|
436
|
-
- **(b) Save draft & exit** — write current progress as draft, exit session
|
|
437
|
-
- **(c) Abandon** — exit without saving
|
|
438
|
-
3. **If (b)**: Write draft and remind: "This is a draft, not validated. Run `/refactor-planner` again to resume."
|
|
439
|
-
4. **If (c)**: Accept without further prompting.
|
|
394
|
+
When validation fails, existing planning artifacts are detected, the session is interrupted, or the user exits before producing a valid final plan, read `${SKILL_DIR}/references/error-recovery.md`. Keep recovery planning-only and resume from the artifact's actual completeness rather than restarting or guessing.
|
|
440
395
|
|
|
441
396
|
## Handoff Message Template
|
|
442
397
|
|