prizmkit 1.1.1 → 1.1.3
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/adapters/claude/agent-adapter.js +18 -0
- package/bundled/adapters/claude/command-adapter.js +1 -27
- package/bundled/agents/prizm-dev-team-critic.md +2 -0
- package/bundled/agents/prizm-dev-team-dev.md +2 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +2 -0
- package/bundled/dev-pipeline/README.md +63 -63
- package/bundled/dev-pipeline/assets/feature-list-example.json +1 -1
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
- package/bundled/dev-pipeline/{launch-daemon.sh → launch-feature-daemon.sh} +33 -33
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +454 -0
- package/bundled/dev-pipeline/lib/branch.sh +1 -1
- package/bundled/dev-pipeline/reset-feature.sh +3 -3
- package/bundled/dev-pipeline/reset-refactor.sh +312 -0
- package/bundled/dev-pipeline/{retry-bug.sh → retry-bugfix.sh} +47 -59
- package/bundled/dev-pipeline/retry-feature.sh +41 -54
- package/bundled/dev-pipeline/retry-refactor.sh +358 -0
- package/bundled/dev-pipeline/run-bugfix.sh +6 -0
- package/bundled/dev-pipeline/{run.sh → run-feature.sh} +31 -31
- package/bundled/dev-pipeline/run-refactor.sh +787 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +177 -10
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +419 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +393 -0
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +726 -0
- package/bundled/dev-pipeline/templates/agent-prompts/critic-code-challenge.md +13 -0
- package/bundled/dev-pipeline/templates/agent-prompts/critic-plan-challenge.md +7 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +7 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +26 -0
- package/bundled/dev-pipeline/templates/agent-prompts/dev-resume.md +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +12 -0
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +29 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +8 -7
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +11 -10
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -3
- package/bundled/dev-pipeline/templates/feature-list-schema.json +1 -1
- package/bundled/dev-pipeline/templates/refactor-list-schema.json +159 -0
- package/bundled/dev-pipeline/templates/sections/ac-verification-checklist.md +13 -0
- package/bundled/dev-pipeline/templates/sections/feature-context.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +9 -8
- package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +9 -8
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +2 -1
- package/bundled/dev-pipeline/templates/sections/phase-critic-code.md +8 -10
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +9 -10
- package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +8 -9
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +7 -10
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +8 -15
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +7 -12
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +8 -19
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery.md +75 -0
- package/bundled/skills/_metadata.json +33 -6
- package/bundled/skills/app-planner/SKILL.md +105 -320
- package/bundled/skills/app-planner/assets/app-design-guide.md +101 -0
- package/bundled/skills/app-planner/references/frontend-design-guide.md +1 -1
- package/bundled/skills/app-planner/references/project-brief-guide.md +49 -80
- package/bundled/skills/bug-fix-workflow/SKILL.md +2 -2
- package/bundled/skills/bug-planner/SKILL.md +68 -5
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +3 -2
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +19 -5
- package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/SKILL.md +32 -32
- package/bundled/skills/feature-planner/SKILL.md +337 -0
- package/bundled/skills/{app-planner → feature-planner}/assets/evaluation-guide.md +4 -4
- package/bundled/skills/{app-planner → feature-planner}/assets/planning-guide.md +3 -171
- package/bundled/skills/{app-planner → feature-planner}/references/browser-interaction.md +6 -5
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +75 -0
- package/bundled/skills/{app-planner → feature-planner}/references/error-recovery.md +8 -8
- package/bundled/skills/{app-planner → feature-planner}/references/incremental-feature-planning.md +1 -1
- package/bundled/skills/{app-planner/references/new-app-planning.md → feature-planner/references/new-project-planning.md} +1 -1
- package/bundled/skills/{app-planner → feature-planner}/scripts/validate-and-generate.py +4 -4
- package/bundled/skills/feature-workflow/SKILL.md +23 -23
- package/bundled/skills/prizm-kit/SKILL.md +1 -3
- package/bundled/skills/prizmkit-analyze/SKILL.md +2 -5
- package/bundled/skills/prizmkit-code-review/SKILL.md +2 -2
- package/bundled/skills/prizmkit-committer/SKILL.md +4 -8
- package/bundled/skills/prizmkit-deploy/SKILL.md +1 -5
- package/bundled/skills/prizmkit-implement/SKILL.md +3 -50
- package/bundled/skills/prizmkit-init/SKILL.md +5 -77
- package/bundled/skills/prizmkit-plan/SKILL.md +1 -12
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +6 -24
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +21 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +12 -117
- package/bundled/skills/recovery-workflow/SKILL.md +166 -316
- package/bundled/skills/recovery-workflow/evals/evals.json +29 -13
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +232 -274
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +352 -0
- package/bundled/skills/refactor-planner/SKILL.md +436 -0
- package/bundled/skills/refactor-planner/assets/planning-guide.md +292 -0
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +301 -0
- package/bundled/skills/refactor-planner/references/refactor-scoping-guide.md +221 -0
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +786 -0
- package/bundled/skills/refactor-workflow/SKILL.md +299 -319
- package/package.json +1 -1
- package/src/clean.js +3 -3
- package/src/scaffold.js +6 -6
- package/bundled/skills/prizmkit-plan/assets/spec-template.md +0 -56
- package/bundled/skills/prizmkit-plan/references/clarify-guide.md +0 -67
- package/src/config.js +0 -504
- package/src/prompts.js +0 -210
- /package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/scripts/preflight-check.py +0 -0
|
@@ -1,378 +1,235 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "recovery-workflow"
|
|
3
|
-
description: "Recover and resume interrupted
|
|
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'. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Recovery Workflow
|
|
7
7
|
|
|
8
|
-
|
|
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.
|
|
9
9
|
|
|
10
10
|
## When to Use
|
|
11
11
|
|
|
12
12
|
User says:
|
|
13
|
-
- "Recover
|
|
14
|
-
- "
|
|
15
|
-
- "
|
|
16
|
-
- "
|
|
17
|
-
- "Session timed out but there's code already written"
|
|
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"
|
|
18
17
|
|
|
19
18
|
**Do NOT use when:**
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- Feature never started (no state at all) → `dev-pipeline-launcher` (Intent E: Retry)
|
|
19
|
+
- Pipeline interrupted → use `retry-feature.sh` / `retry-bugfix.sh`
|
|
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
|
|
24
22
|
|
|
25
|
-
##
|
|
23
|
+
## Supported Workflows
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
| `reset-feature.sh --clean --run` | Even more thorough clean + retry | Same, plus session history |
|
|
33
|
-
| `run.sh --resume-phase N` | Tells new session "start from phase N" via prompt | Better, but doesn't inspect actual worktree state — the new AI session has no memory of what was done |
|
|
34
|
-
|
|
35
|
-
The gap: when a session is interrupted mid-implementation, the **worktree already has real code changes** — possibly a spec, plan, partial or complete implementation, even passing tests. Discarding all of this wastes significant tokens and time. This skill bridges that gap by inspecting the actual filesystem state and resuming intelligently within the current interactive session.
|
|
25
|
+
| Workflow | Branch Pattern | Key Artifacts |
|
|
26
|
+
|----------|---------------|---------------|
|
|
27
|
+
| bug-fix-workflow | `fix/<BUG_ID>-*` | `.prizmkit/bugfix/<BUG_ID>/fix-plan.md`, `fix-report.md` |
|
|
28
|
+
| feature-workflow | `feat/*` | `feature-list.json`, `dev-pipeline/state/features/` |
|
|
29
|
+
| refactor-workflow | `refactor/*` | `refactor-list.json`, `dev-pipeline/state/refactors/` |
|
|
36
30
|
|
|
37
31
|
---
|
|
38
32
|
|
|
39
33
|
## Overview
|
|
40
34
|
|
|
41
35
|
```
|
|
42
|
-
recovery-workflow
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
├──
|
|
47
|
-
|
|
48
|
-
├──
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
recovery-workflow
|
|
37
|
+
│
|
|
38
|
+
├── Phase 0: Auto-detect
|
|
39
|
+
│ ├── Read current branch name
|
|
40
|
+
│ ├── Scan characteristic artifacts
|
|
41
|
+
│ ├── Match workflow signature → determine workflow type
|
|
42
|
+
│ ├── Based on artifact presence → infer current phase
|
|
43
|
+
│ └── No match → reject and guide user
|
|
44
|
+
│
|
|
45
|
+
├── Phase 1: Report + user confirmation
|
|
46
|
+
│ ├── Display detection results
|
|
47
|
+
│ ├── If code changes exist → run test suite
|
|
48
|
+
│ └── User confirms "continue" → proceed
|
|
49
|
+
│
|
|
50
|
+
└── Phase 2: Execute remaining steps
|
|
51
|
+
├── Read target workflow's SKILL.md
|
|
52
|
+
├── Read existing artifacts to restore context
|
|
53
|
+
└── Execute from inferred phase through completion
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
---
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|-------|----------|---------|
|
|
57
|
-
| Feature ID | Yes | `F-007` |
|
|
58
|
-
| Feature list path | No (default: `feature-list.json`) | `my-features.json` |
|
|
58
|
+
## Phase 0: Auto-detect
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
**Goal**: Identify which workflow was interrupted and what phase it reached.
|
|
61
|
+
|
|
62
|
+
Run the detection script:
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
1. **Parse feature ID** from user input (e.g., "recover F-007", "resume F-007")
|
|
67
|
-
2. **Read feature-list.json** to get feature metadata:
|
|
68
|
-
```bash
|
|
69
|
-
python3 -c "
|
|
70
|
-
import json, re
|
|
71
|
-
with open('feature-list.json') as f:
|
|
72
|
-
data = json.load(f)
|
|
73
|
-
for feat in data.get('features', []):
|
|
74
|
-
if feat.get('id') == 'F-007':
|
|
75
|
-
print(json.dumps(feat, indent=2))
|
|
76
|
-
"
|
|
77
|
-
```
|
|
78
|
-
3. **Compute feature slug** (same algorithm the pipeline uses):
|
|
79
|
-
```python
|
|
80
|
-
# F-007 + "User Authentication" → "007-user-authentication"
|
|
81
|
-
numeric = feature_id.replace('F-', '').zfill(3)
|
|
82
|
-
slug = re.sub(r'[^a-z0-9\s-]', '', title.lower())
|
|
83
|
-
slug = re.sub(r'[\s]+', '-', slug.strip()).strip('-')
|
|
84
|
-
slug = f"{numeric}-{slug}"
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
If the feature is not found, ask the user for the correct ID or file path.
|
|
64
|
+
```bash
|
|
65
|
+
python3 ${SKILL_DIR}/scripts/detect-recovery-state.py
|
|
66
|
+
```
|
|
88
67
|
|
|
89
|
-
|
|
68
|
+
The script uses **priority-ordered signature matching**:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
1. Current branch matches fix/* → bug-fix-workflow
|
|
72
|
+
2. .prizmkit/bugfix/ directory has content → bug-fix-workflow
|
|
73
|
+
3. Current branch matches refactor/* → refactor-workflow
|
|
74
|
+
4. refactor-list.json exists → refactor-workflow
|
|
75
|
+
5. Current branch matches feat/* → feature-workflow
|
|
76
|
+
6. feature-list.json exists → feature-workflow
|
|
77
|
+
7. None of the above → no workflow detected
|
|
78
|
+
```
|
|
90
79
|
|
|
91
|
-
|
|
80
|
+
Bug-fix-workflow has highest priority because it is purely interactive and benefits most from recovery (no pipeline retry fallback).
|
|
92
81
|
|
|
93
|
-
|
|
82
|
+
### If no workflow detected
|
|
94
83
|
|
|
95
|
-
|
|
84
|
+
Show guidance and exit:
|
|
96
85
|
|
|
97
|
-
```bash
|
|
98
|
-
python3 ${SKILL_DIR}/scripts/detect-recovery-state.py \
|
|
99
|
-
--feature-id <FEATURE_ID> \
|
|
100
|
-
--feature-list feature-list.json
|
|
101
86
|
```
|
|
87
|
+
No interrupted workflow detected in this workspace.
|
|
102
88
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- Last session directory — path for log inspection
|
|
108
|
-
|
|
109
|
-
### 1.2 PrizmKit Artifacts
|
|
110
|
-
- `.prizmkit/specs/{slug}/spec.md` — specification generated?
|
|
111
|
-
- `.prizmkit/specs/{slug}/plan.md` — plan generated?
|
|
112
|
-
- If plan.md exists: count completed vs total tasks (look for `[x]` vs `[ ]` checkboxes)
|
|
113
|
-
|
|
114
|
-
### 1.3 Git State
|
|
115
|
-
- **Feature branch**: does `feat/{slug}` exist?
|
|
116
|
-
- **Current branch**: are we already on the feature branch?
|
|
117
|
-
- **Uncommitted changes**: `git diff --stat` (working tree changes)
|
|
118
|
-
- **Staged changes**: `git diff --cached --stat`
|
|
119
|
-
- **Commits ahead of main**: `git log main..HEAD --oneline`
|
|
120
|
-
|
|
121
|
-
### 1.4 Code Changes
|
|
122
|
-
- Number of modified/added/deleted files
|
|
123
|
-
- Which directories were touched
|
|
124
|
-
- Whether test files were created/modified
|
|
125
|
-
|
|
126
|
-
### Detection Output
|
|
127
|
-
|
|
128
|
-
The script produces a structured JSON report:
|
|
129
|
-
|
|
130
|
-
```json
|
|
131
|
-
{
|
|
132
|
-
"feature_id": "F-007",
|
|
133
|
-
"feature_title": "User Authentication",
|
|
134
|
-
"feature_slug": "007-user-authentication",
|
|
135
|
-
"pipeline": {
|
|
136
|
-
"status": "failed",
|
|
137
|
-
"retry_count": 1,
|
|
138
|
-
"last_session_id": "F-007-20260329101500",
|
|
139
|
-
"last_session_dir": "dev-pipeline/state/features/F-007/sessions/F-007-20260329101500"
|
|
140
|
-
},
|
|
141
|
-
"artifacts": {
|
|
142
|
-
"spec_exists": true,
|
|
143
|
-
"plan_exists": true,
|
|
144
|
-
"spec_path": ".prizmkit/specs/007-user-authentication/spec.md",
|
|
145
|
-
"plan_path": ".prizmkit/specs/007-user-authentication/plan.md",
|
|
146
|
-
"plan_tasks_total": 5,
|
|
147
|
-
"plan_tasks_completed": 3
|
|
148
|
-
},
|
|
149
|
-
"git": {
|
|
150
|
-
"feature_branch": "feat/007-user-authentication",
|
|
151
|
-
"branch_exists": true,
|
|
152
|
-
"on_feature_branch": true,
|
|
153
|
-
"uncommitted_files": 8,
|
|
154
|
-
"staged_files": 0,
|
|
155
|
-
"commits_ahead_of_main": 0
|
|
156
|
-
},
|
|
157
|
-
"code": {
|
|
158
|
-
"files_modified": 6,
|
|
159
|
-
"files_added": 4,
|
|
160
|
-
"test_files_touched": 2,
|
|
161
|
-
"directories_touched": ["src/auth/", "src/middleware/", "tests/"]
|
|
162
|
-
},
|
|
163
|
-
"recovery": {
|
|
164
|
-
"recommended_action": "continue_implementation",
|
|
165
|
-
"recommended_phase": "implement",
|
|
166
|
-
"reason": "spec and plan exist, 3/5 plan tasks completed, code changes present",
|
|
167
|
-
"remaining_work": "2 tasks + review + commit"
|
|
168
|
-
}
|
|
169
|
-
}
|
|
89
|
+
To start a new workflow:
|
|
90
|
+
• /feature-workflow — build features from idea to code
|
|
91
|
+
• /bug-fix-workflow — fix a specific bug interactively
|
|
92
|
+
• /refactor-workflow — behavior-preserving code restructuring
|
|
170
93
|
```
|
|
171
94
|
|
|
172
|
-
**CHECKPOINT CP-RW-0**:
|
|
95
|
+
**CHECKPOINT CP-RW-0**: Workflow type and phase identified.
|
|
173
96
|
|
|
174
97
|
---
|
|
175
98
|
|
|
176
|
-
## Phase
|
|
99
|
+
## Phase 1: Report + User Confirmation
|
|
177
100
|
|
|
178
|
-
**Goal**:
|
|
101
|
+
**Goal**: Show the user what was found and get confirmation before executing.
|
|
179
102
|
|
|
180
|
-
###
|
|
103
|
+
### 1.1 Display Detection Report
|
|
181
104
|
|
|
182
|
-
Read the
|
|
105
|
+
Read the script output and present a formatted summary:
|
|
183
106
|
|
|
184
107
|
```
|
|
185
108
|
═══════════════════════════════════════════════════
|
|
186
|
-
Recovery Report
|
|
109
|
+
Recovery Report
|
|
187
110
|
═══════════════════════════════════════════════════
|
|
188
111
|
|
|
189
|
-
|
|
190
|
-
|
|
112
|
+
Workflow: bug-fix-workflow
|
|
113
|
+
Branch: fix/B-001-login-crash
|
|
114
|
+
Phase: 5 — Review
|
|
191
115
|
|
|
192
116
|
Artifacts Found:
|
|
193
|
-
✓
|
|
194
|
-
|
|
195
|
-
✓ Code changes (
|
|
196
|
-
✓ Test files (
|
|
117
|
+
✓ fix-plan.md (fix approach documented)
|
|
118
|
+
✗ fix-report.md (not yet created)
|
|
119
|
+
✓ Code changes (4 files — 3 modified, 1 new)
|
|
120
|
+
✓ Test files (1 touched)
|
|
197
121
|
|
|
198
|
-
|
|
199
|
-
Remaining:
|
|
122
|
+
Reason: fix-plan.md exists + code changes present
|
|
123
|
+
Remaining: code review → user verification → commit & merge
|
|
200
124
|
═══════════════════════════════════════════════════
|
|
201
125
|
```
|
|
202
126
|
|
|
203
|
-
###
|
|
127
|
+
### 1.2 Run Tests (if code changes exist)
|
|
204
128
|
|
|
205
|
-
|
|
129
|
+
If the detection report shows code changes (`code.has_changes == true`), run the project's test suite:
|
|
206
130
|
|
|
207
131
|
```bash
|
|
208
|
-
# detect test command from .
|
|
132
|
+
# detect test command from package.json or .prizmkit/config.json
|
|
209
133
|
npm test # or the appropriate test command
|
|
210
134
|
```
|
|
211
135
|
|
|
212
|
-
Include test results in the
|
|
136
|
+
Include test results in the report:
|
|
213
137
|
- How many tests pass/fail
|
|
214
|
-
- If
|
|
215
|
-
|
|
216
|
-
### 2.3 Present Recovery Options
|
|
217
|
-
|
|
218
|
-
Based on the detected state, offer the appropriate options. The most common scenarios:
|
|
219
|
-
|
|
220
|
-
**Scenario A: Implementation in progress** (spec + plan + code changes)
|
|
221
|
-
Most common case — session died mid-implementation.
|
|
222
|
-
|
|
223
|
-
| Option | Description |
|
|
224
|
-
|--------|-------------|
|
|
225
|
-
| **(a) Smart Resume** (recommended) | Fix test failures if any, complete remaining plan tasks, then review → commit |
|
|
226
|
-
| **(b) Review & Commit Only** | If implementation looks complete (all tasks done, tests passing), skip to code review |
|
|
227
|
-
| **(c) Re-implement from Plan** | Keep spec and plan, discard code changes, re-implement. Useful if partial code is low quality |
|
|
228
|
-
| **(d) Clean Restart** | Discard everything, start from scratch (equivalent to `reset-feature.sh --clean --run`) |
|
|
229
|
-
|
|
230
|
-
**Scenario B: Only planning artifacts** (spec/plan exist, no code changes)
|
|
231
|
-
Session died during or after planning, before implementation started.
|
|
232
|
-
|
|
233
|
-
| Option | Description |
|
|
234
|
-
|--------|-------------|
|
|
235
|
-
| **(a) Start Implementation** (recommended) | Plan is ready, begin implementing |
|
|
236
|
-
| **(b) Re-plan** | Keep spec, regenerate plan (useful if plan was incomplete or poor) |
|
|
237
|
-
| **(c) Clean Restart** | Discard everything and start over |
|
|
138
|
+
- If failures exist — which tests and why
|
|
238
139
|
|
|
239
|
-
|
|
240
|
-
Unusual — might be manual work or artifacts were cleaned.
|
|
140
|
+
### 1.3 Ask User to Confirm
|
|
241
141
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
| **(b) Clean Restart** | Discard and restart |
|
|
246
|
-
|
|
247
|
-
**Scenario D: Already committed** (feature branch has commits ahead of main)
|
|
248
|
-
Session completed implementation but didn't finish post-commit steps.
|
|
249
|
-
|
|
250
|
-
| Option | Description |
|
|
251
|
-
|--------|-------------|
|
|
252
|
-
| **(a) Complete Post-commit** (recommended) | Run code review, retrospective, handle merge |
|
|
253
|
-
| **(b) Clean Restart** | Discard and restart |
|
|
254
|
-
|
|
255
|
-
**Scenario E: No state found** (no branch, no artifacts, no code)
|
|
256
|
-
Feature was never executed or was fully cleaned.
|
|
257
|
-
|
|
258
|
-
| Option | Description |
|
|
259
|
-
|--------|-------------|
|
|
260
|
-
| **(a) Run from Scratch** | Suggest using `dev-pipeline-launcher` (Intent E) or `retry-feature.sh` instead |
|
|
142
|
+
```
|
|
143
|
+
Ready to resume from Phase 5 (Review). Continue?
|
|
144
|
+
```
|
|
261
145
|
|
|
262
|
-
|
|
146
|
+
If the user declines, suggest alternatives:
|
|
147
|
+
- "Use `/bug-fix-workflow` to start fresh"
|
|
148
|
+
- "Use `/feature-workflow` to start fresh"
|
|
149
|
+
- "Use `/refactor-workflow` to start fresh"
|
|
263
150
|
|
|
264
|
-
**CHECKPOINT CP-RW-1**: User confirmed recovery
|
|
151
|
+
**CHECKPOINT CP-RW-1**: User confirmed recovery.
|
|
265
152
|
|
|
266
153
|
---
|
|
267
154
|
|
|
268
|
-
## Phase
|
|
269
|
-
|
|
270
|
-
**Goal**: Execute the remaining phases based on the user's chosen strategy.
|
|
155
|
+
## Phase 2: Execute Remaining Steps
|
|
271
156
|
|
|
272
|
-
|
|
157
|
+
**Goal**: Read the target workflow's SKILL.md and execute from the inferred phase.
|
|
273
158
|
|
|
274
|
-
|
|
159
|
+
### 2.0 Read Target Workflow
|
|
275
160
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
# If no feature branch but code changes are on current branch:
|
|
281
|
-
git checkout -b feat/{slug}
|
|
282
|
-
```
|
|
161
|
+
1. **Read the workflow's SKILL.md** from `core/skills/orchestration-skill/workflows/{workflow-type}/SKILL.md`
|
|
162
|
+
2. **Read existing artifacts** to restore context (spec, plan, code diffs, bug descriptions, etc.)
|
|
163
|
+
3. **Read relevant `.prizm-docs/`** — load project context (L0 root, relevant L1)
|
|
283
164
|
|
|
284
|
-
|
|
165
|
+
This step replaces the context that was lost when the AI session was interrupted.
|
|
285
166
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
1. **Read spec.md** (if exists) — understand what this feature should do
|
|
289
|
-
2. **Read plan.md** (if exists) — understand the implementation plan and task breakdown
|
|
290
|
-
3. **Scan code changes** — `git diff main --stat` to understand what was already done
|
|
291
|
-
4. **Read relevant `.prizm-docs/`** — load project context (L0 root, relevant L1)
|
|
292
|
-
|
|
293
|
-
This step replaces the Phase 0-2 that the pipeline would have done (project bootstrap, context building, planning). The artifacts serve as memory of the interrupted session.
|
|
294
|
-
|
|
295
|
-
### 3.2 Fix Existing Test Failures (if any)
|
|
167
|
+
---
|
|
296
168
|
|
|
297
|
-
|
|
169
|
+
### 2.1 Bug-Fix-Workflow Recovery
|
|
298
170
|
|
|
299
|
-
|
|
300
|
-
2. Read the relevant source files
|
|
301
|
-
3. Apply minimal fixes to make tests pass
|
|
302
|
-
4. Verify: run test suite → all green
|
|
171
|
+
Phase inference table:
|
|
303
172
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
-
|
|
173
|
+
| Detected State | Resume From | Actions |
|
|
174
|
+
|---------------|------------|---------|
|
|
175
|
+
| On `fix/<BUG_ID>-*` branch, no artifacts | Phase 1: Deep Bug Diagnosis | Read bug description from `bug-fix-list.json`. Start interactive diagnosis Q&A |
|
|
176
|
+
| `fix-plan.md` exists, no code changes | Phase 4: Fix | Read fix-plan.md. Implement the fix following the plan |
|
|
177
|
+
| `fix-plan.md` + code changes exist | Phase 5: Review | Invoke `/prizmkit-code-review` on all changes |
|
|
178
|
+
| All docs + review passed | Phase 6: User Verification | Ask user to verify the fix works |
|
|
179
|
+
| All docs + committed | Phase 7: Merge Decision | Ask merge vs keep branch |
|
|
308
180
|
|
|
309
|
-
|
|
181
|
+
**Execution for each remaining phase**: Follow the bug-fix-workflow SKILL.md instructions exactly. Call the same prizmkit sub-commands (`/prizmkit-code-review`, `/prizmkit-committer`) at the same points.
|
|
310
182
|
|
|
311
|
-
|
|
183
|
+
**Special handling**:
|
|
184
|
+
- 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.
|
|
185
|
+
- If resuming from Phase 4 (Fix), read fix-plan.md to understand the planned approach before writing code.
|
|
312
186
|
|
|
313
|
-
|
|
314
|
-
2. **For each remaining task**:
|
|
315
|
-
- Read the task description from plan.md
|
|
316
|
-
- Implement the change following the same approach as `/prizmkit-implement`
|
|
317
|
-
- Run full test suite after each task
|
|
318
|
-
- Mark task as complete `[x]` in plan.md
|
|
319
|
-
3. After all tasks complete → full test suite must pass
|
|
187
|
+
---
|
|
320
188
|
|
|
321
|
-
|
|
189
|
+
### 2.2 Feature-Workflow Recovery
|
|
322
190
|
|
|
323
|
-
|
|
191
|
+
Phase inference table:
|
|
324
192
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
193
|
+
| Detected State | Resume From | Actions |
|
|
194
|
+
|---------------|------------|---------|
|
|
195
|
+
| No `feature-list.json` | Phase 1: Brainstorm | Cannot recover conversation context. Start requirement clarification, but leverage any workspace content (README, existing code) for context |
|
|
196
|
+
| `feature-list.json` exists, no pipeline state | Phase 3: Launch | Invoke `feature-pipeline-launcher` to start the pipeline |
|
|
197
|
+
| `feature-list.json` + pipeline state exists | Phase 4: Monitor | Check pipeline status via `feature-pipeline-launcher` (Intent B: Check Status) |
|
|
329
198
|
|
|
330
|
-
|
|
199
|
+
**Note**: Feature-workflow recovery is simpler because Phases 3-4 are pipeline-driven. The main recovery value is avoiding re-brainstorming (Phase 1) when `feature-list.json` already exists.
|
|
331
200
|
|
|
332
|
-
|
|
333
|
-
- **(a) Run the app** → suggest and start the dev server
|
|
334
|
-
- **(b) Run a specific command** → execute what the user specifies
|
|
335
|
-
- **(c) Skip** → proceed directly to commit
|
|
201
|
+
---
|
|
336
202
|
|
|
337
|
-
|
|
203
|
+
### 2.3 Refactor-Workflow Recovery
|
|
338
204
|
|
|
339
|
-
|
|
205
|
+
Phase inference table (mirrors feature-workflow):
|
|
340
206
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
--feature-list feature-list.json \
|
|
347
|
-
--state-dir dev-pipeline/state \
|
|
348
|
-
--feature-id <FEATURE_ID> \
|
|
349
|
-
--action complete
|
|
350
|
-
```
|
|
207
|
+
| Detected State | Resume From | Actions |
|
|
208
|
+
|---------------|------------|---------|
|
|
209
|
+
| No `refactor-list.json` | Phase 1: Brainstorm | Start refactoring goal clarification |
|
|
210
|
+
| `refactor-list.json` exists, no pipeline state | Phase 3: Launch | Invoke `refactor-pipeline-launcher` to start the pipeline |
|
|
211
|
+
| `refactor-list.json` + pipeline state exists | Phase 4: Monitor | Check pipeline status |
|
|
351
212
|
|
|
352
|
-
|
|
213
|
+
---
|
|
353
214
|
|
|
354
|
-
|
|
355
|
-
- (a) Merge to main and delete feature branch
|
|
356
|
-
- (b) Keep feature branch for PR review
|
|
357
|
-
- (c) Decide later
|
|
215
|
+
### 2.4 Post-Recovery Report
|
|
358
216
|
|
|
359
|
-
|
|
360
|
-
```
|
|
361
|
-
Recovery complete: F-007 — User Authentication
|
|
217
|
+
After all remaining phases complete, output a summary:
|
|
362
218
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
Work preserved: spec.md, plan.md, 3 completed tasks
|
|
219
|
+
```
|
|
220
|
+
Recovery complete.
|
|
366
221
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
222
|
+
Workflow: bug-fix-workflow
|
|
223
|
+
Recovered from: Phase 5 (Review)
|
|
224
|
+
Completed: code review → user verification → commit & merge
|
|
225
|
+
Preserved: fix-plan.md, 4 code files, 1 test file
|
|
370
226
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
227
|
+
Next steps:
|
|
228
|
+
• Check for other interrupted workflows
|
|
229
|
+
• Or start a new workflow
|
|
230
|
+
```
|
|
374
231
|
|
|
375
|
-
**CHECKPOINT CP-RW-2**:
|
|
232
|
+
**CHECKPOINT CP-RW-2**: Workflow recovered and completed.
|
|
376
233
|
|
|
377
234
|
---
|
|
378
235
|
|
|
@@ -380,14 +237,12 @@ If user reports issues: return to 3.3 (max 2 additional rounds).
|
|
|
380
237
|
|
|
381
238
|
| Scenario | Action |
|
|
382
239
|
|----------|--------|
|
|
383
|
-
|
|
|
384
|
-
|
|
|
385
|
-
|
|
|
386
|
-
|
|
|
387
|
-
|
|
|
388
|
-
|
|
|
389
|
-
| Pipeline state file inconsistent with git | Trust git and filesystem over status.json — git is the ground truth |
|
|
390
|
-
| detection script fails | Fall back to manual detection (Phase 1 checks can be done individually via bash) |
|
|
240
|
+
| No workflow signature matches | Show guidance message, suggest original workflow skills |
|
|
241
|
+
| Branch exists but artifacts are inconsistent | Trust git as ground truth, report discrepancy in detection report |
|
|
242
|
+
| Test failures in existing code | Report in detection summary; user decides whether to continue |
|
|
243
|
+
| Multiple workflows could match (e.g., on main but both feature-list.json and bug-fix artifacts exist) | Pick highest priority (bug-fix > refactor > feature), mention others in report |
|
|
244
|
+
| Detection script fails | Fall back to manual detection (run individual git/file checks in bash) |
|
|
245
|
+
| Bug ID not found in bug-fix-list.json | Continue with branch-only context; note that full bug description is unavailable |
|
|
391
246
|
|
|
392
247
|
---
|
|
393
248
|
|
|
@@ -395,34 +250,29 @@ If user reports issues: return to 3.3 (max 2 additional rounds).
|
|
|
395
250
|
|
|
396
251
|
| Skill | Relationship |
|
|
397
252
|
|-------|-------------|
|
|
398
|
-
| `
|
|
399
|
-
| `
|
|
400
|
-
| `
|
|
401
|
-
|
|
|
402
|
-
|
|
|
403
|
-
|
|
|
404
|
-
| `/prizmkit-
|
|
405
|
-
|
|
|
253
|
+
| `feature-workflow` | **Recovery target** — this skill can resume interrupted feature-workflow sessions |
|
|
254
|
+
| `bug-fix-workflow` | **Recovery target** — this skill can resume interrupted bug-fix-workflow sessions |
|
|
255
|
+
| `refactor-workflow` | **Recovery target** — this skill can resume interrupted refactor-workflow sessions |
|
|
256
|
+
| `feature-pipeline-launcher` | **Called in Phase 2.2** — launches or checks pipeline status for feature recovery |
|
|
257
|
+
| `retry-feature.sh` | **Alternative** — full clean retry for pipeline failures; this skill is the smart interactive alternative |
|
|
258
|
+
| `retry-bugfix.sh` | **Alternative** — full clean retry for bugfix pipeline failures |
|
|
259
|
+
| `/prizmkit-code-review` | **Called in Phase 2.1** — reviews recovered bug-fix code |
|
|
260
|
+
| `/prizmkit-committer` | **Called in Phase 2.1** — commits the recovered result |
|
|
406
261
|
|
|
407
262
|
---
|
|
408
263
|
|
|
409
|
-
## Comparison with
|
|
264
|
+
## Comparison with Previous Version
|
|
410
265
|
|
|
411
|
-
| Dimension |
|
|
412
|
-
|
|
413
|
-
|
|
|
414
|
-
|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
| Execution mode | Interactive (in-session) | Spawns new session | Spawns new session | Spawns new session |
|
|
419
|
-
| Token efficiency | High (skips done work) | Low (redo all) | Low (redo all) | Medium |
|
|
420
|
-
| Context continuity | Full (reads existing artifacts) | None (fresh AI session) | None | Partial |
|
|
266
|
+
| Dimension | Previous | Current |
|
|
267
|
+
|-----------|----------|---------|
|
|
268
|
+
| Scope | Feature pipeline only | All 3 interactive workflows |
|
|
269
|
+
| Input | Required `F-XXX` feature ID | No input — fully auto-detect |
|
|
270
|
+
| Detection | Feature-specific (spec/plan/git) | Signature-based (branch + artifacts) |
|
|
271
|
+
| Strategy | Multi-option (5 scenarios × 2-4 options each) | Single path: report → confirm → execute |
|
|
272
|
+
| Intrusion | None | None (zero changes to target workflows) |
|
|
421
273
|
|
|
422
274
|
## Output
|
|
423
275
|
|
|
424
|
-
-
|
|
425
|
-
-
|
|
426
|
-
-
|
|
427
|
-
- Updated `.prizm-docs/` (via retrospective)
|
|
428
|
-
- Recovery summary showing what was salvaged vs what was re-done
|
|
276
|
+
- Resumed and completed workflow from the breakpoint
|
|
277
|
+
- Same outputs as the original workflow would produce (commits, artifacts, state updates)
|
|
278
|
+
- Recovery summary showing what was preserved vs what was re-done
|