prizmkit 1.1.0 → 1.1.3

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 (95) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/agent-adapter.js +18 -0
  3. package/bundled/adapters/claude/command-adapter.js +1 -27
  4. package/bundled/agents/prizm-dev-team-critic.md +2 -0
  5. package/bundled/agents/prizm-dev-team-dev.md +2 -0
  6. package/bundled/agents/prizm-dev-team-reviewer.md +2 -0
  7. package/bundled/dev-pipeline/README.md +63 -63
  8. package/bundled/dev-pipeline/assets/feature-list-example.json +1 -1
  9. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +1 -1
  10. package/bundled/dev-pipeline/{launch-daemon.sh → launch-feature-daemon.sh} +33 -33
  11. package/bundled/dev-pipeline/launch-refactor-daemon.sh +454 -0
  12. package/bundled/dev-pipeline/lib/branch.sh +1 -1
  13. package/bundled/dev-pipeline/reset-feature.sh +3 -3
  14. package/bundled/dev-pipeline/reset-refactor.sh +312 -0
  15. package/bundled/dev-pipeline/{retry-bug.sh → retry-bugfix.sh} +47 -59
  16. package/bundled/dev-pipeline/retry-feature.sh +41 -54
  17. package/bundled/dev-pipeline/retry-refactor.sh +358 -0
  18. package/bundled/dev-pipeline/run-bugfix.sh +6 -0
  19. package/bundled/dev-pipeline/{run.sh → run-feature.sh} +31 -31
  20. package/bundled/dev-pipeline/run-refactor.sh +787 -0
  21. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +177 -10
  22. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +419 -0
  23. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +393 -0
  24. package/bundled/dev-pipeline/scripts/update-refactor-status.py +726 -0
  25. package/bundled/dev-pipeline/templates/agent-prompts/critic-code-challenge.md +13 -0
  26. package/bundled/dev-pipeline/templates/agent-prompts/critic-plan-challenge.md +7 -0
  27. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +7 -0
  28. package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +26 -0
  29. package/bundled/dev-pipeline/templates/agent-prompts/dev-resume.md +5 -0
  30. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +5 -0
  31. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +12 -0
  32. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +29 -2
  33. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +8 -7
  34. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +11 -10
  35. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -3
  36. package/bundled/dev-pipeline/templates/feature-list-schema.json +1 -1
  37. package/bundled/dev-pipeline/templates/refactor-list-schema.json +159 -0
  38. package/bundled/dev-pipeline/templates/sections/ac-verification-checklist.md +13 -0
  39. package/bundled/dev-pipeline/templates/sections/feature-context.md +1 -1
  40. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +9 -8
  41. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +9 -8
  42. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +2 -1
  43. package/bundled/dev-pipeline/templates/sections/phase-critic-code.md +8 -10
  44. package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +9 -10
  45. package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +8 -9
  46. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +7 -10
  47. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +8 -15
  48. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +7 -12
  49. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +8 -19
  50. package/bundled/dev-pipeline/templates/sections/test-failure-recovery.md +75 -0
  51. package/bundled/skills/_metadata.json +33 -6
  52. package/bundled/skills/app-planner/SKILL.md +105 -320
  53. package/bundled/skills/app-planner/assets/app-design-guide.md +101 -0
  54. package/bundled/skills/app-planner/references/frontend-design-guide.md +1 -1
  55. package/bundled/skills/app-planner/references/project-brief-guide.md +49 -80
  56. package/bundled/skills/bug-fix-workflow/SKILL.md +2 -2
  57. package/bundled/skills/bug-planner/SKILL.md +68 -5
  58. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +3 -2
  59. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +19 -5
  60. package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/SKILL.md +32 -32
  61. package/bundled/skills/feature-planner/SKILL.md +337 -0
  62. package/bundled/skills/{app-planner → feature-planner}/assets/evaluation-guide.md +4 -4
  63. package/bundled/skills/{app-planner → feature-planner}/assets/planning-guide.md +3 -171
  64. package/bundled/skills/{app-planner → feature-planner}/references/browser-interaction.md +6 -5
  65. package/bundled/skills/feature-planner/references/decomposition-patterns.md +75 -0
  66. package/bundled/skills/{app-planner → feature-planner}/references/error-recovery.md +8 -8
  67. package/bundled/skills/{app-planner → feature-planner}/references/incremental-feature-planning.md +1 -1
  68. package/bundled/skills/{app-planner/references/new-app-planning.md → feature-planner/references/new-project-planning.md} +1 -1
  69. package/bundled/skills/{app-planner → feature-planner}/scripts/validate-and-generate.py +4 -4
  70. package/bundled/skills/feature-workflow/SKILL.md +23 -23
  71. package/bundled/skills/prizm-kit/SKILL.md +1 -3
  72. package/bundled/skills/prizmkit-analyze/SKILL.md +2 -5
  73. package/bundled/skills/prizmkit-code-review/SKILL.md +2 -2
  74. package/bundled/skills/prizmkit-committer/SKILL.md +4 -8
  75. package/bundled/skills/prizmkit-deploy/SKILL.md +1 -5
  76. package/bundled/skills/prizmkit-implement/SKILL.md +3 -50
  77. package/bundled/skills/prizmkit-init/SKILL.md +5 -77
  78. package/bundled/skills/prizmkit-plan/SKILL.md +1 -12
  79. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +6 -24
  80. package/bundled/skills/prizmkit-prizm-docs/assets/PRIZM-SPEC.md +21 -0
  81. package/bundled/skills/prizmkit-retrospective/SKILL.md +12 -117
  82. package/bundled/skills/recovery-workflow/SKILL.md +166 -316
  83. package/bundled/skills/recovery-workflow/evals/evals.json +29 -13
  84. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +232 -274
  85. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +352 -0
  86. package/bundled/skills/refactor-planner/SKILL.md +436 -0
  87. package/bundled/skills/refactor-planner/assets/planning-guide.md +292 -0
  88. package/bundled/skills/refactor-planner/references/behavior-preservation.md +301 -0
  89. package/bundled/skills/refactor-planner/references/refactor-scoping-guide.md +221 -0
  90. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +786 -0
  91. package/bundled/skills/refactor-workflow/SKILL.md +299 -319
  92. package/package.json +1 -1
  93. package/src/clean.js +3 -3
  94. package/src/scaffold.js +6 -6
  95. /package/bundled/skills/{dev-pipeline-launcher → feature-pipeline-launcher}/scripts/preflight-check.py +0 -0
@@ -0,0 +1,101 @@
1
+ # App Design Reference Guide
2
+
3
+ This guide provides structured templates, decision matrices, and decomposition patterns for new application planning. Use during the vision and architecture phases of app-planner sessions.
4
+
5
+ ---
6
+
7
+ ## 1. App Vision Template
8
+
9
+ Use this template to capture the app vision during the initial planning phase.
10
+
11
+ ```markdown
12
+ # App Vision: [APP_NAME]
13
+
14
+ ## Problem Statement
15
+ [What problem does this app solve?]
16
+
17
+ ## Target Users
18
+ - Primary: [Who are the main users?]
19
+ - Secondary: [Any secondary user types?]
20
+
21
+ ## Core Value Proposition
22
+ [What makes this app valuable? What's the "elevator pitch"?]
23
+
24
+ ## Key Differentiators
25
+ [What sets this apart from existing solutions?]
26
+ ```
27
+
28
+ ### Guidance
29
+
30
+ - **Problem Statement**: Should describe a real pain point in 1-3 sentences. Avoid vague statements like "improve productivity." Be specific about who suffers and why.
31
+ - **Target Users**: Identify at least one primary user persona. Secondary users are optional but useful for prioritization decisions later.
32
+ - **Core Value Proposition**: Should be expressible in one sentence. If it takes a paragraph, the scope is likely too broad.
33
+ - **Key Differentiators**: List 1-3 concrete differentiators. If none exist, reconsider whether the app needs to be built.
34
+
35
+ ---
36
+
37
+ ## 2. Tech Stack Decision Matrix
38
+
39
+ Use these tables to guide tech stack selection based on project requirements.
40
+
41
+ ### Frontend Frameworks
42
+
43
+ | Framework | Best For | Ecosystem |
44
+ |-----------|----------|-----------|
45
+ | Next.js 14+ | Full-stack React, SSR, API routes | React ecosystem, Vercel |
46
+ | Nuxt 3 | Full-stack Vue, SSR | Vue ecosystem |
47
+ | SvelteKit | Performance-focused, smaller teams | Svelte ecosystem |
48
+ | Remix | Nested routes, data loading | React ecosystem |
49
+
50
+ ### Backend Frameworks
51
+
52
+ | Framework | Best For | Language |
53
+ |-----------|----------|----------|
54
+ | Express.js | Flexible, minimal | Node.js/TS |
55
+ | FastAPI | High-perf APIs, Python ML | Python |
56
+ | NestJS | Enterprise, structured | Node.js/TS |
57
+ | Django | Batteries-included, admin | Python |
58
+ | Go (Gin/Echo) | High concurrency | Go |
59
+
60
+ ### Databases
61
+
62
+ | Database | Best For | Type |
63
+ |----------|----------|------|
64
+ | PostgreSQL | Complex queries, ACID | Relational |
65
+ | MySQL | Read-heavy, simple | Relational |
66
+ | MongoDB | Flexible schema, documents | Document |
67
+ | SQLite | Embedded, prototyping | Relational |
68
+ | Redis | Caching, sessions, pub/sub | Key-Value |
69
+
70
+ ### Design Systems
71
+
72
+ | System | Best For | Framework |
73
+ |--------|----------|-----------|
74
+ | shadcn/ui | Modern, customizable | React/Next.js |
75
+ | Ant Design | Enterprise, data-heavy | React |
76
+ | Material UI | Google-style, full-featured | React |
77
+ | Vuetify | Material Design for Vue | Vue |
78
+ | Tailwind CSS | Utility-first, any framework | Any |
79
+
80
+ ### Common Service Patterns
81
+
82
+ | Need | Options |
83
+ |------|---------|
84
+ | Auth | NextAuth.js, Auth0, Clerk, Supabase Auth, custom JWT |
85
+ | Real-time | WebSocket, Socket.io, SSE, Supabase Realtime |
86
+ | File Storage | S3, Cloudflare R2, Supabase Storage |
87
+ | Email | SendGrid, Resend, Postmark |
88
+ | Payments | Stripe, LemonSqueezy |
89
+ | Search | Algolia, Meilisearch, Elasticsearch |
90
+
91
+ ### Selection Heuristics
92
+
93
+ - If the user has no strong preference, default to **Next.js + PostgreSQL + shadcn/ui + Tailwind CSS** as a general-purpose stack.
94
+ - If the project involves ML/AI backends, prefer **FastAPI** on the backend.
95
+ - If the project requires high concurrency with minimal resource usage, consider **Go**.
96
+ - If rapid prototyping is the goal, consider **SQLite** initially with a migration path to PostgreSQL.
97
+ - Always ask about deployment preferences (Vercel, AWS, self-hosted) as this influences framework choice.
98
+
99
+
100
+
101
+ > **Note**: Feature decomposition patterns (CRUD, SaaS, Social, E-commerce) have been moved to `feature-planner/references/decomposition-patterns.md`. Load that reference during feature decomposition phase.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Create distinctive, production-grade frontend interfaces that avoid generic "AI slop" aesthetics.
4
4
 
5
- **App-planner context**: In the planning phase, use this guide to establish **design direction decisions** (aesthetic tone, typography approach, color strategy, layout philosophy). Do NOT produce CSS, code, or implementation artifacts — capture the design direction as decisions in the project instruction file (`CLAUDE.md` / `CODEBUDDY.md`). Downstream implementation skills will consume these decisions when building features.
5
+ **app-planner context**: In the planning phase, use this guide to establish **design direction decisions** (aesthetic tone, typography approach, color strategy, layout philosophy). Do NOT produce CSS, code, or implementation artifacts — capture the design direction as decisions in the project instruction file (`CLAUDE.md` / `CODEBUDDY.md`). Downstream implementation skills will consume these decisions when building features.
6
6
 
7
7
  Load this guide **only when the feature involves frontend/UI work**. Skip for backend-only or infrastructure features.
8
8
 
@@ -1,110 +1,79 @@
1
- # Project Brief — Real-Time Accumulation Guide
1
+ # Project Brief — Checklist Format Guide
2
2
 
3
- > Distill the user's key requirements, design decisions, and project context into a concise `project-brief.md` during interactive planning. This file is injected into every headless `dev-pipeline` session so individual feature builds understand the bigger picture.
3
+ > Capture the user's key product ideas as a simple checklist in `project-brief.md`. Each line is one idea. The dev-pipeline injects this file into every feature session so the AI understands the user's overall product vision.
4
4
 
5
5
  ## Purpose
6
6
 
7
- When `app-planner` generates 20+ features through conversation, each headless session only sees its own feature description and the tech stack (`global_context`). Cross-feature design decisions, business intent, and user-emphasized details exist only in the chat history and are lost. `project-brief.md` bridges this gap.
7
+ During `app-planner` conversation, the user describes what they want to build. `project-brief.md` distills these into a flat checklist one idea per line. When `dev-pipeline` builds individual features, each session sees this checklist and understands the bigger picture.
8
8
 
9
9
  ## Persistence
10
10
 
11
11
  - **File**: `project-brief.md` at project root (same level as `feature-list.json`)
12
- - **Format**: Markdown with fixed sections, bullet-point style
12
+ - **Format**: Checklist one idea per line, `[ ]` for pending, `[x]` for completed
13
13
  - **Size limit**: 500 words max (injected into every session's context window)
14
14
  - **Consumed by**: `dev-pipeline/scripts/generate-bootstrap-prompt.py` → `{{PROJECT_BRIEF}}` placeholder
15
15
 
16
- ## Accumulation Trigger
17
-
18
- After each meaningful user response (skip acknowledgments, yes/no confirmations, or meta-conversation), evaluate whether the response contains:
19
-
20
- - Business/product intent or vision
21
- - Technical constraints or preferences
22
- - Cross-feature design decisions (e.g., "all APIs use JWT", "use Material Design 3")
23
- - Specific implementation preferences or details the user emphasized
24
-
25
- If yes → update the relevant section in `project-brief.md`.
26
-
27
- ## File Template
16
+ ## File Format
28
17
 
29
18
  ```markdown
30
19
  # Project Brief
31
20
 
32
- ## Vision
33
- - [What the project is, who it's for, core value proposition]
34
-
35
- ## Core Constraints
36
- - [Technical constraints, business constraints, immutable decisions]
37
-
38
- ## Design Decisions
39
- - [Cross-feature decisions: API style, auth method, state management, etc.]
40
-
41
- ## Key Requirements
42
- - [Details and preferences the user specifically emphasized]
21
+ [x] 表示构想已在某个 feature 中实现完成
22
+
23
+ --------
24
+
25
+ [ ] B2B SaaS 餐饮库存管理平台,面向中小连锁餐厅 (5-50 家门店)
26
+ [ ] 核心价值:通过预测性订货减少 30% 食物浪费
27
+ [ ] 必须支持 iPad Safari 离线模式,厨房平板 WiFi 不稳定
28
+ [ ] 后端可部署到客户自有云(多租户但可自托管)
29
+ [ ] RESTful API + JWT 认证,不用 GraphQL
30
+ [ ] 使用 Supabase (PostgreSQL) 作为数据库和认证
31
+ [ ] TailwindCSS + shadcn/ui 统一前端组件
32
+ [ ] 所有金额用整数(分)存储,避免浮点精度问题
33
+ [ ] Dashboard 在 3G 网络下 2 秒内加载
34
+ [ ] 供应商集成 API 支持 webhook 回调
35
+ [ ] 用户端中文界面,管理后台英文界面
43
36
  ```
44
37
 
45
- ## Update Rules
46
-
47
- - **First update**: Create the file with all four sections. Populate whichever sections have content; leave others with a single placeholder bullet `- (to be determined)`.
48
- - **Subsequent updates**: Use Edit tool to update only the changed section — do not rewrite the entire file.
49
- - Keep each bullet to **one sentence** — no paragraphs.
50
- - Total file size **must not exceed 500 words**. If approaching the limit, merge or condense existing bullets.
51
- - Language: match the user's language (Chinese or English).
52
- - Content is append/modify only — never delete bullets unless the user explicitly requests it.
53
-
54
- ## Checkpoint
55
-
56
- Verified at **CP-AP-5.3**: Before CP-AP-6 (`feature-list.json` generation), `project-brief.md` must exist with the Vision section plus at least one other populated section (not placeholder bullets).
38
+ ## Format Rules
57
39
 
58
- ## How the Pipeline Uses It
40
+ 1. **First line**: `# Project Brief`
41
+ 2. **Second line**: `[x] 表示构想已在某个 feature 中实现完成` — fixed legend
42
+ 3. **Third line**: `--------` — separator
43
+ 4. **Remaining lines**: One idea per line, each starting with `[ ]`
44
+ 5. Each line is **one sentence** — no paragraphs, no sub-bullets
45
+ 6. Language: match the user's language (Chinese or English)
59
46
 
60
- `generate-bootstrap-prompt.py` reads `project-brief.md` and injects its content into the `{{PROJECT_BRIEF}}` section of every bootstrap prompt (tier1/tier2/tier3). The section appears between Acceptance Criteria and Dependencies, with this framing:
47
+ ## How app-planner Writes It
61
48
 
62
- > "Distilled summary of the project's key requirements and design decisions, captured during planning. When your feature implementation touches any of these key points, ensure alignment."
49
+ During interactive conversation, after each meaningful user response (skip acknowledgments, yes/no):
50
+ - Evaluate whether the response contains a product idea, constraint, design decision, or technical preference
51
+ - If yes → append a new `[ ]` line to `project-brief.md`
52
+ - Keep each line concise — one idea, one sentence
53
+ - Merge or condense if approaching 500-word limit
63
54
 
64
- If the file does not exist, the placeholder is replaced with `(No project brief available)` the pipeline runs normally without it.
55
+ **First write**: Create the file with the header, legend, separator, and initial ideas.
56
+ **Subsequent writes**: Append new `[ ]` lines only — do not rewrite existing lines.
65
57
 
66
- ## Examples
58
+ ## How the Pipeline Marks Completion
67
59
 
68
- ### Minimal Brief (early in conversation)
60
+ When a feature session in `dev-pipeline` completes and its implementation addresses one or more ideas from the checklist:
61
+ 1. Change `[ ]` to `[x]` for that idea
62
+ 2. Append 1-2 key directory/file paths after the idea text, showing where it was implemented
69
63
 
70
- ```markdown
71
- # Project Brief
72
-
73
- ## Vision
74
- - B2B SaaS platform for restaurant inventory management, targeting small-to-medium restaurant chains
64
+ Example of a completed item:
65
+ ```
66
+ [x] RESTful API + JWT 认证,不用 GraphQL → src/middleware/auth.ts, src/routes/api/
67
+ ```
75
68
 
76
- ## Core Constraints
77
- - (to be determined)
69
+ ## Checkpoint
78
70
 
79
- ## Design Decisions
80
- - (to be determined)
71
+ Verified at **CP-AP-4**: Before handoff to `feature-planner`, `project-brief.md` must exist with at least 3 ideas listed.
81
72
 
82
- ## Key Requirements
83
- - Must support offline mode for kitchen tablets with unreliable WiFi
84
- ```
73
+ ## How the Pipeline Uses It
85
74
 
86
- ### Mature Brief (after several rounds of discussion)
75
+ `generate-bootstrap-prompt.py` reads `project-brief.md` and injects its content into the `{{PROJECT_BRIEF}}` section of every bootstrap prompt (tier1/tier2/tier3). The framing:
87
76
 
88
- ```markdown
89
- # Project Brief
77
+ > "Product ideas checklist from planning. Lines marked [x] are already implemented. When your feature touches any [ ] item, ensure alignment. After implementation, mark relevant items [x] and append the key file paths."
90
78
 
91
- ## Vision
92
- - B2B SaaS platform for restaurant inventory management, targeting small-to-medium restaurant chains (5-50 locations)
93
- - Core value: reduce food waste by 30% through predictive ordering
94
-
95
- ## Core Constraints
96
- - Must work on iPad Safari (no native app)
97
- - Backend must be deployable to customer's own cloud (multi-tenant but self-hostable)
98
- - Budget: MVP in 4 weeks
99
-
100
- ## Design Decisions
101
- - RESTful API with JWT auth; no GraphQL
102
- - Use Supabase for auth + database (PostgreSQL)
103
- - TailwindCSS + shadcn/ui for all frontend components
104
- - All monetary values stored as integers (cents) to avoid floating point
105
-
106
- ## Key Requirements
107
- - Dashboard must load in under 2 seconds on 3G connection
108
- - Supplier integration API must support webhook callbacks
109
- - All user-facing text in Simplified Chinese; admin panel in English
110
- ```
79
+ If the file does not exist, the placeholder is replaced with `(No project brief available)`.
@@ -148,7 +148,7 @@ Ask the user: "Is this summary accurate? Any details to add?"
148
148
 
149
149
  **Goal**: Locate affected code, identify root cause, classify severity.
150
150
 
151
- > **Reference**: This phase incorporates the logic of `prizmkit-tool-error-triage`. Classify error into: Runtime / Network / Auth / Data / Resource / Logic / Config / External. Check `.prizm-docs/` TRAPS for known patterns first. If a TRAPS match is found, use documented solution and reference the specific `.prizm-docs/` entry. If no match, trace the call chain from the stack frame to identify root cause from first principles.
151
+ > **Triage**: Classify error into: Runtime / Network / Auth / Data / Resource / Logic / Config / External. Check `.prizm-docs/` TRAPS for known patterns first. If a TRAPS match is found, use documented solution and reference the specific `.prizm-docs/` entry. If no match, trace the call chain from the stack frame to identify root cause from first principles.
152
152
 
153
153
  1. **Read project context**: `.prizm-docs/root.prizm` → relevant L1/L2 docs for affected modules
154
154
  2. **Locate affected code**: read the files mentioned in the error/stack trace or identified during diagnosis
@@ -171,7 +171,7 @@ Ask the user: "Is this summary accurate? Any details to add?"
171
171
 
172
172
  **Goal**: Create a failing test that proves the bug exists.
173
173
 
174
- > **Reference**: This phase incorporates the logic of `prizmkit-tool-bug-reproducer`. For API bugs: generate curl/HTTP request sequence with assertions. For UI bugs: generate step-by-step interaction guide. For logic bugs: generate unit test (arrange/act/assert). For data bugs: generate seed data + query sequence. The reproduction must FAIL with current behavior and be designed to PASS after the fix is applied — making it a regression guard.
174
+ > **Reproduce**: For API bugs: generate curl/HTTP request sequence with assertions. For UI bugs: generate step-by-step interaction guide. For logic bugs: generate unit test (arrange/act/assert). For data bugs: generate seed data + query sequence. The reproduction must FAIL with current behavior and be designed to PASS after the fix is applied — making it a regression guard.
175
175
 
176
176
  1. **Write a reproduction test** that demonstrates the bug:
177
177
  - Name: `<module>.test.ts` → add a test case named `should handle <bug scenario>`
@@ -6,7 +6,7 @@ description: "Interactive bug planning that produces bug-fix-list.json for the B
6
6
 
7
7
  # Bug Planner
8
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`).
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 `feature-planner` (which generates `feature-list.json`).
10
10
 
11
11
  ## When to Use
12
12
 
@@ -19,7 +19,7 @@ User says:
19
19
  **Do NOT use when:**
20
20
  - User wants to start fixing bugs now (use `bugfix-pipeline-launcher`)
21
21
  - User wants to fix a single bug interactively (use `bug-fix-workflow`)
22
- - User wants to plan features (use `app-planner`)
22
+ - User wants to plan features (use `feature-planner`)
23
23
 
24
24
  ## Intent Routing
25
25
 
@@ -37,7 +37,7 @@ This skill handles multiple operations. Determine the user's intent and execute
37
37
 
38
38
  ## Operation: Interactive Planning
39
39
 
40
- Launch the interactive bug planning process through 4 phases.
40
+ Launch the interactive bug planning process through 5 phases.
41
41
 
42
42
  ### Phase 1: Project Context
43
43
 
@@ -119,6 +119,35 @@ ALERT: Error rate spike: 500 errors/min on /api/login endpoint
119
119
 
120
120
  **Per-bug clarification** — if the bug's root cause, reproduction steps, expected behavior, or scope is unclear from the provided information, ask focused questions one at a time (cite the unclear point, give a recommended answer with rationale) until the bug is fully understood. Do not finalize a bug entry with ambiguous details. No limit on the number of questions per bug.
121
121
 
122
+ **Per-bug confirmation (mandatory)** — after extracting and clarifying each bug, present a structured summary for user review using this template:
123
+
124
+ ```
125
+ ┌─ Bug Confirmation: B-NNN ─────────────────────────────
126
+ │ Title: <auto-suggested title>
127
+ │ Description: <expected vs actual behavior>
128
+ │ Severity: <auto-classified> | Verification: <type>
129
+
130
+ │ Reproduction: <steps if available, or "not provided">
131
+ │ Affected: <module/feature or "unknown">
132
+
133
+ │ ✅ Acceptance Criteria (fix verified when):
134
+ │ 1. <criterion — specific enough for automated pipeline to verify>
135
+ │ 2. <criterion>
136
+
137
+ │ ⚠️ Open Questions:
138
+ │ - <any unclear points, or "None">
139
+ └────────────────────────────────────────────────────────
140
+ ```
141
+
142
+ Then ask three confirmation questions:
143
+ 1. "描述是否准确?是否需要修改?" / "Is the description accurate? Any corrections?"
144
+ 2. "是否需要补充更多细节?(复现步骤、环境信息、相关代码位置等)" / "Need to add more details? (reproduction steps, environment, related code locations, etc.)"
145
+ 3. "验证条件是否具体到 pipeline 可以自主判断修复成功?" / "Are the acceptance criteria specific enough that the pipeline can autonomously verify the fix?"
146
+
147
+ The acceptance criteria are critical — they directly determine how the bugfix pipeline judges success or failure. Vague criteria like "login works" lead to shallow fixes; prefer specific, verifiable conditions like "POST /api/login with valid credentials returns 200 and a JWT token in the response body."
148
+
149
+ Only finalize the bug entry after user confirms all three points.
150
+
122
151
  **Multiple bugs per session**: After each bug, ask "Any more bugs to add? (yes/no)"
123
152
 
124
153
  ### Phase 3: Prioritization & Review
@@ -134,7 +163,41 @@ ALERT: Error rate spike: 500 errors/min on /api/login endpoint
134
163
  3. **Ask for adjustments**: "Want to reorder priorities, change severity, or remove any bugs?"
135
164
  4. **Detect potential duplicates**: If two bugs have similar error messages or affected modules, warn user
136
165
 
137
- ### Phase 4: Generate & Validate
166
+ ### Phase 4: Pre-Generation Completeness Review
167
+
168
+ Before generating `bug-fix-list.json`, perform a holistic scan across all collected bugs. The bugfix pipeline runs autonomously — any ambiguity left here becomes a wrong assumption later.
169
+
170
+ **Step 1 — Description adequacy scan**: For each bug, check:
171
+ - Description clearly states **expected** vs **actual** behavior (not just "X doesn't work")
172
+ - Reproduction path is specific enough for the pipeline AI to locate the relevant code
173
+ - If the bug involves user interaction, the trigger action is described (not just the symptom)
174
+
175
+ **Step 2 — Acceptance criteria specificity check**: For each bug, verify each acceptance criterion passes the "pipeline autonomy test" — could an AI session, without asking a human, determine whether this criterion is met? Flag criteria that are subjective ("works correctly"), lack measurable conditions ("performs better"), or don't specify the verification method.
176
+
177
+ **Step 3 — Cross-bug analysis**: Check for:
178
+ - **Root cause overlap**: Multiple bugs in the same module may share a root cause — flag for user to confirm whether they should be merged or kept separate
179
+ - **Missing dependencies**: If fixing B-002 requires B-001 to be fixed first, flag the dependency
180
+ - **Scope gaps**: If bugs describe symptoms but the underlying cause likely affects more areas, suggest additional bugs
181
+
182
+ **Step 4 — Present review table**: Display the completeness assessment using this template:
183
+
184
+ ```
185
+ ┌─ Completeness Review ─────────────────────────────────────────────────
186
+ │ Bug │ Description │ Criteria │ Reproducible │ Notes
187
+ │ B-001 │ ✓ Clear │ ✓ Specific │ ✓ Yes │ —
188
+ │ B-002 │ ⚠ Vague │ ⚠ Subjective│ ✓ Yes │ "encoding works" → needs specific test case
189
+ │ B-003 │ ✓ Clear │ ⚠ No metric│ ⚠ No steps │ needs perf threshold + reproduction steps
190
+ └────────────────────────────────────────────────────────────────────────
191
+ ```
192
+
193
+ For any ⚠ items, ask targeted questions to fill gaps. Iterate until the user confirms all bugs are adequately described. Present bilingual prompt:
194
+
195
+ > "以上是完整性审查结果。标记 ⚠ 的项目需要补充,是否逐一补充?还是先跳过,之后再完善?"
196
+ > "Above is the completeness review. Items marked ⚠ need more detail. Address them now, or proceed and refine later?"
197
+
198
+ Only proceed to Phase 5 after user confirms.
199
+
200
+ ### Phase 5: Generate & Validate
138
201
 
139
202
  1. **Generate `bug-fix-list.json`**: Conform to `dev-pipeline/templates/bug-fix-list-schema.json`
140
203
  2. **Validate against schema**: Run the validation script:
@@ -254,7 +317,7 @@ After `bug-fix-list.json` is generated, the user can:
254
317
  2. **Background daemon**: `./dev-pipeline/launch-bugfix-daemon.sh start bug-fix-list.json`
255
318
  3. **Foreground run**: `./dev-pipeline/run-bugfix.sh run bug-fix-list.json`
256
319
  4. **Fix single bug interactively**: invoke `bug-fix-workflow` in current session
257
- 5. **Retry a failed bug**: `./dev-pipeline/retry-bug.sh B-001`
320
+ 5. **Retry a failed bug**: `./dev-pipeline/retry-bugfix.sh B-001`
258
321
 
259
322
  ## Error Handling
260
323
 
@@ -21,6 +21,7 @@ VALID_SOURCE_TYPES = {"stack_trace", "user_report", "failed_test", "log_pattern"
21
21
  VALID_VERIFICATION_TYPES = {"automated", "manual", "hybrid"}
22
22
  VALID_STATUSES = {"pending", "in_progress", "fixed", "failed", "skipped", "needs_info"}
23
23
  BUG_ID_PATTERN = re.compile(r"^B-\d{3}$")
24
+ SCHEMA_VERSION = "dev-pipeline-bug-fix-list-v1"
24
25
 
25
26
 
26
27
  def validate(bug_list_path, feature_list_path=None):
@@ -51,8 +52,8 @@ def validate(bug_list_path, feature_list_path=None):
51
52
  # Top-level required fields
52
53
  if "$schema" not in data:
53
54
  errors.append("Missing required field: $schema")
54
- elif data["$schema"] != "dev-pipeline-bug-fix-list-v1":
55
- errors.append(f"Invalid $schema: expected 'dev-pipeline-bug-fix-list-v1', got '{data['$schema']}'")
55
+ elif data["$schema"] != SCHEMA_VERSION:
56
+ errors.append(f"Invalid $schema: expected '{SCHEMA_VERSION}', got '{data['$schema']}'")
56
57
 
57
58
  if not data.get("project_name"):
58
59
  errors.append("Missing or empty required field: project_name")
@@ -41,7 +41,7 @@ Three execution modes are available. The user chooses one before configuring oth
41
41
  **Do NOT use this skill when:**
42
42
  - User wants to plan/collect bugs (use `bug-planner` instead)
43
43
  - User wants to fix a single bug interactively in current session (use `bug-fix-workflow`)
44
- - User wants to launch the feature pipeline (use `dev-pipeline-launcher`)
44
+ - User wants to launch the feature pipeline (use `feature-pipeline-launcher`)
45
45
 
46
46
  ### Prerequisites
47
47
 
@@ -142,6 +142,20 @@ Detect user intent from their message, then follow the corresponding workflow:
142
142
  | Verbose: On | `VERBOSE=1` |
143
143
  | Max retries: N | `MAX_RETRIES=N` |
144
144
  | Timeout: value | `SESSION_TIMEOUT=<seconds>` |
145
+ | Model override | `MODEL=<model-name>` |
146
+
147
+ **Advanced environment variables** (not exposed in interactive menu, pass via `--env`):
148
+
149
+ | Variable | Default | Purpose |
150
+ |----------|---------|---------|
151
+ | `MODEL` | (none) | AI model override (e.g. `claude-opus-4.6`) |
152
+ | `AUTO_PUSH` | `0` | Auto-push to remote after successful bug fix (`1` to enable) |
153
+ | `DEV_BRANCH` | auto-generated | Custom dev branch name (default: `bugfix/pipeline-{run_id}`) |
154
+ | `HEARTBEAT_INTERVAL` | `30` | Heartbeat log interval in seconds |
155
+ | `HEARTBEAT_STALE_THRESHOLD` | `600` | Max seconds without heartbeat before marking stale |
156
+ | `LOG_CLEANUP_ENABLED` | `1` | Run periodic log cleanup (`0` to disable) |
157
+ | `LOG_RETENTION_DAYS` | `14` | Delete logs older than N days |
158
+ | `LOG_MAX_TOTAL_MB` | `1024` | Keep total logs under N MB via oldest-first cleanup |
145
159
 
146
160
  ⚠️ STOP HERE and wait for user response before continuing to step 6.
147
161
 
@@ -190,7 +204,7 @@ Detect user intent from their message, then follow the corresponding workflow:
190
204
  **If foreground**: Pipeline runs to completion in the terminal. After it finishes:
191
205
  - Summarize results: total bugs, fixed, failed, skipped
192
206
  - If all fixed: each bug session has already run `prizmkit-retrospective` (structural sync) internally. Ask user what's next.
193
- - If some failed: show failed bug IDs and suggest `retry-bug.sh <B-XXX>` or `reset-bug.sh <B-XXX> --clean --run`
207
+ - If some failed: show failed bug IDs and suggest `retry-bugfix.sh <B-XXX>` or `reset-bug.sh <B-XXX> --clean --run`
194
208
 
195
209
  **If background daemon**:
196
210
  1. Verify launch:
@@ -281,14 +295,14 @@ Detect user intent from their message, then follow the corresponding workflow:
281
295
  When user says "retry B-001":
282
296
 
283
297
  ```bash
284
- dev-pipeline/retry-bug.sh B-001 bug-fix-list.json
298
+ dev-pipeline/retry-bugfix.sh B-001 bug-fix-list.json
285
299
  ```
286
300
 
287
- **Note:** `retry-bug.sh` automatically cleans bug artifacts and resets status before retrying. This is equivalent to `reset-feature.sh --clean --run` in the feature pipeline. No separate reset command is needed.
301
+ **Note:** `retry-bugfix.sh` automatically cleans bug artifacts and resets status before retrying. This is equivalent to `reset-feature.sh --clean --run` in the feature pipeline. No separate reset command is needed.
288
302
 
289
303
  Environment variables (optional):
290
304
  ```bash
291
- SESSION_TIMEOUT=3600 dev-pipeline/retry-bug.sh B-001 bug-fix-list.json
305
+ SESSION_TIMEOUT=3600 dev-pipeline/retry-bugfix.sh B-001 bug-fix-list.json
292
306
  ```
293
307
 
294
308
  ### Error Handling