prizmkit 1.0.0 → 1.0.1

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 (89) hide show
  1. package/bundled/VERSION.json +5 -0
  2. package/bundled/adapters/claude/agent-adapter.js +108 -0
  3. package/bundled/adapters/claude/command-adapter.js +104 -0
  4. package/bundled/adapters/claude/paths.js +35 -0
  5. package/bundled/adapters/claude/rules-adapter.js +77 -0
  6. package/bundled/adapters/claude/settings-adapter.js +73 -0
  7. package/bundled/adapters/claude/team-adapter.js +183 -0
  8. package/bundled/adapters/codebuddy/agent-adapter.js +43 -0
  9. package/bundled/adapters/codebuddy/paths.js +29 -0
  10. package/bundled/adapters/codebuddy/settings-adapter.js +47 -0
  11. package/bundled/adapters/codebuddy/skill-adapter.js +68 -0
  12. package/bundled/adapters/codebuddy/team-adapter.js +46 -0
  13. package/bundled/adapters/shared/frontmatter.js +77 -0
  14. package/bundled/agents/prizm-dev-team-coordinator.md +142 -0
  15. package/bundled/agents/prizm-dev-team-dev.md +99 -0
  16. package/bundled/agents/prizm-dev-team-pm.md +114 -0
  17. package/bundled/agents/prizm-dev-team-reviewer.md +119 -0
  18. package/bundled/dev-pipeline/README.md +482 -0
  19. package/bundled/dev-pipeline/assets/feature-list-example.json +147 -0
  20. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +138 -0
  21. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +425 -0
  22. package/bundled/dev-pipeline/launch-daemon.sh +549 -0
  23. package/bundled/dev-pipeline/reset-feature.sh +209 -0
  24. package/bundled/dev-pipeline/retry-bug.sh +344 -0
  25. package/bundled/dev-pipeline/retry-feature.sh +338 -0
  26. package/bundled/dev-pipeline/run-bugfix.sh +638 -0
  27. package/bundled/dev-pipeline/run.sh +845 -0
  28. package/bundled/dev-pipeline/scripts/check-session-status.py +158 -0
  29. package/bundled/dev-pipeline/scripts/detect-stuck.py +385 -0
  30. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +598 -0
  31. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +402 -0
  32. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +294 -0
  33. package/bundled/dev-pipeline/scripts/init-dev-team.py +134 -0
  34. package/bundled/dev-pipeline/scripts/init-pipeline.py +335 -0
  35. package/bundled/dev-pipeline/scripts/update-bug-status.py +748 -0
  36. package/bundled/dev-pipeline/scripts/update-feature-status.py +1076 -0
  37. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +262 -0
  38. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +159 -0
  39. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +291 -0
  40. package/bundled/dev-pipeline/templates/feature-list-schema.json +112 -0
  41. package/bundled/dev-pipeline/templates/session-status-schema.json +77 -0
  42. package/bundled/skills/_metadata.json +267 -0
  43. package/bundled/skills/app-planner/SKILL.md +580 -0
  44. package/bundled/skills/app-planner/assets/planning-guide.md +313 -0
  45. package/bundled/skills/app-planner/scripts/validate-and-generate.py +758 -0
  46. package/bundled/skills/bug-planner/SKILL.md +235 -0
  47. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +252 -0
  48. package/bundled/skills/dev-pipeline-launcher/SKILL.md +223 -0
  49. package/bundled/skills/prizm-kit/SKILL.md +151 -0
  50. package/bundled/skills/prizm-kit/assets/claude-md-template.md +38 -0
  51. package/bundled/skills/prizm-kit/assets/codebuddy-md-template.md +35 -0
  52. package/bundled/skills/prizm-kit/assets/hooks/prizm-commit-hook.json +15 -0
  53. package/bundled/skills/prizmkit-adr-manager/SKILL.md +68 -0
  54. package/bundled/skills/prizmkit-adr-manager/assets/adr-template.md +26 -0
  55. package/bundled/skills/prizmkit-analyze/SKILL.md +194 -0
  56. package/bundled/skills/prizmkit-api-doc-generator/SKILL.md +56 -0
  57. package/bundled/skills/prizmkit-bug-fix-workflow/SKILL.md +351 -0
  58. package/bundled/skills/prizmkit-bug-reproducer/SKILL.md +62 -0
  59. package/bundled/skills/prizmkit-ci-cd-generator/SKILL.md +54 -0
  60. package/bundled/skills/prizmkit-clarify/SKILL.md +52 -0
  61. package/bundled/skills/prizmkit-code-review/SKILL.md +70 -0
  62. package/bundled/skills/prizmkit-committer/SKILL.md +117 -0
  63. package/bundled/skills/prizmkit-db-migration/SKILL.md +65 -0
  64. package/bundled/skills/prizmkit-dependency-health/SKILL.md +123 -0
  65. package/bundled/skills/prizmkit-deployment-strategy/SKILL.md +58 -0
  66. package/bundled/skills/prizmkit-error-triage/SKILL.md +55 -0
  67. package/bundled/skills/prizmkit-implement/SKILL.md +47 -0
  68. package/bundled/skills/prizmkit-init/SKILL.md +156 -0
  69. package/bundled/skills/prizmkit-log-analyzer/SKILL.md +55 -0
  70. package/bundled/skills/prizmkit-monitoring-setup/SKILL.md +75 -0
  71. package/bundled/skills/prizmkit-onboarding-generator/SKILL.md +70 -0
  72. package/bundled/skills/prizmkit-perf-profiler/SKILL.md +55 -0
  73. package/bundled/skills/prizmkit-plan/SKILL.md +54 -0
  74. package/bundled/skills/prizmkit-plan/assets/plan-template.md +37 -0
  75. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +140 -0
  76. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +943 -0
  77. package/bundled/skills/prizmkit-retrospective/SKILL.md +79 -0
  78. package/bundled/skills/prizmkit-security-audit/SKILL.md +130 -0
  79. package/bundled/skills/prizmkit-specify/SKILL.md +52 -0
  80. package/bundled/skills/prizmkit-specify/assets/spec-template.md +37 -0
  81. package/bundled/skills/prizmkit-summarize/SKILL.md +51 -0
  82. package/bundled/skills/prizmkit-summarize/assets/registry-template.md +18 -0
  83. package/bundled/skills/prizmkit-tasks/SKILL.md +50 -0
  84. package/bundled/skills/prizmkit-tasks/assets/tasks-template.md +21 -0
  85. package/bundled/skills/prizmkit-tech-debt-tracker/SKILL.md +139 -0
  86. package/bundled/team/prizm-dev-team.json +47 -0
  87. package/bundled/templates/claude-md-template.md +38 -0
  88. package/bundled/templates/codebuddy-md-template.md +35 -0
  89. package/package.json +2 -1
@@ -0,0 +1,194 @@
1
+ ---
2
+ name: "prizmkit-analyze"
3
+ description: "Cross-document consistency analysis for spec.md, plan.md, and tasks.md. Detects duplications, ambiguities, gaps, and rule conflicts. Read-only. (project)"
4
+ ---
5
+
6
+ # PrizmKit Analyze
7
+
8
+ Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md before implementation. Identifies duplications, ambiguities, underspecified items, rule conflicts, and coverage gaps.
9
+
10
+ ### When to Use
11
+ - After `prizmkit.plan` to validate spec-plan alignment before task generation
12
+ - After `prizmkit.tasks` to validate full spec-plan-tasks consistency before implementation
13
+ - User says "analyze", "check consistency", "validate spec", "review plan"
14
+ - Before `prizmkit.implement` as a quality gate
15
+
16
+ ## Commands
17
+
18
+ ### prizmkit.analyze
19
+
20
+ Cross-document consistency analysis.
21
+
22
+ **PRECONDITION:** `spec.md` and `plan.md` exist in `.prizmkit/specs/###-feature-name/`. `tasks.md` is recommended but not required.
23
+
24
+ ## Operating Constraints
25
+
26
+ **STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report to conversation only. Offer an optional remediation plan (user must explicitly approve before any edits).
27
+
28
+ **Prizm Rules Authority**: The project rules in `.prizm-docs/root.prizm` RULES section are **non-negotiable** within this analysis scope. Rule conflicts are automatically CRITICAL severity and require adjustment of the spec, plan, or tasks — not dilution or silent ignoring of the rule. If a rule itself needs to change, that must occur via a separate `prizmkit.doc.update`.
29
+
30
+ ## Execution Steps
31
+
32
+ ### Step 1: Initialize Analysis Context
33
+
34
+ Locate the current feature directory in `.prizmkit/specs/###-feature-name/` by checking the current Git branch name or scanning `.prizmkit/specs/` for the most recent feature directory.
35
+
36
+ Derive absolute paths:
37
+ - SPEC = `.prizmkit/specs/###-feature-name/spec.md`
38
+ - PLAN = `.prizmkit/specs/###-feature-name/plan.md`
39
+ - TASKS = `.prizmkit/specs/###-feature-name/tasks.md` (optional)
40
+
41
+ Abort with an error message if spec.md or plan.md is missing — instruct the user to run the missing prerequisite command (`prizmkit.specify` or `prizmkit.plan`).
42
+
43
+ If tasks.md is missing, proceed with spec+plan analysis only and note reduced coverage in the report.
44
+
45
+ ### Step 2: Load Artifacts (Progressive Disclosure)
46
+
47
+ Load only the minimal necessary context from each artifact:
48
+
49
+ **From spec.md:**
50
+ - Overview/Context
51
+ - Functional Requirements
52
+ - Non-Functional Requirements
53
+ - User Stories and Acceptance Criteria
54
+ - Scope Boundaries
55
+ - Edge Cases (if present)
56
+
57
+ **From plan.md:**
58
+ - Architecture/stack choices
59
+ - Component Design
60
+ - Data Model references
61
+ - API Contracts
62
+ - Testing Strategy
63
+ - Risk Assessment
64
+
65
+ **From tasks.md (if exists):**
66
+ - Task IDs and Descriptions
67
+ - Phase grouping (Setup, Foundational, User Stories, Polish)
68
+ - Parallel markers `[P]`
69
+ - Referenced file paths
70
+
71
+ **From .prizm-docs/root.prizm:**
72
+ - RULES section (MUST/NEVER/PREFER directives)
73
+ - PATTERNS section (project-wide code patterns)
74
+ - TECH_STACK section (for consistency checking)
75
+
76
+ ### Step 3: Build Semantic Models
77
+
78
+ Create internal representations (do not include raw artifacts in output):
79
+
80
+ - **Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug from imperative phrase; e.g., "User can upload file" -> `user-can-upload-file`)
81
+ - **User story/action inventory**: Discrete user actions with acceptance criteria
82
+ - **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
83
+ - **Prizm rule set**: Extract MUST/NEVER/PREFER normative statements from root.prizm RULES
84
+
85
+ ### Step 4: Detection Passes
86
+
87
+ Focus on high-signal findings. Limit to **50 findings total**; aggregate remainder in overflow summary.
88
+
89
+ #### A. Duplication Detection
90
+ - Identify near-duplicate requirements across spec.md sections
91
+ - Mark lower-quality phrasing for consolidation
92
+
93
+ #### B. Ambiguity Detection
94
+ - Flag vague adjectives (fast, scalable, secure, intuitive, robust) lacking measurable criteria
95
+ - Flag unresolved placeholders (TODO, TBD, ???, `<placeholder>`, `[NEEDS CLARIFICATION]`)
96
+
97
+ #### C. Underspecification
98
+ - Requirements with verbs but missing object or measurable outcome
99
+ - User stories missing acceptance criteria alignment
100
+ - Tasks referencing files or components not defined in spec/plan
101
+ - Plan components with no corresponding spec requirement
102
+
103
+ #### D. Prizm Rules Alignment
104
+ - Any requirement or plan element conflicting with a MUST/NEVER directive
105
+ - Missing mandated patterns from PATTERNS section
106
+ - Tech stack inconsistencies between plan and root.prizm TECH_STACK
107
+
108
+ #### E. Coverage Gaps
109
+ - Requirements with zero associated tasks (if tasks.md loaded)
110
+ - Tasks with no mapped requirement/story ("orphan tasks")
111
+ - Non-functional requirements not reflected in tasks (performance, security, etc.)
112
+ - User stories without corresponding plan components
113
+
114
+ #### F. Inconsistency
115
+ - Terminology drift (same concept named differently across files)
116
+ - Data entities referenced in plan but absent in spec (or vice versa)
117
+ - Task ordering contradictions (e.g., integration tasks before foundational setup without dependency note)
118
+ - Conflicting requirements (e.g., one requires REST while other specifies GraphQL)
119
+
120
+ ### Step 5: Severity Assignment
121
+
122
+ Use this heuristic to prioritize findings:
123
+
124
+ - **CRITICAL**: Violates Prizm RULES MUST/NEVER directive, missing core artifact section, or requirement with zero coverage that blocks baseline functionality
125
+ - **HIGH**: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
126
+ - **MEDIUM**: Terminology drift, missing non-functional task coverage, underspecified edge case
127
+ - **LOW**: Style/wording improvements, minor redundancy not affecting execution order
128
+
129
+ ### Step 6: Produce Compact Analysis Report
130
+
131
+ Output a Markdown report (**no file writes**) with the following structure:
132
+
133
+ ```
134
+ ## Consistency Analysis Report
135
+
136
+ | ID | Category | Severity | Location(s) | Summary | Recommendation |
137
+ |----|----------|----------|-------------|---------|----------------|
138
+ | A1 | Duplication | HIGH | spec.md §2.1, §3.4 | Two similar requirements... | Merge phrasing; keep clearer version |
139
+ | D1 | Rules Alignment | CRITICAL | plan.md §Architecture | Conflicts with MUST rule... | Adjust plan to align with rule |
140
+
141
+ **Coverage Summary:**
142
+
143
+ | Requirement Key | Has Task? | Task IDs | Notes |
144
+ |-----------------|-----------|----------|-------|
145
+
146
+ **Prizm Rules Alignment Issues:** (if any)
147
+
148
+ **Unmapped Tasks:** (if any)
149
+
150
+ **Metrics:**
151
+ - Total Requirements: N
152
+ - Total Tasks: N
153
+ - Coverage %: N% (requirements with >=1 task)
154
+ - Ambiguity Count: N
155
+ - Duplication Count: N
156
+ - Critical Issues: N
157
+ ```
158
+
159
+ ### Step 7: Provide Next Actions
160
+
161
+ At end of report, output a concise Next Actions block:
162
+
163
+ - If CRITICAL issues exist: **Recommend resolving before `prizmkit.implement`**
164
+ - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
165
+ - Provide explicit command suggestions:
166
+ - "Run `prizmkit.specify` to refine requirements"
167
+ - "Run `prizmkit.plan` to adjust architecture"
168
+ - "Edit tasks.md to add coverage for requirement X"
169
+ - "Proceed to `prizmkit.implement`" (if clean)
170
+
171
+ ### Step 8: Offer Remediation
172
+
173
+ Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
174
+
175
+ ## Operating Principles
176
+
177
+ ### Context Efficiency
178
+ - **Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
179
+ - **Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
180
+ - **Token-efficient output**: Limit findings table to 50 rows; summarize overflow
181
+ - **Deterministic results**: Rerunning without changes should produce consistent IDs and counts
182
+
183
+ ### Analysis Guidelines
184
+ - **NEVER modify files** (this is read-only analysis)
185
+ - **NEVER hallucinate missing sections** (if absent, report them accurately)
186
+ - **Prioritize Prizm Rules violations** (these are always CRITICAL)
187
+ - **Use examples over exhaustive rules** (cite specific instances, not generic patterns)
188
+ - **Report zero issues gracefully** (emit success report with coverage statistics)
189
+
190
+ **HANDOFF:** `prizmkit.implement` (if clean) or `prizmkit.specify` / `prizmkit.plan` / `prizmkit.tasks` (if issues found)
191
+
192
+ ## Output
193
+
194
+ Analysis report is output to conversation only. No files are created or modified.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: "prizmkit-api-doc-generator"
3
+ tier: 2
4
+ description: "[Tier 2] Extract API documentation from source code into OpenAPI/Markdown. May miss undocumented or dynamically generated endpoints. (project)"
5
+ ---
6
+
7
+ # PrizmKit API Doc Generator
8
+
9
+ Generate API documentation from source code by scanning routes, controllers, and handlers. Produces OpenAPI 3.0 specs or Markdown reference docs.
10
+
11
+ ## Commands
12
+
13
+ ### prizmkit.api-docs [api-directory]
14
+
15
+ Generate API documentation from source code.
16
+
17
+ **STEPS:**
18
+
19
+ 1. Read `.prizm-docs/` for project tech stack (framework, language, API style: REST / GraphQL / gRPC)
20
+ 2. Scan API source files (routes, controllers, handlers):
21
+ - Detect routing patterns based on framework:
22
+ - Express/Fastify: `app.get()`, `router.post()`, etc.
23
+ - Django/Flask: `@app.route()`, `urlpatterns`
24
+ - Spring: `@GetMapping`, `@PostMapping`, etc.
25
+ - Go: `http.HandleFunc`, gorilla/mux, chi routes
26
+ - If `api-directory` is specified, limit scan to that directory
27
+ 3. Extract for each endpoint:
28
+ - **HTTP method and path**: GET /api/users/:id
29
+ - **Request parameters**:
30
+ - Path parameters (with types)
31
+ - Query parameters (with types and defaults)
32
+ - Request body schema (from types, validation decorators, or inline definitions)
33
+ - **Response body schemas**: Success and error response structures
34
+ - **Authentication requirements**: Which auth mechanism is required (JWT, API key, session, none)
35
+ - **Error responses**: Common error codes and their meanings (400, 401, 403, 404, 500)
36
+ - **Description**: From JSDoc comments, docstrings, or function/handler names
37
+ 4. Generate documentation in requested format:
38
+ - **OpenAPI 3.0 YAML** (default): Full spec with schemas, security definitions, and server info
39
+ - **Markdown API reference**: Human-readable endpoint documentation
40
+ - **Both**: Generate both formats
41
+ 5. Include examples for each endpoint:
42
+ - Sample request (curl command)
43
+ - Sample success response (JSON)
44
+ - Sample error response (JSON)
45
+ 6. Write to `docs/api/` directory:
46
+ - `docs/api/openapi.yaml` for OpenAPI spec
47
+ - `docs/api/API_REFERENCE.md` for Markdown docs
48
+
49
+ ## Path References
50
+
51
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
52
+
53
+ ## Output
54
+
55
+ - `docs/api/openapi.yaml`: OpenAPI 3.0 specification
56
+ - `docs/api/API_REFERENCE.md`: Markdown API reference
@@ -0,0 +1,351 @@
1
+ ---
2
+ name: "prizmkit-bug-fix-workflow"
3
+ tier: 1
4
+ description: "[Tier 1] End-to-end bug fix workflow: triage → reproduce → fix → verify → commit. Orchestrates existing skills into a closed-loop 5-phase pipeline with standardized input/output artifacts. (project)"
5
+ ---
6
+
7
+ # PrizmKit Bug Fix Workflow
8
+
9
+ End-to-end orchestration skill for bug fixes. Chains existing PrizmKit skills (error-triage, bug-reproducer, implement, code-review, committer) into a closed-loop 5-phase pipeline with standardized artifacts.
10
+
11
+ ## Overview
12
+
13
+ ```
14
+ bug-planner → bug-fix-list.json → Bug Fix Pipeline → fix-plan.md + fix-report.md
15
+ (plan) (input) (5 phases) (2 artifacts per bug)
16
+ ```
17
+
18
+ ### Pipeline Phases
19
+
20
+ | Phase | Name | Skill Used | Artifact |
21
+ |-------|------|-----------|----------|
22
+ | 1 | Triage 分诊 | `prizmkit.error-triage` | → `fix-plan.md` |
23
+ | 2 | Reproduce 复现 | `prizmkit.bug-reproduce` | (reproduction test) |
24
+ | 3 | Fix 修复 | `prizmkit.implement` | (code changes) |
25
+ | 4 | Verify 验证 | `prizmkit.code-review` | (review report) |
26
+ | 5 | Commit & Learn | `prizmkit.committer` | → `fix-report.md` |
27
+
28
+ ### Artifacts — Fixed at 2, NEVER more
29
+
30
+ Each bug produces exactly **2 artifact documents**:
31
+
32
+ 1. **`fix-plan.md`** — Generated after Phase 1 Triage. Contains root cause analysis, impact assessment, test strategy, and fix approach.
33
+ 2. **`fix-report.md`** — Generated after Phase 5 Commit. Contains fix details, verification results, knowledge captured, and acceptance criteria verification.
34
+
35
+ Artifacts are stored at: `.prizmkit/bugfix/<BUG_ID>/`
36
+
37
+ ## Commands
38
+
39
+ ### prizmkit.bug-fix \<bug-description-or-error\>
40
+
41
+ Execute the full bug fix pipeline for a single bug.
42
+
43
+ **INPUT FORMATS** (any of the following):
44
+ - Natural language bug description
45
+ - Stack trace / error log
46
+ - Failed test case output
47
+ - User reproduction steps
48
+ - Reference to a `bug-fix-list.json` entry
49
+
50
+ ### prizmkit.bug-fix-batch \<bug-fix-list.json\>
51
+
52
+ Execute the bug fix pipeline for all pending bugs in a standardized `bug-fix-list.json` file.
53
+
54
+ - Processes bugs in priority order (lower priority number = processed first)
55
+ - Skips bugs with status ≠ `pending`
56
+ - Updates status in `bug-fix-list.json` as each bug progresses through phases
57
+
58
+ ---
59
+
60
+ ## Phase 1: Triage — 分诊分类
61
+
62
+ **Goal**: Classify the bug, identify scope and severity, check known issues, produce `fix-plan.md`.
63
+
64
+ **STEPS:**
65
+
66
+ 1. **Parse bug input**: Extract:
67
+ - Error message / stack trace (if provided)
68
+ - Expected vs actual behavior
69
+ - Steps to reproduce (if provided)
70
+ - Environment details (OS, runtime, browser)
71
+ - Affected feature / module (if identifiable)
72
+
73
+ 2. **Invoke `prizmkit.error-triage`**:
74
+ - Receive: error category, subcategory, root cause analysis, affected files
75
+ - Receive: severity rating (CRITICAL / HIGH / MEDIUM / LOW)
76
+
77
+ 3. **Check TRAPS for known issues**:
78
+ - Read `.prizm-docs/` TRAPS sections for identified modules
79
+ - If matching trap found:
80
+ - Set `KNOWN_ISSUE=true`, `SKIP_REPRODUCE=true`
81
+ - Include documented solution in fix-plan.md
82
+ - Jump to Phase 3
83
+
84
+ 4. **Generate `fix-plan.md`** at `.prizmkit/bugfix/<BUG_ID>/fix-plan.md`:
85
+
86
+ Required sections:
87
+ - **Bug Summary**: ID, title, severity, source type, affected feature
88
+ - **Root Cause Analysis**: error classification, root cause, call chain, TRAP match status
89
+ - **Impact Assessment**: directly affected files (with impact level), potentially affected modules (with risk level), cross-module impact notes
90
+ - **Test Strategy**: verification type, reproduction test design, regression test plan, manual verification steps (if verification_type=manual/hybrid)
91
+ - **Fix Approach**: proposed fix, fix scope (estimated lines changed), constraints
92
+
93
+ **CHECKPOINT CP-BF-1**: `fix-plan.md` exists.
94
+
95
+ **DECISION GATE — Fast Path**:
96
+ - If severity ∈ {low, medium} AND root cause confidence is HIGH AND estimated change < 10 lines:
97
+ → Skip Phase 2, go directly to Phase 3
98
+ - Otherwise → proceed to Phase 2
99
+
100
+ ---
101
+
102
+ ## Phase 2: Reproduce — 复现确认
103
+
104
+ **Goal**: Create an automated reproduction that proves the bug exists.
105
+
106
+ **STEPS:**
107
+
108
+ 1. **Invoke `prizmkit.bug-reproduce`** with triage results and bug description
109
+
110
+ 2. **Receive and execute reproduction**:
111
+ - Run the generated reproduction test
112
+ - Verify it FAILS (proving the bug exists)
113
+
114
+ 3. **Handle reproduction result**:
115
+ - **Success** (test fails as expected): record as regression baseline, proceed to Phase 3
116
+ - **Failure** (cannot reproduce): refine and retry, **max 2 rounds**
117
+ - **After 2 failed rounds**: set status to `needs_info`, output questions for reporter, STOP
118
+
119
+ **CHECKPOINT CP-BF-2**: Reproduction test exists and FAILS.
120
+
121
+ **KEY RULES:**
122
+ - Reproduction test MUST be automated
123
+ - MUST fail with current code and pass after fix
124
+ - Use project's existing test framework and conventions
125
+ - Naming convention: `test_bugfix_<short-description>.<ext>`
126
+
127
+ ---
128
+
129
+ ## Phase 3: Fix — 修复实现
130
+
131
+ **Goal**: Implement the fix using TDD — reproduction test goes red → green.
132
+
133
+ **STEPS:**
134
+
135
+ 1. **Read context**: fix-plan.md, reproduction test, `.prizm-docs/` (TRAPS, RULES, PATTERNS)
136
+
137
+ 2. **Plan fix** (lightweight, inline — NO spec/plan/tasks files):
138
+ - Identify exact code location(s) to modify
139
+ - Determine minimal fix approach
140
+ - Assess regression risk
141
+
142
+ 3. **Implement fix** via `prizmkit.implement` in TDD mode:
143
+ - Reproduction test is the "red test"
144
+ - Implement minimal code change to make it pass
145
+ - Ensure all existing tests still pass
146
+
147
+ 4. **Local verification**:
148
+ - Reproduction test → MUST PASS (green)
149
+ - Module test suite → MUST PASS (no regression)
150
+
151
+ **CHECKPOINT CP-BF-3**: Reproduction test passes, module tests pass.
152
+
153
+ **FIX LOOP**: Max 3 rounds. If still failing → escalate to user.
154
+
155
+ **KEY RULES:**
156
+ - Do NOT create `.prizmkit/specs/` directories
157
+ - Do NOT create spec.md, plan.md, or tasks.md
158
+ - Fix MUST be minimal and targeted — no scope creep
159
+ - If fix requires architectural changes → STOP, recommend creating a Feature instead
160
+
161
+ ---
162
+
163
+ ## Phase 4: Verify — 代码审查与回归验证
164
+
165
+ **Goal**: Ensure fix correctness and zero regressions.
166
+
167
+ **STEPS:**
168
+
169
+ 1. **Invoke `prizmkit.code-review`** (scoped to changed files only):
170
+ - Review dimensions for bug fix:
171
+ - **Fix correctness**: Does it address the root cause?
172
+ - **Regression safety**: Does it break existing behavior?
173
+ - **Code quality**: Is the fix clean and maintainable?
174
+ - **Test coverage**: Is the reproduction test adequate?
175
+ - Verdict: PASS / PASS_WITH_WARNINGS / NEEDS_FIXES
176
+
177
+ 2. **Run full test suite**: All tests MUST pass
178
+
179
+ 3. **Handle review results**:
180
+ - PASS / PASS_WITH_WARNINGS → proceed to Phase 5
181
+ - NEEDS_FIXES → return to Phase 3 (max 2 review rounds)
182
+
183
+ **CHECKPOINT CP-BF-4**: Code review passes, all tests green.
184
+
185
+ **MANUAL VERIFICATION GATE** (when verification_type=manual or hybrid):
186
+ - Pipeline PAUSES after automated review passes
187
+ - Output UAT checklist from fix-plan.md
188
+ - Set status to `verifying`, wait for user confirmation
189
+ - Resume to Phase 5 after user sign-off
190
+
191
+ ---
192
+
193
+ ## Phase 5: Commit & Learn — 提交与知识积累
194
+
195
+ **Goal**: Commit with proper conventions, capture lessons, generate `fix-report.md`.
196
+
197
+ **STEPS:**
198
+
199
+ 1. **Invoke `prizmkit.committer`**:
200
+ - Commit message: `fix(<scope>): <description>`
201
+ - Include fix code + reproduction test
202
+ - Do NOT run `prizmkit.summarize` (no REGISTRY.md entry)
203
+ - Do NOT push
204
+
205
+ 2. **Update TRAPS** (if new pitfall discovered):
206
+ - Append to affected module's TRAPS section in `.prizm-docs/`
207
+ - Format: `- TRAP: <description> | FIX: <solution> | DATE: YYYY-MM-DD`
208
+ - If no new pitfall: skip
209
+
210
+ 3. **Generate `fix-report.md`** at `.prizmkit/bugfix/<BUG_ID>/fix-report.md`:
211
+
212
+ Required sections:
213
+ - **Bug Resolution Summary**: ID, title, status (✅ FIXED), phases completed, duration
214
+ - **What Was Fixed**: changes made (file, change type, description), diff summary, commit message
215
+ - **Verification Results**: reproduction test before/after, regression test results, review verdict
216
+ - **Knowledge Captured**: TRAPS updated (yes/no with details), prevention recommendation
217
+ - **Acceptance Criteria Verification**: checklist with pass/fail for each criterion
218
+
219
+ Additional sections (when verification_type=manual or hybrid):
220
+ - **Manual Verification Results**: UAT checklist results, sign-off status, reviewer, date
221
+
222
+ **CHECKPOINT CP-BF-5**: Commit recorded, fix-report.md written.
223
+
224
+ ---
225
+
226
+ ## Fast Path — 快速修复路径
227
+
228
+ For LOW/MEDIUM severity bugs with obvious root cause and high confidence:
229
+
230
+ ```
231
+ Phase 1 (Triage) → Phase 3 (Fix) → Phase 5 (Commit)
232
+ ```
233
+
234
+ Skip Phase 2 (Reproduce) and Phase 4 (full Review).
235
+ - Still write a basic test for the fix
236
+ - Still use `fix(<scope>):` commit convention
237
+ - Still update TRAPS if applicable
238
+ - Still generate both fix-plan.md and fix-report.md
239
+
240
+ **CRITERIA**:
241
+ - Triage confidence is HIGH
242
+ - Root cause is a single, obvious code error
243
+ - Fix is less than 10 lines of code changes
244
+ - No cross-module impact
245
+
246
+ ---
247
+
248
+ ## Status Mapping
249
+
250
+ `bug-fix-list.json` status values map to pipeline phases:
251
+
252
+ | Phase | Entry Status | In-Progress | Success Exit | Failure Exit |
253
+ |-------|-------------|-------------|-------------|-------------|
254
+ | Phase 1: Triage | `pending` | `triaging` | → `reproducing` | → `failed` |
255
+ | Phase 2: Reproduce | `reproducing` | `reproducing` | → `fixing` | → `needs_info` |
256
+ | Phase 3: Fix | `fixing` | `fixing` | → `verifying` | → `failed` (3 rounds) |
257
+ | Phase 4: Verify | `verifying` | `verifying` | → Phase 5 | → `fixing` (return) |
258
+ | Phase 5: Commit | — | — | → `completed` | → `failed` |
259
+
260
+ ---
261
+
262
+ ## Knowledge Accumulation Mechanism
263
+
264
+ ### Automatic TRAPS Update
265
+
266
+ After each successful bug fix (Phase 5):
267
+ - If new pitfall discovered (not previously in TRAPS):
268
+ → Append to `.prizm-docs/<affected-module>.prizm` TRAPS section
269
+ - If `affected_feature` is set:
270
+ → Cross-reference original Feature ID in TRAPS entry
271
+
272
+ ### Bug Pattern Analysis (optional, manual trigger)
273
+
274
+ When `.prizmkit/bugfix/` accumulates 5+ completed bugs:
275
+ - Analyze `error_source.type` distribution
276
+ - Analyze `severity` distribution trends
277
+ - Analyze `affected_modules` frequency (identify fragile modules)
278
+ - Output recommendations for preventive refactoring
279
+
280
+ ### Feature Quality Tracking
281
+
282
+ When `affected_feature` is non-empty:
283
+ - If same Feature accumulates 3+ bugs → flag as "needs-revisit"
284
+
285
+ ---
286
+
287
+ ## Error Handling
288
+
289
+ | Scenario | Action |
290
+ |----------|--------|
291
+ | Cannot parse bug description | Ask user for clarification |
292
+ | Triage returns LOW confidence | Proceed with warning |
293
+ | Cannot reproduce after 2 rounds | STOP, set `needs_info`, request more info |
294
+ | Fix fails after 3 rounds | Escalate to user with analysis |
295
+ | Review fails after 2 rounds | Escalate with review findings |
296
+ | Full test suite has pre-existing failures | Warn user, isolate bug fix tests |
297
+ | Fix requires architectural change | STOP, recommend Feature instead |
298
+ | verification_type=manual and no user response | Keep status `verifying`, wait |
299
+
300
+ ---
301
+
302
+ ## Relationship to Other Skills
303
+
304
+ | Skill | Role in Bug Fix Workflow |
305
+ |-------|------------------------|
306
+ | `prizmkit-error-triage` | Phase 1: error classification and root cause analysis |
307
+ | `prizmkit-bug-reproducer` | Phase 2: generate minimal reproduction |
308
+ | `prizmkit-implement` | Phase 3: TDD-style fix implementation |
309
+ | `prizmkit-code-review` | Phase 4: review fix correctness |
310
+ | `prizmkit-committer` | Phase 5: commit with `fix()` convention |
311
+ | `prizmkit-log-analyzer` | Optional: analyze logs if bug includes log files |
312
+ | `bug-planner` | Pre-pipeline: generate standardized `bug-fix-list.json` |
313
+ | `prizmkit-retrospective` | NOT used (bug fixes don't get retrospectives) |
314
+ | `prizmkit-summarize` | NOT used (no REGISTRY entries for bugs) |
315
+ | `prizmkit-specify` | NOT used (no spec.md for bugs) |
316
+ | `prizmkit-plan` | NOT used (no plan.md for bugs) |
317
+ | `prizmkit-tasks` | NOT used (no tasks.md for bugs) |
318
+
319
+ ---
320
+
321
+ ## Comparison with Feature Pipeline
322
+
323
+ | Dimension | Feature Pipeline | Bug Fix Pipeline |
324
+ |-----------|-----------------|-----------------|
325
+ | Input Skill | `app-planner` (7-phase interactive) | `bug-planner` (multi-format parser) |
326
+ | Input File | `feature-list.json` (F-NNN) | `bug-fix-list.json` (B-NNN) |
327
+ | Schema Version | `dev-pipeline-feature-list-v1` | `dev-pipeline-bug-fix-list-v1` |
328
+ | Pipeline Phases | 10 Phase (0-7 + init + cleanup) | 5 Phase (Fast Path: 3) |
329
+ | Artifact Docs | 3: spec.md + plan.md + tasks.md | 2: fix-plan.md + fix-report.md |
330
+ | Artifact Path | `.prizmkit/specs/<feature-slug>/` | `.prizmkit/bugfix/<bug-id>/` |
331
+ | Prompt Template | `bootstrap-prompt.md` | `bugfix-bootstrap-prompt.md` |
332
+ | Skills Chain | specify → plan → tasks → implement → review → summarize → commit | error-triage → bug-reproduce → implement → code-review → commit |
333
+ | Commit Prefix | `feat(<scope>):` | `fix(<scope>):` |
334
+ | REGISTRY Update | ✅ via summarize | ❌ not applicable |
335
+ | TRAPS Update | Only in retrospective | ✅ automatic after every fix |
336
+ | Manual Verification | None | Supported (verification_type=manual/hybrid) |
337
+ | Agent Roles | PM → Dev → Reviewer → Doc | Dev → Reviewer (streamlined) |
338
+
339
+ ## Path References
340
+
341
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
342
+
343
+ ## Output
344
+
345
+ - `fix-plan.md` (Phase 1 artifact)
346
+ - Reproduction test file (Phase 2)
347
+ - Fix implementation (Phase 3)
348
+ - Code review report (Phase 4, conversation only)
349
+ - `fix-report.md` (Phase 5 artifact)
350
+ - Git commit with `fix(<scope>):` prefix (Phase 5)
351
+ - Updated `.prizm-docs/` TRAPS (if applicable)
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: "prizmkit-bug-reproducer"
3
+ tier: 1
4
+ description: "[Tier 1] Generate minimal reproduction scripts and test cases from bug descriptions. AI strength in test/script generation. (project)"
5
+ ---
6
+
7
+ # PrizmKit Bug Reproducer
8
+
9
+ Generate minimal reproduction scripts and test cases from bug descriptions to isolate, confirm, and verify fixes.
10
+
11
+ ## Commands
12
+
13
+ ### prizmkit.bug-reproduce \<bug-description\>
14
+
15
+ Generate a minimal reproduction for a reported bug.
16
+
17
+ **STEPS:**
18
+
19
+ 1. Parse bug description: extract expected vs actual behavior, steps to reproduce (if given), environment details
20
+ 2. Read `.prizm-docs/` for relevant module context, paying special attention to TRAPS sections that may document known pitfalls
21
+ 3. Identify affected code path from description:
22
+ - Map user-facing behavior to source code modules
23
+ - Identify entry points and data flow
24
+ 4. Generate minimal reproduction based on bug type:
25
+ a. **For API bugs**: Generate curl/HTTP request sequence
26
+ - Include headers, authentication, request body
27
+ - Show expected vs actual response
28
+ - Add assertions on status code and response body
29
+ b. **For UI bugs**: Generate step-by-step user interaction guide
30
+ - Numbered steps with specific UI elements to interact with
31
+ - Screenshot annotation points (where to look)
32
+ - Browser/device requirements if relevant
33
+ c. **For logic bugs**: Generate unit test that demonstrates the failure
34
+ - Minimal test case with clear arrange/act/assert
35
+ - Test name describes the expected behavior
36
+ - Comments explaining why this should pass
37
+ d. **For data bugs**: Generate seed data + query sequence
38
+ - Minimal dataset that triggers the issue
39
+ - Query or operation sequence to reproduce
40
+ - Expected vs actual result comparison
41
+ 5. Write reproduction script/test to a temporary file:
42
+ - Use project's existing test framework and conventions
43
+ - Include setup and teardown
44
+ - Make it self-contained and runnable
45
+ 6. Include assertions that:
46
+ - FAIL with current (buggy) behavior
47
+ - PASS with expected (correct) behavior
48
+ - Serve as regression test after fix is applied
49
+ 7. Output:
50
+ - Reproduction file path
51
+ - Minimal steps document describing how to run
52
+ - Suggested fix investigation starting points
53
+
54
+ ## Path References
55
+
56
+ All internal asset paths MUST use `${SKILL_DIR}` placeholder for cross-IDE compatibility.
57
+
58
+ ## Output
59
+
60
+ - Reproduction script or test file written to project's test directory
61
+ - Minimal steps document printed to console
62
+ - Investigation pointers for the fix