prizmkit 1.1.130 → 1.1.134
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/command-adapter.js +0 -2
- package/bundled/dev-pipeline/.env.example +1 -1
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +11 -6
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -9
- package/bundled/dev-pipeline/prizmkit_runtime/processes.py +21 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
- package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +119 -18
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +3 -2
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +411 -17
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +57 -14
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +5 -4
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +55 -2
- package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
- package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
- package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +5 -5
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +28 -22
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +24 -10
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +20 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +5 -10
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +9 -19
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +1 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +15 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +5 -5
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +15 -11
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +6 -6
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +1 -1
- package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +1 -1
- package/bundled/dev-pipeline/templates/sections/task-contract.md +4 -0
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +349 -48
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +129 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +567 -23
- package/bundled/dev-pipeline/tests/test_unified_cli.py +37 -10
- package/bundled/skills/_metadata.json +63 -26
- package/bundled/skills/app-planner/SKILL.md +4 -3
- package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
- package/bundled/skills/bug-planner/SKILL.md +12 -27
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
- package/bundled/skills/feature-planner/SKILL.md +27 -22
- package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
- package/bundled/skills/feature-workflow/SKILL.md +94 -121
- package/bundled/skills/prizmkit/SKILL.md +130 -94
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +132 -86
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +243 -0
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +42 -1
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +93 -1
- package/bundled/skills/prizmkit-committer/SKILL.md +125 -48
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-init/SKILL.md +5 -5
- package/bundled/skills/prizmkit-plan/SKILL.md +146 -105
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +18 -0
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +242 -0
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +4 -4
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-test/SKILL.md +52 -6
- package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +63 -12
- package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +1 -1
- package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +13 -0
- package/bundled/skills/prizmkit-test/references/evidence-protocol.md +6 -1
- package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +8 -1
- package/bundled/skills/prizmkit-test/references/examples.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +4 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
- package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +15 -0
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +744 -23
- package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +194 -15
- package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/recovery-workflow/SKILL.md +62 -241
- package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
- package/bundled/skills/recovery-workflow/references/detection.md +28 -52
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
- package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
- package/bundled/skills/refactor-planner/SKILL.md +12 -57
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
- package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
- package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
- package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
- package/bundled/skills/refactor-workflow/SKILL.md +98 -139
- package/bundled/templates/project-memory-template.md +4 -4
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/prompts.js +10 -3
- package/src/scaffold.js +1 -1
- package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
- package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
|
@@ -1,246 +1,205 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "refactor-workflow"
|
|
3
|
-
description: "Thin
|
|
3
|
+
description: "Thin behavior-preserving refactor scenario router. Clarifies enough to choose direct single-requirement guidance, refactor planning, existing-list command construction, or behavior-change rerouting; hands planning to refactor-planner and runtime command construction to refactor-pipeline-launcher. It never starts coding or owns the requirement lifecycle."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Refactor Workflow
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Classify behavior intent, prepare a concise handoff brief, and route planned work without implementing a refactor or duplicating planner/launcher responsibilities.
|
|
9
9
|
|
|
10
10
|
## Responsibility Boundary
|
|
11
11
|
|
|
12
12
|
This workflow owns:
|
|
13
|
-
- Scenario recognition:
|
|
14
|
-
- Lightweight behavior-
|
|
13
|
+
- Scenario recognition: direct single-requirement guidance, Pipeline Path, existing-list command construction, or behavior-change reroute.
|
|
14
|
+
- Lightweight behavior-preservation and scope triage.
|
|
15
15
|
- User path selection through `AskUserQuestion`.
|
|
16
|
-
- Prompt brief handoff to
|
|
16
|
+
- Prompt brief handoff to `refactor-planner`, `refactor-pipeline-launcher`, or `feature-workflow` for behavior changes.
|
|
17
17
|
- Continuation after `refactor-planner` when the user entered through this workflow.
|
|
18
18
|
|
|
19
19
|
This workflow does not own:
|
|
20
|
+
- Source-code implementation, test execution, code review, documentation sync, or commit execution.
|
|
20
21
|
- Deep code analysis, item decomposition, dependency ordering, behavior-preservation strategy selection, schema validation, or plan review gates — those belong to `refactor-planner`.
|
|
21
|
-
-
|
|
22
|
-
- Product behavior changes — those
|
|
22
|
+
- Runtime option selection, command construction, prerequisite checks, or status/log/stop/retry syntax — those belong to `refactor-pipeline-launcher`.
|
|
23
|
+
- Product behavior changes — those route to feature work.
|
|
24
|
+
- The independent direct requirement lifecycle.
|
|
25
|
+
|
|
26
|
+
## Execution Topology
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
Direct single requirement:
|
|
30
|
+
User → prizmkit-workflow → atomic lifecycle skills
|
|
31
|
+
|
|
32
|
+
Planned refactor execution:
|
|
33
|
+
User → refactor-workflow → refactor-planner → refactor-pipeline-launcher → returned CLI command → runtime → atomic lifecycle skills
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The routes are independent. This workflow can identify a direct-path candidate, but it ends before the user enters the direct path and never invokes the direct workflow.
|
|
23
37
|
|
|
24
38
|
## Behavior-Preservation Boundary
|
|
25
39
|
|
|
26
40
|
Refactoring means external behavior remains unchanged:
|
|
27
|
-
- Public product behavior
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
- Tests and behavior checks are used to prove the change is structural.
|
|
41
|
+
- Public product behavior and user-visible outcomes stay the same.
|
|
42
|
+
- Public contracts remain stable unless the user confirms a compatibility-preserving migration.
|
|
43
|
+
- Tests and behavior checks prove the change is structural.
|
|
31
44
|
|
|
32
|
-
|
|
45
|
+
Changed product behavior, new user-facing functionality, or a breaking public API routes to `feature-workflow`. Internal API/import/module changes can remain refactoring when external behavior is preserved and the planner can define a safe migration.
|
|
33
46
|
|
|
34
47
|
## When to Use
|
|
35
48
|
|
|
36
|
-
Use this workflow
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- Decide whether a refactor is small enough for current-session Fast Path or should use the refactor pipeline.
|
|
42
|
-
- Continue from an existing `.prizmkit/plans/refactor-list.json`.
|
|
49
|
+
Use this workflow to:
|
|
50
|
+
- Classify cleanup, restructuring, extraction, decoupling, simplification, or migration intent.
|
|
51
|
+
- Decide whether one confirmed refactor should use the independent Direct Path or planned runtime execution.
|
|
52
|
+
- Plan batch/cross-module behavior-preserving work.
|
|
53
|
+
- Continue from `.prizmkit/plans/refactor-list.json`.
|
|
43
54
|
|
|
44
55
|
Do not use this workflow when the user only wants:
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
56
|
+
- The direct single-requirement lifecycle -> enter it independently.
|
|
57
|
+
- Refactor planning without execution intent -> `refactor-planner`.
|
|
58
|
+
- Runtime command construction for an existing refactor list -> `refactor-pipeline-launcher`.
|
|
59
|
+
- New functionality or changed product behavior -> `feature-workflow`.
|
|
60
|
+
- Bug repair -> `bug-fix-workflow` or bug planning skills.
|
|
49
61
|
|
|
50
62
|
## Route Overview
|
|
51
63
|
|
|
52
64
|
| User situation | Route |
|
|
53
65
|
|---|---|
|
|
54
|
-
|
|
|
55
|
-
| Batch, cross-module,
|
|
56
|
-
| Product behavior change or breaking public API
|
|
57
|
-
|
|
|
58
|
-
|
|
|
66
|
+
| One confirmed local behavior-preserving requirement | Explain independent Direct Path and end this router |
|
|
67
|
+
| Batch, cross-module, weak-test, or ordered migration | `refactor-planner` -> return here -> `refactor-pipeline-launcher` |
|
|
68
|
+
| Product behavior change or breaking public API | `feature-workflow` |
|
|
69
|
+
| Explicit request for an existing refactor-list command | `refactor-pipeline-launcher` |
|
|
70
|
+
| Auto-discovered refactor list | Ask construct command / inspect / update |
|
|
59
71
|
|
|
60
72
|
## Route Selection
|
|
61
73
|
|
|
62
|
-
### Step 1: Detect
|
|
63
|
-
|
|
64
|
-
Classify the request before asking detailed refactoring questions:
|
|
65
|
-
|
|
66
|
-
- **Behavior-preserving refactor**: the user asks to clean up, restructure, simplify, extract, decouple, or migrate implementation structure.
|
|
67
|
-
- **Behavior change**: the user asks to change what the product does, add functionality, or break a public contract.
|
|
68
|
-
- **Existing list launch**: the user explicitly asks to run, start, resume, check, retry, or stop `.prizmkit/plans/refactor-list.json`.
|
|
69
|
-
- **Unclear**: the request mixes cleanup with behavior changes.
|
|
74
|
+
### Step 1: Detect entry mode
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
Classify the request as behavior-preserving refactor, confirmed behavior change, suspected behavior change, existing-list command, or unclear. If preservation is unclear, ask one concise question.
|
|
72
77
|
|
|
73
|
-
### Step 2: Lightweight triage
|
|
78
|
+
### Step 2: Lightweight triage
|
|
74
79
|
|
|
75
|
-
|
|
80
|
+
A Direct Path candidate is one localized, confirmed behavior-preserving requirement with obvious checks and no dependency ordering. This classification only tells the user to leave this router for the independent direct entry.
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
- Expected work is localized and follows existing patterns.
|
|
80
|
-
- Behavior-preservation checks are obvious or already available.
|
|
81
|
-
- No broad dependency ordering, public behavior change, or risky migration is needed.
|
|
82
|
-
|
|
83
|
-
Pipeline Path candidate when any are true:
|
|
84
|
-
- Multiple refactor items or batch refactoring request.
|
|
82
|
+
A Pipeline Path candidate has one or more of these signals:
|
|
83
|
+
- Multiple items or batch refactoring.
|
|
85
84
|
- Cross-module or multi-layer impact.
|
|
86
|
-
- Import-path, internal API, or module-boundary migration
|
|
87
|
-
- Weak test coverage
|
|
88
|
-
-
|
|
89
|
-
-
|
|
85
|
+
- Import-path, internal API, or module-boundary migration ordering.
|
|
86
|
+
- Weak test coverage or non-trivial behavior-preservation risk.
|
|
87
|
+
- Autonomous/background execution intent.
|
|
88
|
+
- A need for planner-owned analysis, decomposition, validation, and review.
|
|
89
|
+
|
|
90
|
+
Do not perform deep code analysis here.
|
|
90
91
|
|
|
91
92
|
### Step 3: Ask for path selection
|
|
92
93
|
|
|
93
|
-
Use `AskUserQuestion`; do not render
|
|
94
|
+
Use `AskUserQuestion`; do not render options as plain text.
|
|
94
95
|
|
|
95
96
|
```text
|
|
96
97
|
Question: How would you like to proceed?
|
|
97
98
|
Header: Approach
|
|
98
99
|
Options:
|
|
99
|
-
-
|
|
100
|
-
- Use Pipeline Path — refactor-planner creates/reviews refactor-list.json, then refactor-pipeline-launcher
|
|
101
|
-
- Continue clarifying — ask
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
If the request appears to change product behavior:
|
|
105
|
-
|
|
106
|
-
```text
|
|
107
|
-
Question: This appears to change behavior rather than only restructure code. What should we do?
|
|
108
|
-
Header: Boundary
|
|
109
|
-
Options:
|
|
110
|
-
- Route to feature-workflow (Recommended) — treat behavior change as feature work
|
|
111
|
-
- Keep as refactor — only if behavior remains externally unchanged or this is a compatibility-preserving migration
|
|
112
|
-
- Continue clarifying — define which behavior must stay unchanged
|
|
100
|
+
- Use Direct Path — leave this router and invoke the direct single-requirement workflow independently
|
|
101
|
+
- Use Pipeline Path — refactor-planner creates/reviews refactor-list.json, then refactor-pipeline-launcher constructs the runtime command
|
|
102
|
+
- Continue clarifying — ask more route-level questions
|
|
113
103
|
```
|
|
114
104
|
|
|
115
|
-
|
|
105
|
+
If behavior change is confirmed, route to `feature-workflow` and stop refactor routing. If behavior change is only suspected, offer `Route to feature-workflow (Recommended)`, `Confirm behavior-preserving constraints`, or `Continue clarifying`.
|
|
116
106
|
|
|
117
|
-
|
|
118
|
-
Question: Existing refactor-list.json found. What should we do with it?
|
|
119
|
-
Header: Refactor list
|
|
120
|
-
Options:
|
|
121
|
-
- Launch existing list — hand off to refactor-pipeline-launcher
|
|
122
|
-
- Inspect summary first — show refactor count/status, then ask again
|
|
123
|
-
- Update/re-plan — hand off to refactor-planner in incremental mode
|
|
124
|
-
- Ignore and start fresh — continue route selection from the new request
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
If the user explicitly asked to run an existing list, that explicit request counts as path selection; hand off directly to `refactor-pipeline-launcher`.
|
|
107
|
+
For an auto-discovered list, offer construct command, inspect summary, update/re-plan, or ignore and plan the new request. Explicit command intent counts as path selection.
|
|
128
108
|
|
|
129
109
|
## Workflow Handoff Brief
|
|
130
110
|
|
|
131
|
-
When handing off, include this prompt brief
|
|
111
|
+
When handing off to a planner, launcher, or feature router, include this prompt brief. Do not write it to disk.
|
|
132
112
|
|
|
133
113
|
```markdown
|
|
134
|
-
## Workflow Handoff Brief
|
|
135
|
-
|
|
136
114
|
### Source
|
|
137
115
|
- workflow: refactor-workflow
|
|
138
|
-
- selected_path:
|
|
116
|
+
- selected_path: pipeline_path | existing_list_command | behavior_change_reroute
|
|
139
117
|
|
|
140
118
|
### User Goal
|
|
141
119
|
- original_request: <preserve the user's wording>
|
|
142
|
-
- normalized_goal: <lightly normalized
|
|
120
|
+
- normalized_goal: <lightly normalized restructuring goal>
|
|
143
121
|
|
|
144
122
|
### Scope
|
|
145
123
|
- included: <explicitly in scope>
|
|
146
124
|
- excluded: <explicitly out of scope or unknown>
|
|
147
125
|
|
|
148
126
|
### Behavior Preservation
|
|
149
|
-
- must_remain_unchanged: <public behavior,
|
|
127
|
+
- must_remain_unchanged: <public behavior, outcomes, APIs, workflows, tests>
|
|
150
128
|
- suspected_behavior_changes: <items that may need feature-workflow>
|
|
151
129
|
|
|
152
130
|
### Materials
|
|
153
|
-
- provided_paths: <paths/directories
|
|
154
|
-
- provided_docs_or_urls: <docs, links, screenshots,
|
|
155
|
-
- notes: <
|
|
131
|
+
- provided_paths: <paths/directories>
|
|
132
|
+
- provided_docs_or_urls: <docs, links, screenshots, specs>
|
|
133
|
+
- notes: <constraints or emphasis>
|
|
156
134
|
|
|
157
135
|
### Decision
|
|
158
|
-
- route_reason: <why
|
|
136
|
+
- route_reason: <why selected>
|
|
159
137
|
- user_confirmed: yes
|
|
160
138
|
|
|
161
139
|
### Next Skill Instruction
|
|
162
|
-
-
|
|
163
|
-
-
|
|
140
|
+
- Planner: own code analysis for planning, preservation strategy, validation, generation, and planner-local review; return the validated list without performing the refactor.
|
|
141
|
+
- Launcher: own runtime configuration and command construction; do not re-plan, implement, or execute the command.
|
|
164
142
|
```
|
|
165
143
|
|
|
166
|
-
|
|
144
|
+
The direct path has no planner/launcher handoff. Preserve original intent and behavior constraints in the exit guidance.
|
|
167
145
|
|
|
168
|
-
|
|
146
|
+
## Selected Path Execution
|
|
169
147
|
|
|
170
|
-
|
|
148
|
+
### Direct Path guidance
|
|
171
149
|
|
|
172
|
-
1.
|
|
173
|
-
2.
|
|
174
|
-
3.
|
|
175
|
-
4.
|
|
176
|
-
5. Run `/prizmkit-code-review` when the user requested review, behavior-preservation uncertainty is high, or Full-path-level risk appears during implementation.
|
|
177
|
-
6. Run `/prizmkit-retrospective` only when structure, interfaces, dependencies, behavior, or durable project knowledge changed.
|
|
178
|
-
7. Run `/prizmkit-committer` with a `refactor(<scope>):` message.
|
|
179
|
-
8. End the workflow after commit; do not call `refactor-planner`, `refactor-pipeline-launcher`, or monitoring.
|
|
150
|
+
1. Confirm one formal behavior-preserving requirement.
|
|
151
|
+
2. Explain the independent direct topology in §Execution Topology.
|
|
152
|
+
3. Preserve requirement and behavior constraints in one concise next-entry instruction.
|
|
153
|
+
4. End `refactor-workflow`. Do not start coding, invoke lifecycle skills, monitor the direct workflow, or reclaim control after it starts.
|
|
180
154
|
|
|
181
|
-
If
|
|
155
|
+
If scope grows or behavior changes, remain in this router and offer Pipeline Path or `feature-workflow`.
|
|
182
156
|
|
|
183
157
|
### Pipeline Path
|
|
184
158
|
|
|
185
159
|
1. Invoke `refactor-planner` with the handoff brief.
|
|
186
|
-
2.
|
|
187
|
-
3. After
|
|
188
|
-
4. Ask whether to
|
|
160
|
+
2. The planner owns code analysis, decomposition, preservation strategy, validation, and review.
|
|
161
|
+
3. After a validated `.prizmkit/plans/refactor-list.json` returns, show item count, ordering, preservation strategy, and review/validation outcome.
|
|
162
|
+
4. Ask whether to construct the runtime command.
|
|
189
163
|
5. If yes, invoke `refactor-pipeline-launcher`.
|
|
190
164
|
|
|
191
|
-
Do not duplicate
|
|
165
|
+
Do not duplicate strict-behavior-check or runtime configuration questions.
|
|
192
166
|
|
|
193
|
-
### Existing list
|
|
167
|
+
### Existing list command
|
|
194
168
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
If this workflow discovered the list on its own, use the `Existing refactor-list.json found` question in §Route Selection before invoking the launcher.
|
|
169
|
+
Route explicit run/status/logs/retry/stop command requests to `refactor-pipeline-launcher`. Ask construct command / inspect / update when the list was only auto-discovered.
|
|
198
170
|
|
|
199
171
|
## Resume Guidance
|
|
200
172
|
|
|
201
173
|
| State found | Action |
|
|
202
174
|
|---|---|
|
|
203
|
-
|
|
|
204
|
-
| Valid
|
|
205
|
-
| Valid refactor list
|
|
206
|
-
|
|
|
207
|
-
|
|
208
|
-
For interrupted autonomous pipeline sessions, prefer `refactor-pipeline-launcher` status/retry operations or `recovery-workflow` when the user explicitly asks to recover a broken AI session.
|
|
209
|
-
|
|
210
|
-
## Runtime Status Reference
|
|
211
|
-
|
|
212
|
-
This workflow does not assemble runtime commands, but it may show lightweight status before handoff or recovery. Use the canonical Python runtime forms:
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
|
|
216
|
-
python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
For start/stop/logs/retry execution, hand off to `refactor-pipeline-launcher`; do not duplicate launcher configuration here.
|
|
175
|
+
| Direct workflow state exists | Exit this router and tell the user to resume its recorded requirement workflow |
|
|
176
|
+
| Valid refactor list with command intent | Invoke `refactor-pipeline-launcher` |
|
|
177
|
+
| Valid refactor list with planning intent | Invoke `refactor-planner` |
|
|
178
|
+
| Interrupted refactor task branch exists | Route to `recovery-workflow` for the exact continuation command |
|
|
179
|
+
| No artifacts | Start behavior classification and route selection |
|
|
220
180
|
|
|
221
181
|
## Error Handling
|
|
222
182
|
|
|
223
183
|
| Situation | Action |
|
|
224
184
|
|---|---|
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
| No behavior checks
|
|
229
|
-
|
|
|
230
|
-
| Planner needs
|
|
231
|
-
| Launcher finds
|
|
185
|
+
| Product behavior change is confirmed | Route to `feature-workflow` and stop refactor routing |
|
|
186
|
+
| Planning only | Route to `refactor-planner` and stop after its summary |
|
|
187
|
+
| Existing-list command requested | Route to `refactor-pipeline-launcher` |
|
|
188
|
+
| No obvious behavior checks | Recommend Pipeline Path unless scope is clearly local |
|
|
189
|
+
| Direct candidate reveals broader risk | Keep control here and offer Pipeline Path |
|
|
190
|
+
| Planner needs detail | Let `refactor-planner` ask its own questions |
|
|
191
|
+
| Launcher finds configuration issues | Let `refactor-pipeline-launcher` own them |
|
|
232
192
|
|
|
233
193
|
## Handoff Map
|
|
234
194
|
|
|
235
195
|
| From | To | Condition |
|
|
236
196
|
|---|---|---|
|
|
237
197
|
| `refactor-workflow` | `feature-workflow` | Request requires product behavior change |
|
|
238
|
-
| `refactor-workflow` | `/prizmkit-plan` | User selects Fast Path |
|
|
239
198
|
| `refactor-workflow` | `refactor-planner` | User selects Pipeline Path |
|
|
240
|
-
| `refactor-planner` | `refactor-workflow` |
|
|
241
|
-
| `refactor-workflow` | `refactor-pipeline-launcher` | User
|
|
199
|
+
| `refactor-planner` | `refactor-workflow` | Planning completed from this workflow's Pipeline Path |
|
|
200
|
+
| `refactor-workflow` | `refactor-pipeline-launcher` | User requests command construction or an existing-list operation |
|
|
242
201
|
|
|
243
202
|
## Output
|
|
244
203
|
|
|
245
|
-
-
|
|
246
|
-
- Pipeline Path: handoff brief, validated `.prizmkit/plans/refactor-list.json
|
|
204
|
+
- Direct guidance: behavior-preservation summary, independent direct-entry topology, and preserved requirement text; no code change or implementation result.
|
|
205
|
+
- Pipeline Path: handoff brief, validated `.prizmkit/plans/refactor-list.json`, and a command returned by `refactor-pipeline-launcher`.
|
|
@@ -32,12 +32,12 @@ This project uses PrizmKit with the Prizm documentation system for AI-optimized
|
|
|
32
32
|
### Available Commands
|
|
33
33
|
Run `/prizmkit` to see all available PrizmKit commands.
|
|
34
34
|
|
|
35
|
-
###
|
|
36
|
-
Not every change needs the full
|
|
35
|
+
### Lightweight Planning Path
|
|
36
|
+
Not every change needs the full formal-requirement lifecycle. Use the lightweight path for:
|
|
37
37
|
- Bug fixes with clear root cause, config tweaks, typo fixes, simple refactors
|
|
38
38
|
- Documentation-only changes, test additions for existing code
|
|
39
|
-
-
|
|
39
|
+
- Lightweight path: `/prizmkit-plan` (simplified) → `/prizmkit-implement` → `/prizmkit-committer`
|
|
40
40
|
|
|
41
|
-
Use the full
|
|
41
|
+
Use the full formal lifecycle (`/prizmkit-plan` → `/prizmkit-implement` → `/prizmkit-code-review` → `/prizmkit-test` → `/prizmkit-retrospective` → `/prizmkit-committer`) for:
|
|
42
42
|
- New features, multi-file coordinated changes, architectural decisions, data model or API changes
|
|
43
43
|
<!-- PRIZMKIT:END -->
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -133,6 +133,10 @@ export async function runScaffold(directory, options) {
|
|
|
133
133
|
name: `Minimal — 最小可用 (${metadata.suites.minimal.skills.length} 个技能)`,
|
|
134
134
|
value: 'minimal',
|
|
135
135
|
},
|
|
136
|
+
...(metadata.suites.recommended ? [{
|
|
137
|
+
name: `Recommended — 推荐工作流 (${metadata.suites.recommended.skills.length} 个技能)`,
|
|
138
|
+
value: 'recommended',
|
|
139
|
+
}] : []),
|
|
136
140
|
],
|
|
137
141
|
default: 'core',
|
|
138
142
|
});
|
package/src/prompts.js
CHANGED
|
@@ -171,10 +171,10 @@ export async function selectAiCliLaunch(currentCommand, detected = {}, currentLa
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
|
-
* Select skill suite (core, minimal, or recommended:<type>).
|
|
174
|
+
* Select skill suite (core, minimal, recommended, or recommended:<type>).
|
|
175
175
|
* @param {string} currentSuite - current suite value
|
|
176
176
|
* @param {Object} metadata - skill metadata with suites definitions
|
|
177
|
-
* @returns {Promise<string>} - 'core', 'minimal', or 'recommended:type'
|
|
177
|
+
* @returns {Promise<string>} - 'core', 'minimal', 'recommended', or 'recommended:type'
|
|
178
178
|
*/
|
|
179
179
|
export async function selectSkillSuite(currentSuite, metadata) {
|
|
180
180
|
const choices = [
|
|
@@ -188,7 +188,14 @@ export async function selectSkillSuite(currentSuite, metadata) {
|
|
|
188
188
|
},
|
|
189
189
|
];
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
if (metadata.suites.recommended) {
|
|
192
|
+
choices.push({
|
|
193
|
+
name: `Recommended — 推荐工作流 (${metadata.suites.recommended.skills.length} 个技能)`,
|
|
194
|
+
value: 'recommended',
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Add recommended project variants if available
|
|
192
199
|
if (metadata.recommendations) {
|
|
193
200
|
for (const [type, rec] of Object.entries(metadata.recommendations)) {
|
|
194
201
|
const baseSkills = rec.base === '*'
|
package/src/scaffold.js
CHANGED
|
@@ -182,7 +182,7 @@ async function loadSharedFrontmatter() {
|
|
|
182
182
|
export async function resolveSkillList(suite) {
|
|
183
183
|
const metadata = await loadMetadata();
|
|
184
184
|
|
|
185
|
-
//
|
|
185
|
+
// Handle recommended:<type> by inheriting the declared recommended base.
|
|
186
186
|
if (suite && suite.startsWith('recommended:')) {
|
|
187
187
|
const projectType = suite.split(':')[1];
|
|
188
188
|
const rec = metadata.recommendations?.[projectType];
|