prizmkit 1.0.0 → 1.0.2
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 +5 -0
- package/bundled/adapters/claude/agent-adapter.js +108 -0
- package/bundled/adapters/claude/command-adapter.js +104 -0
- package/bundled/adapters/claude/paths.js +35 -0
- package/bundled/adapters/claude/rules-adapter.js +77 -0
- package/bundled/adapters/claude/settings-adapter.js +73 -0
- package/bundled/adapters/claude/team-adapter.js +183 -0
- package/bundled/adapters/codebuddy/agent-adapter.js +43 -0
- package/bundled/adapters/codebuddy/paths.js +29 -0
- package/bundled/adapters/codebuddy/settings-adapter.js +47 -0
- package/bundled/adapters/codebuddy/skill-adapter.js +68 -0
- package/bundled/adapters/codebuddy/team-adapter.js +46 -0
- package/bundled/adapters/shared/frontmatter.js +77 -0
- package/bundled/agents/prizm-dev-team-coordinator.md +142 -0
- package/bundled/agents/prizm-dev-team-dev.md +99 -0
- package/bundled/agents/prizm-dev-team-pm.md +114 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +119 -0
- package/bundled/dev-pipeline/README.md +482 -0
- package/bundled/dev-pipeline/assets/feature-list-example.json +147 -0
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +138 -0
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +425 -0
- package/bundled/dev-pipeline/launch-daemon.sh +549 -0
- package/bundled/dev-pipeline/reset-feature.sh +209 -0
- package/bundled/dev-pipeline/retry-bug.sh +344 -0
- package/bundled/dev-pipeline/retry-feature.sh +338 -0
- package/bundled/dev-pipeline/run-bugfix.sh +638 -0
- package/bundled/dev-pipeline/run.sh +845 -0
- package/bundled/dev-pipeline/scripts/check-session-status.py +158 -0
- package/bundled/dev-pipeline/scripts/detect-stuck.py +385 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +598 -0
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +402 -0
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +294 -0
- package/bundled/dev-pipeline/scripts/init-dev-team.py +134 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +335 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +748 -0
- package/bundled/dev-pipeline/scripts/update-feature-status.py +1076 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +262 -0
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +159 -0
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +291 -0
- package/bundled/dev-pipeline/templates/feature-list-schema.json +112 -0
- package/bundled/dev-pipeline/templates/session-status-schema.json +77 -0
- package/bundled/skills/_metadata.json +267 -0
- package/bundled/skills/app-planner/SKILL.md +580 -0
- package/bundled/skills/app-planner/assets/planning-guide.md +313 -0
- package/bundled/skills/app-planner/scripts/validate-and-generate.py +758 -0
- package/bundled/skills/bug-planner/SKILL.md +235 -0
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +252 -0
- package/bundled/skills/dev-pipeline-launcher/SKILL.md +223 -0
- package/bundled/skills/prizm-kit/SKILL.md +151 -0
- package/bundled/skills/prizm-kit/assets/claude-md-template.md +38 -0
- package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +35 -0
- package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +15 -0
- package/bundled/skills/prizmkit-adr-manager/SKILL.md +68 -0
- package/bundled/skills/prizmkit-adr-manager/assets/adr-template.md +26 -0
- package/bundled/skills/prizmkit-analyze/SKILL.md +194 -0
- package/bundled/skills/prizmkit-api-doc-generator/SKILL.md +56 -0
- package/bundled/skills/prizmkit-bug-fix-workflow/SKILL.md +351 -0
- package/bundled/skills/prizmkit-bug-reproducer/SKILL.md +62 -0
- package/bundled/skills/prizmkit-ci-cd-generator/SKILL.md +54 -0
- package/bundled/skills/prizmkit-clarify/SKILL.md +52 -0
- package/bundled/skills/prizmkit-code-review/SKILL.md +70 -0
- package/bundled/skills/prizmkit-committer/SKILL.md +117 -0
- package/bundled/skills/prizmkit-db-migration/SKILL.md +65 -0
- package/bundled/skills/prizmkit-dependency-health/SKILL.md +123 -0
- package/bundled/skills/prizmkit-deployment-strategy/SKILL.md +58 -0
- package/bundled/skills/prizmkit-error-triage/SKILL.md +55 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +47 -0
- package/bundled/skills/prizmkit-init/SKILL.md +156 -0
- package/bundled/skills/prizmkit-log-analyzer/SKILL.md +55 -0
- package/bundled/skills/prizmkit-monitoring-setup/SKILL.md +75 -0
- package/bundled/skills/prizmkit-onboarding-generator/SKILL.md +70 -0
- package/bundled/skills/prizmkit-perf-profiler/SKILL.md +55 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +54 -0
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +37 -0
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +140 -0
- package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +943 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +79 -0
- package/bundled/skills/prizmkit-security-audit/SKILL.md +130 -0
- package/bundled/skills/prizmkit-specify/SKILL.md +52 -0
- package/bundled/skills/prizmkit-specify/assets/spec-template.md +37 -0
- package/bundled/skills/prizmkit-summarize/SKILL.md +51 -0
- package/bundled/skills/prizmkit-summarize/assets/registry-template.md +18 -0
- package/bundled/skills/prizmkit-tasks/SKILL.md +50 -0
- package/bundled/skills/prizmkit-tasks/assets/tasks-template.md +21 -0
- package/bundled/skills/prizmkit-tech-debt-tracker/SKILL.md +139 -0
- package/bundled/team/prizm-dev-team.json +47 -0
- package/bundled/templates/claude-md-template.md +38 -0
- package/bundled/templates/codebuddy-md-template.md +35 -0
- package/package.json +2 -1
- package/src/scaffold.js +1 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "bug-planner"
|
|
3
|
+
tier: companion
|
|
4
|
+
description: "Interactive bug planning that produces bug-fix-list.json for the Bug Fix Pipeline. Supports multiple input formats: error logs, stack traces, user reports, failed tests, monitoring alerts. (project)"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Bug Planner
|
|
8
|
+
|
|
9
|
+
Interactive skill that collects bug information from various input formats and generates a standardized `bug-fix-list.json` for the Bug Fix Pipeline. This is the bug-fix counterpart to `app-planner` (which generates `feature-list.json`).
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
User says:
|
|
14
|
+
- "plan bug fixes", "report bugs", "create bug list"
|
|
15
|
+
- "修复 bug", "生成 bug 列表", "规划 bug 修复"
|
|
16
|
+
- "I have some bugs to fix", "these tests are failing"
|
|
17
|
+
- "here's an error log", "parse these errors"
|
|
18
|
+
- After receiving bug reports, error logs, or failed test output
|
|
19
|
+
|
|
20
|
+
## Commands
|
|
21
|
+
|
|
22
|
+
### prizmkit.bug-plan
|
|
23
|
+
|
|
24
|
+
Launch the interactive bug planning process.
|
|
25
|
+
|
|
26
|
+
### prizmkit.bug-plan-from-log \<log-file-or-content\>
|
|
27
|
+
|
|
28
|
+
Auto-generate bug entries from error logs or stack traces.
|
|
29
|
+
|
|
30
|
+
### prizmkit.bug-plan-from-tests \<test-output\>
|
|
31
|
+
|
|
32
|
+
Auto-generate bug entries from failed test case output.
|
|
33
|
+
|
|
34
|
+
### prizmkit.bug-plan-validate \<bug-fix-list.json\>
|
|
35
|
+
|
|
36
|
+
Validate an existing `bug-fix-list.json` against the schema.
|
|
37
|
+
|
|
38
|
+
### prizmkit.bug-plan-summary \<bug-fix-list.json\>
|
|
39
|
+
|
|
40
|
+
Print a summary of bugs grouped by severity and status.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Interactive Planning Process
|
|
45
|
+
|
|
46
|
+
The interactive `prizmkit.bug-plan` command guides through 4 phases:
|
|
47
|
+
|
|
48
|
+
### Phase 1: Project Context
|
|
49
|
+
|
|
50
|
+
1. **Identify project**: Read project name and description from existing `feature-list.json` or ask user
|
|
51
|
+
2. **Identify tech stack**: Read from `feature-list.json` global_context or `.prizm-docs/root.prizm`, or ask user
|
|
52
|
+
3. **Identify testing framework**: Auto-detect from package.json/requirements.txt/etc., or ask user
|
|
53
|
+
|
|
54
|
+
Output: `project_name`, `project_description`, `global_context` fields populated.
|
|
55
|
+
|
|
56
|
+
### Phase 2: Bug Collection
|
|
57
|
+
|
|
58
|
+
Accept bug information in ANY of these formats (auto-detect):
|
|
59
|
+
|
|
60
|
+
#### Format A: Stack Trace / Error Log
|
|
61
|
+
```
|
|
62
|
+
TypeError: Cannot read property 'token' of null
|
|
63
|
+
at AuthService.handleLogin (src/services/auth.ts:42)
|
|
64
|
+
at LoginPage.onSubmit (src/pages/login.tsx:28)
|
|
65
|
+
```
|
|
66
|
+
→ Auto-extract: `error_source.type="stack_trace"`, `error_message`, `stack_trace`, `affected_modules`
|
|
67
|
+
|
|
68
|
+
#### Format B: Natural Language User Report
|
|
69
|
+
```
|
|
70
|
+
When I click the login button with correct credentials, the page turns white.
|
|
71
|
+
Expected: redirect to home page.
|
|
72
|
+
Actual: white screen with no error message visible.
|
|
73
|
+
```
|
|
74
|
+
→ Auto-extract: `error_source.type="user_report"`, `reproduction_steps`, `description` (expected vs actual)
|
|
75
|
+
|
|
76
|
+
#### Format C: Failed Test Output
|
|
77
|
+
```
|
|
78
|
+
FAIL src/services/__tests__/auth.test.ts
|
|
79
|
+
● AuthService > handleLogin > should return token on success
|
|
80
|
+
Expected: "abc123"
|
|
81
|
+
Received: null
|
|
82
|
+
```
|
|
83
|
+
→ Auto-extract: `error_source.type="failed_test"`, `failed_test_path`, `error_message`
|
|
84
|
+
|
|
85
|
+
#### Format D: Log Pattern
|
|
86
|
+
```
|
|
87
|
+
[2026-03-07 10:23:45] ERROR [auth-service] Connection timeout after 30000ms
|
|
88
|
+
[2026-03-07 10:23:45] ERROR [auth-service] Failed to authenticate user: ETIMEDOUT
|
|
89
|
+
[2026-03-07 10:23:46] ERROR [auth-service] Connection timeout after 30000ms
|
|
90
|
+
```
|
|
91
|
+
→ Auto-extract: `error_source.type="log_pattern"`, `log_snippet`, `affected_modules`
|
|
92
|
+
|
|
93
|
+
#### Format E: Monitoring Alert
|
|
94
|
+
```
|
|
95
|
+
ALERT: CPU usage > 95% for auth-service pod (5min avg)
|
|
96
|
+
ALERT: Error rate spike: 500 errors/min on /api/login endpoint
|
|
97
|
+
```
|
|
98
|
+
→ Auto-extract: `error_source.type="monitoring_alert"`, `error_message`, `affected_modules`
|
|
99
|
+
|
|
100
|
+
**For each bug collected**, interactively confirm or fill in:
|
|
101
|
+
- Title (auto-suggest from error message, user can edit)
|
|
102
|
+
- Description (auto-generate expected vs actual, user can edit)
|
|
103
|
+
- Severity (auto-suggest based on error type, user can override)
|
|
104
|
+
- Affected feature (ask if known, map to existing F-NNN IDs)
|
|
105
|
+
- Environment (ask or auto-detect from logs)
|
|
106
|
+
- Verification type (suggest `automated` by default, ask user)
|
|
107
|
+
- Acceptance criteria (auto-suggest based on description, user can edit)
|
|
108
|
+
|
|
109
|
+
**Multiple bugs per session**: After each bug, ask "Any more bugs to add? (yes/no)"
|
|
110
|
+
|
|
111
|
+
### Phase 3: Prioritization & Review
|
|
112
|
+
|
|
113
|
+
1. **Auto-assign priorities**: Based on severity (critical=1, high=2, medium=3, low=4), adjustable by user
|
|
114
|
+
2. **Display summary table**:
|
|
115
|
+
```
|
|
116
|
+
ID | Title | Severity | Priority | Verification
|
|
117
|
+
B-001 | Login null reference crash | critical | 1 | automated
|
|
118
|
+
B-002 | CSV export Chinese encoding | medium | 3 | hybrid
|
|
119
|
+
B-003 | Slow dashboard loading | low | 4 | manual
|
|
120
|
+
```
|
|
121
|
+
3. **Ask for adjustments**: "Want to reorder priorities, change severity, or remove any bugs?"
|
|
122
|
+
4. **Detect potential duplicates**: If two bugs have similar error messages or affected modules, warn user
|
|
123
|
+
|
|
124
|
+
### Phase 4: Generate & Validate
|
|
125
|
+
|
|
126
|
+
1. **Generate `bug-fix-list.json`**: Conform to `dev-pipeline/templates/bug-fix-list-schema.json`
|
|
127
|
+
2. **Validate against schema**: Auto-run validation
|
|
128
|
+
3. **Write file** to project root (or user-specified path)
|
|
129
|
+
4. **Output**: File path, summary, and next steps:
|
|
130
|
+
```
|
|
131
|
+
✅ bug-fix-list.json generated with 3 bugs (1 critical, 1 medium, 1 low)
|
|
132
|
+
|
|
133
|
+
Next steps:
|
|
134
|
+
- Review: cat bug-fix-list.json
|
|
135
|
+
- Start fixing: say "开始修复" or "start fixing bugs" to launch the bugfix pipeline
|
|
136
|
+
- Or run directly: ./dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json
|
|
137
|
+
- Fix one interactively: invoke prizmkit-bug-fix-workflow for each bug
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Non-Interactive Commands
|
|
143
|
+
|
|
144
|
+
### prizmkit.bug-plan-from-log
|
|
145
|
+
|
|
146
|
+
Batch-parse error logs to generate bug entries without interactive prompts:
|
|
147
|
+
|
|
148
|
+
1. Accept log file path or piped content
|
|
149
|
+
2. Parse all unique errors (deduplicate by error message pattern)
|
|
150
|
+
3. Auto-generate bug entries with:
|
|
151
|
+
- Title: first line of error message
|
|
152
|
+
- Description: full error context
|
|
153
|
+
- Severity: auto-classify (crash/OOM=critical, auth/timeout=high, validation=medium, other=low)
|
|
154
|
+
- error_source: populated from log content
|
|
155
|
+
- verification_type: default to `automated`
|
|
156
|
+
- acceptance_criteria: auto-generate "Error no longer occurs in [scenario]"
|
|
157
|
+
4. Output draft `bug-fix-list.json` for user review
|
|
158
|
+
5. Ask: "Review and confirm? You can edit individual entries."
|
|
159
|
+
|
|
160
|
+
### prizmkit.bug-plan-from-tests
|
|
161
|
+
|
|
162
|
+
Batch-parse failed test output:
|
|
163
|
+
|
|
164
|
+
1. Accept test runner output (Jest, pytest, Go test, etc.)
|
|
165
|
+
2. Parse each failed test case as a separate bug entry
|
|
166
|
+
3. Auto-populate `failed_test_path`, `error_message`
|
|
167
|
+
4. Set verification_type to `automated` (test already exists)
|
|
168
|
+
5. Output draft `bug-fix-list.json`
|
|
169
|
+
|
|
170
|
+
### prizmkit.bug-plan-validate
|
|
171
|
+
|
|
172
|
+
Validate existing `bug-fix-list.json`:
|
|
173
|
+
|
|
174
|
+
1. Check JSON syntax
|
|
175
|
+
2. Validate against `dev-pipeline/templates/bug-fix-list-schema.json`
|
|
176
|
+
3. Check for:
|
|
177
|
+
- Duplicate IDs
|
|
178
|
+
- Missing required fields
|
|
179
|
+
- Invalid status values
|
|
180
|
+
- Priority conflicts (same priority for different bugs)
|
|
181
|
+
- Invalid `affected_feature` references (if feature-list.json exists)
|
|
182
|
+
4. Output: validation result with specific errors/warnings
|
|
183
|
+
|
|
184
|
+
### prizmkit.bug-plan-summary
|
|
185
|
+
|
|
186
|
+
Print human-readable summary:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
Bug Fix List Summary: my-web-app
|
|
190
|
+
═══════════════════════════════
|
|
191
|
+
|
|
192
|
+
Total: 3 bugs
|
|
193
|
+
By Severity: critical=1, high=0, medium=1, low=1
|
|
194
|
+
By Status: pending=3
|
|
195
|
+
|
|
196
|
+
Bug List (by priority):
|
|
197
|
+
1. [B-001] Login null reference crash (CRITICAL) — automated
|
|
198
|
+
2. [B-002] CSV export Chinese encoding (MEDIUM) — hybrid
|
|
199
|
+
3. [B-003] Slow dashboard loading (LOW) — manual
|
|
200
|
+
|
|
201
|
+
Affected Features: F-003 (1 bug), F-012 (1 bug), none (1 bug)
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Integration with Bug Fix Pipeline
|
|
207
|
+
|
|
208
|
+
After `bug-fix-list.json` is generated, the user can:
|
|
209
|
+
|
|
210
|
+
1. **Say "开始修复" or "start fixing bugs"** — triggers `bugfix-pipeline-launcher` skill to auto-launch pipeline in background (recommended)
|
|
211
|
+
2. **Background daemon**: `./dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json`
|
|
212
|
+
3. **Foreground run**: `./dev-pipeline/run-bugfix.sh run bug-fix-list.json`
|
|
213
|
+
4. **Fix single bug interactively**: invoke `prizmkit-bug-fix-workflow` in current session
|
|
214
|
+
5. **Retry a failed bug**: `./dev-pipeline/retry-bug.sh B-001`
|
|
215
|
+
|
|
216
|
+
## Error Handling
|
|
217
|
+
|
|
218
|
+
| Error | Action |
|
|
219
|
+
|-------|--------|
|
|
220
|
+
| Cannot parse error log format | Ask user to specify format or provide raw text |
|
|
221
|
+
| Ambiguous severity classification | Present options, ask user to choose |
|
|
222
|
+
| Duplicate bug detected | Warn user, suggest merging or keeping separate |
|
|
223
|
+
| No bugs provided | Prompt with examples of supported input formats |
|
|
224
|
+
| Invalid feature reference | Warn and ask user to correct or remove reference |
|
|
225
|
+
| Schema validation failure | Show specific errors, offer to fix interactively |
|
|
226
|
+
|
|
227
|
+
## Path References
|
|
228
|
+
|
|
229
|
+
All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
|
|
230
|
+
|
|
231
|
+
## Output
|
|
232
|
+
|
|
233
|
+
- `bug-fix-list.json` conforming to `dev-pipeline/templates/bug-fix-list-schema.json`
|
|
234
|
+
- Validation report (if validation run)
|
|
235
|
+
- Summary report (if summary run)
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "bugfix-pipeline-launcher"
|
|
3
|
+
description: "Launch and manage the bugfix pipeline from within a cbc session. Start pipeline in background, monitor logs, check status, stop pipeline. Invoke when user wants to start fixing bugs, run the bugfix pipeline, or check bugfix progress. (project)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bugfix-Pipeline Launcher
|
|
7
|
+
|
|
8
|
+
Launch the autonomous bug fix pipeline from within a cbc conversation. The pipeline runs as a fully detached background process -- closing the cbc session does NOT stop the pipeline.
|
|
9
|
+
|
|
10
|
+
### When to Use
|
|
11
|
+
|
|
12
|
+
**Start bugfix pipeline** -- User says:
|
|
13
|
+
- "start fixing bugs", "run bugfix pipeline", "launch bug fixes", "fix all bugs"
|
|
14
|
+
- "start bug fix", "run bug fix", "execute bug list", "begin fixing"
|
|
15
|
+
- "启动 bug 修复", "开始修复 bug", "运行 bug 修复流水线", "开始修 bug"
|
|
16
|
+
- "修复所有 bug", "批量修复", "启动修复流水线"
|
|
17
|
+
- After bug-planner completes: "go", "start", "fix them", "开始吧", "开始修复"
|
|
18
|
+
|
|
19
|
+
**Check status** -- User says:
|
|
20
|
+
- "bugfix status", "check bug fixes", "how's the fixing going", "bug fix progress"
|
|
21
|
+
- "修复进度", "bug 修复状态", "查看修复进度", "修复到哪了"
|
|
22
|
+
|
|
23
|
+
**Stop bugfix pipeline** -- User says:
|
|
24
|
+
- "stop bug fix", "stop fixing", "halt bugfix", "pause bug fix"
|
|
25
|
+
- "停止修复", "暂停 bug 修复", "停止修复流水线"
|
|
26
|
+
|
|
27
|
+
**Show logs** -- User says:
|
|
28
|
+
- "bugfix logs", "show fix logs", "what's being fixed"
|
|
29
|
+
- "查看修复日志", "修复日志", "看看修复情况"
|
|
30
|
+
|
|
31
|
+
**Do NOT use this skill when:**
|
|
32
|
+
- User wants to plan/collect bugs (use `bug-planner` instead)
|
|
33
|
+
- User wants to fix a single bug interactively in current session (use `prizmkit-bug-fix-workflow`)
|
|
34
|
+
- User wants to launch the feature pipeline (use `dev-pipeline-launcher`)
|
|
35
|
+
|
|
36
|
+
### Prerequisites
|
|
37
|
+
|
|
38
|
+
Before any action, validate:
|
|
39
|
+
|
|
40
|
+
1. **bugfix pipeline exists**: Confirm `dev-pipeline/launch-bugfix-daemon.sh` is present and executable
|
|
41
|
+
2. **For start**: `bug-fix-list.json` must exist in project root (or user-specified path)
|
|
42
|
+
3. **Dependencies**: `jq`, `python3`, AI CLI (`cbc` or `claude`) must be in PATH
|
|
43
|
+
|
|
44
|
+
Quick check:
|
|
45
|
+
```bash
|
|
46
|
+
command -v jq && command -v python3 && (command -v cbc || command -v claude) && echo "All dependencies OK"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If `bug-fix-list.json` is missing, inform user:
|
|
50
|
+
> "No bug-fix-list.json found. Run the `bug-planner` skill first to generate one, or provide a path to your bug fix list."
|
|
51
|
+
|
|
52
|
+
### Workflow
|
|
53
|
+
|
|
54
|
+
Detect user intent from their message, then follow the corresponding workflow:
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
#### Intent A: Start Bugfix Pipeline
|
|
59
|
+
|
|
60
|
+
1. **Check prerequisites**:
|
|
61
|
+
```bash
|
|
62
|
+
ls bug-fix-list.json 2>/dev/null && echo "Found" || echo "Missing"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. **Check not already running**:
|
|
66
|
+
```bash
|
|
67
|
+
dev-pipeline/launch-bugfix-daemon.sh status 2>/dev/null
|
|
68
|
+
```
|
|
69
|
+
If running, inform user and ask: "Bugfix pipeline is already running. Want to restart it, check status, or view logs?"
|
|
70
|
+
|
|
71
|
+
3. **Show bug summary** (so user knows what will be fixed):
|
|
72
|
+
```bash
|
|
73
|
+
python3 -c "
|
|
74
|
+
import json
|
|
75
|
+
with open('bug-fix-list.json') as f:
|
|
76
|
+
data = json.load(f)
|
|
77
|
+
bugs = data.get('bugs', [])
|
|
78
|
+
severity_order = {'critical': 0, 'high': 1, 'medium': 2, 'low': 3}
|
|
79
|
+
bugs_sorted = sorted(bugs, key=lambda b: (severity_order.get(b.get('severity', 'medium'), 2), b.get('priority', 99)))
|
|
80
|
+
print(f'Total bugs: {len(bugs)}')
|
|
81
|
+
sev_counts = {}
|
|
82
|
+
for b in bugs:
|
|
83
|
+
s = b.get('severity', 'medium')
|
|
84
|
+
sev_counts[s] = sev_counts.get(s, 0) + 1
|
|
85
|
+
print(f'By severity: {dict(sorted(sev_counts.items(), key=lambda x: severity_order.get(x[0], 2)))}')
|
|
86
|
+
print()
|
|
87
|
+
for b in bugs_sorted:
|
|
88
|
+
print(f\" {b['id']}: [{b.get('severity','?').upper()}] {b.get('title', 'untitled')}\")
|
|
89
|
+
"
|
|
90
|
+
```
|
|
91
|
+
If pipeline state already exists, use the status command instead:
|
|
92
|
+
```bash
|
|
93
|
+
python3 dev-pipeline/scripts/update-bug-status.py \
|
|
94
|
+
--bug-list bug-fix-list.json \
|
|
95
|
+
--state-dir dev-pipeline/bugfix-state \
|
|
96
|
+
--action status 2>/dev/null
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
4. **Ask user to confirm**: "Ready to launch the bugfix pipeline? It will process N bugs (by severity order) in the background."
|
|
100
|
+
|
|
101
|
+
5. **Launch**:
|
|
102
|
+
```bash
|
|
103
|
+
dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json
|
|
104
|
+
```
|
|
105
|
+
If user specified environment overrides (e.g. timeout, retries, verbose):
|
|
106
|
+
```bash
|
|
107
|
+
dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json --env "SESSION_TIMEOUT=7200 MAX_RETRIES=5"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
6. **Verify launch**:
|
|
111
|
+
```bash
|
|
112
|
+
dev-pipeline/launch-bugfix-daemon.sh status
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
7. **Start log monitoring** -- Use the Bash tool with `run_in_background: true`:
|
|
116
|
+
```bash
|
|
117
|
+
tail -f dev-pipeline/bugfix-state/pipeline-daemon.log
|
|
118
|
+
```
|
|
119
|
+
This runs in background so you can continue interacting with the user.
|
|
120
|
+
|
|
121
|
+
8. **Report to user**:
|
|
122
|
+
- Pipeline PID
|
|
123
|
+
- Log file location
|
|
124
|
+
- "You can ask me 'bugfix status' or 'show fix logs' at any time"
|
|
125
|
+
- "Closing this session will NOT stop the pipeline"
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
#### Intent B: Check Status
|
|
130
|
+
|
|
131
|
+
1. **Check daemon status**:
|
|
132
|
+
```bash
|
|
133
|
+
dev-pipeline/launch-bugfix-daemon.sh status
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
2. **Show bug-level progress**:
|
|
137
|
+
```bash
|
|
138
|
+
python3 dev-pipeline/scripts/update-bug-status.py \
|
|
139
|
+
--bug-list bug-fix-list.json \
|
|
140
|
+
--state-dir dev-pipeline/bugfix-state \
|
|
141
|
+
--action status
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
3. **Show recent log activity** (last 20 lines):
|
|
145
|
+
```bash
|
|
146
|
+
tail -20 dev-pipeline/bugfix-state/pipeline-daemon.log
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
4. **Summarize** to user: total bugs, completed, in-progress, failed, pending, needs-info.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
#### Intent C: Stop Bugfix Pipeline
|
|
154
|
+
|
|
155
|
+
1. **Stop the daemon**:
|
|
156
|
+
```bash
|
|
157
|
+
dev-pipeline/launch-bugfix-daemon.sh stop
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
2. **Verify stopped**:
|
|
161
|
+
```bash
|
|
162
|
+
dev-pipeline/launch-bugfix-daemon.sh status 2>/dev/null || true
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
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."
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
#### Intent D: Show Logs
|
|
170
|
+
|
|
171
|
+
1. **Check if running**:
|
|
172
|
+
```bash
|
|
173
|
+
dev-pipeline/launch-bugfix-daemon.sh status 2>/dev/null
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
2. **If running** -- Start live tail with Bash tool `run_in_background: true`:
|
|
177
|
+
```bash
|
|
178
|
+
tail -f dev-pipeline/bugfix-state/pipeline-daemon.log
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
3. **If not running** -- Show last 50 lines:
|
|
182
|
+
```bash
|
|
183
|
+
tail -50 dev-pipeline/bugfix-state/pipeline-daemon.log
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
4. **For per-bug session logs** (when user asks about a specific bug):
|
|
187
|
+
```bash
|
|
188
|
+
# Find current/recent session
|
|
189
|
+
cat dev-pipeline/bugfix-state/current-session.json 2>/dev/null
|
|
190
|
+
# Then tail that bug's session log
|
|
191
|
+
tail -100 dev-pipeline/bugfix-state/bugs/<BUG_ID>/sessions/<SESSION_ID>/logs/session.log
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
#### Intent E: Custom Parameters
|
|
197
|
+
|
|
198
|
+
When user specifies custom settings, map to environment variables:
|
|
199
|
+
|
|
200
|
+
| User says | Environment variable |
|
|
201
|
+
|-----------|---------------------|
|
|
202
|
+
| "timeout 2 hours" / "超时2小时" | `SESSION_TIMEOUT=7200` |
|
|
203
|
+
| "max 5 retries" / "最多重试5次" | `MAX_RETRIES=5` |
|
|
204
|
+
| "verbose mode" / "详细模式" | `VERBOSE=1` |
|
|
205
|
+
| "heartbeat every 60s" | `HEARTBEAT_INTERVAL=60` |
|
|
206
|
+
|
|
207
|
+
Pass via `--env`:
|
|
208
|
+
```bash
|
|
209
|
+
dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json --env "SESSION_TIMEOUT=7200 MAX_RETRIES=5 VERBOSE=1"
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
#### Intent F: Retry Single Bug
|
|
215
|
+
|
|
216
|
+
When user says "retry B-001" or "重试 B-001":
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
dev-pipeline/retry-bug.sh B-001 bug-fix-list.json
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Or within the main pipeline (reset + resume):
|
|
223
|
+
```bash
|
|
224
|
+
python3 dev-pipeline/scripts/update-bug-status.py \
|
|
225
|
+
--bug-list bug-fix-list.json \
|
|
226
|
+
--state-dir dev-pipeline/bugfix-state \
|
|
227
|
+
--bug-id B-001 --action reset
|
|
228
|
+
# Then restart pipeline to pick it up
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Error Handling
|
|
232
|
+
|
|
233
|
+
| Error | Action |
|
|
234
|
+
|-------|--------|
|
|
235
|
+
| `bug-fix-list.json` not found | Tell user to run `bug-planner` skill first |
|
|
236
|
+
| `jq` not installed | Suggest: `brew install jq` |
|
|
237
|
+
| `cbc`/`claude` not in PATH | Check AI CLI installation |
|
|
238
|
+
| Bugfix pipeline already running | Show status, ask if user wants to stop and restart |
|
|
239
|
+
| PID file stale (process dead) | `launch-bugfix-daemon.sh` auto-cleans, retry start |
|
|
240
|
+
| Launch failed (process died immediately) | Show last 20 lines of log: `tail -20 dev-pipeline/bugfix-state/pipeline-daemon.log` |
|
|
241
|
+
| All bugs blocked/failed/needs-info | Show status, suggest retrying or providing more info |
|
|
242
|
+
| Permission denied on script | Run `chmod +x dev-pipeline/launch-bugfix-daemon.sh dev-pipeline/run-bugfix.sh` |
|
|
243
|
+
|
|
244
|
+
### Integration Notes
|
|
245
|
+
|
|
246
|
+
- **After bug-planner**: This is the natural next step. When user finishes bug planning and has `bug-fix-list.json`, suggest launching the bugfix pipeline.
|
|
247
|
+
- **Session independence**: The bugfix pipeline runs completely detached. User can close cbc, open a new session later, and use this skill to check progress or stop the pipeline.
|
|
248
|
+
- **Single instance**: Only one bugfix pipeline can run at a time. The PID file prevents duplicates.
|
|
249
|
+
- **Feature pipeline coexistence**: Bugfix and feature pipelines use separate state directories (`bugfix-state/` vs `state/`), so they can run simultaneously without conflict.
|
|
250
|
+
- **State preservation**: Stopping and restarting the bugfix pipeline resumes from where it left off -- completed bugs are not re-fixed.
|
|
251
|
+
- **Bug ordering**: Bugs are processed by severity (critical → high → medium → low), then by priority number within the same severity.
|
|
252
|
+
- **HANDOFF**: After pipeline completes all bugs, suggest running `prizmkit-retrospective` to capture lessons learned, or checking the fix reports in `.prizmkit/bugfix/`.
|