prizmkit 1.1.8 → 1.1.10

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 (123) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/skill-adapter.js +21 -7
  3. package/bundled/agents/prizm-dev-team-reviewer.md +53 -173
  4. package/bundled/dev-pipeline/.env.example +45 -0
  5. package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +535 -0
  6. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  7. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +57 -12
  8. package/bundled/dev-pipeline/launch-feature-daemon.sh +3 -1
  9. package/bundled/dev-pipeline/launch-refactor-daemon.sh +57 -12
  10. package/bundled/dev-pipeline/lib/branch.sh +6 -1
  11. package/bundled/dev-pipeline/lib/common.sh +71 -0
  12. package/bundled/dev-pipeline/lib/heartbeat.sh +2 -2
  13. package/bundled/dev-pipeline/retry-bugfix.sh +60 -23
  14. package/bundled/dev-pipeline/retry-feature.sh +47 -12
  15. package/bundled/dev-pipeline/retry-refactor.sh +105 -23
  16. package/bundled/dev-pipeline/run-bugfix.sh +265 -44
  17. package/bundled/dev-pipeline/run-feature.sh +35 -1
  18. package/bundled/dev-pipeline/run-refactor.sh +376 -51
  19. package/bundled/dev-pipeline/scripts/check-session-status.py +24 -1
  20. package/bundled/dev-pipeline/scripts/detect-stuck.py +195 -85
  21. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +31 -19
  22. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +19 -3
  23. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +98 -11
  24. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +30 -5
  25. package/bundled/dev-pipeline/scripts/init-pipeline.py +3 -3
  26. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +15 -4
  27. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -5
  28. package/bundled/dev-pipeline/scripts/patch-completion-notes.py +191 -0
  29. package/bundled/dev-pipeline/scripts/update-bug-status.py +159 -14
  30. package/bundled/dev-pipeline/scripts/update-feature-status.py +79 -37
  31. package/bundled/dev-pipeline/scripts/update-refactor-status.py +343 -13
  32. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +1 -1
  33. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +7 -11
  34. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +41 -7
  35. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +27 -3
  36. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +43 -19
  37. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -26
  38. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +5 -14
  39. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +36 -25
  40. package/bundled/dev-pipeline/templates/feature-list-schema.json +23 -11
  41. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +270 -0
  42. package/bundled/dev-pipeline/templates/refactor-list-schema.json +10 -2
  43. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +3 -1
  44. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +1 -0
  45. package/bundled/dev-pipeline/templates/sections/feature-context.md +2 -0
  46. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +29 -2
  47. package/bundled/dev-pipeline/templates/sections/phase-commit.md +22 -0
  48. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +8 -6
  50. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -5
  51. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  52. package/bundled/skills/_metadata.json +5 -22
  53. package/bundled/skills/app-planner/SKILL.md +92 -66
  54. package/bundled/skills/app-planner/assets/app-design-guide.md +1 -1
  55. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
  56. package/bundled/skills/app-planner/references/project-brief-guide.md +69 -66
  57. package/bundled/skills/bug-fix-workflow/SKILL.md +47 -4
  58. package/bundled/skills/bug-planner/SKILL.md +130 -188
  59. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +43 -0
  60. package/bundled/skills/bug-planner/references/critic-and-verification.md +44 -0
  61. package/bundled/skills/bug-planner/references/error-recovery.md +73 -0
  62. package/bundled/skills/bug-planner/references/input-formats.md +53 -0
  63. package/bundled/skills/bug-planner/references/schema-validation.md +25 -0
  64. package/bundled/skills/bug-planner/references/severity-rules.md +16 -0
  65. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +1 -5
  66. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -10
  67. package/bundled/skills/feature-pipeline-launcher/SKILL.md +16 -3
  68. package/bundled/skills/feature-planner/SKILL.md +33 -122
  69. package/bundled/skills/feature-planner/assets/evaluation-guide.md +1 -1
  70. package/bundled/skills/feature-planner/assets/planning-guide.md +21 -5
  71. package/bundled/skills/feature-planner/references/browser-interaction.md +2 -4
  72. package/bundled/skills/feature-planner/references/completeness-review.md +57 -0
  73. package/bundled/skills/feature-planner/references/error-recovery.md +15 -34
  74. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +1 -1
  75. package/bundled/skills/feature-planner/references/new-project-planning.md +2 -2
  76. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -2
  77. package/bundled/skills/feature-workflow/SKILL.md +3 -4
  78. package/bundled/skills/prizm-kit/SKILL.md +39 -49
  79. package/bundled/skills/prizmkit-code-review/SKILL.md +51 -64
  80. package/bundled/skills/prizmkit-code-review/rules/dimensions.md +85 -0
  81. package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +11 -11
  82. package/bundled/skills/prizmkit-committer/SKILL.md +3 -31
  83. package/bundled/skills/prizmkit-deploy/SKILL.md +34 -31
  84. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  85. package/bundled/skills/prizmkit-implement/SKILL.md +35 -68
  86. package/bundled/skills/prizmkit-init/SKILL.md +112 -65
  87. package/bundled/skills/prizmkit-init/assets/project-brief-template.md +82 -0
  88. package/bundled/skills/prizmkit-plan/SKILL.md +120 -79
  89. package/bundled/skills/prizmkit-plan/assets/plan-template.md +28 -18
  90. package/bundled/skills/prizmkit-plan/assets/spec-template.md +28 -11
  91. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +3 -3
  92. package/bundled/skills/prizmkit-plan/references/verification-checklist.md +60 -0
  93. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +10 -81
  94. package/bundled/skills/prizmkit-prizm-docs/assets/{PRIZM-SPEC.md → prizm-docs-format.md} +41 -526
  95. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +46 -0
  96. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +16 -0
  97. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +14 -0
  98. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +19 -0
  99. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +17 -0
  100. package/bundled/skills/prizmkit-retrospective/SKILL.md +27 -65
  101. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -4
  102. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +7 -25
  103. package/bundled/skills/recovery-workflow/SKILL.md +8 -8
  104. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +17 -9
  105. package/bundled/skills/refactor-planner/SKILL.md +23 -41
  106. package/bundled/skills/refactor-workflow/SKILL.md +1 -2
  107. package/bundled/team/prizm-dev-team.json +1 -1
  108. package/bundled/{skills/prizm-kit/assets → templates}/project-memory-template.md +1 -1
  109. package/package.json +1 -1
  110. package/src/clean.js +0 -1
  111. package/src/gitignore-template.js +0 -1
  112. package/src/scaffold.js +10 -3
  113. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +0 -5
  114. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +0 -19
  115. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +0 -19
  116. package/bundled/skills/app-planner/references/project-conventions.md +0 -93
  117. package/bundled/skills/prizmkit-analyze/SKILL.md +0 -207
  118. package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +0 -25
  119. package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +0 -43
  120. package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +0 -25
  121. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +0 -69
  122. package/bundled/skills/prizmkit-verify/SKILL.md +0 -281
  123. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +0 -402
@@ -1,111 +1,103 @@
1
1
  ---
2
2
  name: "prizmkit-plan"
3
- description: "Specify and plan features: natural language → spec.md plan.md with architecture and executable tasks. Supports feature, refactor, and bugfix modes. Use before /prizmkit-implement. Trigger on: 'specify', 'plan', 'new feature', 'I want to add/build...', 'architect', 'design', 'break it down', 'create tasks'. (project)"
3
+ description: "Specify and plan tasks: natural language → spec.md & plan.md with architecture and executable tasks. Use before /prizmkit-implement. Trigger on: 'specify', 'plan', 'new task', 'I want to add/build...', 'architect', 'design', 'break it down', 'create tasks'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Plan
7
7
 
8
+ A universal spec + plan generator. Takes a natural-language description of ANY development task (new feature, refactoring, bug fix, migration, etc.) and produces `spec.md` (WHAT/WHY) and `plan.md` (HOW) with executable tasks.
9
+
8
10
  ### When to Use
9
- - New feature user says "specify", "plan", "new feature", "I want to add..."
11
+ - Any non-trivial development task that benefits from written specification and planning
10
12
  - Before `/prizmkit-implement` — to create the spec + task breakdown
11
- - When a feature idea needs to go from concept to executable plan
13
+ - User says "specify", "plan", "new task", "I want to add...", "architect", "design", "break it down"
12
14
 
13
15
  ### When NOT to Use
14
- - Bug fix with clear root cause fast path (skip Phase 0, simplified plan implement → commit)
15
- - Config tweaks, typo fixes edit directly
16
- - User already has a detailed spec → start from Phase 1
16
+ - Config tweaks, typo fixes, trivial one-line changesedit directly
17
+ - Simple changes where the developer already knows exactly what to do and the scope is ≤10 lines in a single file
18
+
19
+ ## Input
20
+
21
+ | Parameter | Required | Description |
22
+ |-----------|----------|-------------|
23
+ | `description` | Yes | Natural-language description of the task |
24
+ | `artifact_dir` | No | Directory to write spec.md + plan.md into. If omitted, auto-generates under `.prizmkit/specs/` (see Phase 0 Step 2). |
17
25
 
18
26
  ## Execution
19
27
 
20
- ### Phase 0: Specify (WHAT)
28
+ ### Phase 0: Specify (→ spec.md)
21
29
 
22
- Transforms natural language into a structured spec. Skip this phase when:
23
- - A `spec.md` already exists for this feature
24
- - Running in refactor mode (input is `refactor-analysis.md`)
25
- - Running in bugfix mode (input is `fix-plan.md` or caller-provided description)
30
+ **Skip condition**: If `spec.md` already exists in the artifact directory, skip to Phase 1.
26
31
 
27
32
  **Steps:**
28
33
 
29
- 1. Ask user for feature description (natural language)
30
- 2. Auto-generate 2-4 word feature slug from description
31
- 3. Determine next feature number by scanning `.prizmkit/specs/`:
32
- - List existing `###-*` directories, find highest numeric prefix
33
- - Next = highest + 1 (zero-padded to 3 digits)
34
- - If empty or doesn't exist, start at `001`
35
- 4. Create directory: `.prizmkit/specs/###-feature-name/`
36
- 5. Load project context (use first available):
37
- - If `context-snapshot.md` exists in the feature dir → read Section 3 'Prizm Context' (skip re-reading .prizm-docs/)
38
- - Otherwise → read `.prizm-docs/root.prizm` and relevant L1/L2 docs
39
- 6. Generate `spec.md` from template (`${SKILL_DIR}/assets/spec-template.md`):
40
- - Feature title and description
41
- - User stories (As a... I want... So that...) with acceptance criteria (Given/When/Then)
42
- - Scope boundaries (In scope / Out of scope)
43
- - Dependencies and constraints
34
+ 1. Gather input: read the task description. If no description is provided and interactive session is available, ask the user; otherwise abort with an error.
35
+ 2. Determine artifact directory:
36
+ - If `artifact_dir` is provided use it directly
37
+ - If not provided → scan `.prizmkit/specs/` for existing `###-*` directories, find highest numeric prefix, next = highest + 1 (zero-padded to 3 digits; start at `001` if empty). Create `.prizmkit/specs/###-task-slug/`
38
+ - Auto-generate 2-10 word task slug from description
39
+ 3. Load project context: read `.prizm-docs/root.prizm` and relevant L1/L2 docs
40
+ 4. Generate `spec.md` from template (`${SKILL_DIR}/assets/spec-template.md`):
41
+ - Fill sections based on the task description — all sections are optional, include only what is relevant
44
42
  - `[NEEDS CLARIFICATION]` markers for all ambiguous items
45
- 7. **Database design detection**: If feature involves data persistence (new entities, fields, schema changes), add a `## Data Model` section to spec.md — scan existing schema files to extract naming conventions, ID strategy, constraint patterns. Mark uncertain decisions with `[NEEDS CLARIFICATION]`.
46
- 8. Run quality validation (max 3 iterations): all stories have criteria? scope defined? DB conventions documented?
47
- 9. **Auto-clarification**: If any `[NEEDS CLARIFICATION]` markers remain, enter interactive clarification immediately.
43
+ 5. **Database design detection**: If changes involve data persistence (new entities, fields, schema changes), add `## Data Model` section — scan existing schema files to extract naming conventions, ID strategy, constraint patterns. Mark uncertain decisions with `[NEEDS CLARIFICATION]`.
44
+ 6. Run quality validation : all goals have criteria? scope defined? DB conventions documented (if applicable)?
45
+ 7. **Auto-clarification**: If any `[NEEDS CLARIFICATION]` markers remain and interactive session is available, enter interactive clarification.
48
46
  → Read `${SKILL_DIR}/references/clarify-guide.md` for question strategy and update rules.
47
+ If non-interactive, resolve ambiguities by choosing the most conservative option and annotating the decision.
49
48
  Resolve all markers before proceeding to Phase 1.
50
49
 
51
- **Writing principles**: Focus on WHAT and WHY, never HOW. Every user story needs acceptance criteria. Scope boundaries must be explicit. Mark all genuine ambiguities — the clarification phase resolves them.
50
+ **Writing principles**: Focus on WHAT and WHY, never HOW. Every goal needs acceptance criteria. Scope boundaries must be explicit. Mark all genuine ambiguities — the clarification phase resolves them.
52
51
 
53
- ### Phase 1: Design (HOW)
52
+ ### Phase 1: Design (spec.md → plan.md)
54
53
 
55
- **Precondition:**
56
-
57
- | Mode | Required Input | Directory |
58
- |---|---|---|
59
- | **Feature** (default) | `spec.md` (from Phase 0) + `.prizm-docs/root.prizm` | `.prizmkit/specs/###-feature-name/` |
60
- | **Refactor** | `refactor-analysis.md` | `.prizmkit/refactor/<refactor-slug>/` |
61
- | **Bugfix** | `fix-plan.md` or caller-provided description | `.prizmkit/bugfix/<BUG_ID>/` |
62
-
63
- If no input document exists, prompt user to describe the feature (triggers Phase 0).
54
+ **Precondition**: `spec.md` exists in the artifact directory.
64
55
 
65
56
  **Steps:**
66
57
 
67
- 1. Read the input document (spec.md / refactor-analysis.md / fix-plan.md)
68
- 2. Load project context if not already loaded in Phase 0:
69
- - If `context-snapshot.md` exists → read it for docs + code structure
70
- - Otherwise → read `.prizm-docs/root.prizm` and relevant L1/L2 docs
58
+ 1. Read `spec.md` from the artifact directory
59
+ 2. Load project context if not already loaded in Phase 0: read `.prizm-docs/root.prizm` and relevant L1/L2 docs
71
60
  3. Resolve any remaining `[NEEDS CLARIFICATION]` by proposing solutions
72
61
  4. Generate `plan.md` from template (`${SKILL_DIR}/assets/plan-template.md`):
73
- - Architecture approach, component design
62
+ - Change approach (how the changes integrate with existing system)
63
+ - Component / file changes
74
64
  - Data model changes (with **database design gate** — read ALL existing schema files, ensure new schema follows existing patterns, resolve all DB ambiguities inline before proceeding)
75
65
  - Interface design (API endpoints, request/response formats)
76
- - Integration points, testing strategy, risk assessment
77
- 5. Cross-check: every user story maps to plan components — unmapped stories = coverage gaps
66
+ - Testing strategy
67
+ - Risk assessment
68
+ - Behavior preservation strategy (if the task modifies existing behavior — include what must remain unchanged and how to verify)
69
+ 5. Cross-check: every goal in spec.md maps to plan components — unmapped goals = coverage gaps
78
70
  6. Check alignment with `.prizm-docs/root.prizm` RULES section
79
- 7. **Deployment strategy check:**
71
+ 7. **Deployment strategy check** (skip if no deployment impact):
80
72
  - Read `.prizmkit/config.json` `deploy_strategy` field
81
- - No strategy → ask user, write to config.json
82
- - Strategy exists + new tech stack detected → ask about new component only
83
- - Skipped in fast-path mode (bug fixes / simple refactors)
73
+ - No strategy and new infra needed → ask user, write to config.json
84
74
 
85
- ### Phase 2: Task Generation
75
+ ### Phase 2: Task Generation (plan.md → Tasks section)
86
76
 
87
- 1. Ask user for strategy (or infer): MVP-first / Incremental / Parallel
88
- 2. Append `## Tasks` section to `plan.md` using tasks template in `${SKILL_DIR}/assets/plan-template.md`:
89
- - Phases: Setup (T-001~T-009) → Foundational (T-010~T-099) → User Stories (T-100+) → Polish (T-900+)
90
- - Each task: `- [ ] [T-NNN] [P?] [US?] Description — file: path/to/file`
77
+ 1. If interactive session is available, ask user for strategy; otherwise infer automatically: MVP-first / Incremental / Parallel
78
+ 2. Append `## Tasks` section to `plan.md` using template in `${SKILL_DIR}/assets/plan-template.md`:
79
+ - Phases: Setup (T-001~T-009) → Foundation (T-010~T-099) → Core (T-100+) → Polish (T-900+)
80
+ - Each task: `- [ ] [T-NNN] [P?] [G-N?] Description — file: path/to/file`
91
81
  - Checkpoint tasks between phases for validation
92
- 3. Verify coverage:
93
- - Every user storyat least one task
94
- - Every task a target file path
95
- - Risk assessment → at least one risk with mitigation
96
- 4. Output: `plan.md` path, summary of design decisions, task count
82
+ - Organize Core tasks by goals (G-1, G-2, ...) or by logical grouping appropriate to the task
83
+ 3. Verify consistency and coverage read `${SKILL_DIR}/references/verification-checklist.md` and run all checks. Fix any issues inline before output.
84
+ 4. Output: `plan.md` path, summary of design decisions, task count.
97
85
 
98
86
  **HANDOFF:** `/prizmkit-implement`
99
87
 
100
- ## Example
88
+ ## Examples
89
+
90
+ ### Example 1: New Feature
101
91
 
102
92
  **Input:** "I want users to upload avatars"
103
93
 
104
94
  **Phase 0 output:** `.prizmkit/specs/003-user-avatar/spec.md`
105
95
  ```markdown
106
- # Feature: User Avatar Upload
107
- ## User Stories
108
- ### US-1: Upload Avatar
96
+ # User Avatar Upload
97
+ ## Overview
98
+ Allow registered users to upload and manage profile pictures.
99
+ ## Goals
100
+ ### G-1: Upload Avatar
109
101
  As a registered user, I want to upload a profile picture,
110
102
  so that other users can visually identify me.
111
103
  **Acceptance Criteria:**
@@ -119,26 +111,75 @@ so that other users can visually identify me.
119
111
 
120
112
  **Phase 1-2 output:** `plan.md` excerpt:
121
113
  ```markdown
122
- ## Architecture Approach
123
- Extend existing user profile module. Add S3 integration for file storage.
124
-
125
114
  ## Tasks
126
- ### Phase: Data Layer (T-010~T-019)
127
- - [ ] [T-010] [US-1] Add avatar_url field to User model — file: src/models/user.ts
128
- - [ ] [T-011] [US-1] Create S3 upload utility — file: src/lib/s3.ts
129
- ### Phase: API [P] (T-100~T-109)
130
- - [ ] [T-100] [P] [US-1] POST /api/avatar upload endpoint — file: src/routes/avatar.ts
115
+ ### Phase: Foundation (T-010~T-019)
116
+ - [ ] [T-010] [G-1] Add avatar_url field to User model — file: src/models/user.ts
117
+ - [ ] [T-011] [G-1] Create S3 upload utility — file: src/lib/s3.ts
118
+ ### Phase: Core [P] (T-100~T-109)
119
+ - [ ] [T-100] [P] [G-1] POST /api/avatar upload endpoint — file: src/routes/avatar.ts
120
+ ```
121
+
122
+ ### Example 2: Refactoring
123
+
124
+ **Input:** "Extract shared auth middleware from the API routes"
125
+
126
+ **Phase 0 output:** `.prizmkit/specs/004-extract-auth-middleware/spec.md`
127
+ ```markdown
128
+ # Extract Auth Middleware
129
+ ## Overview
130
+ Consolidate duplicated authentication logic scattered across route files into a single shared middleware.
131
+ ## Goals
132
+ ### G-1: Extract Shared Authentication Logic
133
+ Consolidate duplicated auth checks from 5 route files into a single middleware module.
134
+ **Acceptance Criteria:**
135
+ - All existing auth-related tests pass without modification
136
+ - Auth logic exists in exactly one file (src/middleware/auth.ts)
137
+ - No route file contains inline token verification
138
+ ## Scope
139
+ - **In scope:** src/routes/users.ts, orders.ts, admin.ts, payments.ts, profile.ts
140
+ - **Out of scope:** Authorization (role-based access), rate limiting
141
+ ## Behavior Preservation
142
+ - All 23 existing API tests must pass unchanged
143
+ - Response formats and HTTP status codes must not change
144
+ - Error message strings must remain identical
145
+ ```
146
+
147
+ ### Example 3: Bug Fix
148
+
149
+ **Input:** "Login page crashes when API returns 401"
150
+
151
+ **Phase 0 output:** `.prizmkit/specs/005-login-401-crash/spec.md`
152
+ ```markdown
153
+ # Fix: Login Crash on 401 Response
154
+ ## Overview
155
+ Login page throws unhandled exception when auth API returns 401, causing a white screen.
156
+ ## Goals
157
+ ### G-1: Handle 401 Response Gracefully
158
+ When the auth API returns 401, display an error message instead of crashing.
159
+ **Acceptance Criteria:**
160
+ - Given user submits invalid credentials, When API returns 401, Then error message "Invalid credentials" is displayed
161
+ - Given user submits invalid credentials, When API returns 401, Then no unhandled exception is thrown
162
+ ## Root Cause
163
+ - Error classification: Runtime
164
+ - Root cause: `AuthService.handleLogin()` at src/services/auth.ts:42 does not handle null token
165
+ - Affected files: src/services/auth.ts (L42), src/pages/login.tsx (L28)
166
+ ## Scope
167
+ - **In scope:** Null handling in auth service, error display in login page
168
+ - **Out of scope:** Other HTTP error codes (403, 500), auth flow redesign
169
+ ## Behavior Preservation
170
+ - All existing login success tests must pass unchanged
171
+ - Auth token flow for valid credentials must not change
131
172
  ```
132
173
 
133
- ## Templates
174
+ ## References
134
175
 
135
176
  - Spec template: `${SKILL_DIR}/assets/spec-template.md`
136
177
  - Plan template: `${SKILL_DIR}/assets/plan-template.md`
178
+ - Clarification guide: `${SKILL_DIR}/references/clarify-guide.md`
179
+ - Verification checklist: `${SKILL_DIR}/references/verification-checklist.md`
137
180
 
138
181
  ## Output
139
182
 
140
- | Mode | Directory | Files |
141
- |---|---|---|
142
- | Feature | `.prizmkit/specs/###-feature-name/` | `spec.md` + `plan.md` |
143
- | Refactor | `.prizmkit/refactor/<refactor-slug>/` | `plan.md` |
144
- | Bugfix | `.prizmkit/bugfix/<BUG_ID>/` | `plan.md` |
183
+ | Directory | Files |
184
+ |---|---|
185
+ | `artifact_dir` (provided or auto-generated `.prizmkit/specs/###-slug/`) | `spec.md` + `plan.md` |
@@ -1,7 +1,7 @@
1
- # Implementation Plan: [FEATURE_TITLE]
1
+ # Plan: [TITLE]
2
2
 
3
- ## Architecture Approach
4
- [How this feature integrates with existing system architecture]
3
+ ## Change Approach
4
+ [Description of the technical approach — how these changes integrate with the existing system]
5
5
 
6
6
  ## Component Design
7
7
 
@@ -11,8 +11,17 @@
11
11
  ### Modified Components
12
12
  - [Component]: [What changes and why]
13
13
 
14
+ ## Behavior Preservation Strategy
15
+ <!-- Include when the task modifies existing behavior. Delete if not applicable (e.g., greenfield feature). -->
16
+ <!-- Strategy: one of test-gate / snapshot / manual -->
17
+ <!-- test-gate: all tests must pass after each task -->
18
+ <!-- snapshot: before-after comparison of outputs -->
19
+ <!-- manual: reviewer verification at checkpoints -->
20
+ - Strategy: [test-gate / snapshot / manual]
21
+ - Baseline: [describe green test suite or snapshot state]
22
+
14
23
  ## Data Model
15
- <!-- Skip this section if the feature does not involve database changes -->
24
+ <!-- Include when changes involve database / data persistence. Delete if not applicable. -->
16
25
  <!-- IMPORTANT: Read existing schema/model files BEFORE designing new tables -->
17
26
 
18
27
  ### Existing Schema Audit
@@ -57,8 +66,7 @@
57
66
  | [Risk] | [H/M/L] | [Plan] |
58
67
 
59
68
  ## Deployment Considerations
60
- <!-- Skip this section if the feature does not affect deployment (no new services, infra, or environment changes) -->
61
- <!-- Only fill when: new external service added, new database/cache introduced, new env vars required, or infra topology changes -->
69
+ <!-- Include when there is deployment impact (new services, infra, environment changes). Delete if not applicable. -->
62
70
 
63
71
  ### New Infrastructure Requirements
64
72
  - [Component]: [Deployment target from config deploy_strategy] — [any special config needed]
@@ -76,30 +84,32 @@
76
84
  - [ ] CI/CD pipeline update needed
77
85
 
78
86
  ## Pre-Implementation Gates
79
- - [ ] Spec coverage: all user stories mapped to components
80
- - [ ] Data model reviewed — existing schema conventions documented and followed
81
- - [ ] All Data Model `[NEEDS CLARIFICATION]` items resolved (mandatory for DB features)
82
- - [ ] API contracts defined
87
+ - [ ] Spec coverage: all goals mapped to components
88
+ - [ ] Data model reviewed — existing schema conventions documented and followed (if applicable)
89
+ - [ ] All `[NEEDS CLARIFICATION]` items resolved
83
90
  - [ ] Testing approach agreed
91
+ - [ ] Behavior preservation strategy defined (if modifying existing behavior)
92
+ - [ ] Root cause confirmed with reproduction test design (if fixing a defect)
84
93
 
85
94
  ## Tasks
86
95
 
87
96
  ### Strategy: [MVP-first | Incremental | Parallel]
88
97
 
89
98
  ### Phase: Setup
90
- - [ ] [T-001] Project scaffolding — file: [path]
99
+ - [ ] [T-001] [Description] — file: [path]
91
100
 
92
- ### Phase: Foundational
93
- - [ ] [T-010] [Data model / Schema changes] — file: [path]
101
+ ### Phase: Foundation
102
+ - [ ] [T-010] [Description] — file: [path]
94
103
 
95
- ### Phase: User Story 1 — [Title]
96
- - [ ] [T-100] [P] [US1] [Task description] file: [path]
104
+ ### Phase: Core
105
+ <!-- Organize by goals (G-1, G-2, ...) or by logical grouping appropriate to the task -->
106
+ - [ ] [T-100] [P] [G-1] [Task description] — file: [path]
97
107
 
98
108
  ### Phase: Polish
99
- - [ ] [T-900] Final integration test
109
+ - [ ] [T-900] Final verification
100
110
  - [ ] [T-901] Documentation update
101
111
 
102
112
  ### Checkpoints
103
113
  - [ ] [CP-1] After Setup: project builds and tests pass
104
- - [ ] [CP-2] After Foundational: data model verified
105
- - [ ] [CP-3] After each US: acceptance criteria pass
114
+ - [ ] [CP-2] After Foundation: base changes verified
115
+ - [ ] [CP-3] After each Core group: acceptance criteria pass
@@ -1,17 +1,19 @@
1
- # Feature: [FEATURE_TITLE]
1
+ # [TITLE]
2
2
 
3
3
  ## Overview
4
- [One paragraph describing the feature purpose and business value]
4
+ [One paragraph describing the purpose and motivation]
5
5
 
6
- ## User Stories
6
+ ## Goals
7
7
 
8
- ### US1: [Story Title]
9
- **As a** [role]
10
- **I want** [capability]
11
- **So that** [benefit]
8
+ ### G-1: [Goal Title]
9
+ [Goal description — use whatever format best suits the task:
10
+ - User Story format: "As a [role], I want [capability], so that [benefit]."
11
+ - Objective format: "Objective: [change to make]. Target state: [desired outcome]."
12
+ - Fix format: "Fix: [symptom]. Root cause: [brief cause]."
13
+ - Or any other clear format.]
12
14
 
13
15
  **Acceptance Criteria:**
14
- - [ ] Given [context], When [action], Then [expected result]
16
+ - [ ] [Criterion 1 Given/When/Then, or a concrete verifiable statement]
15
17
 
16
18
  ## Scope
17
19
 
@@ -21,14 +23,27 @@
21
23
  ### Out of Scope
22
24
  - [Item 1]
23
25
 
26
+ ## Behavior Preservation
27
+ <!-- Include this section when the task modifies existing behavior (refactoring, bug fixes, migrations, etc.). Delete if not applicable. -->
28
+ - [What behavior / contracts / interfaces must remain unchanged]
29
+ - [Existing test suites that must continue to pass]
30
+
31
+ ## Root Cause
32
+ <!-- Include this section when the task is fixing a defect. Delete if not applicable. -->
33
+ - Error classification: [Runtime / Network / Auth / Data / Logic / Config / External]
34
+ - Root cause: [specific code location and mechanism]
35
+ - Affected files: [file list with line numbers]
36
+ - Impact: [blast radius — which modules / features are affected]
37
+
24
38
  ## Dependencies
25
39
  - [Dependency 1]: [Why needed]
26
40
 
27
- ## Data Model (if feature involves database changes)
41
+ ## Data Model
42
+ <!-- Include this section when changes involve database / data persistence. Delete if not applicable. -->
28
43
 
29
44
  ### Existing Schema Reference
30
45
  <!-- Read existing schema/model files BEFORE designing new tables. Document observed conventions here. -->
31
- - Tables reviewed: [list existing tables related to this feature]
46
+ - Tables reviewed: [list existing tables related to this change]
32
47
  - Naming convention: [snake_case/camelCase — match existing]
33
48
  - ID strategy: [UUID/auto-increment — match existing]
34
49
  - Timestamp pattern: [created_at/updated_at — match existing]
@@ -50,7 +65,9 @@
50
65
  [NEEDS CLARIFICATION]: [Ambiguous item]
51
66
 
52
67
  ## Review Checklist
53
- - [ ] All user stories have acceptance criteria
68
+ - [ ] All goals have acceptance criteria
54
69
  - [ ] Scope boundaries are clearly defined
55
70
  - [ ] Dependencies are identified
56
71
  - [ ] No implementation details (WHAT not HOW)
72
+ - [ ] Behavior preservation defined (if modifying existing behavior)
73
+ - [ ] Root cause identified with evidence (if fixing a defect)
@@ -9,7 +9,7 @@ Invoked automatically during `/prizmkit-plan` Phase 0 (specify) when `[NEEDS CLA
9
9
  **Ask one question at a time.** Batching questions produces lower-quality answers.
10
10
 
11
11
  For each question:
12
- 1. Cite the exact location in spec.md (e.g., "§3.2 says...")
12
+ 1. Cite the exact location in spec.md (e.g., "§Goals G-1 says..." or "§Scope says...")
13
13
  2. State what is ambiguous and why it matters for implementation
14
14
  3. Provide a **recommended answer** with rationale — gives the user a concrete starting point to accept, modify, or reject
15
15
 
@@ -45,7 +45,7 @@ If the user says "done", "stop", or "enough" — end immediately and output a su
45
45
  ## Example Exchange
46
46
 
47
47
  **Question:**
48
- > §3.2 says "User can upload files" but doesn't specify file types or size limits.
48
+ > §Goals G-1 says "User can upload files" but doesn't specify file types or size limits.
49
49
  >
50
50
  > **Recommended:** Accept JPEG, PNG, PDF up to 10MB — covers common use cases without straining storage.
51
51
  >
@@ -53,7 +53,7 @@ If the user says "done", "stop", or "enough" — end immediately and output a su
53
53
 
54
54
  **User:** "Also allow SVG, make it 25MB"
55
55
 
56
- **Action:** Update spec.md §3.2 → `File upload: JPEG, PNG, PDF, SVG. Max 25MB per file.` Remove marker.
56
+ **Action:** Update spec.md §Goals G-1 → `File upload: JPEG, PNG, PDF, SVG. Max 25MB per file.` Remove marker.
57
57
 
58
58
  **Follow-up question triggered by answer:**
59
59
  > SVGs can contain embedded scripts (XSS risk). Should uploaded SVGs be sanitized (strip `<script>` + event handlers), or restricted to trusted users only?
@@ -0,0 +1,60 @@
1
+ # Verification Checklist — Spec & Plan Consistency
2
+
3
+ Run this checklist after generating the Tasks section in plan.md. Fix any issues inline before outputting the final plan.
4
+
5
+ ---
6
+
7
+ ## Coverage
8
+
9
+ - [ ] Every goal (G-N) in spec.md has at least one task in plan.md
10
+ - [ ] Every task has a target file path (`— file: path/to/file`)
11
+ - [ ] Risk assessment contains at least one risk with a mitigation plan
12
+ - [ ] If spec includes `## Behavior Preservation` → at least one verification task exists
13
+ - [ ] If spec includes `## Root Cause` → at least one reproduction test task exists
14
+
15
+ ## Duplication Detection
16
+
17
+ - [ ] No near-duplicate requirements exist across spec.md sections (same intent, different wording)
18
+ - [ ] If duplicates found, consolidate to the clearer phrasing and remove the other
19
+
20
+ ## Orphan Detection
21
+
22
+ - [ ] No task exists without a mapped goal (orphan task)
23
+ - [ ] No plan component exists without a corresponding spec requirement
24
+
25
+ ## Ambiguity Scan
26
+
27
+ - [ ] No unresolved `[NEEDS CLARIFICATION]`, TBD, TODO, or `???` markers remain
28
+ - [ ] No vague criteria without measurable thresholds (e.g., "fast", "secure", "scalable", "intuitive" — replace with concrete numbers or conditions)
29
+
30
+ ## Terminology Consistency
31
+
32
+ - [ ] Same concept uses the same name in both spec.md and plan.md (no terminology drift)
33
+ - [ ] Data entities referenced in plan.md exist in spec.md (and vice versa)
34
+
35
+ ## Task Ordering
36
+
37
+ - [ ] No task references the output of a later task without an explicit dependency note
38
+ - [ ] Foundation tasks precede Core tasks that depend on them
39
+ - [ ] Checkpoint tasks exist between phases
40
+
41
+ ## Rules Alignment
42
+
43
+ - [ ] No spec or plan element conflicts with `.prizm-docs/root.prizm` RULES MUST/NEVER directives
44
+ - [ ] Tech stack choices in plan.md match `.prizm-docs/root.prizm` TECH_STACK (if defined)
45
+
46
+ ## Database Design (skip if no Data Model section)
47
+
48
+ - [ ] New entity/field naming follows conventions documented in "Existing Schema Audit"
49
+ - [ ] All fields have explicit nullability (NOT NULL or nullable)
50
+ - [ ] Foreign key constraints and indexes are defined
51
+ - [ ] ID strategy and timestamp patterns match existing tables
52
+ - [ ] No unresolved questions remain in Data Model "Unresolved Questions" section
53
+ - [ ] Style Conformance Checklist in plan.md is fully checked
54
+
55
+ ## Action on Failure
56
+
57
+ If any check fails:
58
+ 1. Fix the issue directly in spec.md or plan.md
59
+ 2. Re-run the failed checks only
60
+ 3. Do not proceed to output until all checks pass