prizmkit 1.0.108 → 1.0.110
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/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +7 -6
- package/bundled/skills/bug-fix-workflow/SKILL.md +115 -12
- package/bundled/skills/bug-planner/SKILL.md +4 -5
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +60 -20
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +11 -14
- package/bundled/skills/feature-workflow/SKILL.md +38 -21
- package/bundled/skills/refactor-workflow/SKILL.md +78 -22
- package/package.json +1 -1
package/bundled/VERSION.json
CHANGED
|
@@ -14,10 +14,10 @@ Always produce a validated `feature-list.json` that conforms to `dev-pipeline-fe
|
|
|
14
14
|
## When to Use
|
|
15
15
|
|
|
16
16
|
Trigger this skill for requests like:
|
|
17
|
-
- "Plan an app", "Design a project", "
|
|
18
|
-
- "Add features to existing system", "Continue planning"
|
|
17
|
+
- "Plan an app", "Design a project", "Design a new application"
|
|
18
|
+
- "Add features to existing system", "Continue planning"
|
|
19
19
|
- "Prepare feature-list.json", "Prepare dev-pipeline input"
|
|
20
|
-
- "Reprioritize features", "Split features"
|
|
20
|
+
- "Reprioritize features", "Split features"
|
|
21
21
|
|
|
22
22
|
Do NOT use this skill when:
|
|
23
23
|
- user only wants to run pipeline now (invoke `dev-pipeline-launcher`)
|
|
@@ -376,9 +376,10 @@ When the session appears to be ending (user says "thanks", "that's all", "bye",
|
|
|
376
376
|
1. **Remind**: "You set out to produce `feature-list.json` but we haven't completed it yet."
|
|
377
377
|
2. **Offer 3 options**:
|
|
378
378
|
- **(a) Continue to completion** — resume from current phase
|
|
379
|
-
- **(b)
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
- **(b) Save draft & exit** — write current progress as draft, exit session
|
|
380
|
+
- **(c) Abandon** — exit without saving
|
|
381
|
+
3. **If (b)**: Write the draft file and remind user: "This is a draft, not validated. Run `/app-planner` again to resume and finalize."
|
|
382
|
+
4. **If (c)**: Accept without further prompting.
|
|
382
383
|
|
|
383
384
|
|
|
384
385
|
## Handoff Message Template
|
|
@@ -23,14 +23,62 @@ Fix a single bug interactively within the current AI CLI session. This is the in
|
|
|
23
23
|
|
|
24
24
|
## Input
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
26
|
+
**PRECONDITION:**
|
|
27
|
+
|
|
28
|
+
| Input Source | Detection | Example |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| Bug-fix-list.json entry | User says "fix B-001" → read entry from `bug-fix-list.json` | `fix B-001` |
|
|
31
|
+
| Stack trace / error message | User pastes error directly | `TypeError: Cannot read property...` |
|
|
32
|
+
| Natural language description | User describes the problem | "login page crashes on submit" |
|
|
33
|
+
| Failed test | User references a failing test file | `src/auth/__tests__/login.test.ts` |
|
|
34
|
+
|
|
35
|
+
At least one input source must be provided. If none is clear, ask the user to describe the bug.
|
|
36
|
+
|
|
37
|
+
## Fast Path
|
|
38
|
+
|
|
39
|
+
For trivial bugs with clear root cause and minimal scope:
|
|
40
|
+
|
|
41
|
+
### Eligibility Criteria (ALL must be true)
|
|
42
|
+
- Root cause is immediately obvious (typo, missing null check, wrong variable name, off-by-one)
|
|
43
|
+
- Fix is ≤10 lines of code in a single file
|
|
44
|
+
- No cross-module impact
|
|
45
|
+
- Existing tests cover the affected path (or bug is in untested utility)
|
|
46
|
+
- No data model or API changes
|
|
47
|
+
|
|
48
|
+
### Fast Path Workflow
|
|
49
|
+
1. Branch Setup → `fix/<BUG_ID>-<short-desc>`
|
|
50
|
+
2. Write reproduction test → confirm failing
|
|
51
|
+
3. Apply fix → confirm test passes + full suite green
|
|
52
|
+
4. Ask user: "Quick fix applied. Verify before commit? (Y/skip)"
|
|
53
|
+
5. Commit with `fix(<scope>):` prefix
|
|
54
|
+
6. Ask merge preference
|
|
55
|
+
|
|
56
|
+
**Fast Path still requires**: fix branch, reproduction test, full test suite pass, user merge decision.
|
|
57
|
+
|
|
58
|
+
---
|
|
31
59
|
|
|
32
60
|
## Execution
|
|
33
61
|
|
|
62
|
+
### Phase 0: Branch Setup
|
|
63
|
+
|
|
64
|
+
**Goal**: Create an isolated working branch to keep main clean.
|
|
65
|
+
|
|
66
|
+
1. **Check current branch**:
|
|
67
|
+
```bash
|
|
68
|
+
git branch --show-current
|
|
69
|
+
```
|
|
70
|
+
2. **If on `main` or a shared branch**: Create and switch to fix branch:
|
|
71
|
+
```bash
|
|
72
|
+
git checkout -b fix/<BUG_ID>-<short-description>
|
|
73
|
+
```
|
|
74
|
+
Example: `git checkout -b fix/B-001-login-null-crash`
|
|
75
|
+
3. **If already on a fix branch**: Confirm with user: "Continue on current branch `<branch-name>`, or create a new one?"
|
|
76
|
+
4. **Record the original branch name** for later merge.
|
|
77
|
+
|
|
78
|
+
**CHECKPOINT CP-BFW-0**: On a dedicated fix branch, not main/shared branch.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
34
82
|
### Phase 1: Triage
|
|
35
83
|
|
|
36
84
|
**Goal**: Understand the bug, locate affected code, classify severity.
|
|
@@ -108,23 +156,75 @@ If the fix causes test regressions:
|
|
|
108
156
|
Ready to commit.
|
|
109
157
|
```
|
|
110
158
|
|
|
111
|
-
### Phase 5:
|
|
159
|
+
### Phase 5: User Verification
|
|
112
160
|
|
|
113
|
-
**Goal**:
|
|
161
|
+
**Goal**: Let the user verify the fix works as expected before committing.
|
|
162
|
+
|
|
163
|
+
1. **Ask user**: "Fix passes all tests. Would you like to verify before committing?"
|
|
164
|
+
- **(a) Run the app** — Start the dev server so you can manually test the fix scenario
|
|
165
|
+
- **(b) Run a specific command** — Specify a test or script to run
|
|
166
|
+
- **(c) Skip verification** — Proceed directly to commit (automated tests already pass)
|
|
167
|
+
2. **If (a)**: Detect and suggest dev server command (e.g. `npm run dev`, `python manage.py runserver`), start it, wait for user confirmation: "Fix verified? (yes/no)"
|
|
168
|
+
3. **If (b)**: Run the specified command, show results, ask confirmation
|
|
169
|
+
4. **If (c)**: Proceed to Phase 6
|
|
170
|
+
|
|
171
|
+
If user reports the fix is NOT working:
|
|
172
|
+
- Return to Phase 3 (max 2 more attempts)
|
|
173
|
+
- If still failing: escalate with analysis
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### Phase 6: Commit & Merge
|
|
178
|
+
|
|
179
|
+
**Goal**: Commit the fix and offer to merge back to the original branch.
|
|
114
180
|
|
|
115
181
|
1. **Run `/prizmkit-committer`**:
|
|
116
182
|
- Commit message: `fix(<scope>): <description>`
|
|
117
183
|
- Include both fix code and reproduction test
|
|
118
184
|
- Do NOT push (user decides when to push)
|
|
119
|
-
- Do NOT run `/prizmkit-retrospective` — bug fixes do not update `.prizm-docs/`
|
|
185
|
+
- Do NOT run `/prizmkit-retrospective` — bug fixes do not update `.prizm-docs/`
|
|
120
186
|
- `/prizmkit-committer` is a pure commit tool — it does NOT modify `.prizm-docs/` or any project files
|
|
121
|
-
2. **
|
|
187
|
+
2. **Ask merge preference**:
|
|
188
|
+
```
|
|
189
|
+
Fix committed on branch `fix/<BUG_ID>-<short-desc>`.
|
|
190
|
+
What would you like to do?
|
|
191
|
+
(a) Merge to <original-branch> and delete fix branch
|
|
192
|
+
(b) Keep fix branch (for PR review workflow)
|
|
193
|
+
(c) Decide later
|
|
194
|
+
```
|
|
195
|
+
3. **If (a)**:
|
|
196
|
+
```bash
|
|
197
|
+
git checkout <original-branch>
|
|
198
|
+
git merge fix/<BUG_ID>-<short-description>
|
|
199
|
+
git branch -d fix/<BUG_ID>-<short-description>
|
|
200
|
+
```
|
|
201
|
+
4. **If (b)**: Inform user: "Branch `fix/<BUG_ID>-<short-desc>` retained. Create a PR when ready."
|
|
202
|
+
5. **If bug came from bug-fix-list.json**: inform user to update bug status
|
|
122
203
|
```
|
|
123
204
|
Bug B-001 fixed and committed.
|
|
124
205
|
To update the bug list: manually set B-001 status to "fixed" in bug-fix-list.json
|
|
125
206
|
Or retry the pipeline to pick up remaining bugs.
|
|
126
207
|
```
|
|
127
208
|
|
|
209
|
+
## Resume — Interruption Recovery
|
|
210
|
+
|
|
211
|
+
The workflow supports resuming from the last completed phase by detecting existing artifacts.
|
|
212
|
+
|
|
213
|
+
**Detection logic**: Check `.prizmkit/bugfix/<BUG_ID>/` and git branch state:
|
|
214
|
+
|
|
215
|
+
| Artifact Found | Resume From |
|
|
216
|
+
|---------------|------------|
|
|
217
|
+
| (nothing) | Phase 0: Branch Setup |
|
|
218
|
+
| On `fix/<BUG_ID>-*` branch, no artifacts | Phase 1: Triage |
|
|
219
|
+
| `fix-plan.md` only | Phase 3: Fix |
|
|
220
|
+
| `fix-plan.md` + code changes exist | Phase 4: Review |
|
|
221
|
+
| All docs + review passed | Phase 5: User Verification |
|
|
222
|
+
| All docs + committed | Phase 6: Merge decision |
|
|
223
|
+
|
|
224
|
+
**Resume**: If `<BUG_ID>` matches an existing `.prizmkit/bugfix/<BUG_ID>/` directory, resume instead of starting fresh.
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
128
228
|
## Artifacts
|
|
129
229
|
|
|
130
230
|
Bug fix artifacts are stored at `.prizmkit/bugfix/<BUG_ID>/`:
|
|
@@ -138,8 +238,10 @@ Only 2 artifact files per bug, consistent with the pipeline convention.
|
|
|
138
238
|
| Dimension | bug-fix-workflow (this skill) | bugfix-pipeline-launcher |
|
|
139
239
|
|-----------|-------------------------------|--------------------------|
|
|
140
240
|
| Scope | One bug at a time | All bugs in batch |
|
|
141
|
-
| Execution | Interactive, in-session |
|
|
241
|
+
| Execution | Interactive, in-session | Foreground or background daemon |
|
|
242
|
+
| Branch | Creates `fix/<BUG_ID>-*` branch | Pipeline manages branches |
|
|
142
243
|
| Visibility | Full user interaction at each phase | Async, check status periodically |
|
|
244
|
+
| User verification | Yes (Phase 5) | No (automated) |
|
|
143
245
|
| Best for | Complex bugs needing user input | Batch of well-defined bugs |
|
|
144
246
|
| Artifacts | Same (fix-plan.md + fix-report.md) | Same |
|
|
145
247
|
| Commit prefix | `fix(<scope>):` | `fix(<scope>):` |
|
|
@@ -153,6 +255,7 @@ Only 2 artifact files per bug, consistent with the pipeline convention.
|
|
|
153
255
|
| Fix causes regressions | Revert, analyze, retry (max 3 rounds) |
|
|
154
256
|
| Root cause unclear after investigation | Present findings, ask user for guidance |
|
|
155
257
|
| Affected files are in unfamiliar module | Read `.prizm-docs/` L1/L2 for that module first |
|
|
258
|
+
| Branch conflict during merge | Show conflict, ask user to resolve or keep branch |
|
|
156
259
|
|
|
157
260
|
## HANDOFF
|
|
158
261
|
|
|
@@ -161,11 +264,11 @@ Only 2 artifact files per bug, consistent with the pipeline convention.
|
|
|
161
264
|
| `bug-planner` | **this skill** | User picks one bug to fix interactively |
|
|
162
265
|
| `bugfix-pipeline-launcher` | **this skill** | User wants to fix a stuck/complex bug manually |
|
|
163
266
|
| **this skill** | `bugfix-pipeline-launcher` | After fixing, user wants to continue with remaining bugs |
|
|
164
|
-
| **this skill** | `prizmkit-committer` | Built into Phase
|
|
267
|
+
| **this skill** | `prizmkit-committer` | Built into Phase 6 (pure commit, no doc sync) |
|
|
165
268
|
|
|
166
269
|
## Output
|
|
167
270
|
|
|
168
271
|
- Fixed code with reproduction test
|
|
169
272
|
- `.prizmkit/bugfix/<BUG_ID>/fix-plan.md`
|
|
170
273
|
- `.prizmkit/bugfix/<BUG_ID>/fix-report.md`
|
|
171
|
-
- Git commit with `fix(<scope>):` prefix
|
|
274
|
+
- Git commit with `fix(<scope>):` prefix on dedicated fix branch
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "bug-planner"
|
|
3
3
|
tier: companion
|
|
4
|
-
description: "Interactive bug planning that produces bug-fix-list.json for the Bug Fix Pipeline. Supports multiple input formats: error logs, stack traces, user reports, failed tests, monitoring alerts. Use this skill whenever the user has bugs to report, errors to parse, or test failures to organize. Trigger on: 'plan bug fixes', 'report bugs', 'I have some bugs', 'these tests are failing', 'here is an error log', 'parse these errors', '
|
|
4
|
+
description: "Interactive bug planning that produces bug-fix-list.json for the Bug Fix Pipeline. Supports multiple input formats: error logs, stack traces, user reports, failed tests, monitoring alerts. Use this skill whenever the user has bugs to report, errors to parse, or test failures to organize. Trigger on: 'plan bug fixes', 'report bugs', 'I have some bugs', 'these tests are failing', 'here is an error log', 'parse these errors', 'generate bug list'. (project)"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Bug Planner
|
|
@@ -12,9 +12,8 @@ Interactive skill that collects bug information from various input formats and g
|
|
|
12
12
|
|
|
13
13
|
User says:
|
|
14
14
|
- "plan bug fixes", "report bugs", "create bug list"
|
|
15
|
-
- "
|
|
16
|
-
- "
|
|
17
|
-
- "here's an error log", "parse these errors"
|
|
15
|
+
- "generate bug list", "I have some bugs to fix"
|
|
16
|
+
- "these tests are failing", "here's an error log", "parse these errors"
|
|
18
17
|
- After receiving bug reports, error logs, or failed test output
|
|
19
18
|
|
|
20
19
|
**Do NOT use when:**
|
|
@@ -28,7 +27,7 @@ This skill handles multiple operations. Determine the user's intent and execute
|
|
|
28
27
|
|
|
29
28
|
| User Intent | Operation | Trigger Phrases |
|
|
30
29
|
|---|---|---|
|
|
31
|
-
| Plan bugs interactively | **Interactive Planning** | "plan bug fixes", "report bugs"
|
|
30
|
+
| Plan bugs interactively | **Interactive Planning** | "plan bug fixes", "report bugs" |
|
|
32
31
|
| Parse error logs into bugs | **From Log** | "parse this error log", "here's a stack trace", "parse these errors" |
|
|
33
32
|
| Parse test failures into bugs | **From Tests** | "these tests are failing", "parse test output" |
|
|
34
33
|
| Validate existing bug list | **Validate** | "validate bug list", "check bug-fix-list.json" |
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "bugfix-pipeline-launcher"
|
|
3
|
-
description: "Launch and manage the bugfix pipeline from within an AI CLI session. Start pipeline in background, monitor logs, check status, stop pipeline. Use this skill whenever the user wants to start fixing bugs, run the bugfix pipeline, check bugfix progress, or stop the bugfix pipeline. Trigger on: 'start fixing bugs', 'run bugfix pipeline', 'bugfix status', 'stop bug fix', 'launch bug fix', '
|
|
3
|
+
description: "Launch and manage the bugfix pipeline from within an AI CLI session. Start pipeline in background, monitor logs, check status, stop pipeline. Use this skill whenever the user wants to start fixing bugs, run the bugfix pipeline, check bugfix progress, or stop the bugfix pipeline. Trigger on: 'start fixing bugs', 'run bugfix pipeline', 'bugfix status', 'stop bug fix', 'launch bug fix', 'fix progress', 'stop fixing'. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Bugfix-Pipeline Launcher
|
|
7
7
|
|
|
8
|
-
Launch the autonomous bug fix pipeline from within an AI CLI conversation.
|
|
8
|
+
Launch the autonomous bug fix pipeline from within an AI CLI conversation. Supports foreground and background execution modes.
|
|
9
9
|
|
|
10
10
|
### Execution Mode
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**Default: Foreground mode** via `dev-pipeline/run-bugfix.sh run` — this provides visible output and direct error feedback. Use `launch-bugfix-daemon.sh` only when the user explicitly requests background execution.
|
|
13
|
+
|
|
14
|
+
Foreground `run-bugfix.sh` is preferred because:
|
|
15
|
+
- Immediate visibility of errors and progress
|
|
16
|
+
- No orphaned processes if something goes wrong
|
|
17
|
+
- Session summary artifacts are written reliably
|
|
18
|
+
|
|
19
|
+
Use daemon mode (`launch-bugfix-daemon.sh`) only when:
|
|
20
|
+
- User explicitly requests background/detached execution
|
|
21
|
+
- Pipeline must survive AI CLI session closure
|
|
22
|
+
|
|
23
|
+
**Background mode documentation**: When the user chooses background/daemon mode, record the choice and PID in `.prizmkit/bugfix-pipeline-run.log` (append-only) with timestamp, so the decision is traceable:
|
|
24
|
+
```
|
|
25
|
+
[2026-03-26T10:30:00] MODE=daemon PID=12345 BUG_LIST=bug-fix-list.json BUGS=3
|
|
26
|
+
```
|
|
13
27
|
|
|
14
28
|
### When to Use
|
|
15
29
|
|
|
16
30
|
**Start bugfix pipeline** -- User says:
|
|
17
31
|
- "start fixing bugs", "run bugfix pipeline", "launch bug fixes", "fix all bugs"
|
|
18
|
-
- "start bug fix", "
|
|
19
|
-
- "launch bug fix", "start fixing bugs", "run bug fix pipeline", "start fixing bugs"
|
|
20
|
-
- "fix all bugs", "batch fix", "launch fix pipeline"
|
|
32
|
+
- "start bug fix", "execute bug list", "begin fixing", "batch fix"
|
|
21
33
|
- After bug-planner completes: "fix them", "start fixing"
|
|
22
34
|
|
|
23
35
|
**Check status** -- User says:
|
|
@@ -25,12 +37,11 @@ Always use daemon mode via `dev-pipeline/launch-bugfix-daemon.sh` for start/stop
|
|
|
25
37
|
- "fix progress", "bug fix status", "check fix progress", "how far along are the fixes"
|
|
26
38
|
|
|
27
39
|
**Stop bugfix pipeline** -- User says:
|
|
28
|
-
- "stop bug fix", "stop fixing", "halt bugfix", "pause bug fix"
|
|
29
|
-
- "stop fixing", "pause bug fix", "stop fix pipeline"
|
|
40
|
+
- "stop bug fix", "stop fixing", "halt bugfix", "pause bug fix", "stop fix pipeline"
|
|
30
41
|
|
|
31
42
|
**Show logs** -- User says:
|
|
32
43
|
- "bugfix logs", "show fix logs", "what's being fixed"
|
|
33
|
-
- "view fix logs", "fix logs"
|
|
44
|
+
- "view fix logs", "fix logs"
|
|
34
45
|
|
|
35
46
|
**Do NOT use this skill when:**
|
|
36
47
|
- User wants to plan/collect bugs (use `bug-planner` instead)
|
|
@@ -41,7 +52,7 @@ Always use daemon mode via `dev-pipeline/launch-bugfix-daemon.sh` for start/stop
|
|
|
41
52
|
|
|
42
53
|
Before any action, validate:
|
|
43
54
|
|
|
44
|
-
1. **bugfix pipeline exists**: Confirm `dev-pipeline/launch-bugfix-daemon.sh`
|
|
55
|
+
1. **bugfix pipeline exists**: Confirm `dev-pipeline/launch-bugfix-daemon.sh` and `dev-pipeline/run-bugfix.sh` are present and executable
|
|
45
56
|
2. **For start**: `bug-fix-list.json` must exist in project root (or user-specified path)
|
|
46
57
|
3. **Dependencies**: `jq`, `python3`, AI CLI (`cbc` or `claude`) must be in PATH
|
|
47
58
|
|
|
@@ -100,33 +111,61 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
100
111
|
--action status 2>/dev/null
|
|
101
112
|
```
|
|
102
113
|
|
|
103
|
-
4. **Ask
|
|
114
|
+
4. **Ask execution mode**: Present the user with a choice before launching:
|
|
115
|
+
- **(1) Foreground in session (recommended)**: Pipeline runs in the current session via `run-bugfix.sh run`. Visible output and direct error feedback.
|
|
116
|
+
- **(2) Background daemon**: Pipeline runs fully detached via `launch-bugfix-daemon.sh`. Survives session closure. Use only when user explicitly requests background execution.
|
|
117
|
+
- **(3) Manual — show commands**: Display the exact commands the user can run themselves. No execution.
|
|
118
|
+
|
|
119
|
+
Default to option 1 if user says "just run it" or doesn't specify. Default to option 2 only if user explicitly says "background", "detached", or "run in background".
|
|
120
|
+
|
|
121
|
+
**If option 1 (foreground)**:
|
|
122
|
+
```bash
|
|
123
|
+
dev-pipeline/run-bugfix.sh run bug-fix-list.json
|
|
124
|
+
```
|
|
104
125
|
|
|
105
|
-
|
|
126
|
+
**If option 2 (background)**:
|
|
106
127
|
```bash
|
|
107
128
|
dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json
|
|
108
129
|
```
|
|
109
|
-
|
|
130
|
+
After launch, **record the decision** for traceability:
|
|
110
131
|
```bash
|
|
111
|
-
dev-pipeline/
|
|
132
|
+
echo "[$(date -u +%Y-%m-%dT%H:%M:%S)] MODE=daemon PID=$(cat dev-pipeline/bugfix-state/daemon.pid 2>/dev/null) BUG_LIST=bug-fix-list.json BUGS=$(python3 -c "import json; print(len(json.load(open('bug-fix-list.json')).get('bugs',[])))")" >> .prizmkit/bugfix-pipeline-run.log
|
|
112
133
|
```
|
|
134
|
+
Note: Pipeline runs fully detached. Survives session closure.
|
|
135
|
+
|
|
136
|
+
**If option 3 (manual)**: Print commands and stop. Do not execute anything.
|
|
137
|
+
```
|
|
138
|
+
# To run in foreground (recommended):
|
|
139
|
+
dev-pipeline/run-bugfix.sh run bug-fix-list.json
|
|
140
|
+
|
|
141
|
+
# To run in background (detached):
|
|
142
|
+
dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json
|
|
143
|
+
|
|
144
|
+
# To check status:
|
|
145
|
+
dev-pipeline/run-bugfix.sh status bug-fix-list.json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
5. **Ask user to confirm**: "Ready to launch the bugfix pipeline? It will process N bugs (by severity order)."
|
|
149
|
+
|
|
150
|
+
6. **Launch** (based on chosen mode — see step 4).
|
|
113
151
|
|
|
114
|
-
|
|
152
|
+
7. **Verify launch**:
|
|
115
153
|
```bash
|
|
116
154
|
dev-pipeline/launch-bugfix-daemon.sh status
|
|
117
155
|
```
|
|
118
156
|
|
|
119
|
-
|
|
157
|
+
8. **Start log monitoring** (daemon mode only) -- Use the Bash tool with `run_in_background: true`:
|
|
120
158
|
```bash
|
|
121
159
|
tail -f dev-pipeline/bugfix-state/pipeline-daemon.log
|
|
122
160
|
```
|
|
123
161
|
This runs in background so you can continue interacting with the user.
|
|
124
162
|
|
|
125
|
-
|
|
126
|
-
-
|
|
163
|
+
9. **Report to user**:
|
|
164
|
+
- Execution mode chosen
|
|
165
|
+
- Pipeline PID (daemon mode) or session status (foreground)
|
|
127
166
|
- Log file location
|
|
128
167
|
- "You can ask me 'bugfix status' or 'show fix logs' at any time"
|
|
129
|
-
- "Closing this session will NOT stop the pipeline"
|
|
168
|
+
- (daemon mode only) "Closing this session will NOT stop the pipeline"
|
|
130
169
|
|
|
131
170
|
---
|
|
132
171
|
|
|
@@ -246,9 +285,10 @@ SESSION_TIMEOUT=3600 dev-pipeline/retry-bug.sh B-001 bug-fix-list.json
|
|
|
246
285
|
### Integration Notes
|
|
247
286
|
|
|
248
287
|
- **After bug-planner**: This is the natural next step. When user finishes bug planning and has `bug-fix-list.json`, suggest launching the bugfix pipeline.
|
|
249
|
-
- **Session independence**:
|
|
288
|
+
- **Session independence**: In daemon mode, the bugfix pipeline runs completely detached. User can close the AI CLI, open a new session later, and use this skill to check progress or stop the pipeline.
|
|
250
289
|
- **Single instance**: Only one bugfix pipeline can run at a time. The PID file prevents duplicates.
|
|
251
290
|
- **Feature pipeline coexistence**: Bugfix and feature pipelines use separate state directories (`bugfix-state/` vs `state/`), so they can run simultaneously without conflict.
|
|
252
291
|
- **State preservation**: Stopping and restarting the bugfix pipeline resumes from where it left off -- completed bugs are not re-fixed.
|
|
253
292
|
- **Bug ordering**: Bugs are processed by severity (critical → high → medium → low), then by priority number within the same severity.
|
|
293
|
+
- **Background mode traceability**: When daemon mode is chosen, the decision is logged to `.prizmkit/bugfix-pipeline-run.log` with timestamp, PID, and bug count for auditability.
|
|
254
294
|
- **HANDOFF**: After pipeline completes all bugs, suggest running `prizmkit-retrospective` to capture lessons learned, or checking the fix reports in `.prizmkit/bugfix/`.
|
|
@@ -25,14 +25,13 @@ Use daemon mode (`launch-daemon.sh`) only when:
|
|
|
25
25
|
**Start pipeline** -- User says:
|
|
26
26
|
- "run pipeline", "start pipeline", "start building", "launch dev-pipeline"
|
|
27
27
|
- "run the features", "execute feature list", "start implementing"
|
|
28
|
-
- "launch pipeline", "
|
|
29
|
-
- "implement next steps", "execute feature list", "start building"
|
|
28
|
+
- "launch pipeline", "run the pipeline", "start auto-development"
|
|
30
29
|
- After app-planner completes: "build it", "start developing from the feature list"
|
|
31
30
|
- "run only F-001 to F-005", "run features F-001,F-003", "only build these features"
|
|
32
31
|
|
|
33
32
|
**Check status** -- User says:
|
|
34
33
|
- "pipeline status", "check pipeline", "how's it going", "progress"
|
|
35
|
-
- "
|
|
34
|
+
- "check progress", "what's the current situation"
|
|
36
35
|
|
|
37
36
|
**Stop pipeline** -- User says:
|
|
38
37
|
- "stop pipeline", "kill pipeline", "halt", "pause"
|
|
@@ -40,11 +39,10 @@ Use daemon mode (`launch-daemon.sh`) only when:
|
|
|
40
39
|
|
|
41
40
|
**Show logs** -- User says:
|
|
42
41
|
- "show logs", "pipeline logs", "tail logs", "what's happening"
|
|
43
|
-
- "view logs", "
|
|
42
|
+
- "view logs", "check the logs"
|
|
44
43
|
|
|
45
44
|
**Retry single feature node** -- User says:
|
|
46
|
-
- "retry F-003", "retry this feature", "retry this node"
|
|
47
|
-
- "retry F-003", "retry this node", "re-run this feature"
|
|
45
|
+
- "retry F-003", "retry this feature", "retry this node", "re-run this feature"
|
|
48
46
|
|
|
49
47
|
**Do NOT use this skill when:**
|
|
50
48
|
- User wants to plan features (use `app-planner` instead)
|
|
@@ -148,14 +146,13 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
148
146
|
|
|
149
147
|
5. **Ask user to confirm**: "Ready to launch the pipeline? It will process N features."
|
|
150
148
|
|
|
151
|
-
6. **Launch
|
|
152
|
-
|
|
153
|
-
dev-pipeline/launch-daemon.sh start feature-list.json
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
```
|
|
149
|
+
6. **Launch** (based on chosen mode from step 4):
|
|
150
|
+
- Foreground: `dev-pipeline/run.sh run feature-list.json`
|
|
151
|
+
- Background: `dev-pipeline/launch-daemon.sh start feature-list.json`
|
|
152
|
+
- If user specified environment overrides:
|
|
153
|
+
```bash
|
|
154
|
+
dev-pipeline/launch-daemon.sh start feature-list.json --env "SESSION_TIMEOUT=7200 MAX_RETRIES=5"
|
|
155
|
+
```
|
|
159
156
|
|
|
160
157
|
7. **Verify launch**:
|
|
161
158
|
```bash
|
|
@@ -32,7 +32,7 @@ feature-workflow <requirements description>
|
|
|
32
32
|
│
|
|
33
33
|
├── Phase 1: Plan → app-planner → feature-list.json
|
|
34
34
|
│
|
|
35
|
-
├── Phase 2: Launch → dev-pipeline-launcher →
|
|
35
|
+
├── Phase 2: Launch → dev-pipeline-launcher → pipeline execution
|
|
36
36
|
│
|
|
37
37
|
└── Phase 3: Monitor → track progress → report results
|
|
38
38
|
```
|
|
@@ -42,7 +42,7 @@ feature-workflow <requirements description>
|
|
|
42
42
|
| Phase | Action | Result |
|
|
43
43
|
|-------|--------|--------|
|
|
44
44
|
| 1 | Call `app-planner` | `feature-list.json` with N features |
|
|
45
|
-
| 2 | Call `dev-pipeline-launcher` |
|
|
45
|
+
| 2 | Call `dev-pipeline-launcher` | Pipeline started (execution mode chosen by user via launcher) |
|
|
46
46
|
| 3 | Monitor progress | Status updates, completion report |
|
|
47
47
|
|
|
48
48
|
### Why This Skill Exists
|
|
@@ -56,6 +56,13 @@ With this skill, users can:
|
|
|
56
56
|
1. Say "Build a task management App" and walk away
|
|
57
57
|
2. All planning + execution happens automatically
|
|
58
58
|
|
|
59
|
+
### Branch Management
|
|
60
|
+
|
|
61
|
+
The dev-pipeline handles branch management per-feature automatically:
|
|
62
|
+
- Each feature is implemented on its own branch by the pipeline
|
|
63
|
+
- Branches are created, committed, and managed by the pipeline session
|
|
64
|
+
- This workflow does NOT create a top-level branch — the pipeline manages granular per-feature branches
|
|
65
|
+
|
|
59
66
|
---
|
|
60
67
|
|
|
61
68
|
## Input Modes
|
|
@@ -112,7 +119,7 @@ When user says "add features to existing project" or the project already has fea
|
|
|
112
119
|
|
|
113
120
|
## Phase 2: Launch
|
|
114
121
|
|
|
115
|
-
**Goal**: Start the
|
|
122
|
+
**Goal**: Start the development pipeline.
|
|
116
123
|
|
|
117
124
|
**STEPS**:
|
|
118
125
|
|
|
@@ -123,27 +130,20 @@ When user says "add features to existing project" or the project already has fea
|
|
|
123
130
|
F-002: Task CRUD (medium complexity)
|
|
124
131
|
F-003: Task categories (low complexity)
|
|
125
132
|
|
|
126
|
-
Pipeline will run in background. Close this session will NOT stop it.
|
|
127
133
|
Proceed? (Y/n)
|
|
128
134
|
```
|
|
129
135
|
|
|
130
|
-
2. **
|
|
131
|
-
- **(1) Background daemon (recommended)**: Runs detached, survives session closure.
|
|
132
|
-
- **(2) Foreground in session**: Runs in current session with visible output. Stops if session times out.
|
|
133
|
-
- **(3) Manual — show commands**: Display commands only, no execution.
|
|
134
|
-
|
|
135
|
-
Pass the chosen mode to `dev-pipeline-launcher`.
|
|
136
|
-
|
|
137
|
-
3. **Invoke `dev-pipeline-launcher` skill**:
|
|
136
|
+
2. **Invoke `dev-pipeline-launcher` skill**:
|
|
138
137
|
- The launcher handles all prerequisites checks
|
|
139
|
-
-
|
|
140
|
-
-
|
|
138
|
+
- The launcher presents execution mode choices to the user (foreground/background/manual)
|
|
139
|
+
- Do NOT duplicate execution mode selection here — let the launcher handle it
|
|
140
|
+
- Returns PID/status and log file location
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
3. **Verify launch success**:
|
|
143
143
|
- Confirm pipeline is running
|
|
144
144
|
- Record PID and log path for Phase 3
|
|
145
145
|
|
|
146
|
-
**CHECKPOINT CP-FW-2**: Pipeline launched successfully
|
|
146
|
+
**CHECKPOINT CP-FW-2**: Pipeline launched successfully.
|
|
147
147
|
|
|
148
148
|
---
|
|
149
149
|
|
|
@@ -173,7 +173,7 @@ When user says "add features to existing project" or the project already has fea
|
|
|
173
173
|
|
|
174
174
|
4. **Completion report** (when pipeline finishes all features):
|
|
175
175
|
```
|
|
176
|
-
|
|
176
|
+
Pipeline completed: 3/3 features
|
|
177
177
|
|
|
178
178
|
Summary:
|
|
179
179
|
- F-001: User authentication → COMMITTED (feat: user auth)
|
|
@@ -190,9 +190,24 @@ When user says "add features to existing project" or the project already has fea
|
|
|
190
190
|
|
|
191
191
|
---
|
|
192
192
|
|
|
193
|
+
## Resume — Interruption Recovery
|
|
194
|
+
|
|
195
|
+
The workflow supports resuming by detecting existing state:
|
|
196
|
+
|
|
197
|
+
| State Found | Resume From |
|
|
198
|
+
|-------------|------------|
|
|
199
|
+
| No `feature-list.json` | Phase 1: Plan |
|
|
200
|
+
| `feature-list.json` exists, no pipeline state | Phase 2: Launch |
|
|
201
|
+
| `feature-list.json` + pipeline state exists | Phase 3: Monitor (check status) |
|
|
202
|
+
| All features completed | Report completion, suggest next steps |
|
|
203
|
+
|
|
204
|
+
**Resume**: If `feature-list.json` exists, ask user: "Existing feature plan found with N features. Resume pipeline or re-plan?"
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
193
208
|
## Interaction During Pipeline
|
|
194
209
|
|
|
195
|
-
While the pipeline runs
|
|
210
|
+
While the pipeline runs, the user can continue the conversation:
|
|
196
211
|
|
|
197
212
|
| User says | Action |
|
|
198
213
|
|-----------|--------|
|
|
@@ -220,7 +235,7 @@ While the pipeline runs in background, the user can continue the conversation:
|
|
|
220
235
|
| Skill | Relationship |
|
|
221
236
|
|-------|-------------|
|
|
222
237
|
| `app-planner` | **Called by Phase 1** — generates feature-list.json |
|
|
223
|
-
| `dev-pipeline-launcher` | **Called by Phase 2** — starts
|
|
238
|
+
| `dev-pipeline-launcher` | **Called by Phase 2** — starts pipeline (handles execution mode selection) |
|
|
224
239
|
| `bug-planner` | **Alternative** — for bug fix workflows |
|
|
225
240
|
| `bugfix-pipeline-launcher` | **Alternative** — for bug fix pipelines |
|
|
226
241
|
| `refactor-workflow` | **Alternative** — for code restructuring |
|
|
@@ -233,9 +248,11 @@ While the pipeline runs in background, the user can continue the conversation:
|
|
|
233
248
|
|-----------|-----------------|------------------|-------------------|
|
|
234
249
|
| **Purpose** | New features (batch) | Single bug fix (interactive) | Code restructuring |
|
|
235
250
|
| **Planning Skill** | `app-planner` | None (triage built-in) | None (analysis built-in) |
|
|
236
|
-
| **
|
|
251
|
+
| **Branch** | Pipeline manages per-feature | `fix/<BUG_ID>-*` | `refactor/<slug>` |
|
|
252
|
+
| **Execution** | Foreground or background daemon | In-session, interactive | In-session |
|
|
237
253
|
| **Input** | Requirements description | Bug report / stack trace | Module / code target |
|
|
238
254
|
| **Output** | Multiple `feat()` commits | Single `fix()` commit | Single `refactor()` commit |
|
|
255
|
+
| **User verification** | No (pipeline automated) | Yes (Phase 5) | Yes (Phase 5) |
|
|
239
256
|
| **Batch alternative** | (this is the batch flow) | `bug-planner` + `bugfix-pipeline-launcher` | N/A |
|
|
240
257
|
|
|
241
258
|
---
|
|
@@ -247,7 +264,7 @@ All internal asset paths use `${SKILL_DIR}` placeholder for cross-IDE compatibil
|
|
|
247
264
|
## Output
|
|
248
265
|
|
|
249
266
|
- `feature-list.json` (Phase 1 artifact)
|
|
250
|
-
-
|
|
267
|
+
- Pipeline execution (Phase 2)
|
|
251
268
|
- Progress updates (Phase 3)
|
|
252
269
|
- Multiple git commits with `feat(<scope>):` prefix
|
|
253
270
|
- Updated `.prizm-docs/` (via prizmkit-retrospective per feature)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "refactor-workflow"
|
|
3
3
|
tier: 1
|
|
4
|
-
description: "End-to-end refactor workflow: analyze → plan → implement → review → commit.
|
|
4
|
+
description: "End-to-end refactor workflow: analyze → plan → implement → review → commit. 6-phase behavior-preserving pipeline with mandatory test gates. Use this skill whenever the user wants to restructure, clean up, or optimize code without changing behavior. Trigger on: 'refactor', 'clean up code', 'restructure', 'optimize code structure', 'extract module', 'code refactoring'. (project)"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# PrizmKit Refactor Workflow
|
|
8
8
|
|
|
9
|
-
End-to-end orchestration skill for code refactoring and optimization. Chains existing PrizmKit skills into a
|
|
9
|
+
End-to-end orchestration skill for code refactoring and optimization. Chains existing PrizmKit skills into a 6-phase behavior-preserving pipeline with mandatory test gates after each task.
|
|
10
10
|
|
|
11
11
|
### When to Use
|
|
12
12
|
- User says "refactor", "clean up code", "restructure", "extract module", "code refactoring", "optimize code structure"
|
|
@@ -23,22 +23,24 @@ End-to-end orchestration skill for code refactoring and optimization. Chains exi
|
|
|
23
23
|
|
|
24
24
|
```
|
|
25
25
|
refactor-workflow
|
|
26
|
+
→ Phase 0: Branch → refactor/<slug> branch
|
|
26
27
|
→ Phase 1: Analyze → refactor-analysis.md
|
|
27
28
|
→ Phase 2: Plan → plan.md (including Tasks section)
|
|
28
29
|
→ Phase 3: Implement → (code)
|
|
29
30
|
→ Phase 4: Review → (review report)
|
|
30
|
-
→ Phase 5: Commit
|
|
31
|
+
→ Phase 5: Verify & Commit → git commit + merge decision
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
### Pipeline Phases
|
|
34
35
|
|
|
35
36
|
| Phase | Name | Skill Used | Artifact |
|
|
36
37
|
|-------|------|-----------|----------|
|
|
38
|
+
| 0 | Branch Setup | git | → `refactor/<slug>` branch |
|
|
37
39
|
| 1 | Analyze (Code Analysis) | Built-in code analysis + code reading | → `refactor-analysis.md` |
|
|
38
40
|
| 2 | Plan (Refactor Plan & Tasks) | `/prizmkit-plan` | → `plan.md` (with Tasks section) |
|
|
39
41
|
| 3 | Implement | `/prizmkit-implement` | (code changes) |
|
|
40
42
|
| 4 | Code Review | `/prizmkit-code-review` | (review report) |
|
|
41
|
-
| 5 | Commit | `/prizmkit-committer` | git commit |
|
|
43
|
+
| 5 | Verify & Commit | `/prizmkit-committer` | git commit + merge |
|
|
42
44
|
|
|
43
45
|
### Key Principles
|
|
44
46
|
|
|
@@ -54,6 +56,14 @@ Refactor artifacts stored at `.prizmkit/refactor/<refactor-slug>/`:
|
|
|
54
56
|
- **`refactor-analysis.md`** — Code analysis (Phase 1)
|
|
55
57
|
- **`plan.md`** — Refactoring plan with Tasks section (Phase 2)
|
|
56
58
|
|
|
59
|
+
**PRECONDITION:**
|
|
60
|
+
|
|
61
|
+
| Required | Check | If Missing |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| Refactoring target (module path, file path, or natural language description) | User provides target in request | Ask: "What module or code do you want to refactor?" |
|
|
64
|
+
| Test suite exists for target module | Tests can be located and run | WARN user, recommend writing tests first before refactoring |
|
|
65
|
+
| No uncommitted changes on current branch | `git status` is clean | Ask user to commit or stash changes first |
|
|
66
|
+
|
|
57
67
|
**INPUT**: Target description. Can be:
|
|
58
68
|
- Module or file path (e.g., "src/auth/")
|
|
59
69
|
- Natural language description (e.g., "refactor the auth module, extract shared logic")
|
|
@@ -61,6 +71,26 @@ Refactor artifacts stored at `.prizmkit/refactor/<refactor-slug>/`:
|
|
|
61
71
|
|
|
62
72
|
---
|
|
63
73
|
|
|
74
|
+
## Phase 0: Branch Setup
|
|
75
|
+
|
|
76
|
+
**Goal**: Create an isolated working branch to keep main clean.
|
|
77
|
+
|
|
78
|
+
1. **Check current branch**:
|
|
79
|
+
```bash
|
|
80
|
+
git branch --show-current
|
|
81
|
+
```
|
|
82
|
+
2. **If on `main` or a shared branch**: Create and switch to refactor branch:
|
|
83
|
+
```bash
|
|
84
|
+
git checkout -b refactor/<refactor-slug>
|
|
85
|
+
```
|
|
86
|
+
Example: `git checkout -b refactor/extract-auth-middleware`
|
|
87
|
+
3. **If already on a refactor branch**: Confirm with user: "Continue on current branch `<branch-name>`, or create a new one?"
|
|
88
|
+
4. **Record the original branch name** for later merge.
|
|
89
|
+
|
|
90
|
+
**CHECKPOINT CP-RW-0**: On a dedicated refactor branch, not main/shared branch.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
64
94
|
## Phase 1: Analyze — Code Analysis
|
|
65
95
|
|
|
66
96
|
**Goal**: Assess current code state, identify refactoring targets, establish baseline.
|
|
@@ -163,23 +193,44 @@ Refactor artifacts stored at `.prizmkit/refactor/<refactor-slug>/`:
|
|
|
163
193
|
|
|
164
194
|
---
|
|
165
195
|
|
|
166
|
-
## Phase 5: Commit
|
|
196
|
+
## Phase 5: Verify, Commit & Merge
|
|
167
197
|
|
|
168
|
-
**Goal**:
|
|
198
|
+
**Goal**: Let user verify, commit with refactor convention, and merge back.
|
|
169
199
|
|
|
170
200
|
**STEPS:**
|
|
171
201
|
|
|
172
|
-
1. **
|
|
202
|
+
1. **User verification** (optional):
|
|
203
|
+
- Ask user: "Refactoring complete and all tests pass. Would you like to verify before committing?"
|
|
204
|
+
- **(a) Run the app** — Start dev server for manual verification
|
|
205
|
+
- **(b) Run a specific command** — Specify a test or script
|
|
206
|
+
- **(c) Skip** — Proceed to commit (tests already pass)
|
|
207
|
+
- If user reports issues: return to Phase 3
|
|
208
|
+
2. **Invoke `/prizmkit-retrospective`** (Job 1: structural sync only):
|
|
173
209
|
- Update KEY_FILES/INTERFACES/DEPENDENCIES in affected `.prizm-docs/` files
|
|
174
210
|
- Skip knowledge injection unless refactoring revealed a genuinely new pitfall (e.g. a non-obvious coupling)
|
|
175
211
|
- If structural changes are significant (module split/merge), update L1 doc
|
|
176
212
|
- Stage doc changes: `git add .prizm-docs/`
|
|
177
|
-
|
|
213
|
+
3. **Invoke `/prizmkit-committer`**:
|
|
178
214
|
- Commit message: `refactor(<scope>): <description>`
|
|
179
215
|
- Include all refactored code + any test updates
|
|
180
216
|
- Do NOT push
|
|
181
|
-
|
|
182
|
-
|
|
217
|
+
4. **Ask merge preference**:
|
|
218
|
+
```
|
|
219
|
+
Refactoring committed on branch `refactor/<slug>`.
|
|
220
|
+
What would you like to do?
|
|
221
|
+
(a) Merge to <original-branch> and delete refactor branch
|
|
222
|
+
(b) Keep refactor branch (for PR review workflow)
|
|
223
|
+
(c) Decide later
|
|
224
|
+
```
|
|
225
|
+
5. **If (a)**:
|
|
226
|
+
```bash
|
|
227
|
+
git checkout <original-branch>
|
|
228
|
+
git merge refactor/<slug>
|
|
229
|
+
git branch -d refactor/<slug>
|
|
230
|
+
```
|
|
231
|
+
6. **If (b)**: Inform user: "Branch `refactor/<slug>` retained. Create a PR when ready."
|
|
232
|
+
|
|
233
|
+
**CHECKPOINT CP-RW-5**: Commit recorded with `refactor()` prefix. Merge decision made.
|
|
183
234
|
|
|
184
235
|
---
|
|
185
236
|
|
|
@@ -188,7 +239,7 @@ Refactor artifacts stored at `.prizmkit/refactor/<refactor-slug>/`:
|
|
|
188
239
|
For single-file refactoring (rename, extract method, <30 lines changed):
|
|
189
240
|
|
|
190
241
|
```
|
|
191
|
-
Phase 1 (Analyze) → Phase 2 (Simplified Plan) → Phase 3 (Implement) → Phase 4 (Review) → Phase 5 (Commit)
|
|
242
|
+
Phase 0 (Branch) → Phase 1 (Analyze) → Phase 2 (Simplified Plan) → Phase 3 (Implement) → Phase 4 (Review) → Phase 5 (Commit & Merge)
|
|
192
243
|
```
|
|
193
244
|
|
|
194
245
|
Skip Phase 2's detailed planning process, but still generate a lightweight `plan.md` with a simplified Tasks section (typically 1-2 tasks).
|
|
@@ -206,11 +257,13 @@ Skip Phase 2's detailed planning process, but still generate a lightweight `plan
|
|
|
206
257
|
- Single-task refactors typically have just one task in plan.md
|
|
207
258
|
|
|
208
259
|
**Fast Path still requires:**
|
|
260
|
+
- Refactor branch (Phase 0)
|
|
209
261
|
- refactor-analysis.md (lightweight version with baseline)
|
|
210
262
|
- plan.md (simplified, 1-2 tasks)
|
|
211
263
|
- Full test suite run after implementation
|
|
212
264
|
- Code review
|
|
213
265
|
- `refactor(<scope>):` commit convention
|
|
266
|
+
- Merge decision
|
|
214
267
|
|
|
215
268
|
---
|
|
216
269
|
|
|
@@ -218,15 +271,16 @@ Skip Phase 2's detailed planning process, but still generate a lightweight `plan
|
|
|
218
271
|
|
|
219
272
|
The pipeline supports resuming from the last completed phase by detecting existing artifacts.
|
|
220
273
|
|
|
221
|
-
**Detection logic**: Check `.prizmkit/refactor/<slug>/`
|
|
274
|
+
**Detection logic**: Check `.prizmkit/refactor/<slug>/` and git branch state:
|
|
222
275
|
|
|
223
276
|
| Artifact Found | Resume From |
|
|
224
277
|
|---------------|------------|
|
|
225
|
-
| (nothing) | Phase
|
|
278
|
+
| (nothing) | Phase 0: Branch Setup |
|
|
279
|
+
| On `refactor/<slug>` branch, no artifacts | Phase 1: Analyze |
|
|
226
280
|
| `refactor-analysis.md` only | Phase 2: Plan |
|
|
227
281
|
| `refactor-analysis.md` + `plan.md` | Phase 3: Implement |
|
|
228
282
|
| All docs + code changes exist | Phase 4: Review |
|
|
229
|
-
| All docs + review passed | Phase 5: Commit |
|
|
283
|
+
| All docs + review passed | Phase 5: Verify & Commit |
|
|
230
284
|
|
|
231
285
|
**Resume**: If `<slug>` matches an existing `.prizmkit/refactor/<slug>/` directory, resume instead of starting fresh.
|
|
232
286
|
|
|
@@ -244,6 +298,7 @@ The pipeline supports resuming from the last completed phase by detecting existi
|
|
|
244
298
|
| Review fails after 2 rounds | Escalate with review findings |
|
|
245
299
|
| Refactoring creates circular dependency | STOP, revise plan |
|
|
246
300
|
| Performance regression detected | STOP, investigate, revise approach |
|
|
301
|
+
| Branch conflict during merge | Show conflict, ask user to resolve or keep branch |
|
|
247
302
|
|
|
248
303
|
---
|
|
249
304
|
|
|
@@ -259,23 +314,24 @@ The pipeline supports resuming from the last completed phase by detecting existi
|
|
|
259
314
|
| `/prizmkit-retrospective` | Phase 5: structural sync before commit (Job 1 only, skip knowledge injection unless new pitfall) |
|
|
260
315
|
| `feature-workflow` | Handoff target when new behavior is needed |
|
|
261
316
|
| `/prizmkit-specify` | NOT used (no user stories for refactoring) |
|
|
262
|
-
| `/prizmkit-analyze` | NOT used (no spec
|
|
317
|
+
| `/prizmkit-analyze` | NOT used (no spec <-> plan consistency needed) |
|
|
263
318
|
|
|
264
319
|
---
|
|
265
320
|
|
|
266
321
|
## Comparison with Feature and Bug Fix Pipelines
|
|
267
322
|
|
|
268
|
-
| Dimension | Feature Workflow | Refactor Workflow | Bug Fix
|
|
323
|
+
| Dimension | Feature Workflow | Refactor Workflow | Bug Fix Workflow |
|
|
269
324
|
|-----------|-----------------|-------------------|------------------|
|
|
270
325
|
| Input | Natural language requirement | Module/code target | Bug description |
|
|
271
|
-
|
|
|
272
|
-
|
|
|
326
|
+
| Branch | Pipeline manages per-feature | `refactor/<slug>` | `fix/<BUG_ID>-*` |
|
|
327
|
+
| Pipeline Phases | 3 (plan → launch → monitor) | 6 (branch → analyze → plan → implement → review → commit) | 7 (branch → triage → reproduce → fix → review → verify → commit) |
|
|
328
|
+
| Phase 1 | Plan (app-planner) | Analyze (refactor-analysis.md) | Triage (fix-plan.md) |
|
|
273
329
|
| Artifact Path | `.prizmkit/specs/<slug>/` | `.prizmkit/refactor/<slug>/` | `.prizmkit/bugfix/<id>/` |
|
|
274
330
|
| Commit Prefix | `feat(<scope>):` | `refactor(<scope>):` | `fix(<scope>):` |
|
|
275
|
-
| REGISTRY Update | ✅ | ❌ | ❌ |
|
|
276
331
|
| Test Strategy | TDD per task | Full suite after EVERY task | Reproduction test |
|
|
277
|
-
| Scope Guard | N/A |
|
|
278
|
-
| Behavior Change |
|
|
332
|
+
| Scope Guard | N/A | Enforced | N/A |
|
|
333
|
+
| Behavior Change | Expected | Forbidden | Fix behavior |
|
|
334
|
+
| User Verification | No (pipeline) | Yes (Phase 5) | Yes (Phase 5) |
|
|
279
335
|
|
|
280
336
|
## Output
|
|
281
337
|
|
|
@@ -283,5 +339,5 @@ The pipeline supports resuming from the last completed phase by detecting existi
|
|
|
283
339
|
- `plan.md` with Tasks section (Phase 2 artifact)
|
|
284
340
|
- Refactored implementation code (Phase 3)
|
|
285
341
|
- Code review report (Phase 4, conversation only)
|
|
286
|
-
- Git commit with `refactor(<scope>):` prefix (Phase 5)
|
|
342
|
+
- Git commit with `refactor(<scope>):` prefix on dedicated refactor branch (Phase 5)
|
|
287
343
|
- Updated `.prizm-docs/` (if applicable)
|