prizmkit 1.1.111 → 1.1.113
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/codex/skill-adapter.js +4 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +10 -10
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +20 -73
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +290 -421
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
- package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
- package/bundled/dev-pipeline/scripts/utils.py +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +7 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +17 -19
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +21 -26
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +8 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +7 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +7 -1
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +104 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +14 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +239 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
- package/bundled/dev-pipeline/tests/test_utils.py +66 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
- package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
- package/bundled/skills/bug-planner/SKILL.md +6 -5
- package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
- package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +70 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -21
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +25 -26
- package/bundled/skills/feature-planner/SKILL.md +9 -11
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
- package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
- package/bundled/skills/feature-workflow/SKILL.md +170 -298
- package/bundled/skills/prizmkit/SKILL.md +103 -57
- package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +14 -3
- package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
- package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +12 -3
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
- package/bundled/skills/prizmkit-init/SKILL.md +4 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +11 -13
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
- package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
- package/bundled/skills/prizmkit-test/SKILL.md +138 -141
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +1 -1
- package/bundled/skills/prizmkit-test/references/examples.md +11 -9
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
- package/bundled/skills/recovery-workflow/SKILL.md +195 -256
- package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
- package/bundled/skills/recovery-workflow/references/detection.md +48 -39
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +32 -13
- package/bundled/skills/refactor-planner/SKILL.md +2 -2
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
- package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
- package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +174 -307
- package/package.json +1 -1
- package/src/scaffold.js +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
- package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +0 -116
|
@@ -5,7 +5,7 @@ description: "Launch and manage the refactor pipeline from within an AI CLI sess
|
|
|
5
5
|
|
|
6
6
|
# Refactor Pipeline Launcher
|
|
7
7
|
|
|
8
|
-
Launch the autonomous refactor pipeline from within an AI CLI conversation.
|
|
8
|
+
Launch the autonomous refactor pipeline from within an AI CLI conversation. Only Background daemon mode is fully detached and survives AI CLI session closure; Foreground runs in the current session, and Manual prints commands without launching.
|
|
9
9
|
|
|
10
10
|
### Execution Mode
|
|
11
11
|
|
|
@@ -70,7 +70,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
70
70
|
|
|
71
71
|
#### Intent A: Start Pipeline
|
|
72
72
|
|
|
73
|
-
> **Execution model**: The pipeline processes refactor tasks
|
|
73
|
+
> **Execution model**: The pipeline processes eligible refactor tasks one at a time. The `dependencies` field is active: dependencies must complete before dependents are selected. Among unrelated eligible refactors, stable list order determines selection.
|
|
74
74
|
|
|
75
75
|
1. **Check prerequisites**:
|
|
76
76
|
```bash
|
|
@@ -115,13 +115,28 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
115
115
|
```bash
|
|
116
116
|
# Check git working tree is clean
|
|
117
117
|
git status --porcelain | head -5
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
|
|
119
|
+
# Detect the likely baseline test command
|
|
120
|
+
python3 - <<'PY'
|
|
121
|
+
from pathlib import Path
|
|
122
|
+
if Path('package.json').exists():
|
|
123
|
+
print('Detected package.json; use the project test script if configured')
|
|
124
|
+
elif Path('pytest.ini').exists() or Path('pyproject.toml').exists():
|
|
125
|
+
print('Detected Python project; use pytest if configured')
|
|
126
|
+
elif Path('go.mod').exists():
|
|
127
|
+
print('Detected Go project; use go test ./...')
|
|
128
|
+
else:
|
|
129
|
+
print('No obvious test command detected; ask the user for the baseline command')
|
|
130
|
+
PY
|
|
120
131
|
```
|
|
121
132
|
|
|
133
|
+
Use the detected command, an existing project convention, or a user-provided command to establish the baseline before launch.
|
|
134
|
+
|
|
122
135
|
If git working tree is dirty, warn the user:
|
|
123
136
|
> "Working tree has uncommitted changes. It's recommended to commit or stash changes before starting refactoring so each refactor task has a clean baseline. Continue anyway?"
|
|
124
137
|
|
|
138
|
+
If no baseline command is detected, warn and ask the user for the correct command or explicit permission to continue without an automated baseline.
|
|
139
|
+
|
|
125
140
|
If test baseline fails, warn the user:
|
|
126
141
|
> "Test suite is not passing. Refactoring relies on tests to verify behavior preservation. Fix failing tests before starting the refactor pipeline, or continue at your own risk."
|
|
127
142
|
|
|
@@ -154,11 +169,11 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
154
169
|
- No (default) — Use defaults for critic review and failure behavior
|
|
155
170
|
- Yes — Configure critic review, stop-on-failure, and reasoning effort options
|
|
156
171
|
|
|
157
|
-
Note: Refactor filter defaults to all refactor items
|
|
172
|
+
Note: Refactor filter defaults to all refactor items. Runtime selects eligible refactors in stable list order after dependencies are completed; planners should order unrelated refactors by user priority before launch. If the user selects "Other" on any option, handle their custom input.
|
|
158
173
|
|
|
159
174
|
**If user chose "Yes" to Advanced config**, run the advanced configuration round (a second `AskUserQuestion` round, plus a reasoning-effort follow-up). It applies to a minority of sessions, so the full question set lives in `${SKILL_DIR}/references/configuration.md` → **Advanced Configuration Round**. Default Critic to Off unless refactor items have `priority: "critical"` (in which case default to On).
|
|
160
175
|
|
|
161
|
-
|
|
176
|
+
Read `${SKILL_DIR}/references/configuration.md` for the current environment-variable mapping and advanced environment-variable tables.
|
|
162
177
|
|
|
163
178
|
|
|
164
179
|
7. **Show final command**: After user confirms configuration in step 6, assemble the complete command from execution mode + user-confirmed configuration, and present it to the user.
|
|
@@ -167,9 +182,9 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
167
182
|
```bash
|
|
168
183
|
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
|
|
169
184
|
```
|
|
170
|
-
|
|
185
|
+
Selected-options example:
|
|
171
186
|
```bash
|
|
172
|
-
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
|
|
187
|
+
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 ENABLE_CRITIC=true MAX_RETRIES=5 STOP_ON_FAILURE=1 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
|
|
173
188
|
python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
|
|
174
189
|
```
|
|
175
190
|
|
|
@@ -177,10 +192,10 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
177
192
|
```bash
|
|
178
193
|
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
|
|
179
194
|
```
|
|
180
|
-
|
|
195
|
+
Selected-options example:
|
|
181
196
|
```bash
|
|
182
197
|
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json \
|
|
183
|
-
--env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 ENABLE_DEPLOY=1"
|
|
198
|
+
--env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 ENABLE_CRITIC=true MAX_RETRIES=5 STOP_ON_FAILURE=1 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high"
|
|
184
199
|
```
|
|
185
200
|
|
|
186
201
|
**Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 8.
|
|
@@ -197,7 +212,10 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
197
212
|
|
|
198
213
|
8. **Confirm and launch** (Foreground and Background only — Manual mode ends at step 7):
|
|
199
214
|
|
|
200
|
-
|
|
215
|
+
Use a separate `AskUserQuestion` call: "Ready to launch the refactor pipeline with the above command?"
|
|
216
|
+
Options:
|
|
217
|
+
- Launch now (Recommended)
|
|
218
|
+
- Cancel
|
|
201
219
|
|
|
202
220
|
After user confirms, execute the command from step 7.
|
|
203
221
|
|
|
@@ -207,6 +225,7 @@ Detect user intent from their message, then follow the corresponding workflow:
|
|
|
207
225
|
- Summarize results: total refactors, succeeded, failed, skipped
|
|
208
226
|
- If all succeeded: each refactor session has already run `prizmkit-retrospective` internally. Ask user what's next.
|
|
209
227
|
- If some failed: show failed refactor IDs and suggest `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run` for a fresh retry
|
|
228
|
+
- **Browser verification**: Refactor sessions with `browser_interaction` perform supplemental UI verification during execution. After completion, use `python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json` and per-refactor session logs as the source of truth before summarizing browser verification results.
|
|
210
229
|
|
|
211
230
|
**If background daemon**:
|
|
212
231
|
1. Verify launch:
|
|
@@ -310,8 +329,8 @@ Read the error-handling table in `${SKILL_DIR}/references/configuration.md` for
|
|
|
310
329
|
### Integration Notes
|
|
311
330
|
|
|
312
331
|
- **After refactor-planner**: This is the natural next step. When user finishes refactor planning and has `.prizmkit/plans/refactor-list.json`, suggest launching the refactor pipeline.
|
|
313
|
-
- **Session independence**:
|
|
314
|
-
- **Single instance**: Only one refactor pipeline can run at a time.
|
|
332
|
+
- **Session independence**: Only Background daemon mode runs detached. Foreground runs in the current AI CLI session, and Manual mode prints commands without launching.
|
|
333
|
+
- **Single instance per family**: Only one refactor pipeline can run at a time. Different pipeline families may coexist because they use separate daemon metadata and state directories.
|
|
315
334
|
- **Pipeline coexistence**: Refactor pipeline uses `.prizmkit/state/refactor/` separate from `.prizmkit/state/features/` (features) and `.prizmkit/state/bugfix/` (bugs), so all three pipelines can run simultaneously without conflict.
|
|
316
335
|
- **State preservation**: Stopping and restarting the pipeline resumes from where it left off -- completed refactors are not re-run.
|
|
317
336
|
- **HANDOFF**: After pipeline completes all refactors, each session has already run `prizmkit-retrospective` internally. Ask user what's next.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "refactor-planner"
|
|
3
|
-
description: "Interactive refactoring planner. Understands refactoring intent through dialogue, analyzes current code structure, produces validated .prizmkit/plans/refactor-list.json for dev-pipeline execution. Use whenever users discuss refactoring planning, code restructuring scope, or preparing .prizmkit/plans/refactor-list.json."
|
|
3
|
+
description: "Interactive refactoring planner. Understands refactoring intent through dialogue, analyzes current code structure, identifies refactoring targets, decomposes large refactors or code migrations, and produces validated .prizmkit/plans/refactor-list.json for dev-pipeline execution. Use whenever users discuss refactoring planning, code restructuring scope, code migration planning, or preparing .prizmkit/plans/refactor-list.json."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# refactor planner
|
|
@@ -345,7 +345,7 @@ For simple refactoring with minimal scope (1-2 items, low/medium complexity, no
|
|
|
345
345
|
|
|
346
346
|
## Browser Verification
|
|
347
347
|
|
|
348
|
-
Browser verification is
|
|
348
|
+
Browser verification is supported for UI-affecting refactors as a supplement to `behavior_preservation`. Refactors must still declare `behavior_preservation.strategy`; add `browser_interaction` only when UI behavior should be visually checked after refactoring. Read `${SKILL_DIR}/references/planning-phases.md` for strategy details and UI refactoring examples.
|
|
349
349
|
|
|
350
350
|
---
|
|
351
351
|
|
|
@@ -37,8 +37,10 @@ This guide covers strategies for ensuring that refactoring changes structure wit
|
|
|
37
37
|
**Configuration in refactor-list.json**:
|
|
38
38
|
```json
|
|
39
39
|
{
|
|
40
|
-
"behavior_preservation":
|
|
41
|
-
|
|
40
|
+
"behavior_preservation": {
|
|
41
|
+
"strategy": "test-gate",
|
|
42
|
+
"existing_tests": true
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -75,8 +77,13 @@ This guide covers strategies for ensuring that refactoring changes structure wit
|
|
|
75
77
|
**Configuration in refactor-list.json**:
|
|
76
78
|
```json
|
|
77
79
|
{
|
|
78
|
-
"behavior_preservation":
|
|
79
|
-
|
|
80
|
+
"behavior_preservation": {
|
|
81
|
+
"strategy": "snapshot"
|
|
82
|
+
},
|
|
83
|
+
"acceptance_criteria": [
|
|
84
|
+
"API responses for /api/users/* match before/after snapshots",
|
|
85
|
+
"CLI output for --help remains unchanged"
|
|
86
|
+
]
|
|
80
87
|
}
|
|
81
88
|
```
|
|
82
89
|
|
|
@@ -112,8 +119,12 @@ This guide covers strategies for ensuring that refactoring changes structure wit
|
|
|
112
119
|
**Configuration in refactor-list.json**:
|
|
113
120
|
```json
|
|
114
121
|
{
|
|
115
|
-
"behavior_preservation":
|
|
116
|
-
|
|
122
|
+
"behavior_preservation": {
|
|
123
|
+
"strategy": "manual"
|
|
124
|
+
},
|
|
125
|
+
"acceptance_criteria": [
|
|
126
|
+
"Manual verification confirms email login, social login, and password reset behavior remain unchanged"
|
|
127
|
+
]
|
|
117
128
|
}
|
|
118
129
|
```
|
|
119
130
|
|
|
@@ -123,16 +134,10 @@ This guide covers strategies for ensuring that refactoring changes structure wit
|
|
|
123
134
|
|
|
124
135
|
Use this decision tree to select the appropriate strategy for each refactor item:
|
|
125
136
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
│ └── NO: Fix flaky tests first, then → test-gate
|
|
131
|
-
│ (or if fixing is out of scope → snapshot)
|
|
132
|
-
└── NO: Does the code produce deterministic, observable output?
|
|
133
|
-
├── YES → snapshot
|
|
134
|
-
└── NO → manual (flag as high-risk)
|
|
135
|
-
```
|
|
137
|
+
1. If the target area has reliable test coverage above 60%, choose `test-gate`.
|
|
138
|
+
2. If tests exist but are flaky, plan a prerequisite item to stabilize tests first; if stabilization is out of scope, choose `snapshot`.
|
|
139
|
+
3. If test coverage is below 60% but behavior is deterministic and observable, choose `snapshot`.
|
|
140
|
+
4. If neither reliable tests nor deterministic observable output exist, choose `manual` and flag the item as high risk.
|
|
136
141
|
|
|
137
142
|
### Strategy Selection Table
|
|
138
143
|
|
|
@@ -259,16 +264,16 @@ When coverage tools aren't available, assess manually:
|
|
|
259
264
|
|---------------|-------------------|
|
|
260
265
|
| >80% | Proceed with test-gate. High confidence in behavior preservation. |
|
|
261
266
|
| 60-80% | Proceed with test-gate. Note gaps in refactor item descriptions for the pipeline to be cautious about. |
|
|
262
|
-
| 30-60% | Consider writing additional tests before refactoring
|
|
267
|
+
| 30-60% | Consider writing additional tests before refactoring as a normal `R-NNN` prerequisite item. Or use snapshot strategy for low-coverage areas. |
|
|
263
268
|
| <30% | Strongly recommend writing tests first. If user declines, use snapshot or manual strategy and flag as high risk. |
|
|
264
269
|
| 0% | WARN user explicitly. Recommend writing tests as a prerequisite. If user insists on proceeding, use manual strategy and document all known behaviors. |
|
|
265
270
|
|
|
266
271
|
### Adding Tests as a Prerequisite Item
|
|
267
272
|
|
|
268
|
-
When test coverage is insufficient, add a prerequisite refactor item
|
|
273
|
+
When test coverage is insufficient, add a prerequisite refactor item using the normal `R-NNN` sequence. If the prerequisite is added before other generated items, it is usually `R-001`; downstream refactors depend on that ID.
|
|
269
274
|
|
|
270
275
|
```
|
|
271
|
-
Refactor Item R-
|
|
276
|
+
Refactor Item R-001:
|
|
272
277
|
Title: Add test coverage for [target area] before refactoring
|
|
273
278
|
Type: restructure
|
|
274
279
|
Scope: [test files]
|
|
@@ -22,13 +22,11 @@ For simple refactoring with minimal scope.
|
|
|
22
22
|
description: "Skip detailed analysis, draft refactor items directly and add to refactor-list.json"
|
|
23
23
|
- label: "Full workflow"
|
|
24
24
|
description: "Use the complete planning workflow with detailed code analysis"
|
|
25
|
-
- label: "Implement directly"
|
|
26
|
-
description: "Skip the task list entirely and implement the refactoring right now using /prizmkit-plan + /prizmkit-implement"
|
|
27
25
|
```
|
|
28
26
|
|
|
29
27
|
- **Fast-path** → Continue with fast-path workflow below
|
|
30
28
|
- **Full workflow** → Exit fast path, use full workflow from Phase 2
|
|
31
|
-
-
|
|
29
|
+
- If the user wants direct implementation instead of planning, exit the planner flow after explicit confirmation and recommend `/prizmkit-plan`; do not invoke implementation from inside `refactor-planner`.
|
|
32
30
|
|
|
33
31
|
**NEVER proceed without explicit user selection via `AskUserQuestion`. Do NOT render options as plain text — the user must be able to click/select.**
|
|
34
32
|
3. Draft items (title + type + scope + description + acceptance_criteria + behavior_preservation + dependencies)
|
|
@@ -51,7 +49,7 @@ For simple refactoring with minimal scope.
|
|
|
51
49
|
User: "Rename the auth middleware function from checkAuth to requireAuth everywhere."
|
|
52
50
|
AI: [Detects simple rename, single module]
|
|
53
51
|
AI: [Qualifies for fast path: 1 item, low complexity, no cross-module impact]
|
|
54
|
-
AI: [Uses AskUserQuestion with options: "Fast-path", "Full workflow"
|
|
52
|
+
AI: [Uses AskUserQuestion with options: "Fast-path", "Full workflow"]
|
|
55
53
|
User: [Selects "Fast-path"]
|
|
56
54
|
AI: "Drafting R-001..."
|
|
57
55
|
AI: [Validates immediately]
|
|
@@ -130,13 +130,13 @@ Anti-pattern: do not generate an all-high refactor list unless every item indepe
|
|
|
130
130
|
|
|
131
131
|
## Browser Verification
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
Browser verification is supported for UI-affecting refactors, but it is supplemental. Every refactor still uses `behavior_preservation.strategy` as the primary behavior-preservation contract:
|
|
134
134
|
|
|
135
135
|
- `strategy: test-gate` — Rely on existing test suite. Pipeline runs tests before and after refactoring.
|
|
136
136
|
- `strategy: snapshot` — Compare behavior before/after refactoring using executable snapshots (outputs, API responses, side effects)
|
|
137
137
|
- `strategy: manual` — Require human verification that behavior is preserved
|
|
138
138
|
|
|
139
|
-
For refactors that modify UI code
|
|
139
|
+
For refactors that modify UI code, add `browser_interaction.verify_steps` when visual or browser-flow verification is useful. Also keep behavior-preservation acceptance criteria explicit:
|
|
140
140
|
|
|
141
141
|
Example:
|
|
142
142
|
```
|