prizmkit 1.1.129 → 1.1.131
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/dev-pipeline/.env.example +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
- 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 +15 -1
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +398 -6
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +61 -3
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +64 -4
- package/bundled/dev-pipeline/scripts/prompt_framework.py +156 -7
- 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 +2 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +20 -14
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +21 -4
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +18 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -15
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +16 -0
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +12 -8
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +404 -24
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +132 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +411 -18
- package/bundled/dev-pipeline/tests/test_unified_cli.py +3 -3
- package/bundled/skills/_metadata.json +62 -25
- 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 +114 -84
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -1
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +131 -47
- 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 +132 -105
- 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 +28 -6
- package/bundled/skills/prizmkit-test/references/examples.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
- package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
- 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,338 +1,199 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "refactor-pipeline-launcher"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Build refactor-pipeline commands from a validated .prizmkit/plans/refactor-list.json without executing them. Produces foreground or background-daemon start commands plus status, logs, stop, and safe retry commands. Use whenever the user wants to start a prepared refactor list, construct a refactor command, configure strict behavior checks, inspect refactor status, view logs, stop a run, retry a refactor, or clean retry R-001. Trigger on: 'run refactor pipeline', 'start refactoring', 'refactor status', 'refactor logs', 'stop refactor pipeline', 'retry refactor'."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Refactor Pipeline
|
|
6
|
+
# Refactor Pipeline Command Builder
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Build commands for the autonomous refactor pipeline from within an AI CLI conversation. This skill reads configuration and planning inputs, asks only the choices needed to construct an accurate command, displays the command and its effects, then stops.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Command-Only Boundary
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
This skill:
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
- reads a validated refactor list and relevant configuration;
|
|
15
|
+
- builds prerequisite-check, optional baseline-check, start, status, logs, stop, and retry commands;
|
|
16
|
+
- explains command effects and destructive options before returning them;
|
|
17
|
+
- never executes shell commands, starts processes, follows logs, changes pipeline state, refactors source code, runs tests, or performs verification.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Do not invoke another workflow or implementation skill from this command builder. The user decides where and when to run the returned command.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
- "run refactor pipeline", "start refactoring", "launch refactor pipeline"
|
|
22
|
-
- "execute refactor list", "refactor all", "start refactoring tasks"
|
|
23
|
-
- After refactor-planner completes: "refactor it", "start refactoring from the list"
|
|
21
|
+
## When to Use
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
- "refactor pipeline status", "refactor progress", "check refactoring"
|
|
27
|
-
- "how's the refactoring going", "refactor status"
|
|
23
|
+
Use this skill for:
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
-
|
|
25
|
+
- constructing a foreground or background-daemon refactor pipeline command;
|
|
26
|
+
- selecting strict behavior-check configuration;
|
|
27
|
+
- constructing status, logs, stop, or retry commands;
|
|
28
|
+
- translating user-selected runtime options into environment variables.
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
- "refactor logs", "show refactor logs", "what's being refactored"
|
|
34
|
-
- "view refactor logs"
|
|
30
|
+
Do not use it to:
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
-
|
|
32
|
+
- create or modify `.prizmkit/plans/refactor-list.json` — use `refactor-planner`;
|
|
33
|
+
- perform a refactor in the current conversation;
|
|
34
|
+
- execute a baseline test, monitor a run, or verify behavior preservation.
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
- User wants to plan refactoring (use `refactor-planner` instead)
|
|
41
|
-
- User wants a single interactive refactor in current session (use `refactor-workflow` — but note it will delegate back here for batch execution)
|
|
42
|
-
- User wants to implement features (use `feature-pipeline-launcher`)
|
|
36
|
+
## Inputs
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
Default paths:
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
- Runtime CLI: `.prizmkit/dev-pipeline/cli.py`
|
|
41
|
+
- Refactor plan: `.prizmkit/plans/refactor-list.json`
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
Accept a user-specified refactor-list path when provided. Read the plan directly to summarize IDs, types, dependencies, preservation strategies, and current statuses. If the plan is missing or malformed, report that a valid refactor plan is required and stop without constructing a start command.
|
|
44
|
+
|
|
45
|
+
Read `${SKILL_DIR}/references/configuration.md` before constructing prerequisite, baseline, or runtime option fragments.
|
|
46
|
+
|
|
47
|
+
## Intent Routing
|
|
48
|
+
|
|
49
|
+
| Intent | Output |
|
|
50
|
+
|---|---|
|
|
51
|
+
| Start prepared refactors | Prerequisite/baseline command suggestions plus one start command |
|
|
52
|
+
| Check status | Daemon status and item-level status commands |
|
|
53
|
+
| Show logs | Recent or follow-log command |
|
|
54
|
+
| Stop | Daemon stop command plus optional status command |
|
|
55
|
+
| Retry one refactor | Standard or clean reset-and-run command with safety disclosure |
|
|
56
|
+
|
|
57
|
+
Only the start intent uses the execution-mode and configuration rounds.
|
|
58
|
+
|
|
59
|
+
## Start Command Workflow
|
|
60
|
+
|
|
61
|
+
### Step 1: Resolve inputs
|
|
62
|
+
|
|
63
|
+
1. Resolve the refactor-list path.
|
|
64
|
+
2. Read the list and summarize total, eligible, blocked, and selected refactor IDs.
|
|
65
|
+
3. Summarize the declared behavior-preservation strategies without running them.
|
|
66
|
+
4. If an existing run is suspected from user context, include a status command in the output; do not run it.
|
|
67
|
+
|
|
68
|
+
### Step 2: Build optional baseline suggestions
|
|
69
|
+
|
|
70
|
+
Because refactoring depends on a known baseline, include commands the user can run before the pipeline command:
|
|
53
71
|
|
|
54
|
-
Quick check:
|
|
55
72
|
```bash
|
|
56
|
-
|
|
57
|
-
# AI CLI check: read `${SKILL_DIR}/references/configuration.md` §Configured AI CLI Prerequisite Check.
|
|
58
|
-
# It must print `Configured AI CLI: <name>` and verify that exact executable.
|
|
59
|
-
# Optional: browser interaction support (check both tools — refactors may use either)
|
|
60
|
-
command -v playwright-cli && echo "playwright-cli OK" || echo "playwright-cli not found (playwright browser verification will be skipped)"
|
|
61
|
-
command -v opencli && echo "opencli OK" || echo "opencli not found (opencli browser verification will be skipped)"
|
|
73
|
+
git status --short
|
|
62
74
|
```
|
|
63
75
|
|
|
64
|
-
If
|
|
65
|
-
> "No .prizmkit/plans/refactor-list.json found. Run the `refactor-planner` skill first to generate one, or provide a path to your refactor list."
|
|
76
|
+
If the project instruction files or package metadata name a baseline test command, display that exact command. Otherwise state that no baseline command was discovered and ask the user whether they want to provide one. Do not infer and run a test command.
|
|
66
77
|
|
|
67
|
-
###
|
|
78
|
+
### Step 3: Ask execution mode
|
|
68
79
|
|
|
69
|
-
|
|
80
|
+
Use one `AskUserQuestion` call with exactly one question:
|
|
70
81
|
|
|
71
|
-
|
|
82
|
+
- **Foreground (Recommended)** — build `refactor run`; output remains attached to the user's terminal.
|
|
83
|
+
- **Background daemon** — build `daemon refactor start`; the runtime manages detached execution and logs.
|
|
72
84
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
> **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.
|
|
76
|
-
|
|
77
|
-
1. **Check prerequisites**:
|
|
78
|
-
```bash
|
|
79
|
-
ls .prizmkit/plans/refactor-list.json 2>/dev/null && echo "Found" || echo "Missing"
|
|
80
|
-
```
|
|
85
|
+
Wait for the response before asking configuration.
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status 2>/dev/null
|
|
85
|
-
```
|
|
86
|
-
If running, inform user and ask: "Refactor pipeline is already running. Want to restart it, check status, or view logs?"
|
|
87
|
-
|
|
88
|
-
3. **Show refactor summary** (so user knows what will be refactored):
|
|
89
|
-
```bash
|
|
90
|
-
python3 -c "
|
|
91
|
-
import json
|
|
92
|
-
with open('.prizmkit/plans/refactor-list.json') as f:
|
|
93
|
-
data = json.load(f)
|
|
94
|
-
refactors = data.get('refactors', [])
|
|
95
|
-
print(f'Total refactor tasks: {len(refactors)}')
|
|
96
|
-
type_counts = {}
|
|
97
|
-
for r in refactors:
|
|
98
|
-
t = r.get('type', 'unknown')
|
|
99
|
-
type_counts[t] = type_counts.get(t, 0) + 1
|
|
100
|
-
if type_counts:
|
|
101
|
-
print(f'By type: {dict(sorted(type_counts.items()))}')
|
|
102
|
-
print()
|
|
103
|
-
priority_order = {'critical': 0, 'high': 1, 'medium': 2, 'low': 3}
|
|
104
|
-
refactors_sorted = sorted(refactors, key=lambda r: (priority_order.get(r.get('priority', 'medium'), 2), r.get('id', '')))
|
|
105
|
-
for r in refactors_sorted:
|
|
106
|
-
print(f\" {r['id']}: [{r.get('priority','medium').upper()}] [{r.get('type','?')}] {r.get('title', 'untitled')}\")
|
|
107
|
-
"
|
|
108
|
-
```
|
|
109
|
-
If pipeline state already exists, use the status command instead:
|
|
110
|
-
```bash
|
|
111
|
-
python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
4. **Run preflight checks** (behavior-preservation baseline):
|
|
115
|
-
|
|
116
|
-
Before refactoring, verify the codebase is in a clean, testable state:
|
|
117
|
-
```bash
|
|
118
|
-
# Check git working tree is clean
|
|
119
|
-
git status --porcelain | head -5
|
|
120
|
-
|
|
121
|
-
# Detect the likely baseline test command
|
|
122
|
-
python3 - <<'PY'
|
|
123
|
-
from pathlib import Path
|
|
124
|
-
if Path('package.json').exists():
|
|
125
|
-
print('Detected package.json; use the project test script if configured')
|
|
126
|
-
elif Path('pytest.ini').exists() or Path('pyproject.toml').exists():
|
|
127
|
-
print('Detected Python project; use pytest if configured')
|
|
128
|
-
elif Path('go.mod').exists():
|
|
129
|
-
print('Detected Go project; use go test ./...')
|
|
130
|
-
else:
|
|
131
|
-
print('No obvious test command detected; ask the user for the baseline command')
|
|
132
|
-
PY
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Use the detected command, an existing project convention, or a user-provided command to establish the baseline before launch.
|
|
136
|
-
|
|
137
|
-
If git working tree is dirty, warn the user:
|
|
138
|
-
> "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?"
|
|
139
|
-
|
|
140
|
-
If no baseline command is detected, warn and ask the user for the correct command or explicit permission to continue without an automated baseline.
|
|
141
|
-
|
|
142
|
-
If test baseline fails, warn the user:
|
|
143
|
-
> "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."
|
|
144
|
-
|
|
145
|
-
Wait for user confirmation before proceeding.
|
|
146
|
-
|
|
147
|
-
5. **Ask execution mode** (first user decision):
|
|
148
|
-
|
|
149
|
-
Present the three execution modes from the **Execution Mode** section above as a single standalone `AskUserQuestion` call (exactly 1 question, multiSelect: false). Wait for the user's response before continuing to step 6.
|
|
150
|
-
|
|
151
|
-
Each `AskUserQuestion` round is a genuine gate: callers tend to merge interactive rounds and pre-fill answers, which skips real user decisions and produces wrong configs. Therefore: ask execution mode (step 5) and configuration (step 6) as SEPARATE `AskUserQuestion` calls, in order, and do not assemble or show the final command (step 7) until the user has answered both. If you find yourself writing the final command before the user has answered, STOP — you are violating this rule.
|
|
152
|
-
|
|
153
|
-
6. **Ask configuration options** — a SEPARATE `AskUserQuestion` call from step 5, applies to ALL execution modes (Foreground, Background, AND Manual).
|
|
154
|
-
|
|
155
|
-
Use `AskUserQuestion` to present ALL 4 configuration choices (the full 4-question budget goes to config, NOT shared with execution mode):
|
|
156
|
-
|
|
157
|
-
**Question 1 — Verbose logging** (multiSelect: false):
|
|
158
|
-
- On (default) — Detailed AI session logs including tool calls and subagent activity
|
|
159
|
-
- Off — Minimal logging
|
|
160
|
-
|
|
161
|
-
**Question 2 — Max retries** (multiSelect: false):
|
|
162
|
-
- 3 (default)
|
|
163
|
-
- 1
|
|
164
|
-
- 5
|
|
165
|
-
|
|
166
|
-
**Question 3 — Strict behavior check** (multiSelect: false):
|
|
167
|
-
- On (default) — Run full test suite after each refactor task to verify behavior preservation
|
|
168
|
-
- Off — Skip post-task test verification (faster but riskier)
|
|
169
|
-
|
|
170
|
-
**Question 4 — Advanced config?** (multiSelect: false):
|
|
171
|
-
- No (default) — Use defaults for failure behavior
|
|
172
|
-
- Yes — Configure stop-on-failure, deploy-after-completion, and reasoning effort options
|
|
173
|
-
|
|
174
|
-
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.
|
|
175
|
-
|
|
176
|
-
**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**.
|
|
177
|
-
|
|
178
|
-
Read `${SKILL_DIR}/references/configuration.md` for the current environment-variable mapping and advanced environment-variable tables.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
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.
|
|
182
|
-
|
|
183
|
-
**Foreground command:**
|
|
184
|
-
```bash
|
|
185
|
-
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
|
|
186
|
-
```
|
|
187
|
-
Selected-options example:
|
|
188
|
-
```bash
|
|
189
|
-
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 STOP_ON_FAILURE=1 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
|
|
190
|
-
python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
**Background daemon command:**
|
|
194
|
-
```bash
|
|
195
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
|
|
196
|
-
```
|
|
197
|
-
Selected-options example:
|
|
198
|
-
```bash
|
|
199
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json \
|
|
200
|
-
--env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 MAX_RETRIES=5 STOP_ON_FAILURE=1 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high"
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
**Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 8.
|
|
204
|
-
```
|
|
205
|
-
# To run in foreground:
|
|
206
|
-
VERBOSE=1 STRICT_BEHAVIOR_CHECK=1 python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
|
|
207
|
-
|
|
208
|
-
# To run in background (detached):
|
|
209
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json --env "VERBOSE=1 STRICT_BEHAVIOR_CHECK=1"
|
|
87
|
+
### Step 4: Ask base configuration
|
|
210
88
|
|
|
211
|
-
|
|
212
|
-
python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
|
|
213
|
-
```
|
|
89
|
+
Use a separate `AskUserQuestion` call with exactly four questions:
|
|
214
90
|
|
|
215
|
-
|
|
91
|
+
1. **Verbose logging** — On or Off.
|
|
92
|
+
2. **Max retries** — 3, 1, 5, or a user-provided non-negative integer.
|
|
93
|
+
3. **Strict behavior check** — On or Off.
|
|
94
|
+
4. **Advanced config** — No or Yes.
|
|
216
95
|
|
|
217
|
-
|
|
218
|
-
Options:
|
|
219
|
-
- Launch now (Recommended)
|
|
220
|
-
- Cancel
|
|
96
|
+
If Advanced config is Yes, load the advanced question set from `${SKILL_DIR}/references/configuration.md`. Advanced configuration contains only stop-on-failure and reasoning effort.
|
|
221
97
|
|
|
222
|
-
|
|
98
|
+
### Step 5: Build command fragments
|
|
223
99
|
|
|
224
|
-
|
|
100
|
+
Map confirmed choices to environment variables using `${SKILL_DIR}/references/configuration.md`.
|
|
225
101
|
|
|
226
|
-
|
|
227
|
-
- Summarize results: total refactors, succeeded, failed, skipped
|
|
228
|
-
- If all succeeded: each refactor session has already run `prizmkit-retrospective` internally. Ask user what's next.
|
|
229
|
-
- 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
|
|
230
|
-
- **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.
|
|
102
|
+
Return this prerequisite-check command separately from the pipeline command:
|
|
231
103
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
|
|
236
|
-
```
|
|
237
|
-
2. Start log monitoring — Use the Bash tool with `run_in_background: true`:
|
|
238
|
-
```bash
|
|
239
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --follow
|
|
240
|
-
```
|
|
241
|
-
3. Report to user:
|
|
242
|
-
- Pipeline PID
|
|
243
|
-
- Log file location
|
|
244
|
-
- "You can ask me 'refactor status' or 'show refactor logs' at any time"
|
|
245
|
-
- "Closing this session will NOT stop the pipeline"
|
|
104
|
+
```bash
|
|
105
|
+
command -v python3 >/dev/null && command -v git >/dev/null && test -f .prizmkit/dev-pipeline/cli.py && python3 -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 10) else 1)'
|
|
106
|
+
```
|
|
246
107
|
|
|
247
|
-
|
|
108
|
+
Also include the configured AI CLI check fragment from the reference. These are returned commands, not checks performed by this skill.
|
|
109
|
+
|
|
110
|
+
### Step 6: Return the start command
|
|
111
|
+
|
|
112
|
+
Foreground template:
|
|
248
113
|
|
|
249
|
-
|
|
114
|
+
```bash
|
|
115
|
+
VERBOSE=1 MAX_RETRIES=3 STRICT_BEHAVIOR_CHECK=1 \
|
|
116
|
+
python3 ./.prizmkit/dev-pipeline/cli.py refactor run .prizmkit/plans/refactor-list.json
|
|
117
|
+
```
|
|
250
118
|
|
|
251
|
-
|
|
252
|
-
```bash
|
|
253
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
|
|
254
|
-
```
|
|
119
|
+
Background template:
|
|
255
120
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
121
|
+
```bash
|
|
122
|
+
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start .prizmkit/plans/refactor-list.json \
|
|
123
|
+
--env "VERBOSE=1 MAX_RETRIES=3 STRICT_BEHAVIOR_CHECK=1"
|
|
124
|
+
```
|
|
260
125
|
|
|
261
|
-
|
|
262
|
-
```bash
|
|
263
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 20
|
|
264
|
-
```
|
|
126
|
+
Return only the template matching the confirmed mode and options. Explain that the command has not been executed, then stop.
|
|
265
127
|
|
|
266
|
-
|
|
128
|
+
## Status Command
|
|
267
129
|
|
|
268
|
-
|
|
130
|
+
Return:
|
|
269
131
|
|
|
270
|
-
|
|
132
|
+
```bash
|
|
133
|
+
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status
|
|
134
|
+
python3 ./.prizmkit/dev-pipeline/cli.py refactor status .prizmkit/plans/refactor-list.json
|
|
135
|
+
```
|
|
271
136
|
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor stop
|
|
275
|
-
```
|
|
137
|
+
Do not infer completion from the plan file alone when runtime state may exist.
|
|
276
138
|
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status 2>/dev/null || true
|
|
280
|
-
```
|
|
139
|
+
## Logs Command
|
|
281
140
|
|
|
282
|
-
|
|
141
|
+
Recent logs:
|
|
283
142
|
|
|
284
|
-
|
|
143
|
+
```bash
|
|
144
|
+
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 50
|
|
145
|
+
```
|
|
285
146
|
|
|
286
|
-
|
|
147
|
+
Follow logs:
|
|
287
148
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
```
|
|
149
|
+
```bash
|
|
150
|
+
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --follow
|
|
151
|
+
```
|
|
292
152
|
|
|
293
|
-
|
|
294
|
-
```bash
|
|
295
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --follow
|
|
296
|
-
```
|
|
153
|
+
When the user names a specific refactor, explain that its session path can be identified from `.prizmkit/state/refactor/<REFACTOR_ID>/status.json`; do not read or tail it from this skill.
|
|
297
154
|
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor logs --lines 50
|
|
301
|
-
```
|
|
155
|
+
## Stop Command
|
|
302
156
|
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
|
-
# Check refactor status for last session ID
|
|
306
|
-
cat .prizmkit/state/refactor/<REFACTOR_ID>/status.json 2>/dev/null
|
|
307
|
-
# Then tail that refactor's session log
|
|
308
|
-
tail -100 .prizmkit/state/refactor/<REFACTOR_ID>/sessions/<SESSION_ID>/logs/session.log
|
|
309
|
-
```
|
|
157
|
+
Return:
|
|
310
158
|
|
|
311
|
-
|
|
159
|
+
```bash
|
|
160
|
+
python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor stop
|
|
161
|
+
```
|
|
312
162
|
|
|
313
|
-
|
|
163
|
+
Optionally include the daemon status command for the user to run afterward. Do not claim the pipeline stopped until runtime output confirms it.
|
|
314
164
|
|
|
315
|
-
|
|
165
|
+
## Retry Command
|
|
166
|
+
|
|
167
|
+
A reset can discard uncommitted changes when the target task branch is currently checked out. Clean reset additionally deletes the task branch and clears its task history/artifacts. Never hide these effects behind the word “retry.”
|
|
168
|
+
|
|
169
|
+
Use `AskUserQuestion` before constructing a retry command:
|
|
170
|
+
|
|
171
|
+
- **Standard retry (Recommended)** — reset task status and rerun while preserving a non-current task branch; warn that an active task branch may still have uncommitted changes discarded by reset.
|
|
172
|
+
- **Clean retry** — perform the standard reset and also delete the task branch and clear task history/artifacts.
|
|
173
|
+
- **Cancel** — return no reset command.
|
|
174
|
+
|
|
175
|
+
Standard template:
|
|
316
176
|
|
|
317
177
|
```bash
|
|
318
|
-
python3 ./.prizmkit/dev-pipeline/cli.py reset refactor R-001 --
|
|
178
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset refactor R-001 --run .prizmkit/plans/refactor-list.json
|
|
319
179
|
```
|
|
320
180
|
|
|
321
|
-
|
|
322
|
-
- `python3 ./.prizmkit/dev-pipeline/cli.py reset refactor <R-XXX> --clean --run .prizmkit/plans/refactor-list.json` performs a full clean (deletes session history and artifacts) before retrying the selected refactor — this gives a fresh start.
|
|
323
|
-
- Keep pipeline daemon mode for main run management (`python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor start`, `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor status`, or `python3 ./.prizmkit/dev-pipeline/cli.py daemon refactor stop`).
|
|
181
|
+
Clean template:
|
|
324
182
|
|
|
325
|
-
|
|
183
|
+
```bash
|
|
184
|
+
python3 ./.prizmkit/dev-pipeline/cli.py reset refactor R-001 --clean --run .prizmkit/plans/refactor-list.json
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
For clean retry, require explicit acknowledgement of branch deletion and possible uncommitted-change loss before displaying the command.
|
|
326
188
|
|
|
327
|
-
|
|
189
|
+
## Output Contract
|
|
328
190
|
|
|
329
|
-
|
|
191
|
+
For every request, return:
|
|
330
192
|
|
|
331
|
-
|
|
193
|
+
1. Intent and resolved target.
|
|
194
|
+
2. Input plan path and selected IDs, when applicable.
|
|
195
|
+
3. Assumptions, optional baseline commands, and safety warnings.
|
|
196
|
+
4. Exact runtime command block.
|
|
197
|
+
5. `Command execution: not performed by this skill.`
|
|
332
198
|
|
|
333
|
-
|
|
334
|
-
- **Session independence**: Only Background daemon mode runs detached. Foreground runs in the current AI CLI session, and Manual mode prints commands without launching.
|
|
335
|
-
- **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.
|
|
336
|
-
- **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.
|
|
337
|
-
- **State preservation**: Stopping and restarting the pipeline resumes from where it left off -- completed refactors are not re-run.
|
|
338
|
-
- **HANDOFF**: After pipeline completes all refactors, each session has already run `prizmkit-retrospective` internally. Ask user what's next.
|
|
199
|
+
Never report command success, process IDs, log locations, refactor completion, baseline results, verification results, or state changes unless the user later supplies authoritative runtime output for explanation.
|