prizmkit 1.1.130 → 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.
Files changed (88) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/.env.example +1 -1
  3. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +445 -8
  4. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +87 -66
  5. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +53 -3
  6. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +55 -25
  7. package/bundled/dev-pipeline/prizmkit_runtime/runner_status.py +4 -0
  8. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +15 -1
  9. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +396 -4
  10. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +54 -1
  11. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +54 -1
  12. package/bundled/dev-pipeline/scripts/prompt_framework.py +152 -1
  13. package/bundled/dev-pipeline/scripts/update-bug-status.py +53 -0
  14. package/bundled/dev-pipeline/scripts/update-checkpoint.py +294 -69
  15. package/bundled/dev-pipeline/scripts/update-feature-status.py +57 -0
  16. package/bundled/dev-pipeline/scripts/update-refactor-status.py +53 -0
  17. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
  18. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +20 -14
  19. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +21 -4
  20. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +18 -0
  21. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +1 -1
  22. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +5 -15
  23. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +21 -0
  24. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +10 -10
  25. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +16 -0
  26. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +26 -23
  27. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +12 -8
  28. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +1 -1
  29. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +21 -0
  30. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +362 -3
  31. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +310 -22
  32. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +132 -0
  33. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +91 -0
  34. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +411 -18
  35. package/bundled/dev-pipeline/tests/test_unified_cli.py +3 -3
  36. package/bundled/skills/_metadata.json +62 -25
  37. package/bundled/skills/app-planner/SKILL.md +4 -3
  38. package/bundled/skills/bug-fix-workflow/SKILL.md +89 -180
  39. package/bundled/skills/bug-planner/SKILL.md +12 -27
  40. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +131 -220
  41. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +36 -90
  42. package/bundled/skills/feature-pipeline-launcher/SKILL.md +129 -271
  43. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +35 -76
  44. package/bundled/skills/feature-planner/SKILL.md +27 -22
  45. package/bundled/skills/feature-planner/assets/planning-guide.md +4 -4
  46. package/bundled/skills/feature-workflow/SKILL.md +94 -121
  47. package/bundled/skills/prizmkit/SKILL.md +130 -94
  48. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +181 -0
  49. package/bundled/skills/prizmkit-code-review/SKILL.md +114 -84
  50. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -1
  51. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +181 -0
  52. package/bundled/skills/prizmkit-committer/SKILL.md +131 -47
  53. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +181 -0
  54. package/bundled/skills/prizmkit-implement/SKILL.md +99 -73
  55. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +1 -1
  56. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +181 -0
  57. package/bundled/skills/prizmkit-init/SKILL.md +5 -5
  58. package/bundled/skills/prizmkit-plan/SKILL.md +132 -105
  59. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +181 -0
  60. package/bundled/skills/prizmkit-retrospective/SKILL.md +111 -53
  61. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +7 -6
  62. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +5 -4
  63. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +181 -0
  64. package/bundled/skills/prizmkit-test/SKILL.md +28 -6
  65. package/bundled/skills/prizmkit-test/references/examples.md +1 -1
  66. package/bundled/skills/prizmkit-test/references/test-report-template.md +1 -1
  67. package/bundled/skills/prizmkit-test/references/workflow-state-protocol.md +181 -0
  68. package/bundled/skills/prizmkit-workflow/SKILL.md +266 -0
  69. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +181 -0
  70. package/bundled/skills/recovery-workflow/SKILL.md +62 -241
  71. package/bundled/skills/recovery-workflow/evals/evals.json +17 -33
  72. package/bundled/skills/recovery-workflow/references/detection.md +28 -52
  73. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +105 -439
  74. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +136 -275
  75. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +53 -88
  76. package/bundled/skills/refactor-planner/SKILL.md +12 -57
  77. package/bundled/skills/refactor-planner/references/behavior-preservation.md +111 -230
  78. package/bundled/skills/refactor-planner/references/error-recovery.md +37 -0
  79. package/bundled/skills/refactor-planner/references/planning-phases.md +11 -17
  80. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +1 -1
  81. package/bundled/skills/refactor-workflow/SKILL.md +98 -139
  82. package/bundled/templates/project-memory-template.md +4 -4
  83. package/package.json +1 -1
  84. package/src/index.js +4 -0
  85. package/src/prompts.js +10 -3
  86. package/src/scaffold.js +1 -1
  87. package/bundled/dev-pipeline/tests/test-deploy-safety.sh +0 -223
  88. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +0 -462
@@ -1,275 +1,186 @@
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', 'fix progress', 'stop fixing'. (project)"
3
+ description: "Build bugfix-pipeline commands from a validated .prizmkit/plans/bug-fix-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 fixing a prepared bug list, construct a bugfix command, check bugfix status, view logs, stop a run, retry a bug, or clean retry B-001. Trigger on: 'start fixing bugs', 'run bugfix pipeline', 'bugfix status', 'bugfix logs', 'stop bug fix', 'retry bug', 'retry B-001'."
4
4
  ---
5
5
 
6
- # Bugfix-Pipeline Launcher
6
+ # Bugfix Pipeline Command Builder
7
7
 
8
- Launch the autonomous bug fix 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.
8
+ Build commands for the autonomous bugfix 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
- ### Execution Mode
10
+ ## Command-Only Boundary
11
11
 
12
- Three execution modes are available. The user chooses one before configuring other options:
12
+ This skill:
13
13
 
14
- 1. **Foreground** (recommended) — `python3 ./.prizmkit/dev-pipeline/cli.py bugfix run`. Visible output, direct error feedback, no orphaned processes.
15
- 2. **Background daemon** — `python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix start .prizmkit/plans/bug-fix-list.json`. Runs fully detached, survives AI CLI session closure.
16
- 3. **Manual** — Display the assembled command(s) only. Do not execute anything. User runs them on their own.
14
+ - reads a validated bug list and relevant configuration;
15
+ - builds prerequisite-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, fixes source code, or runs verification.
17
18
 
18
- **Background mode traceability**: Daemon mode metadata and logs are written by the Python runtime (`daemon bugfix start/status/logs`). Do not create any extra launcher-managed audit file.
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
- ### When to Use
21
+ ## When to Use
21
22
 
22
- **Start bugfix pipeline** -- User says:
23
- - "start fixing bugs", "run bugfix pipeline", "launch bug fixes", "fix all bugs"
24
- - "start bug fix", "execute bug list", "begin fixing", "batch fix"
25
- - After bug-planner completes: "fix them", "start fixing"
23
+ Use this skill for:
26
24
 
27
- **Check status** -- User says:
28
- - "bugfix status", "check bug fixes", "how's the fixing going", "bug fix progress"
29
- - "fix progress", "bug fix status", "check fix progress", "how far along are the fixes"
25
+ - constructing a foreground or background-daemon bugfix pipeline command;
26
+ - constructing status, logs, stop, or retry commands;
27
+ - translating user-selected runtime options into environment variables.
30
28
 
31
- **Stop bugfix pipeline** -- User says:
32
- - "stop bug fix", "stop fixing", "halt bugfix", "pause bug fix", "stop fix pipeline"
29
+ Do not use it to:
33
30
 
34
- **Show logs** -- User says:
35
- - "bugfix logs", "show fix logs", "what's being fixed"
36
- - "view fix logs", "fix logs"
31
+ - create or modify `.prizmkit/plans/bug-fix-list.json` — use `bug-planner`;
32
+ - fix a bug in the current conversation;
33
+ - execute, monitor, or verify a pipeline run.
37
34
 
38
- **Do NOT use this skill when:**
39
- - User wants to plan/collect bugs (use `bug-planner` instead)
40
- - User wants to fix a single bug interactively in current session (use `bug-fix-workflow`)
41
- - User wants to launch the feature pipeline (use `feature-pipeline-launcher`)
35
+ ## Inputs
42
36
 
43
- ### Prerequisites
37
+ Default paths:
44
38
 
45
- Before any action, validate:
39
+ - Runtime CLI: `.prizmkit/dev-pipeline/cli.py`
40
+ - Bug plan: `.prizmkit/plans/bug-fix-list.json`
46
41
 
47
- 1. **bugfix pipeline exists**: Confirm `.prizmkit/dev-pipeline/cli.py` is present
48
- 2. **For start**: `.prizmkit/plans/bug-fix-list.json` must exist in `.prizmkit/plans/` (or user-specified path)
49
- 3. **Dependencies**: `python3`, `git`, and the configured AI CLI must be in PATH. Resolve and report the AI CLI from `AI_CLI` env, then `.prizmkit/config.json` `ai_cli`, then fallback to `claude` only when neither is configured. Read `${SKILL_DIR}/references/configuration.md` §Configured AI CLI Prerequisite Check before running the AI CLI check.
50
- 4. **Python version**: Requires Python 3.10+ for the unified dev-pipeline runtime
51
- 5. **Browser tools** (optional): If any bug has `browser_interaction` field, check the corresponding tool is available. Bugs may specify `tool: "playwright-cli"`, `tool: "opencli"`, or `tool: "auto"` (AI chooses at runtime).
42
+ Accept a user-specified bug-list path when provided. Read the plan directly to summarize IDs, severity, dependencies, and current statuses. If the plan is missing or malformed, report that a valid bug plan is required and stop without constructing a start command.
43
+
44
+ Read `${SKILL_DIR}/references/configuration.md` before constructing prerequisite or runtime option fragments.
45
+
46
+ ## Intent Routing
47
+
48
+ | Intent | Output |
49
+ |---|---|
50
+ | Start prepared bugs | Prerequisite-check command plus one start command |
51
+ | Check status | Daemon status and item-level status commands |
52
+ | Show logs | Recent or follow-log command |
53
+ | Stop | Daemon stop command plus optional status command |
54
+ | Retry one bug | Standard or clean reset-and-run command with safety disclosure |
55
+
56
+ Only the start intent uses the execution-mode and configuration rounds.
57
+
58
+ ## Start Command Workflow
59
+
60
+ ### Step 1: Resolve inputs
61
+
62
+ 1. Resolve the bug-list path.
63
+ 2. Read the list and summarize total, eligible, blocked, and selected bug IDs.
64
+ 3. If an existing run is suspected from user context, include a status command in the output; do not run it.
65
+
66
+ ### Step 2: Ask execution mode
67
+
68
+ Use one `AskUserQuestion` call with exactly one question:
69
+
70
+ - **Foreground (Recommended)** — build `bugfix run`; output remains attached to the user's terminal.
71
+ - **Background daemon** — build `daemon bugfix start`; the runtime manages detached execution and logs.
72
+
73
+ Wait for the response before asking configuration.
74
+
75
+ ### Step 3: Ask base configuration
76
+
77
+ Use a separate `AskUserQuestion` call with exactly three questions:
78
+
79
+ 1. **Verbose logging** — On or Off.
80
+ 2. **Max retries** — 3, 1, 5, or a user-provided non-negative integer.
81
+ 3. **Advanced config** — No or Yes.
82
+
83
+ 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.
84
+
85
+ ### Step 4: Build command fragments
86
+
87
+ Map confirmed choices to environment variables using `${SKILL_DIR}/references/configuration.md`.
88
+
89
+ Return this prerequisite-check command separately from the pipeline command:
52
90
 
53
- Quick check:
54
91
  ```bash
55
- command -v python3 >/dev/null && command -v git >/dev/null && echo "Core dependencies OK"
56
- # AI CLI check: read `${SKILL_DIR}/references/configuration.md` §Configured AI CLI Prerequisite Check.
57
- # It must print `Configured AI CLI: <name>` and verify that exact executable.
58
- # Optional: browser interaction support (check both tools — bugs may use either)
59
- command -v playwright-cli && echo "playwright-cli OK" || echo "playwright-cli not found (playwright browser verification will be skipped)"
60
- command -v opencli && echo "opencli OK" || echo "opencli not found (opencli browser verification will be skipped)"
92
+ 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)'
61
93
  ```
62
94
 
63
- If `.prizmkit/plans/bug-fix-list.json` is missing, inform user:
64
- > "No .prizmkit/plans/bug-fix-list.json found. Run the `bug-planner` skill first to generate one, or provide a path to your bug fix list."
95
+ Also include the configured AI CLI check fragment from the reference. These are returned commands, not checks performed by this skill.
65
96
 
66
- ### Workflow
97
+ ### Step 5: Return the start command
67
98
 
68
- Detect user intent from their message, then follow the corresponding workflow:
99
+ Foreground template:
69
100
 
70
- ---
101
+ ```bash
102
+ VERBOSE=1 MAX_RETRIES=3 \
103
+ python3 ./.prizmkit/dev-pipeline/cli.py bugfix run .prizmkit/plans/bug-fix-list.json
104
+ ```
71
105
 
72
- #### Intent A: Start Bugfix Pipeline
73
-
74
- > **Execution model**: The pipeline processes eligible bugs one at a time. The `dependencies` field is active: dependencies must complete before dependents are selected. Among unrelated eligible bugs, stable list order determines selection.
75
-
76
- 1. **Check prerequisites**:
77
- ```bash
78
- ls .prizmkit/plans/bug-fix-list.json 2>/dev/null && echo "Found" || echo "Missing"
79
- ```
80
-
81
- 2. **Check not already running**:
82
- ```bash
83
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix status 2>/dev/null
84
- ```
85
- If running, inform user and ask: "Bugfix pipeline is already running. Want to restart it, check status, or view logs?"
86
-
87
- 3. **Show bug summary** (so user knows what will be fixed):
88
- ```bash
89
- python3 -c "
90
- import json
91
- with open('.prizmkit/plans/bug-fix-list.json') as f:
92
- data = json.load(f)
93
- bugs = data.get('bugs', [])
94
- severity_order = {'critical': 0, 'high': 1, 'medium': 2, 'low': 3}
95
- print(f'Total bugs: {len(bugs)}')
96
- sev_counts = {}
97
- for b in bugs:
98
- s = b.get('severity', 'medium')
99
- sev_counts[s] = sev_counts.get(s, 0) + 1
100
- print(f'By severity: {dict(sorted(sev_counts.items(), key=lambda x: severity_order.get(x[0], 2)))}')
101
- print()
102
- for b in bugs:
103
- print(f\" {b['id']}: [{b.get('severity','?').upper()}] {b.get('title', 'untitled')}\")
104
- "
105
- ```
106
- If pipeline state already exists, use the status command instead:
107
- ```bash
108
- python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json
109
- ```
110
-
111
- 4. **Ask execution mode** (first user decision — SEPARATE `AskUserQuestion` call with exactly 1 question):
112
-
113
- Present the three execution modes from the **Execution Mode** section above (Foreground / Background daemon / Manual), multiSelect: false. Then STOP and wait for the user's response before continuing to step 5.
114
-
115
- 5. **Ask configuration options** — applies to ALL execution modes (Foreground, Background, AND Manual). This is a SEPARATE `AskUserQuestion` call from step 4.
116
-
117
- RULE: Execution mode (step 4) and configuration (step 5) are two distinct `AskUserQuestion` calls, asked in order, each followed by waiting for the user's answer. Merging them, assuming defaults, or showing the final command before the user has answered both rounds produces a misconfigured pipeline that runs autonomously for a long time — so it MUST NOT happen. If you find yourself writing the final command before the user has answered, STOP.
118
-
119
- The step-5 questions (4 round-1 questions, plus a round 2 if the user picks "Yes" to Advanced config) and their env-var mappings are enumerated in `${SKILL_DIR}/references/configuration.md` under "Interactive Configuration Options". Present round 1 as one `AskUserQuestion` call; run round 2 only if Advanced config = Yes. Then STOP and wait for the user's response before continuing to step 6.
120
- 6. **Show final command**: Assemble the complete command from execution mode + confirmed configuration, and present it to the user.
121
-
122
- **Foreground command:**
123
- ```bash
124
- VERBOSE=1 python3 ./.prizmkit/dev-pipeline/cli.py bugfix run .prizmkit/plans/bug-fix-list.json
125
- ```
126
- Selected-options example:
127
- ```bash
128
- VERBOSE=1 MAX_RETRIES=5 STOP_ON_FAILURE=1 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high \
129
- python3 ./.prizmkit/dev-pipeline/cli.py bugfix run .prizmkit/plans/bug-fix-list.json
130
- ```
131
-
132
- **Background daemon command:**
133
- ```bash
134
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix start .prizmkit/plans/bug-fix-list.json --env "VERBOSE=1"
135
- ```
136
- Selected-options example:
137
- ```bash
138
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix start .prizmkit/plans/bug-fix-list.json \
139
- --env "VERBOSE=1 MAX_RETRIES=5 STOP_ON_FAILURE=1 ENABLE_DEPLOY=1 PRIZMKIT_EFFORT=high"
140
- ```
141
-
142
- **Manual mode**: Print the assembled command(s) and **stop here**. Do not execute anything. Do not proceed to step 7.
143
- ```
144
- # To run in foreground:
145
- VERBOSE=1 python3 ./.prizmkit/dev-pipeline/cli.py bugfix run .prizmkit/plans/bug-fix-list.json
146
-
147
- # To run in background (detached):
148
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix start .prizmkit/plans/bug-fix-list.json --env "VERBOSE=1"
149
-
150
- # To check status:
151
- python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json
152
- ```
153
-
154
- 7. **Confirm and launch** (Foreground and Background only — Manual mode ends at step 6):
155
-
156
- Use a separate `AskUserQuestion` call: "Ready to launch the bugfix pipeline with the above command?"
157
- Options:
158
- - Launch now (Recommended)
159
- - Cancel
160
-
161
- After user confirms, execute the command from step 6.
162
-
163
- 8. **Post-launch** (depends on execution mode):
164
-
165
- **If foreground**: Pipeline runs to completion in the terminal. After it finishes:
166
- - Summarize results: total bugs, fixed, failed, skipped
167
- - If all fixed: each bug session has already run `prizmkit-retrospective` internally (structural sync by default; full retrospective when the fix changed interfaces, dependencies, or observable behavior). Ask user what's next.
168
- - If some failed: show failed bug IDs and suggest `python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <B-XXX> --clean --run` for a fresh retry
169
- - **Browser verification**: Bug sessions with `browser_interaction` perform their own verification attempts during execution. After completion, use `python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json` and per-bug session logs as the source of truth before summarizing browser verification results.
170
-
171
- **If background daemon**:
172
- 1. Verify launch:
173
- ```bash
174
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix status
175
- ```
176
- 2. Start log monitoring — Use the Bash tool with `run_in_background: true`:
177
- ```bash
178
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --follow
179
- ```
180
- 3. Report to user:
181
- - Pipeline PID
182
- - Log file location
183
- - "You can ask me 'bugfix status' or 'show fix logs' at any time"
184
- - "Closing this session will NOT stop the pipeline"
106
+ Background template:
185
107
 
186
- ---
108
+ ```bash
109
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix start .prizmkit/plans/bug-fix-list.json \
110
+ --env "VERBOSE=1 MAX_RETRIES=3"
111
+ ```
112
+
113
+ Return only the template matching the confirmed mode and options. Explain that the command has not been executed, then stop.
187
114
 
188
- #### Intent B: Check Status
115
+ ## Status Command
189
116
 
190
- 1. **Check daemon status**:
191
- ```bash
192
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix status
193
- ```
117
+ Return:
194
118
 
195
- 2. **Show bug-level progress**:
196
- ```bash
197
- python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json
198
- ```
119
+ ```bash
120
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix status
121
+ python3 ./.prizmkit/dev-pipeline/cli.py bugfix status .prizmkit/plans/bug-fix-list.json
122
+ ```
199
123
 
200
- 3. **Show recent log activity** (last 20 lines):
201
- ```bash
202
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --lines 20
203
- ```
124
+ Do not infer completion from the plan file alone when runtime state may exist.
204
125
 
205
- 4. **Summarize** to user: total bugs, completed, in_progress, failed, pending, needs_info.
126
+ ## Logs Command
206
127
 
207
- ---
128
+ Recent logs:
129
+
130
+ ```bash
131
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --lines 50
132
+ ```
208
133
 
209
- #### Intent C: Stop Bugfix Pipeline
134
+ Follow logs:
210
135
 
211
- 1. **Stop the daemon**:
212
- ```bash
213
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix stop
214
- ```
136
+ ```bash
137
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --follow
138
+ ```
215
139
 
216
- 2. **Verify stopped**:
217
- ```bash
218
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix status 2>/dev/null || true
219
- ```
140
+ When the user names a specific bug, explain that its session path can be identified from `.prizmkit/state/bugfix/<BUG_ID>/status.json`; do not read or tail it from this skill.
220
141
 
221
- 3. **Inform user**: "Bugfix pipeline stopped. State is preserved -- you can resume later with 'start bug fix' and it will pick up where it left off."
142
+ ## Stop Command
222
143
 
223
- ---
144
+ Return:
145
+
146
+ ```bash
147
+ python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix stop
148
+ ```
224
149
 
225
- #### Intent D: Show Logs
150
+ Optionally include the daemon status command for the user to run afterward. Do not claim the pipeline stopped until runtime output confirms it.
226
151
 
227
- 1. **Check if running**:
228
- ```bash
229
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix status 2>/dev/null
230
- ```
152
+ ## Retry Command
231
153
 
232
- 2. **If running** -- Start live tail with Bash tool `run_in_background: true`:
233
- ```bash
234
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --follow
235
- ```
154
+ 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.”
236
155
 
237
- 3. **If not running** -- Show last 50 lines:
238
- ```bash
239
- python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --lines 50
240
- ```
156
+ Use `AskUserQuestion` before constructing a retry command:
241
157
 
242
- 4. **For per-bug session logs** (when user asks about a specific bug):
243
- ```bash
244
- # Check bug status for last session ID
245
- cat .prizmkit/state/bugfix/<BUG_ID>/status.json 2>/dev/null
246
- # Then tail that bug's session log
247
- tail -100 .prizmkit/state/bugfix/<BUG_ID>/sessions/<SESSION_ID>/logs/session.log
248
- ```
158
+ - **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.
159
+ - **Clean retry** — perform the standard reset and also delete the task branch and clear task history/artifacts.
160
+ - **Cancel** return no reset command.
249
161
 
250
- ---
162
+ Standard template:
251
163
 
252
- #### Intent E: Retry Single Bug
164
+ ```bash
165
+ python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix B-001 --run .prizmkit/plans/bug-fix-list.json
166
+ ```
253
167
 
254
- When user says "retry B-001":
168
+ Clean template:
255
169
 
256
170
  ```bash
257
171
  python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix B-001 --clean --run .prizmkit/plans/bug-fix-list.json
258
172
  ```
259
173
 
260
- **Note:** `python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <B-XXX> --clean --run .prizmkit/plans/bug-fix-list.json` performs a full clean (deletes session history and artifacts) before retrying the selected bug — this gives a fresh start.
174
+ For clean retry, require explicit acknowledgement of branch deletion and possible uncommitted-change loss before displaying the command.
261
175
 
262
- ### Error Handling
176
+ ## Output Contract
263
177
 
264
- Read `${SKILL_DIR}/references/configuration.md` for the full error handling table.
178
+ For every request, return:
265
179
 
266
- ### Integration Notes
180
+ 1. Intent and resolved target.
181
+ 2. Input plan path and selected IDs, when applicable.
182
+ 3. Assumptions and safety warnings.
183
+ 4. Exact command block.
184
+ 5. `Command execution: not performed by this skill.`
267
185
 
268
- - **After bug-planner**: This is the natural next step. When user finishes bug planning and has `.prizmkit/plans/bug-fix-list.json`, suggest launching the bugfix pipeline.
269
- - **Session independence**: Only Background daemon mode runs detached. Foreground runs in the current AI CLI session, and Manual mode prints commands without launching.
270
- - **Single instance per family**: Only one bugfix pipeline can run at a time. Different pipeline families may coexist because they use separate daemon metadata and state directories.
271
- - **Pipeline coexistence**: Bugfix, feature, and refactor pipelines use separate state directories (`.prizmkit/state/bugfix/`, `.prizmkit/state/features/`, `.prizmkit/state/refactor/`), so all three can run simultaneously without conflict.
272
- - **State preservation**: Stopping and restarting the bugfix pipeline resumes from where it left off -- completed bugs are not re-fixed.
273
- - **Bug ordering**: Dependencies are active. Runtime selects eligible bugs in stable list order after dependencies are completed; planners should order unrelated bugs by severity/priority before launch.
274
- - **Background mode traceability**: Daemon mode metadata/logging is runtime-owned; use `daemon bugfix status` and `daemon bugfix logs`.
275
- - **HANDOFF**: After pipeline completes all bugs, summarize results and ask what the user wants next. Individual sessions already run retrospective according to the bug-fix documentation policy.
186
+ Never report command success, process IDs, log locations, bug completion, verification results, or state changes unless the user later supplies authoritative runtime output for explanation.
@@ -1,30 +1,28 @@
1
- # Configuration Reference — Bugfix Pipeline Launcher
1
+ # Configuration Reference — Bugfix Pipeline Command Builder
2
2
 
3
- Environment variable mappings for the bugfix launcher.
3
+ Use this reference only to translate confirmed user choices into command fragments. The skill returns commands; it does not execute them.
4
4
 
5
- ## Configured AI CLI Prerequisite Check
5
+ ## Configured AI CLI Prerequisite Command
6
6
 
7
- Read this section during launcher prerequisite validation before reporting AI CLI availability.
7
+ Runtime AI CLI selection is config-driven. Resolve the executable in this order:
8
8
 
9
- Runtime AI CLI selection is config-driven. Resolve the executable name in this order:
10
- 1. `AI_CLI` environment variable when set.
11
- 2. `.prizmkit/config.json` `ai_cli` when present.
12
- 3. `claude` fallback only when neither is configured.
9
+ 1. `AI_CLI` environment variable.
10
+ 2. `.prizmkit/config.json` `ai_cli`.
11
+ 3. `claude` only when neither is configured.
12
+
13
+ Return this check command as part of start-command preparation:
13
14
 
14
- Run this quick check from the project root:
15
15
  ```bash
16
- command -v python3 >/dev/null && command -v git >/dev/null || { echo "python3 or git missing"; exit 1; }
17
16
  AI_CLI="$(
18
17
  python3 - <<'PY'
19
18
  import json, os, shlex
20
19
  from pathlib import Path
21
20
  cli = os.environ.get("AI_CLI", "").strip()
22
21
  if not cli:
23
- config_path = Path(".prizmkit/config.json")
24
- if config_path.is_file():
22
+ path = Path(".prizmkit/config.json")
23
+ if path.is_file():
25
24
  try:
26
- data = json.loads(config_path.read_text(encoding="utf-8"))
27
- cli = str(data.get("ai_cli") or "").strip()
25
+ cli = str(json.loads(path.read_text(encoding="utf-8")).get("ai_cli") or "").strip()
28
26
  except (OSError, json.JSONDecodeError):
29
27
  cli = ""
30
28
  cli = cli or "claude"
@@ -35,89 +33,37 @@ except ValueError:
35
33
  PY
36
34
  )"
37
35
  printf 'Configured AI CLI: %s\n' "$AI_CLI"
38
- command -v "$AI_CLI" >/dev/null && printf 'AI CLI OK: %s\n' "$(command -v "$AI_CLI")" || { printf 'AI CLI not found: %s\n' "$AI_CLI"; exit 1; }
39
- echo "All dependencies OK"
36
+ command -v "$AI_CLI" >/dev/null
40
37
  ```
41
38
 
42
- Report the configured executable, for example `Configured AI CLI: claude`. Do not report the first arbitrary PATH match such as `cbc` when project config selects a different AI CLI.
43
-
44
- ## Environment Variable Mapping
45
-
46
- Translating user responses to env vars:
47
-
48
- | Config choice | Environment variable |
49
- |-----------|---------------------|
50
- | Verbose: Off | `VERBOSE=0` |
51
- | Verbose: On | `VERBOSE=1` |
52
- | Max retries: N | `MAX_RETRIES=N` |
53
- | Stop on failure: On | `STOP_ON_FAILURE=1` |
54
- | Deploy: Yes | `ENABLE_DEPLOY=1` |
55
- | Effort: value | `PRIZMKIT_EFFORT=<value>` |
56
-
57
- ## Advanced Environment Variables
58
-
59
- Not exposed in interactive menu, pass via `--env`:
60
-
61
- | Variable | Default | Purpose |
62
- |----------|---------|---------|
63
- | `MODEL` | (none) | AI model override (e.g. `claude-opus-4.6`) |
64
- | `AUTO_PUSH` | `0` | Auto-push to remote after successful bug fix (`1` to enable) |
65
- | `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `bugfix/pipeline-{run_id}`) |
66
- | `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
67
- | `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
68
-
69
- ## Interactive Configuration Options
70
-
71
- Present these via `AskUserQuestion` in step 5. Round 1 is one `AskUserQuestion` call with all 4 questions; round 2 only runs if the user picks "Yes" to Advanced config.
72
-
73
- ### Round 1 (always asked)
74
-
75
- **Question 1 — Verbose logging** (multiSelect: false):
76
- - On (default) — Detailed AI session logs including tool calls and subagent activity
77
- - Off — Minimal logging
78
-
79
- **Question 2 — Max retries** (multiSelect: false):
80
- - 3 (default)
81
- - 1
82
- - 5
39
+ Do not claim the configured executable exists until the user supplies successful command output.
83
40
 
84
- **Question 4 Advanced config?** (multiSelect: false):
85
- - No (default) — Use defaults for failure behavior
86
- - Yes — Configure stop-on-failure, deploy, and reasoning effort options
41
+ ## Base Configuration Mapping
87
42
 
88
- Note: Bug filter defaults to all bugs. Runtime selects eligible bugs in stable list order after dependencies are completed; planners should order unrelated bugs by severity/priority before launch. If the user selects "Other" on any option, handle their custom input.
43
+ | Choice | Command fragment |
44
+ |---|---|
45
+ | Verbose Off | `VERBOSE=0` |
46
+ | Verbose On | `VERBOSE=1` |
47
+ | Max retries N | `MAX_RETRIES=N` |
89
48
 
90
- ### Round 2 (only if Advanced config = Yes)
49
+ ## Advanced Configuration Questions
91
50
 
92
- **Question 1 Stop on failure** (multiSelect: false):
93
- - Off (default) — Pipeline continues to next task after failure
94
- - On — Pipeline halts immediately when a task exhausts all retries (`STOP_ON_FAILURE=1`)
51
+ Ask only when the user selected Advanced config.
95
52
 
96
- **Question 2 — Deploy after completion?** (multiSelect: false):
97
- - No (default) — Skip deployment after pipeline completes
98
- - YesRun /prizmkit-deploy automatically after all bugs fixed successfully (`ENABLE_DEPLOY=1`). Deployment is blocked if any bug was not fixed (status not 'completed', 'skipped', or 'needs_info').
53
+ 1. **Stop on failure**
54
+ - Off (default) — continue to other eligible tasks after a task exhausts retries.
55
+ - Onadd `STOP_ON_FAILURE=1`.
56
+ 2. **Reasoning effort**
57
+ - Default — omit `PRIZMKIT_EFFORT`.
58
+ - `low`, `medium`, `high`, `xhigh`, or `max` — add `PRIZMKIT_EFFORT=<value>` after confirming the configured AI CLI supports it.
99
59
 
100
- **Question 3 Reasoning effort** (multiSelect: false):
101
- - Default (none) — Use CLI default
102
- - low — Minimize reasoning, fastest output (`PRIZMKIT_EFFORT=low`)
103
- - medium — Moderate reasoning (`PRIZMKIT_EFFORT=medium`)
104
- - high — Thorough reasoning for complex tasks (`PRIZMKIT_EFFORT=high`)
105
- - xhigh — Extensive reasoning (`PRIZMKIT_EFFORT=xhigh`)
106
- - max — Maximum reasoning, Claude Code only (`PRIZMKIT_EFFORT=max`)
60
+ These are the complete advanced choices for this command builder.
107
61
 
108
- ## Error Handling
62
+ ## Command Construction Rules
109
63
 
110
- | Error | Action |
111
- |-------|--------|
112
- | `.prizmkit/plans/bug-fix-list.json` not found | Tell user to run `bug-planner` skill first |
113
- | `python3` not installed | Install Python 3.10+ and rerun the Python runtime command |
114
- | `git` not installed | Install git; the Python runtime uses git for branch/worktree/status operations |
115
- | Configured AI CLI not in PATH | Install the executable selected by `AI_CLI` or `.prizmkit/config.json` `ai_cli`, or update the config to a CLI available in PATH. |
116
- | Bugfix pipeline already running | Show status, ask if user wants to stop and restart |
117
- | PID file stale (process dead) | `python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix start .prizmkit/plans/bug-fix-list.json` auto-cleans, retry start |
118
- | Launch failed (process died immediately) | Show last 20 lines of log: `python3 ./.prizmkit/dev-pipeline/cli.py daemon bugfix logs --lines 20` |
119
- | All bugs blocked/failed/needs_info | Show status, suggest retrying with `python3 ./.prizmkit/dev-pipeline/cli.py reset bugfix <B-XXX> --clean --run .prizmkit/plans/bug-fix-list.json` or providing more info |
120
- | `playwright-cli` not installed | Browser verification skipped for playwright bugs (non-blocking). Suggest: `npm install -g @playwright/cli@latest && playwright-cli install --skills` |
121
- | `opencli` not installed | Browser verification skipped for opencli bugs (non-blocking). Install opencli for Chrome session-based browser verification |
122
- | Deploy session failed | Pipeline completed but deploy session exited non-zero. Check `.prizmkit/state/bugfix/deploy/<session_id>/logs/session.log`. Retry manually: `/prizmkit-deploy`. |
123
- | Permission denied running Python CLI | Ensure Python is installed and the command uses `python3 ./.prizmkit/dev-pipeline/cli.py ...` |
64
+ - Foreground: place environment assignments before `python3`.
65
+ - Background daemon: place assignments inside one `--env "..."` value.
66
+ - Include only confirmed options.
67
+ - Preserve the user-provided list path.
68
+ - Shell-quote custom paths and values.
69
+ - Return one start command for the selected mode, never both.