prizmkit 1.0.45 → 1.0.66

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 (67) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/agent-adapter.js +2 -1
  3. package/bundled/adapters/claude/command-adapter.js +3 -3
  4. package/bundled/agents/prizm-dev-team-dev.md +1 -1
  5. package/bundled/dev-pipeline/README.md +6 -8
  6. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +24 -19
  7. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +2 -2
  8. package/bundled/dev-pipeline/launch-daemon.sh +2 -2
  9. package/bundled/dev-pipeline/lib/branch.sh +76 -0
  10. package/bundled/dev-pipeline/run-bugfix.sh +58 -149
  11. package/bundled/dev-pipeline/run.sh +60 -153
  12. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +17 -4
  13. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +2 -2
  14. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +16 -27
  15. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +20 -32
  16. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +32 -53
  17. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +29 -41
  18. package/bundled/dev-pipeline/templates/session-status-schema.json +1 -1
  19. package/bundled/dev-pipeline/tests/conftest.py +19 -126
  20. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +207 -0
  21. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +128 -141
  22. package/bundled/dev-pipeline/tests/test_utils.py +51 -110
  23. package/bundled/rules/prizm/prizm-commit-workflow.md +3 -3
  24. package/bundled/skills/_metadata.json +15 -16
  25. package/bundled/skills/app-planner/SKILL.md +8 -7
  26. package/bundled/skills/bug-fix-workflow/SKILL.md +171 -0
  27. package/bundled/skills/bug-planner/SKILL.md +25 -33
  28. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +156 -0
  29. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -7
  30. package/bundled/skills/dev-pipeline-launcher/SKILL.md +4 -6
  31. package/bundled/skills/feature-workflow/SKILL.md +25 -42
  32. package/bundled/skills/prizm-kit/SKILL.md +61 -23
  33. package/bundled/skills/prizm-kit/assets/{claude-md-template.md → project-memory-template.md} +3 -3
  34. package/bundled/skills/prizmkit-analyze/SKILL.md +44 -33
  35. package/bundled/skills/prizmkit-clarify/SKILL.md +40 -30
  36. package/bundled/skills/prizmkit-code-review/SKILL.md +58 -45
  37. package/bundled/skills/prizmkit-committer/SKILL.md +30 -68
  38. package/bundled/skills/prizmkit-implement/SKILL.md +60 -28
  39. package/bundled/skills/prizmkit-init/SKILL.md +57 -66
  40. package/bundled/skills/prizmkit-plan/SKILL.md +60 -23
  41. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +74 -19
  42. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +23 -23
  43. package/bundled/skills/prizmkit-retrospective/SKILL.md +142 -65
  44. package/bundled/skills/prizmkit-retrospective/assets/retrospective-template.md +13 -0
  45. package/bundled/skills/prizmkit-specify/SKILL.md +69 -15
  46. package/bundled/skills/refactor-workflow/SKILL.md +116 -52
  47. package/bundled/team/prizm-dev-team.json +2 -2
  48. package/package.json +1 -1
  49. package/src/scaffold.js +4 -4
  50. package/bundled/dev-pipeline/lib/worktree.sh +0 -164
  51. package/bundled/dev-pipeline/tests/__init__.py +0 -0
  52. package/bundled/dev-pipeline/tests/test_check_session.py +0 -131
  53. package/bundled/dev-pipeline/tests/test_cleanup_logs.py +0 -119
  54. package/bundled/dev-pipeline/tests/test_detect_stuck.py +0 -207
  55. package/bundled/dev-pipeline/tests/test_generate_prompt.py +0 -190
  56. package/bundled/dev-pipeline/tests/test_init_bugfix_pipeline.py +0 -153
  57. package/bundled/dev-pipeline/tests/test_init_pipeline.py +0 -241
  58. package/bundled/dev-pipeline/tests/test_update_bug_status.py +0 -142
  59. package/bundled/dev-pipeline/tests/test_update_feature_status.py +0 -338
  60. package/bundled/dev-pipeline/tests/test_worktree.py +0 -236
  61. package/bundled/dev-pipeline/tests/test_worktree_integration.py +0 -796
  62. package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +0 -35
  63. package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +0 -15
  64. package/bundled/skills/prizmkit-summarize/SKILL.md +0 -51
  65. package/bundled/skills/prizmkit-summarize/assets/registry-template.md +0 -18
  66. package/bundled/templates/hooks/commit-intent-claude.json +0 -26
  67. /package/bundled/templates/hooks/{commit-intent-codebuddy.json → commit-intent.json} +0 -0
@@ -1,141 +1,82 @@
1
- """Tests for utils.py."""
1
+ """Tests for dev-pipeline/scripts/utils.py shared utilities."""
2
2
 
3
3
  import json
4
4
  import os
5
- import pytest
5
+ import tempfile
6
6
 
7
7
  from utils import load_json_file, write_json_file, pad_right, _build_progress_bar
8
8
 
9
9
 
10
- class TestLoadJsonFile:
11
- def test_valid_json(self, tmp_path):
12
- p = tmp_path / "valid.json"
13
- p.write_text('{"key": "value"}', encoding="utf-8")
14
- data, err = load_json_file(str(p))
15
- assert err is None
16
- assert data == {"key": "value"}
17
-
18
- def test_invalid_json(self, tmp_path):
19
- p = tmp_path / "invalid.json"
20
- p.write_text("{not valid json", encoding="utf-8")
21
- data, err = load_json_file(str(p))
22
- assert data is None
23
- assert "Invalid JSON" in err
24
-
25
- def test_missing_file(self, tmp_path):
26
- data, err = load_json_file(str(tmp_path / "missing.json"))
27
- assert data is None
28
- assert "File not found" in err
29
-
30
- def test_empty_file(self, tmp_path):
31
- p = tmp_path / "empty.json"
32
- p.write_text("", encoding="utf-8")
33
- data, err = load_json_file(str(p))
34
- assert data is None
35
- assert "Invalid JSON" in err
36
-
37
- def test_unicode_content(self, tmp_path):
38
- p = tmp_path / "unicode.json"
39
- p.write_text('{"name": "hello"}', encoding="utf-8")
40
- data, err = load_json_file(str(p))
41
- assert err is None
42
- assert data["name"] == "hello"
10
+ # ---------------------------------------------------------------------------
11
+ # load_json_file / write_json_file round-trip
12
+ # ---------------------------------------------------------------------------
43
13
 
44
- def test_nested_json(self, tmp_path):
45
- nested = {"a": {"b": [1, 2, 3]}}
46
- p = tmp_path / "nested.json"
47
- p.write_text(json.dumps(nested), encoding="utf-8")
48
- data, err = load_json_file(str(p))
14
+ class TestJsonIO:
15
+ def test_round_trip(self, tmp_path):
16
+ path = str(tmp_path / "data.json")
17
+ data = {"features": [{"id": "F-001"}]}
18
+ err = write_json_file(path, data)
49
19
  assert err is None
50
- assert data == nested
51
20
 
52
-
53
- class TestWriteJsonFile:
54
- def test_write_and_read_back(self, tmp_path):
55
- p = str(tmp_path / "output.json")
56
- data = {"hello": "world", "num": 42}
57
- err = write_json_file(p, data)
21
+ loaded, err = load_json_file(path)
58
22
  assert err is None
59
- read_data, read_err = load_json_file(p)
60
- assert read_err is None
61
- assert read_data == data
62
-
63
- def test_creates_parent_directories(self, tmp_path):
64
- p = str(tmp_path / "a" / "b" / "c" / "output.json")
65
- err = write_json_file(p, {"nested": True})
23
+ assert loaded == data
24
+
25
+ def test_load_missing_file(self):
26
+ loaded, err = load_json_file("/nonexistent/path.json")
27
+ assert loaded is None
28
+ assert "not found" in err.lower() or "File not found" in err
29
+
30
+ def test_load_invalid_json(self, tmp_path):
31
+ path = str(tmp_path / "bad.json")
32
+ with open(path, "w") as f:
33
+ f.write("{invalid json}")
34
+ loaded, err = load_json_file(path)
35
+ assert loaded is None
36
+ assert "invalid" in err.lower() or "Invalid" in err
37
+
38
+ def test_write_creates_parent_dirs(self, tmp_path):
39
+ path = str(tmp_path / "a" / "b" / "c" / "data.json")
40
+ err = write_json_file(path, {"ok": True})
66
41
  assert err is None
67
- assert os.path.isfile(p)
68
-
69
- def test_overwrites_existing(self, tmp_path):
70
- p = str(tmp_path / "overwrite.json")
71
- write_json_file(p, {"v": 1})
72
- write_json_file(p, {"v": 2})
73
- data, _ = load_json_file(p)
74
- assert data["v"] == 2
75
-
76
- def test_unicode_data(self, tmp_path):
77
- p = str(tmp_path / "unicode.json")
78
- err = write_json_file(p, {"name": "hello"})
79
- assert err is None
80
- data, _ = load_json_file(p)
81
- assert data["name"] == "hello"
42
+ assert os.path.isfile(path)
43
+
82
44
 
45
+ # ---------------------------------------------------------------------------
46
+ # pad_right
47
+ # ---------------------------------------------------------------------------
83
48
 
84
49
  class TestPadRight:
85
- def test_shorter_than_width(self):
50
+ def test_basic_padding(self):
86
51
  result = pad_right("abc", 10)
87
52
  assert len(result) == 10
88
53
  assert result == "abc "
89
54
 
90
- def test_exact_width(self):
91
- result = pad_right("abcde", 5)
92
- assert result == "abcde"
93
-
94
- def test_longer_than_width(self):
95
- result = pad_right("abcdefgh", 5)
96
- assert result == "abcdefgh"
55
+ def test_no_padding_needed(self):
56
+ result = pad_right("abcdef", 3)
57
+ assert result == "abcdef"
97
58
 
98
- def test_empty_string(self):
99
- result = pad_right("", 5)
100
- assert result == " "
59
+ def test_ansi_escape_ignored(self):
60
+ # ANSI color code should not count toward visible length
61
+ text = "\033[31mred\033[0m" # "red" with ANSI color (3 visible chars)
62
+ result = pad_right(text, 10)
63
+ # Visible length is 3, so 7 spaces of padding
64
+ assert result.endswith(" ")
101
65
 
102
- def test_ansi_codes_ignored(self):
103
- # ANSI escape should not count toward visible length
104
- text = "\033[92mHi\033[0m" # visible "Hi" = 2 chars
105
- result = pad_right(text, 5)
106
- # visible width is 2, so 3 spaces of padding
107
- assert result.endswith(" ")
108
-
109
- def test_zero_width(self):
110
- result = pad_right("abc", 0)
111
- assert result == "abc"
112
66
 
67
+ # ---------------------------------------------------------------------------
68
+ # _build_progress_bar
69
+ # ---------------------------------------------------------------------------
113
70
 
114
71
  class TestBuildProgressBar:
115
72
  def test_zero_percent(self):
116
- bar = _build_progress_bar(0)
73
+ bar = _build_progress_bar(0, width=10)
117
74
  assert "0%" in bar
118
- assert "\u2591" in bar # empty blocks
119
- assert "\u2588" not in bar # no filled blocks
120
-
121
- def test_fifty_percent(self):
122
- bar = _build_progress_bar(50, width=20)
123
- assert "50%" in bar
124
- assert bar.count("\u2588") == 10
125
- assert bar.count("\u2591") == 10
126
75
 
127
76
  def test_hundred_percent(self):
128
- bar = _build_progress_bar(100, width=20)
77
+ bar = _build_progress_bar(100, width=10)
129
78
  assert "100%" in bar
130
- assert bar.count("\u2588") == 20
131
- assert bar.count("\u2591") == 0
132
79
 
133
- def test_custom_width(self):
80
+ def test_fifty_percent(self):
134
81
  bar = _build_progress_bar(50, width=10)
135
- assert bar.count("\u2588") == 5
136
- assert bar.count("\u2591") == 5
137
-
138
- def test_partial_percent(self):
139
- bar = _build_progress_bar(33, width=10)
140
- assert bar.count("\u2588") == 3
141
- assert bar.count("\u2591") == 7
82
+ assert "50%" in bar
@@ -3,8 +3,8 @@ description: "PrizmKit commit workflow rules"
3
3
  ---
4
4
 
5
5
  Before any git commit in this project:
6
- 1. Update `.prizm-docs/` for affected modules
6
+ 1. Run `/prizmkit-retrospective` to sync `.prizm-docs/` (memory maintenance)
7
7
  2. Use Conventional Commits format: type(scope): description
8
8
  3. Bug fixes use `fix()` prefix, not `feat()`
9
- 4. Do NOT create REGISTRY.md entries for bug fixes
10
- 5. Use `/prizmkit-committer` command for the complete commit workflow
9
+ 4. Bug fixes run retrospective with structural sync only (Job 1)
10
+ 5. Use `/prizmkit-committer` command for the pure commit workflow
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.45",
2
+ "version": "1.0.66",
3
3
  "skills": {
4
4
  "prizm-kit": {
5
5
  "description": "Full-lifecycle dev toolkit. Covers spec-driven development, Prizm context docs, code quality, debugging, deployment, and knowledge management.",
@@ -23,7 +23,7 @@
23
23
  "hasScripts": false
24
24
  },
25
25
  "prizmkit-clarify": {
26
- "description": "Interactive requirement clarification. Resolves ambiguities in feature specs.",
26
+ "description": "Interactive requirement clarification. Resolves ambiguities in feature specs. Use when spec has unclear parts or you're unsure about requirements before planning.",
27
27
  "tier": "1",
28
28
  "category": "prizmkit-skill",
29
29
  "hasAssets": false,
@@ -37,7 +37,7 @@
37
37
  "hasScripts": false
38
38
  },
39
39
  "prizmkit-analyze": {
40
- "description": "Cross-document consistency analysis for spec.md and plan.md (including Tasks section).",
40
+ "description": "Cross-document consistency analysis for spec.md and plan.md. Check if spec and plan are aligned, validate documents before coding.",
41
41
  "tier": "1",
42
42
  "category": "prizmkit-skill",
43
43
  "hasAssets": false,
@@ -58,24 +58,17 @@
58
58
  "hasScripts": false
59
59
  },
60
60
  "prizmkit-committer": {
61
- "description": "Commit workflow with automatic Prizm doc updates and changelog management.",
61
+ "description": "Pure git commit workflow with safety checks. Does NOT modify .prizm-docs/.",
62
62
  "tier": "1",
63
63
  "category": "prizmkit-skill",
64
64
  "hasAssets": false,
65
65
  "hasScripts": false
66
66
  },
67
- "prizmkit-summarize": {
68
- "description": "Archive completed features to REGISTRY.md.",
69
- "tier": "1",
70
- "category": "prizmkit-skill",
71
- "hasAssets": true,
72
- "hasScripts": false
73
- },
74
67
  "prizmkit-retrospective": {
75
- "description": "Post-feature retrospective. Extracts lessons from completed features.",
68
+ "description": "Sole .prizm-docs/ maintainer. Update project documentation after code changes. Structural sync + knowledge injection (TRAPS/RULES/DECISIONS). Run after code review passes, before committing.",
76
69
  "tier": "1",
77
70
  "category": "prizmkit-skill",
78
- "hasAssets": false,
71
+ "hasAssets": true,
79
72
  "hasScripts": false
80
73
  },
81
74
  "prizmkit-prizm-docs": {
@@ -224,6 +217,13 @@
224
217
  "category": "Custom-skill",
225
218
  "hasAssets": false,
226
219
  "hasScripts": false
220
+ },
221
+ "bug-fix-workflow": {
222
+ "description": "Interactive single-bug fix in current session. Guides triage → reproduce → fix → review → commit without background pipeline.",
223
+ "tier": "companion",
224
+ "category": "Custom-skill",
225
+ "hasAssets": false,
226
+ "hasScripts": false
227
227
  }
228
228
  },
229
229
  "suites": {
@@ -244,14 +244,14 @@
244
244
  "prizmkit-implement",
245
245
  "prizmkit-code-review",
246
246
  "prizmkit-committer",
247
- "prizmkit-summarize",
248
247
  "prizmkit-retrospective",
249
248
  "feature-workflow",
250
249
  "refactor-workflow",
251
250
  "app-planner",
252
251
  "bug-planner",
253
252
  "dev-pipeline-launcher",
254
- "bugfix-pipeline-launcher"
253
+ "bugfix-pipeline-launcher",
254
+ "bug-fix-workflow"
255
255
  ]
256
256
  },
257
257
  "minimal": {
@@ -267,7 +267,6 @@
267
267
  "prizmkit-implement",
268
268
  "prizmkit-code-review",
269
269
  "prizmkit-committer",
270
- "prizmkit-summarize",
271
270
  "prizmkit-retrospective"
272
271
  ]
273
272
  }
@@ -92,7 +92,7 @@ Execute the selected scenario workflow in conversation mode with mandatory check
92
92
 
93
93
  ### Checkpoints (Mandatory Gates)
94
94
 
95
- Never skip checkpoints. If any checkpoint fails, follow error recovery flow (see §Error Recovery).
95
+ Checkpoints catch cascading errors early skipping one means the next phase builds on unvalidated assumptions, which compounds into much harder debugging later.
96
96
 
97
97
  | Checkpoint | Artifact/State | Criteria | Phase |
98
98
  |-----------|----------------|----------|-------|
@@ -311,16 +311,17 @@ Resume incremental planning? (Y/n)"
311
311
 
312
312
  ### Artifact Path Convention
313
313
 
314
- Recommended structure for feature planning artifacts:
314
+ The primary output `feature-list.json` is always written to the **project root** — this is where `dev-pipeline-launcher` and all pipeline scripts expect it.
315
315
 
316
316
  ```
317
- .prizmkit/planning/
318
- ├── feature-list.json # Primary output (always here)
319
- ├── feature-list.validated.json # Checkpoint backup after CP-AP-5
320
- └── <ISO-timestamp>.backup.json # Optional incremental backups
317
+ <project-root>/
318
+ ├── feature-list.json # Primary output (always here, at project root)
319
+ └── .prizmkit/planning/ # Optional organization for backups
320
+ ├── feature-list.validated.json # Checkpoint backup after CP-AP-5
321
+ └── <ISO-timestamp>.backup.json # Optional incremental backups
321
322
  ```
322
323
 
323
- Mention this path when summarizing (Phase 8 handoff) to help users organize future sessions.
324
+ The pipeline reads `feature-list.json` from the project root by default. If the user specifies a custom path, the launcher accepts it as an argument.
324
325
 
325
326
  Maintainer note: evaluation workflow moved to `assets/evaluation-guide.md`.
326
327
 
@@ -0,0 +1,171 @@
1
+ ---
2
+ name: "bug-fix-workflow"
3
+ tier: companion
4
+ description: "Interactive single-bug fix in current session. Guides through triage → reproduce → fix → review → commit without the background pipeline. Use this skill when the user wants to fix one specific bug right now, interactively. Trigger on: 'fix this bug', 'debug this', 'fix B-001', 'help me fix', 'let me fix this bug myself', '修这个 bug', '交互式修复', '手动修 bug'. (project)"
5
+ ---
6
+
7
+ # Bug Fix Workflow
8
+
9
+ Fix a single bug interactively within the current AI CLI session. This is the in-session counterpart to `bugfix-pipeline-launcher` (which runs multiple bugs in the background).
10
+
11
+ ## When to Use
12
+
13
+ - User wants to fix **one specific bug** right now, with full visibility
14
+ - User says "fix this bug", "debug this error", "help me fix B-001", "修这个 bug"
15
+ - User has a stack trace or error and wants interactive debugging
16
+ - User prefers hands-on fixing over background pipeline
17
+
18
+ **Do NOT use when:**
19
+ - User has multiple bugs to fix in batch → `bug-planner` + `bugfix-pipeline-launcher`
20
+ - User wants to plan/collect bugs without fixing → `bug-planner`
21
+ - User wants background autonomous fixing → `bugfix-pipeline-launcher`
22
+ - User wants to build features → `feature-workflow`
23
+
24
+ ## Input
25
+
26
+ The bug can come from:
27
+ - **A bug-fix-list.json entry**: "fix B-001" → read the entry from bug-fix-list.json
28
+ - **A stack trace/error message**: user pastes error directly
29
+ - **A description**: "the login page crashes when I click submit"
30
+ - **A failed test**: "this test is failing: src/auth/__tests__/login.test.ts"
31
+
32
+ ## Execution
33
+
34
+ ### Phase 1: Triage
35
+
36
+ **Goal**: Understand the bug, locate affected code, classify severity.
37
+
38
+ 1. **Gather bug info**:
39
+ - If bug ID given (e.g. B-001): read entry from `bug-fix-list.json`
40
+ - If raw error: extract error message, stack trace, affected files
41
+ - If description: ask clarifying questions to narrow down the issue
42
+ 2. **Read project context**: `.prizm-docs/root.prizm` → relevant L1/L2 docs for affected modules
43
+ 3. **Locate affected code**: read the files mentioned in the error/stack trace
44
+ 4. **Check known issues**: search `.prizm-docs/` TRAPS sections for matching patterns
45
+ 5. **Classify**: root cause (confirmed/suspected), blast radius, fix complexity
46
+ 6. **Present diagnosis to user**:
47
+ ```
48
+ Bug: Login page crash on submit
49
+ Root Cause: AuthService.handleLogin() receives null token when API returns 401
50
+ Affected Files: src/services/auth.ts (L42), src/pages/login.tsx (L28)
51
+ Fix Complexity: Low (null check + error handling)
52
+ ```
53
+ Ask: "Does this diagnosis look right? Should I proceed with the fix?"
54
+
55
+ ### Phase 2: Reproduce
56
+
57
+ **Goal**: Create a failing test that proves the bug exists.
58
+
59
+ 1. **Write a reproduction test** that demonstrates the bug:
60
+ - Name: `<module>.test.ts` → add a test case named `should handle <bug scenario>`
61
+ - The test captures the exact failure condition
62
+ 2. **Run the test** → confirm it **fails** (red)
63
+ 3. **Show result to user**: "Reproduction test written and confirmed failing."
64
+
65
+ If the bug is hard to reproduce automatically (e.g. environment-specific):
66
+ - Ask the user for reproduction steps
67
+ - Write a manual reproduction checklist instead
68
+ - Proceed to Phase 3 with the manual checklist
69
+
70
+ ### Phase 3: Fix
71
+
72
+ **Goal**: Implement the minimal fix. Red test → green.
73
+
74
+ 1. **Implement the fix**:
75
+ - Change the minimum amount of code to fix the root cause
76
+ - Do NOT refactor or add unrelated improvements — fix the bug only
77
+ - Follow existing code conventions (read from `.prizm-docs/` RULES/PATTERNS)
78
+ 2. **Run the reproduction test** → must **pass** (green)
79
+ 3. **Run the full module test suite** → must pass (no regressions)
80
+ 4. **Show the fix to user**:
81
+ - Summary of changes made
82
+ - Test results (reproduction + regression)
83
+ - Ask: "Fix looks good? Any concerns?"
84
+
85
+ If the fix causes test regressions:
86
+ - Show which tests broke and why
87
+ - Revise the fix (max 3 attempts)
88
+ - If still failing after 3 attempts, escalate to user with analysis
89
+
90
+ ### Phase 4: Review
91
+
92
+ **Goal**: Verify fix quality before committing.
93
+
94
+ 1. **Self-review** the changes:
95
+ - Does the fix address the root cause (not just the symptom)?
96
+ - Are there edge cases not covered?
97
+ - Is the reproduction test thorough enough?
98
+ - Does the fix follow project conventions?
99
+ 2. **Run full test suite** one final time
100
+ 3. **Present review summary**:
101
+ ```
102
+ Fix Review:
103
+ - Root cause addressed: Yes (null check added at auth service level)
104
+ - Edge cases: Covered (401, 403, network error)
105
+ - Regression: None (48/48 tests pass)
106
+ - Code quality: Clean, follows existing patterns
107
+
108
+ Ready to commit.
109
+ ```
110
+
111
+ ### Phase 5: Commit
112
+
113
+ **Goal**: Commit the fix with proper conventions.
114
+
115
+ 1. **Run `/prizmkit-committer`**:
116
+ - Commit message: `fix(<scope>): <description>`
117
+ - Include both fix code and reproduction test
118
+ - Do NOT push (user decides when to push)
119
+ - Do NOT run `/prizmkit-retrospective` — bug fixes do not update `.prizm-docs/` (per project rules: "bugs are incomplete features, recording bug details causes doc bloat with no AI value")
120
+ - `/prizmkit-committer` is a pure commit tool — it does NOT modify `.prizm-docs/` or any project files
121
+ 2. **If bug came from bug-fix-list.json**: inform user to update bug status
122
+ ```
123
+ Bug B-001 fixed and committed.
124
+ To update the bug list: manually set B-001 status to "fixed" in bug-fix-list.json
125
+ Or retry the pipeline to pick up remaining bugs.
126
+ ```
127
+
128
+ ## Artifacts
129
+
130
+ Bug fix artifacts are stored at `.prizmkit/bugfix/<BUG_ID>/`:
131
+ - `fix-plan.md` — Triage output (diagnosis, root cause, fix approach)
132
+ - `fix-report.md` — Post-fix summary (what changed, test results, TRAPS added)
133
+
134
+ Only 2 artifact files per bug, consistent with the pipeline convention.
135
+
136
+ ## Comparison with Pipeline Bug Fix
137
+
138
+ | Dimension | bug-fix-workflow (this skill) | bugfix-pipeline-launcher |
139
+ |-----------|-------------------------------|--------------------------|
140
+ | Scope | One bug at a time | All bugs in batch |
141
+ | Execution | Interactive, in-session | Background daemon |
142
+ | Visibility | Full user interaction at each phase | Async, check status periodically |
143
+ | Best for | Complex bugs needing user input | Batch of well-defined bugs |
144
+ | Artifacts | Same (fix-plan.md + fix-report.md) | Same |
145
+ | Commit prefix | `fix(<scope>):` | `fix(<scope>):` |
146
+
147
+ ## Error Handling
148
+
149
+ | Scenario | Action |
150
+ |----------|--------|
151
+ | Bug ID not found in bug-fix-list.json | Ask user to provide bug details directly |
152
+ | Cannot reproduce the bug | Ask for more context, try alternative reproduction |
153
+ | Fix causes regressions | Revert, analyze, retry (max 3 rounds) |
154
+ | Root cause unclear after investigation | Present findings, ask user for guidance |
155
+ | Affected files are in unfamiliar module | Read `.prizm-docs/` L1/L2 for that module first |
156
+
157
+ ## HANDOFF
158
+
159
+ | From | To | Condition |
160
+ |------|----|-----------|
161
+ | `bug-planner` | **this skill** | User picks one bug to fix interactively |
162
+ | `bugfix-pipeline-launcher` | **this skill** | User wants to fix a stuck/complex bug manually |
163
+ | **this skill** | `bugfix-pipeline-launcher` | After fixing, user wants to continue with remaining bugs |
164
+ | **this skill** | `prizmkit-committer` | Built into Phase 5 (pure commit, no doc sync) |
165
+
166
+ ## Output
167
+
168
+ - Fixed code with reproduction test
169
+ - `.prizmkit/bugfix/<BUG_ID>/fix-plan.md`
170
+ - `.prizmkit/bugfix/<BUG_ID>/fix-report.md`
171
+ - Git commit with `fix(<scope>):` prefix
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "bug-planner"
3
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)"
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. Use this skill whenever the user has bugs to report, errors to parse, or test failures to organize. Trigger on: 'plan bug fixes', 'report bugs', 'I have some bugs', 'these tests are failing', 'here is an error log', 'parse these errors', '修复 bug', '生成 bug 列表', '规划 bug 修复'. (project)"
5
5
  ---
6
6
 
7
7
  # Bug Planner
@@ -17,33 +17,28 @@ User says:
17
17
  - "here's an error log", "parse these errors"
18
18
  - After receiving bug reports, error logs, or failed test output
19
19
 
20
- ## Commands
20
+ **Do NOT use when:**
21
+ - User wants to start fixing bugs now (use `bugfix-pipeline-launcher`)
22
+ - User wants to fix a single bug interactively (use `bug-fix-workflow`)
23
+ - User wants to plan features (use `app-planner`)
21
24
 
22
- ### prizmkit.bug-plan
25
+ ## Intent Routing
23
26
 
24
- Launch the interactive bug planning process.
27
+ This skill handles multiple operations. Determine the user's intent and execute the matching operation:
25
28
 
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.
29
+ | User Intent | Operation | Trigger Phrases |
30
+ |---|---|---|
31
+ | Plan bugs interactively | **Interactive Planning** | "plan bug fixes", "report bugs", "规划 bug 修复" |
32
+ | Parse error logs into bugs | **From Log** | "parse this error log", "here's a stack trace", "parse these errors" |
33
+ | Parse test failures into bugs | **From Tests** | "these tests are failing", "parse test output" |
34
+ | Validate existing bug list | **Validate** | "validate bug list", "check bug-fix-list.json" |
35
+ | Summarize bug list | **Summary** | "bug summary", "show bug list", "list bugs" |
41
36
 
42
37
  ---
43
38
 
44
- ## Interactive Planning Process
39
+ ## Operation: Interactive Planning
45
40
 
46
- The interactive `prizmkit.bug-plan` command guides through 4 phases:
41
+ Launch the interactive bug planning process through 4 phases.
47
42
 
48
43
  ### Phase 1: Project Context
49
44
 
@@ -140,7 +135,11 @@ ALERT: Error rate spike: 500 errors/min on /api/login endpoint
140
135
  ### Phase 4: Generate & Validate
141
136
 
142
137
  1. **Generate `bug-fix-list.json`**: Conform to `dev-pipeline/templates/bug-fix-list-schema.json`
143
- 2. **Validate against schema**: Run the validation checks below
138
+ 2. **Validate against schema**: Run the validation script:
139
+ ```bash
140
+ python3 ${SKILL_DIR}/scripts/validate-bug-list.py bug-fix-list.json --feature-list feature-list.json
141
+ ```
142
+ If the script is not available, perform the validation checks manually (see checklist below).
144
143
  3. **Write file** to project root (or user-specified path)
145
144
  4. **Output**: File path, summary, and next steps
146
145
 
@@ -179,14 +178,11 @@ Next steps:
179
178
  - Review: cat bug-fix-list.json
180
179
  - Start fixing: say "开始修复" or "start fixing bugs" to launch the bugfix pipeline
181
180
  - Or run directly: ./dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json
182
- - Fix one interactively: invoke bug-fix-workflow for each bug
183
181
  ```
184
182
 
185
183
  ---
186
184
 
187
- ## Non-Interactive Commands
188
-
189
- ### prizmkit.bug-plan-from-log
185
+ ## Operation: From Log
190
186
 
191
187
  Batch-parse error logs to generate bug entries without interactive prompts:
192
188
 
@@ -202,7 +198,7 @@ Batch-parse error logs to generate bug entries without interactive prompts:
202
198
  4. Output draft `bug-fix-list.json` for user review
203
199
  5. Ask: "Review and confirm? You can edit individual entries."
204
200
 
205
- ### prizmkit.bug-plan-from-tests
201
+ ## Operation: From Tests
206
202
 
207
203
  Batch-parse failed test output:
208
204
 
@@ -212,7 +208,7 @@ Batch-parse failed test output:
212
208
  4. Set verification_type to `automated` (test already exists)
213
209
  5. Output draft `bug-fix-list.json`
214
210
 
215
- ### prizmkit.bug-plan-validate
211
+ ## Operation: Validate
216
212
 
217
213
  Validate existing `bug-fix-list.json`:
218
214
 
@@ -226,7 +222,7 @@ Validate existing `bug-fix-list.json`:
226
222
  - Invalid `affected_feature` references (if feature-list.json exists)
227
223
  4. Output: validation result with specific errors/warnings
228
224
 
229
- ### prizmkit.bug-plan-summary
225
+ ## Operation: Summary
230
226
 
231
227
  Print human-readable summary:
232
228
 
@@ -269,10 +265,6 @@ After `bug-fix-list.json` is generated, the user can:
269
265
  | Invalid feature reference | Warn and ask user to correct or remove reference |
270
266
  | Schema validation failure | Show specific errors, offer to fix interactively |
271
267
 
272
- ## Path References
273
-
274
- All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
275
-
276
268
  ## Output
277
269
 
278
270
  - `bug-fix-list.json` conforming to `dev-pipeline/templates/bug-fix-list-schema.json`