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.
Files changed (110) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
  3. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
  4. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +19 -73
  5. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +283 -421
  6. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
  7. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
  8. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
  9. package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
  10. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
  11. package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
  12. package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
  13. package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
  14. package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
  15. package/bundled/dev-pipeline/scripts/utils.py +171 -0
  16. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  17. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +10 -18
  18. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +14 -25
  19. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
  20. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
  21. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
  22. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
  23. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
  24. package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
  25. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
  26. package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
  27. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
  28. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
  32. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
  33. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
  34. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
  35. package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
  36. package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
  37. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +1 -1
  38. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
  39. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
  40. package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
  41. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
  42. package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
  43. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
  44. package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
  45. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
  47. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
  48. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
  49. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
  50. package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
  51. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +17 -5
  52. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +197 -0
  53. package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
  54. package/bundled/dev-pipeline/tests/test_utils.py +66 -1
  55. package/bundled/skills/_metadata.json +1 -1
  56. package/bundled/skills/app-planner/SKILL.md +8 -7
  57. package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
  58. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
  59. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
  60. package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
  61. package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
  62. package/bundled/skills/bug-planner/SKILL.md +6 -5
  63. package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
  64. package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
  65. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +30 -1
  66. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +16 -16
  67. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
  68. package/bundled/skills/feature-pipeline-launcher/SKILL.md +19 -11
  69. package/bundled/skills/feature-planner/SKILL.md +9 -11
  70. package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
  71. package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
  72. package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
  73. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
  74. package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
  75. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
  76. package/bundled/skills/feature-workflow/SKILL.md +169 -298
  77. package/bundled/skills/prizmkit/SKILL.md +103 -57
  78. package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
  79. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
  80. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +12 -1
  81. package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
  82. package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
  83. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
  84. package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
  85. package/bundled/skills/prizmkit-init/SKILL.md +4 -3
  86. package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
  87. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
  88. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
  89. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
  90. package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
  91. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
  92. package/bundled/skills/prizmkit-test/SKILL.md +138 -141
  93. package/bundled/skills/prizmkit-test/references/examples.md +10 -8
  94. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
  95. package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
  96. package/bundled/skills/recovery-workflow/SKILL.md +195 -256
  97. package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
  98. package/bundled/skills/recovery-workflow/references/detection.md +48 -39
  99. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
  100. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -11
  101. package/bundled/skills/refactor-planner/SKILL.md +2 -2
  102. package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
  103. package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
  104. package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
  105. package/bundled/skills/refactor-workflow/SKILL.md +173 -307
  106. package/package.json +1 -1
  107. package/src/scaffold.js +5 -0
  108. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
  109. package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
  110. 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 interactive workflow sessions. Auto-detects which workflow (feature-workflow, bug-fix-workflow, refactor-workflow) was interrupted and what phase it reached by inspecting git branch names, characteristic artifacts, and pipeline state then resumes from the breakpoint. Use this skill whenever an AI CLI session is interrupted mid-workflow, times out, or hits token limits. Trigger on: 'recover', 'resume', 'continue where I left off', 'session interrupted', 'session timed out', 'pick up where it left off', 'token limit exceeded', 'salvage partial work'."
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
- Auto-detect and resume interrupted interactive workflow sessions. When a user's AI CLI session is interrupted mid-workflow (timeout, token limit, crash, manual stop), this skill inspects the workspace to determine which workflow was running and what phase it reached, then continues from the breakpoint.
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
- User says:
13
- - "Recover", "Resume", "Continue where I left off"
14
- - "Session interrupted / timed out / token limit exceeded"
15
- - "Pick up where it left off"
16
- - "Don't want to restart from scratch"
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
- **Do NOT use when:**
19
- - Pipeline interrupted use `python3 ./.prizmkit/dev-pipeline/cli.py reset feature <F-XXX> --clean --run .prizmkit/plans/feature-list.json` / `python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <B-XXX> --clean --run .prizmkit/plans/bug-fix-list.json` for a fresh retry
20
- - User wants a clean restart use the original workflow skill directly (`/feature-workflow`, `/bug-fix-workflow`, `/refactor-workflow`)
21
- - Nothing was ever started use the original workflow skill
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
- ## Pipeline Recovery (Recommended)
23
+ ## Recovery Approach Policy
24
24
 
25
- **IMPORTANT**: In Phase 1.3, you MUST present the user with a choice between pipeline recovery (`python3 ./.prizmkit/dev-pipeline/cli.py recovery run`) and interactive recovery. **NEVER skip this choice. NEVER decide for the user.** The pipeline approach is recommended because it generates a comprehensive bootstrap prompt that explicitly lists every remaining phase with full instructions, ensuring the AI completes the full workflow — not just the implementation part.
25
+ Always present the user with recovery choices after detection. Do not silently choose between script recovery and interactive recovery.
26
26
 
27
- Pipeline commands (for reference — Phase 1.3 will present these as a selectable option):
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
- ```bash
30
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run # Auto-detect and recover
31
- python3 ./.prizmkit/dev-pipeline/cli.py recovery detect # Detection report only
32
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run --dry-run # Generate prompt, don't execute
33
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run --yes # Skip confirmation
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
- ## Phase 0: Auto-detect
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
- **Goal**: Identify which workflow was interrupted and what phase it reached.
40
+ ## Detection Signals
82
41
 
83
- Run the detection script:
42
+ Inspect multiple signals. Do not depend on a single artifact.
84
43
 
85
- Run the detection script (`python3 ${SKILL_DIR}/scripts/detect-recovery-state.py`). For the full signature matching table, phase inference tables (bug-fix/feature/refactor), and no-workflow-detected guidance, read `${SKILL_DIR}/references/detection.md`.
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
- **CHECKPOINT CP-REC-0**: Workflow type and phase identified.
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
- ## Phase 1: Diagnose + Report + User Confirmation
65
+ For the signature matching and phase inference tables, read `${SKILL_DIR}/references/detection.md`.
92
66
 
93
- **Goal**: Assess workspace health, identify failed tasks across all pipelines, and present recovery options.
67
+ ## Recovery Flow
94
68
 
95
- ### 1.0 Workspace & Failure Diagnosis
69
+ ### Phase 0: Auto-detect
96
70
 
97
- Before showing the recovery report, run a comprehensive diagnosis:
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
- 1. **Check current branch and working tree**:
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
- 2. **Scan all pipelines for failed/in-progress tasks**:
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
- # Bugfix pipeline
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
- # Refactor pipeline
115
- python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
116
- ```
117
- For each pipeline that has state, extract: total tasks, completed, failed, in-progress, pending.
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
- 3. **Find residual dev branches** from failed/interrupted tasks:
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
- 4. **Present diagnosis summary** — show all findings before the recovery report:
126
- ```
127
- ═══════════════════════════════════════════════════
128
- Workspace Diagnosis
129
- ═══════════════════════════════════════════════════
93
+ ```markdown
94
+ ## Workspace Diagnosis
130
95
 
131
- Branch: fix/B-001-login-crash
132
- Working tree: 3 uncommitted changes
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
- Feature pipeline: 2 completed, 1 failed (F-003), 2 pending
135
- Bugfix pipeline: 1 completed, 1 failed (B-002), 0 pending
136
- Refactor pipeline: (no state found)
103
+ ## Detected Recovery Target
137
104
 
138
- Residual branches:
139
- dev/F-003-payment-integration-202604201030
140
- fix/B-002-encoding-bug
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
- Failed tasks:
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
- If no pipelines have state and no failed tasks are found, skip to 1.1 (standard recovery report).
113
+ ### Phase 2: Select recovery target
149
114
 
150
- ### 1.1 Display Detection Report
115
+ If multiple failed or interrupted targets exist, use `AskUserQuestion` to choose the first target.
151
116
 
152
- Read the script output and present a formatted summary:
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
- Recovery Report
157
- ═══════════════════════════════════════════════════
158
-
159
- Workflow: bug-fix-workflow
160
- Branch: fix/B-001-login-crash
161
- Phase: 5Review
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
- ### 1.2 Run Tests (if code changes exist)
129
+ ### Phase 3: Select recovery approach
175
130
 
176
- If the detection report shows code changes (`code.has_changes == true`), run the project's test suite:
131
+ Use `AskUserQuestion` for the approach. Do not proceed without an explicit selection.
177
132
 
178
- ```bash
179
- # detect test command from package.json or .prizmkit/config.json
180
- npm test # or the appropriate test command
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
- Include test results in the report:
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
- AskUserQuestion:
193
- question: "Multiple failed/interrupted tasks found. Which would you like to recover?"
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
- Generate the options dynamically from the diagnosis results. Include task ID, title, pipeline type, status, and branch name.
150
+ ### Phase 4: Execute the selected approach
205
151
 
206
- If only one failed/interrupted task is found, skip this step — proceed directly to 1.4 with that task as the recovery target.
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
- **If "Copy command and run manually"** Output the command for the user to copy and run in their own terminal:
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
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run
160
+ **Resume interactively**:
238
161
 
239
- Or with options:
240
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run --dry-run # Preview the recovery prompt first
241
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run --yes # Skip confirmation
242
- python3 ./.prizmkit/dev-pipeline/cli.py recovery run --model <model> # Specify AI model
243
- ```
244
- **End this skill** do not proceed to Phase 2. The user will run the command themselves.
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
- **If "Resume interactively"** → Continue to Phase 2 below (execute remaining steps in this session).
171
+ **Clean retry**:
247
172
 
248
- **If "Start fresh"** → Suggest the appropriate original workflow skill:
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
- **NEVER proceed to Phase 2 without explicit user selection via `AskUserQuestion`. Do NOT render options as plain text — the user must be able to click/select.**
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
- **CHECKPOINT CP-REC-1**: User chose recovery target and approach.
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
- ## Phase 2: Execute Remaining Steps
185
+ Suggest the original workflow:
186
+ - `feature-workflow`
187
+ - `bug-fix-workflow`
188
+ - `refactor-workflow`
261
189
 
262
- **Goal**: Read the target workflow's SKILL.md and execute from the inferred phase.
190
+ Stop after the user confirms restart.
263
191
 
264
- ### 2.0 Read Target Workflow
192
+ ## Per-Workflow Recovery Notes
265
193
 
266
- 1. **Read the workflow's SKILL.md** from `core/skills/orchestration-skill/workflows/{workflow-type}/SKILL.md`
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
- This step replaces the context that was lost when the AI session was interrupted.
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
- ### 2.1 Per-Workflow Phase Inference
205
+ Typical inference:
278
206
 
279
- Read `${SKILL_DIR}/references/detection.md` for the per-workflow phase-inference tables (bug-fix / feature / refactor) that map detected state the phase to resume from and its actions.
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
- **Bug-fix execution**: Follow the bug-fix-workflow SKILL.md instructions exactly. Call the same prizmkit sub-commands (`/prizmkit-code-review`, `/prizmkit-committer`) at the same points.
215
+ ### Feature recovery
282
216
 
283
- **Special handling**:
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
- **Feature recovery**: Phases 3-4 are pipeline-driven. The main recovery value is avoiding re-brainstorming (Phase 1) when `.prizmkit/plans/feature-list.json` already exists.
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
- **Refactor recovery**: Mirrors feature-workflow (brainstorm → launch → monitor).
226
+ ### Refactor recovery
290
227
 
291
- ### 2.4 Post-Recovery Report
228
+ Refactor recovery mirrors feature recovery but must preserve behavior checks:
292
229
 
293
- After all remaining phases complete, output a summary:
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
- Workflow: bug-fix-workflow
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
- Next steps:
304
- Check for other interrupted workflows
305
- Or start a new workflow
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
- **CHECKPOINT CP-REC-2**: Workflow recovered and completed.
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 | Show guidance message, suggest original workflow skills |
317
- | Branch exists but artifacts are inconsistent | Trust git as ground truth, report discrepancy in detection report |
318
- | Test failures in existing code | Report in detection summary; user decides whether to continue |
319
- | Multiple workflows could match (e.g., on main but both .prizmkit/plans/feature-list.json and bug-fix artifacts exist) | Pick highest priority (bug-fix > refactor > feature), mention others in report |
320
- | Detection script fails | Fall back to manual detection (run individual git/file checks in bash) |
321
- | Bug ID not found in .prizmkit/plans/bug-fix-list.json | Continue with branch-only context; note that full bug description is unavailable |
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` | **Recovery target** this skill can resume interrupted feature-workflow sessions |
330
- | `bug-fix-workflow` | **Recovery target** this skill can resume interrupted bug-fix-workflow sessions |
331
- | `refactor-workflow` | **Recovery target** this skill can resume interrupted refactor-workflow sessions |
332
- | `feature-pipeline-launcher` | **Called in Phase 2.2** — launches or checks pipeline status for feature recovery |
333
- | `python3 ./.prizmkit/dev-pipeline/cli.py reset feature <F-XXX> --clean --run .prizmkit/plans/feature-list.json` | **Alternative** — full clean retry for pipeline failures; this skill is the smart interactive alternative |
334
- | `python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <B-XXX> --clean --run .prizmkit/plans/bug-fix-list.json` | **Alternative** full clean retry for bugfix pipeline failures |
335
- | `python3 ./.prizmkit/dev-pipeline/cli.py recovery run` | **Pipeline counterpart** Python recovery that generates bootstrap prompt and spawns AI CLI session for autonomous completion |
336
- | `/prizmkit-code-review` | **Called in Phase 2.1** reviews recovered bug-fix code |
337
- | `/prizmkit-committer` | **Called in Phase 2.1** — commits the recovered result |
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
- - Resumed and completed workflow from the breakpoint
344
- - Same outputs as the original workflow would produce (commits, artifacts, state updates)
345
- - Recovery summary showing what was preserved vs what was re-done
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.