prizmkit 1.1.111 → 1.1.112
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/agents/prizm-dev-team-reviewer.md +12 -1
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +19 -73
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +283 -421
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
- package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
- package/bundled/dev-pipeline/scripts/utils.py +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +10 -18
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +14 -25
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +17 -5
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +197 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
- package/bundled/dev-pipeline/tests/test_utils.py +66 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
- package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
- package/bundled/skills/bug-planner/SKILL.md +6 -5
- package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
- package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +30 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +16 -16
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +19 -11
- package/bundled/skills/feature-planner/SKILL.md +9 -11
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
- package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
- package/bundled/skills/feature-workflow/SKILL.md +169 -298
- package/bundled/skills/prizmkit/SKILL.md +103 -57
- package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +12 -1
- package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
- package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
- package/bundled/skills/prizmkit-init/SKILL.md +4 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
- package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
- package/bundled/skills/prizmkit-test/SKILL.md +138 -141
- package/bundled/skills/prizmkit-test/references/examples.md +10 -8
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
- package/bundled/skills/recovery-workflow/SKILL.md +195 -256
- package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
- package/bundled/skills/recovery-workflow/references/detection.md +48 -39
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -11
- package/bundled/skills/refactor-planner/SKILL.md +2 -2
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
- package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
- package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +173 -307
- package/package.json +1 -1
- package/src/scaffold.js +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
- package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +0 -116
|
@@ -1,345 +1,284 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "recovery-workflow"
|
|
3
|
-
description: "Recover and resume interrupted
|
|
3
|
+
description: "Recover and resume interrupted PrizmKit workflow or pipeline sessions. Auto-detects feature-workflow, bug-fix-workflow, refactor-workflow, plan lists, pipeline state, git branches, diffs, spec/plan artifacts, review artifacts, and session summaries; then offers recovery script, manual command, interactive resume, clean retry, or start-fresh options. Use when an AI CLI session timed out, crashed, hit token limits, left partial work, or the user says recover, resume, continue where I left off, pick up where it left off, or salvage partial work."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Recovery Workflow
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Recover interrupted workflow or pipeline work. This skill is intentionally different from the ordinary feature/bug/refactor workflows: the success criterion is high-quality continuation of interrupted work, not structural consistency with other workflows.
|
|
9
9
|
|
|
10
10
|
## When to Use
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
12
|
+
Use this skill when the user says:
|
|
13
|
+
- Recover, resume, continue where I left off, or pick up where it left off.
|
|
14
|
+
- Session interrupted, timed out, crashed, or hit token limits.
|
|
15
|
+
- A pipeline/AI session left partial work and the user wants to salvage or complete it.
|
|
16
|
+
- The user does not know whether the interrupted work was feature, bug fix, or refactor work.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
18
|
+
Do not use this skill when:
|
|
19
|
+
- The user only wants normal pipeline status/logs/stop/retry for a healthy pipeline -> use the matching launcher.
|
|
20
|
+
- The user explicitly wants a clean retry of one pipeline item -> use the matching launcher reset guidance.
|
|
21
|
+
- The user wants to discard all interrupted work and start fresh -> route to the original workflow after confirmation.
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Recovery Approach Policy
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Always present the user with recovery choices after detection. Do not silently choose between script recovery and interactive recovery.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Recommended default:
|
|
28
|
+
- Use `python3 ./.prizmkit/dev-pipeline/cli.py recovery run` when the interrupted work appears to be a pipeline or AI-session continuation problem and the user wants autonomous completion.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
python3 ./.prizmkit/dev-pipeline/cli.py recovery run --model <model> # Override AI model
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### When to use pipeline vs interactive recovery
|
|
38
|
-
|
|
39
|
-
| Scenario | Approach |
|
|
40
|
-
|----------|----------|
|
|
41
|
-
| Pipeline session timed out / crashed | `python3 ./.prizmkit/dev-pipeline/cli.py recovery run` — autonomous, completes all phases reliably |
|
|
42
|
-
| Interactive session interrupted | This skill (`/recovery-workflow`) — for in-session interactive use |
|
|
43
|
-
| Want to inspect before recovering | `python3 ./.prizmkit/dev-pipeline/cli.py recovery detect` or `python3 ./.prizmkit/dev-pipeline/cli.py recovery run --dry-run` |
|
|
44
|
-
| Daemon/scripted use | `python3 ./.prizmkit/dev-pipeline/cli.py recovery run --yes` — no user confirmation needed |
|
|
45
|
-
|
|
46
|
-
## Supported Workflows
|
|
47
|
-
|
|
48
|
-
| Workflow | Branch Pattern | Key Artifacts |
|
|
49
|
-
|----------|---------------|---------------|
|
|
50
|
-
| bug-fix-workflow | `fix/<BUG_ID>-*` | `.prizmkit/bugfix/<BUG_ID>/fix-plan.md`, `fix-report.md` |
|
|
51
|
-
| feature-workflow | `feat/*` | `.prizmkit/plans/feature-list.json`, `.prizmkit/state/features/` |
|
|
52
|
-
| refactor-workflow | `refactor/*` | `.prizmkit/plans/refactor-list.json`, `.prizmkit/state/refactor/` |
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Overview
|
|
57
|
-
|
|
58
|
-
1. **Phase 0: Auto-detect**
|
|
59
|
-
1. Read current branch name
|
|
60
|
-
2. Scan characteristic artifacts
|
|
61
|
-
3. Match workflow signature → determine workflow type
|
|
62
|
-
4. Based on artifact presence → infer current phase
|
|
63
|
-
5. No match → reject and guide user
|
|
64
|
-
2. **Phase 1: Diagnose + report + user choice**
|
|
65
|
-
1. Check branch and working tree state
|
|
66
|
-
2. Scan all pipelines for failed/in-progress tasks
|
|
67
|
-
3. Find residual dev branches from failed tasks
|
|
68
|
-
4. Display diagnosis + detection results
|
|
69
|
-
5. If code changes exist → run test suite
|
|
70
|
-
6. If multiple failed tasks → ask user which to recover
|
|
71
|
-
7. User chooses: python3 ./.prizmkit/dev-pipeline/cli.py recovery run (recommended) | interactive | start fresh
|
|
72
|
-
3. **Phase 2: Execute remaining steps**
|
|
73
|
-
1. Read target workflow's SKILL.md
|
|
74
|
-
2. Read existing artifacts to restore context
|
|
75
|
-
3. Execute from inferred phase through completion
|
|
76
|
-
|
|
77
|
-
---
|
|
30
|
+
Interactive recovery remains valid when:
|
|
31
|
+
- The user wants control in the current conversation.
|
|
32
|
+
- The recovery script is unavailable or fails.
|
|
33
|
+
- The interrupted work is a small current-workspace Fast Path task.
|
|
34
|
+
- The user wants to inspect before launching another AI session.
|
|
78
35
|
|
|
79
|
-
|
|
36
|
+
Clean retry is different from recovery:
|
|
37
|
+
- Use clean retry when the user wants to discard the failed item attempt and rerun from scratch.
|
|
38
|
+
- Use recovery when partial work, context, or decisions should be preserved.
|
|
80
39
|
|
|
81
|
-
|
|
40
|
+
## Detection Signals
|
|
82
41
|
|
|
83
|
-
|
|
42
|
+
Inspect multiple signals. Do not depend on a single artifact.
|
|
84
43
|
|
|
85
|
-
|
|
44
|
+
| Signal | Meaning |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Current branch | `fix/*`, `feat/*`, `refactor/*`, or task-specific branch names can indicate workflow family |
|
|
47
|
+
| Git diff / staged / untracked files | Shows partial implementation or planning work |
|
|
48
|
+
| `spec.md` / `plan.md` | Current-session Fast Path planning artifacts |
|
|
49
|
+
| `.prizmkit/plans/feature-list.json` | Feature pipeline planning artifact |
|
|
50
|
+
| `.prizmkit/plans/bug-fix-list.json` | Bugfix pipeline planning artifact |
|
|
51
|
+
| `.prizmkit/plans/refactor-list.json` | Refactor pipeline planning artifact |
|
|
52
|
+
| `.prizmkit/state/features/` | Feature pipeline state |
|
|
53
|
+
| `.prizmkit/state/bugfix/` | Bugfix pipeline state |
|
|
54
|
+
| `.prizmkit/state/refactor/` | Refactor pipeline state |
|
|
55
|
+
| `session-summary.md` / `context-snapshot.md` | Previous-session context handoff |
|
|
56
|
+
| Review artifacts | Evidence that implementation reached review |
|
|
57
|
+
| `.prizmkit/bugfix/<BUG_ID>/fix-plan.md` / `fix-report.md` | Optional bug recovery signals when present, not required contract |
|
|
86
58
|
|
|
87
|
-
|
|
59
|
+
Run the detection script for the first pass:
|
|
88
60
|
|
|
89
|
-
|
|
61
|
+
```bash
|
|
62
|
+
python3 ${SKILL_DIR}/scripts/detect-recovery-state.py
|
|
63
|
+
```
|
|
90
64
|
|
|
91
|
-
|
|
65
|
+
For the signature matching and phase inference tables, read `${SKILL_DIR}/references/detection.md`.
|
|
92
66
|
|
|
93
|
-
|
|
67
|
+
## Recovery Flow
|
|
94
68
|
|
|
95
|
-
###
|
|
69
|
+
### Phase 0: Auto-detect
|
|
96
70
|
|
|
97
|
-
|
|
71
|
+
1. Run the detection script.
|
|
72
|
+
2. If the script fails, fall back to manual checks: branch, git status, list files, pipeline state directories, and obvious session artifacts.
|
|
73
|
+
3. Identify primary workflow family: bug-fix, feature, refactor, or unknown.
|
|
74
|
+
4. Identify whether the work is current-workspace Fast Path, planned pipeline work, active pipeline work, failed pipeline item, or ambiguous.
|
|
98
75
|
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
git branch --show-current
|
|
102
|
-
git status --porcelain | head -10
|
|
103
|
-
```
|
|
104
|
-
Report: which branch is active, whether there are uncommitted changes.
|
|
76
|
+
Checkpoint: recovery target and likely phase are known, or no workflow is detected.
|
|
105
77
|
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
# Feature pipeline
|
|
109
|
-
python3 ./.prizmkit/dev-pipeline/cli.py feature status .prizmkit/plans/feature-list.json
|
|
78
|
+
### Phase 1: Diagnose workspace health
|
|
110
79
|
|
|
111
|
-
|
|
112
|
-
python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json
|
|
80
|
+
Before recommending recovery, inspect and summarize:
|
|
113
81
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
82
|
+
- Current branch.
|
|
83
|
+
- Whether the working tree has uncommitted changes.
|
|
84
|
+
- Whether code/test files changed.
|
|
85
|
+
- Which plan lists exist.
|
|
86
|
+
- Which pipeline state directories exist.
|
|
87
|
+
- Failed, in-progress, pending, and completed items when status commands are available.
|
|
88
|
+
- Residual task branches that may correspond to failed/interrupted work.
|
|
89
|
+
- Detected artifacts such as `spec.md`, `plan.md`, review reports, session summaries, or optional bugfix reports.
|
|
118
90
|
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
git branch --list 'dev/*' 'feat/*' 'fix/*' 'bugfix/*' 'refactor/*'
|
|
122
|
-
```
|
|
123
|
-
Cross-reference with failed task IDs to identify which branches belong to which failed tasks.
|
|
91
|
+
Use concise markdown, not box-drawing banners:
|
|
124
92
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
═══════════════════════════════════════════════════
|
|
128
|
-
Workspace Diagnosis
|
|
129
|
-
═══════════════════════════════════════════════════
|
|
93
|
+
```markdown
|
|
94
|
+
## Workspace Diagnosis
|
|
130
95
|
|
|
131
|
-
|
|
132
|
-
|
|
96
|
+
- Branch: fix/B-001-login-crash
|
|
97
|
+
- Working tree: 3 uncommitted files
|
|
98
|
+
- Code changes: 2 source files, 1 test file
|
|
99
|
+
- Plan lists: bug-fix-list.json found
|
|
100
|
+
- Pipeline state: bugfix has 1 failed item
|
|
101
|
+
- Session artifacts: plan.md found, review report not found
|
|
133
102
|
|
|
134
|
-
|
|
135
|
-
Bugfix pipeline: 1 completed, 1 failed (B-002), 0 pending
|
|
136
|
-
Refactor pipeline: (no state found)
|
|
103
|
+
## Detected Recovery Target
|
|
137
104
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
105
|
+
- Workflow: bug-fix-workflow
|
|
106
|
+
- Likely phase: Review
|
|
107
|
+
- Reason: fix branch + code changes + no review artifact
|
|
108
|
+
- Remaining work: review -> verification -> commit -> merge decision
|
|
109
|
+
```
|
|
141
110
|
|
|
142
|
-
|
|
143
|
-
F-003: Payment integration [FAILED] → branch: dev/F-003-...
|
|
144
|
-
B-002: CSV encoding bug [FAILED] → branch: fix/B-002-...
|
|
145
|
-
═══════════════════════════════════════════════════
|
|
146
|
-
```
|
|
111
|
+
If code changes exist, run or suggest the project test command when it is safe and reasonably detectable. Report failures without hiding them.
|
|
147
112
|
|
|
148
|
-
|
|
113
|
+
### Phase 2: Select recovery target
|
|
149
114
|
|
|
150
|
-
|
|
115
|
+
If multiple failed or interrupted targets exist, use `AskUserQuestion` to choose the first target.
|
|
151
116
|
|
|
152
|
-
|
|
117
|
+
For up to three targets, list each target explicitly plus an all-sequential option. If there are more than three targets, group choices to avoid an overloaded question:
|
|
153
118
|
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
Artifacts Found:
|
|
164
|
-
✓ fix-plan.md (fix approach documented)
|
|
165
|
-
✗ fix-report.md (not yet created)
|
|
166
|
-
✓ Code changes (4 files — 3 modified, 1 new)
|
|
167
|
-
✓ Test files (1 touched)
|
|
168
|
-
|
|
169
|
-
Reason: fix-plan.md exists + code changes present
|
|
170
|
-
Remaining: code review → user verification → commit & merge
|
|
171
|
-
═══════════════════════════════════════════════════
|
|
119
|
+
```text
|
|
120
|
+
Question: Multiple interrupted targets found. Which should we recover first?
|
|
121
|
+
Header: Target
|
|
122
|
+
Options:
|
|
123
|
+
- Highest-priority failed item — recover the most urgent failed item first
|
|
124
|
+
- Choose from summary — show full target list before selecting
|
|
125
|
+
- Recover all sequentially — recover each failed/interrupted item in priority order
|
|
126
|
+
- Stop here — do not recover now
|
|
172
127
|
```
|
|
173
128
|
|
|
174
|
-
###
|
|
129
|
+
### Phase 3: Select recovery approach
|
|
175
130
|
|
|
176
|
-
|
|
131
|
+
Use `AskUserQuestion` for the approach. Do not proceed without an explicit selection.
|
|
177
132
|
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
|
|
133
|
+
```text
|
|
134
|
+
Question: Interrupted work was detected. How would you like to recover?
|
|
135
|
+
Header: Recovery
|
|
136
|
+
Options:
|
|
137
|
+
- Run recovery script (Recommended) — execute python3 ./.prizmkit/dev-pipeline/cli.py recovery run to generate a bootstrap prompt and complete remaining phases in a dedicated AI session
|
|
138
|
+
- Resume interactively — continue from the inferred phase in this conversation
|
|
139
|
+
- Clean retry — discard the failed item attempt and rerun it from scratch through the matching launcher reset flow
|
|
140
|
+
- Start fresh — abandon interrupted work and restart the original workflow
|
|
181
141
|
```
|
|
182
142
|
|
|
183
|
-
|
|
184
|
-
- How many tests pass/fail
|
|
185
|
-
- If failures exist — which tests and why
|
|
186
|
-
|
|
187
|
-
### 1.3 Select Recovery Target (if multiple failed tasks)
|
|
188
|
-
|
|
189
|
-
If the diagnosis in 1.0 found **multiple failed/interrupted tasks** across pipelines, ask the user which one to recover first before proceeding:
|
|
143
|
+
If the user wants to inspect first, offer:
|
|
190
144
|
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
header: "Target"
|
|
195
|
-
options:
|
|
196
|
-
- label: "F-003: Payment integration"
|
|
197
|
-
description: "Feature pipeline — FAILED — branch: dev/F-003-payment-integration-202604201030"
|
|
198
|
-
- label: "B-002: CSV encoding bug"
|
|
199
|
-
description: "Bugfix pipeline — FAILED — branch: fix/B-002-encoding-bug"
|
|
200
|
-
- label: "Recover all sequentially"
|
|
201
|
-
description: "Recover each failed task one by one in priority order"
|
|
145
|
+
```bash
|
|
146
|
+
python3 ./.prizmkit/dev-pipeline/cli.py recovery detect
|
|
147
|
+
python3 ./.prizmkit/dev-pipeline/cli.py recovery run --dry-run
|
|
202
148
|
```
|
|
203
149
|
|
|
204
|
-
|
|
150
|
+
### Phase 4: Execute the selected approach
|
|
205
151
|
|
|
206
|
-
|
|
152
|
+
**Run recovery script**:
|
|
207
153
|
|
|
208
|
-
### 1.4 Ask User to Choose Recovery Approach
|
|
209
|
-
|
|
210
|
-
**User choice required (mandatory)** — Use `AskUserQuestion` to present interactive selectable options. **NEVER skip this step. NEVER choose for the user.**
|
|
211
|
-
|
|
212
|
-
```
|
|
213
|
-
AskUserQuestion:
|
|
214
|
-
question: "Interrupted {workflow_type} detected at Phase {N} ({phase_name}). How would you like to recover?"
|
|
215
|
-
header: "Recovery"
|
|
216
|
-
options:
|
|
217
|
-
- label: "Run recovery script (Recommended)"
|
|
218
|
-
description: "Execute python3 ./.prizmkit/dev-pipeline/cli.py recovery run — autonomously completes ALL remaining phases (review, commit, merge, etc.) via a dedicated AI session with explicit phase instructions"
|
|
219
|
-
- label: "Copy command and run manually"
|
|
220
|
-
description: "I'll give you the exact shell command to paste into your terminal — you run it yourself outside this session"
|
|
221
|
-
- label: "Resume interactively in this session"
|
|
222
|
-
description: "Continue from Phase {N} within this conversation — more control, but may not complete all phases if session is interrupted again"
|
|
223
|
-
- label: "Start fresh"
|
|
224
|
-
description: "Discard interrupted work and restart the original workflow from scratch"
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
**If "Run recovery script"** → Execute the pipeline recovery:
|
|
228
154
|
```bash
|
|
229
155
|
python3 ./.prizmkit/dev-pipeline/cli.py recovery run
|
|
230
156
|
```
|
|
231
|
-
The script handles everything: detection, confirmation, prompt generation, session spawn, and post-session validation. **End this skill after launching the script** — do not proceed to Phase 2.
|
|
232
157
|
|
|
233
|
-
|
|
234
|
-
```
|
|
235
|
-
To recover, run this command in your project root:
|
|
158
|
+
After launch, stop this skill and report how the user can monitor the recovery session.
|
|
236
159
|
|
|
237
|
-
|
|
160
|
+
**Resume interactively**:
|
|
238
161
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
162
|
+
1. Read the target workflow SKILL.md.
|
|
163
|
+
2. Read available context artifacts in this order:
|
|
164
|
+
- `context-snapshot.md` when present.
|
|
165
|
+
- `session-summary.md` when present.
|
|
166
|
+
- `spec.md`, `plan.md`, review reports, relevant diffs, and list entries.
|
|
167
|
+
3. Read relevant `.prizmkit/prizm-docs/` according to the project progressive-loading protocol.
|
|
168
|
+
4. Continue from the inferred phase using the target workflow's rules.
|
|
169
|
+
5. Preserve existing work where safe; do not restart from scratch unless the user chooses that.
|
|
245
170
|
|
|
246
|
-
**
|
|
171
|
+
**Clean retry**:
|
|
247
172
|
|
|
248
|
-
|
|
249
|
-
- bug-fix-workflow → `/bug-fix-workflow`
|
|
250
|
-
- feature-workflow → `/feature-workflow`
|
|
251
|
-
- refactor-workflow → `/refactor-workflow`
|
|
252
|
-
End this skill.
|
|
173
|
+
Route to the matching launcher reset flow:
|
|
253
174
|
|
|
254
|
-
|
|
175
|
+
```bash
|
|
176
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset feature <FEATURE_ID> --clean --run .prizmkit/plans/feature-list.json
|
|
177
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <BUG_ID> --clean --run .prizmkit/plans/bug-fix-list.json
|
|
178
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <REFACTOR_ID> --clean --run .prizmkit/plans/refactor-list.json
|
|
179
|
+
```
|
|
255
180
|
|
|
256
|
-
|
|
181
|
+
Ask before running a clean retry because it intentionally discards that item's prior session state.
|
|
257
182
|
|
|
258
|
-
|
|
183
|
+
**Start fresh**:
|
|
259
184
|
|
|
260
|
-
|
|
185
|
+
Suggest the original workflow:
|
|
186
|
+
- `feature-workflow`
|
|
187
|
+
- `bug-fix-workflow`
|
|
188
|
+
- `refactor-workflow`
|
|
261
189
|
|
|
262
|
-
|
|
190
|
+
Stop after the user confirms restart.
|
|
263
191
|
|
|
264
|
-
|
|
192
|
+
## Per-Workflow Recovery Notes
|
|
265
193
|
|
|
266
|
-
|
|
267
|
-
2. **Read existing artifacts** to restore context — check in this order for the most efficient recovery:
|
|
268
|
-
- If `context-snapshot.md` exists in the artifact directory → read it first. It provides a snapshot of completed tasks, key decisions, and remaining work from the interrupted session.
|
|
269
|
-
- If `session-summary.md` exists → read it for a lightweight summary of the previous session.
|
|
270
|
-
- Then read remaining artifacts: spec.md, plan.md, review-report.md, code diffs, bug descriptions, etc.
|
|
271
|
-
3. **Read relevant `.prizmkit/prizm-docs/`** — load project context (L0 root, relevant L1/L2 for affected modules).
|
|
194
|
+
### Bug-fix recovery
|
|
272
195
|
|
|
273
|
-
|
|
196
|
+
Bug-fix recovery should not assume `fix-plan.md` or `fix-report.md` exists. Use them when present, but also infer from:
|
|
274
197
|
|
|
275
|
-
|
|
198
|
+
- `fix/*` branch.
|
|
199
|
+
- Code/test diff.
|
|
200
|
+
- `spec.md` / `plan.md`.
|
|
201
|
+
- Review artifacts.
|
|
202
|
+
- Commits ahead of the original branch.
|
|
203
|
+
- User-provided bug ID or matching bug-fix-list entry.
|
|
276
204
|
|
|
277
|
-
|
|
205
|
+
Typical inference:
|
|
278
206
|
|
|
279
|
-
|
|
207
|
+
| Detected state | Resume from |
|
|
208
|
+
|---|---|
|
|
209
|
+
| Fix branch, no implementation artifacts | Diagnosis / triage |
|
|
210
|
+
| `spec.md` or `plan.md`, no code changes | Fix implementation |
|
|
211
|
+
| Code/test changes, no review artifact | Review |
|
|
212
|
+
| Review artifact or optional `fix-report.md` | User verification |
|
|
213
|
+
| Fix commit exists on branch | Merge decision |
|
|
280
214
|
|
|
281
|
-
|
|
215
|
+
### Feature recovery
|
|
282
216
|
|
|
283
|
-
|
|
284
|
-
- If resuming from Phase 5 (Review) and tests are failing, fix test failures first (max 3 attempts). If unfixable, ask user whether to continue or restart.
|
|
285
|
-
- If resuming from Phase 4 (Fix), read fix-plan.md to understand the planned approach before writing code.
|
|
217
|
+
Feature recovery is usually list/pipeline driven:
|
|
286
218
|
|
|
287
|
-
|
|
219
|
+
| Detected state | Resume from |
|
|
220
|
+
|---|---|
|
|
221
|
+
| No feature list and no Fast Path artifacts | Route selection or feature clarification |
|
|
222
|
+
| Valid feature list, no pipeline state | `feature-pipeline-launcher` launch |
|
|
223
|
+
| Feature list plus pipeline state | `feature-pipeline-launcher` status/retry or recovery script |
|
|
224
|
+
| Current-workspace Fast Path artifacts | Continue `/prizmkit-implement`, review, retrospective, or commit based on state |
|
|
288
225
|
|
|
289
|
-
|
|
226
|
+
### Refactor recovery
|
|
290
227
|
|
|
291
|
-
|
|
228
|
+
Refactor recovery mirrors feature recovery but must preserve behavior checks:
|
|
292
229
|
|
|
293
|
-
|
|
230
|
+
| Detected state | Resume from |
|
|
231
|
+
|---|---|
|
|
232
|
+
| No refactor list and no Fast Path artifacts | Route selection or refactor clarification |
|
|
233
|
+
| Valid refactor list, no pipeline state | `refactor-pipeline-launcher` launch |
|
|
234
|
+
| Refactor list plus pipeline state | `refactor-pipeline-launcher` status/retry or recovery script |
|
|
235
|
+
| Current-workspace Fast Path artifacts | Continue implementation, behavior checks, review, retrospective, or commit based on state |
|
|
294
236
|
|
|
295
|
-
|
|
296
|
-
Recovery complete.
|
|
237
|
+
## Runtime Status Reference
|
|
297
238
|
|
|
298
|
-
|
|
299
|
-
Recovered from: Phase 5 (Review)
|
|
300
|
-
Completed: code review → user verification → commit & merge
|
|
301
|
-
Preserved: fix-plan.md, 4 code files, 1 test file
|
|
239
|
+
Recovery may inspect pipeline state before choosing recovery, interactive resume, or clean retry. Use the canonical Python runtime forms:
|
|
302
240
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
241
|
+
```bash
|
|
242
|
+
python3 ./.prizmkit/dev-pipeline/cli.py recovery run
|
|
243
|
+
python3 ./.prizmkit/dev-pipeline/cli.py recovery detect
|
|
244
|
+
python3 ./.prizmkit/dev-pipeline/cli.py feature status .prizmkit/plans/feature-list.json
|
|
245
|
+
python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json
|
|
246
|
+
python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
|
|
247
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset feature <F-XXX> --clean --run .prizmkit/plans/feature-list.json
|
|
248
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <B-XXX> --clean --run .prizmkit/plans/bug-fix-list.json
|
|
306
249
|
```
|
|
307
250
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
---
|
|
251
|
+
Use the matching launcher for healthy status/logs/retry flows. Use clean retry only after explicit user confirmation because it discards the selected item session state.
|
|
311
252
|
|
|
312
253
|
## Error Handling
|
|
313
254
|
|
|
314
255
|
| Scenario | Action |
|
|
315
|
-
|
|
316
|
-
| No workflow signature matches |
|
|
317
|
-
|
|
|
318
|
-
|
|
|
319
|
-
|
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
|
|
323
|
-
---
|
|
256
|
+
|---|---|
|
|
257
|
+
| No workflow signature matches | Report no interrupted workflow detected and suggest original workflow skills |
|
|
258
|
+
| Multiple workflows match | Present the evidence and ask which target to recover first |
|
|
259
|
+
| Branch and artifacts disagree | Trust git diff/status as ground truth, but report the discrepancy |
|
|
260
|
+
| Detection script fails | Fall back to manual detection checks |
|
|
261
|
+
| Tests fail during diagnosis | Report failures and ask whether to continue recovery, fix tests, or stop |
|
|
262
|
+
| Recovery script unavailable | Offer interactive recovery or clean retry |
|
|
263
|
+
| Clean retry requested with uncommitted changes | Warn that retry may discard item session state; ask for explicit confirmation |
|
|
324
264
|
|
|
325
265
|
## Relationship to Other Skills
|
|
326
266
|
|
|
327
|
-
| Skill | Relationship |
|
|
328
|
-
|
|
329
|
-
| `feature-workflow` |
|
|
330
|
-
| `bug-fix-workflow` |
|
|
331
|
-
| `refactor-workflow` |
|
|
332
|
-
| `feature-pipeline-launcher` |
|
|
333
|
-
| `
|
|
334
|
-
| `
|
|
335
|
-
|
|
|
336
|
-
| `/prizmkit-
|
|
337
|
-
|
|
|
338
|
-
|
|
339
|
-
---
|
|
267
|
+
| Skill or command | Relationship |
|
|
268
|
+
|---|---|
|
|
269
|
+
| `feature-workflow` | Recovery target for interrupted feature workflows |
|
|
270
|
+
| `bug-fix-workflow` | Recovery target for interrupted bug-fix workflows |
|
|
271
|
+
| `refactor-workflow` | Recovery target for interrupted refactor workflows |
|
|
272
|
+
| `feature-pipeline-launcher` | Status/logs/retry for healthy or resumable feature pipelines |
|
|
273
|
+
| `bugfix-pipeline-launcher` | Status/logs/retry for healthy or resumable bugfix pipelines |
|
|
274
|
+
| `refactor-pipeline-launcher` | Status/logs/retry for healthy or resumable refactor pipelines |
|
|
275
|
+
| `/prizmkit-code-review` | Used when interactive recovery resumes at review |
|
|
276
|
+
| `/prizmkit-committer` | Used when interactive recovery resumes at commit |
|
|
277
|
+
| `python3 ./.prizmkit/dev-pipeline/cli.py recovery run` | Dedicated script recovery counterpart |
|
|
340
278
|
|
|
341
279
|
## Output
|
|
342
280
|
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
281
|
+
- Recovery diagnosis summary.
|
|
282
|
+
- User-selected recovery target and approach.
|
|
283
|
+
- Either launched recovery script, interactive continuation, clean retry command, or start-fresh handoff.
|
|
284
|
+
- Final recovery summary when interactive recovery completes.
|