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.
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/codebuddy/skill-adapter.js +21 -7
- package/bundled/agents/prizm-dev-team-reviewer.md +53 -173
- package/bundled/dev-pipeline/.env.example +45 -0
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +535 -0
- package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
- package/bundled/dev-pipeline/launch-bugfix-daemon.sh +57 -12
- package/bundled/dev-pipeline/launch-feature-daemon.sh +3 -1
- package/bundled/dev-pipeline/launch-refactor-daemon.sh +57 -12
- package/bundled/dev-pipeline/lib/branch.sh +6 -1
- package/bundled/dev-pipeline/lib/common.sh +71 -0
- package/bundled/dev-pipeline/lib/heartbeat.sh +2 -2
- package/bundled/dev-pipeline/retry-bugfix.sh +60 -23
- package/bundled/dev-pipeline/retry-feature.sh +47 -12
- package/bundled/dev-pipeline/retry-refactor.sh +105 -23
- package/bundled/dev-pipeline/run-bugfix.sh +265 -44
- package/bundled/dev-pipeline/run-feature.sh +35 -1
- package/bundled/dev-pipeline/run-refactor.sh +376 -51
- package/bundled/dev-pipeline/scripts/check-session-status.py +24 -1
- package/bundled/dev-pipeline/scripts/detect-stuck.py +195 -85
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +31 -19
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +19 -3
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +98 -11
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +30 -5
- package/bundled/dev-pipeline/scripts/init-pipeline.py +3 -3
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +15 -4
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -5
- package/bundled/dev-pipeline/scripts/patch-completion-notes.py +191 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +159 -14
- package/bundled/dev-pipeline/scripts/update-feature-status.py +79 -37
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +343 -13
- package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +1 -1
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +7 -11
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +41 -7
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +27 -3
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +43 -19
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -26
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +5 -14
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +36 -25
- package/bundled/dev-pipeline/templates/feature-list-schema.json +23 -11
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +270 -0
- package/bundled/dev-pipeline/templates/refactor-list-schema.json +10 -2
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +3 -1
- package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +1 -0
- package/bundled/dev-pipeline/templates/sections/feature-context.md +2 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +29 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +22 -0
- package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +8 -6
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -5
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
- package/bundled/skills/_metadata.json +5 -22
- package/bundled/skills/app-planner/SKILL.md +92 -66
- package/bundled/skills/app-planner/assets/app-design-guide.md +1 -1
- package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
- package/bundled/skills/app-planner/references/project-brief-guide.md +69 -66
- package/bundled/skills/bug-fix-workflow/SKILL.md +47 -4
- package/bundled/skills/bug-planner/SKILL.md +130 -188
- package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +43 -0
- package/bundled/skills/bug-planner/references/critic-and-verification.md +44 -0
- package/bundled/skills/bug-planner/references/error-recovery.md +73 -0
- package/bundled/skills/bug-planner/references/input-formats.md +53 -0
- package/bundled/skills/bug-planner/references/schema-validation.md +25 -0
- package/bundled/skills/bug-planner/references/severity-rules.md +16 -0
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +1 -5
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -10
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +16 -3
- package/bundled/skills/feature-planner/SKILL.md +33 -122
- package/bundled/skills/feature-planner/assets/evaluation-guide.md +1 -1
- package/bundled/skills/feature-planner/assets/planning-guide.md +21 -5
- package/bundled/skills/feature-planner/references/browser-interaction.md +2 -4
- package/bundled/skills/feature-planner/references/completeness-review.md +57 -0
- package/bundled/skills/feature-planner/references/error-recovery.md +15 -34
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +1 -1
- package/bundled/skills/feature-planner/references/new-project-planning.md +2 -2
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -2
- package/bundled/skills/feature-workflow/SKILL.md +3 -4
- package/bundled/skills/prizm-kit/SKILL.md +39 -49
- package/bundled/skills/prizmkit-code-review/SKILL.md +51 -64
- package/bundled/skills/prizmkit-code-review/rules/dimensions.md +85 -0
- package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +11 -11
- package/bundled/skills/prizmkit-committer/SKILL.md +3 -31
- package/bundled/skills/prizmkit-deploy/SKILL.md +34 -31
- package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
- package/bundled/skills/prizmkit-implement/SKILL.md +35 -68
- package/bundled/skills/prizmkit-init/SKILL.md +112 -65
- package/bundled/skills/prizmkit-init/assets/project-brief-template.md +82 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +120 -79
- package/bundled/skills/prizmkit-plan/assets/plan-template.md +28 -18
- package/bundled/skills/prizmkit-plan/assets/spec-template.md +28 -11
- package/bundled/skills/prizmkit-plan/references/clarify-guide.md +3 -3
- package/bundled/skills/prizmkit-plan/references/verification-checklist.md +60 -0
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +10 -81
- package/bundled/skills/prizmkit-prizm-docs/assets/{PRIZM-SPEC.md → prizm-docs-format.md} +41 -526
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +46 -0
- package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +16 -0
- package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +14 -0
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +19 -0
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +17 -0
- package/bundled/skills/prizmkit-retrospective/SKILL.md +27 -65
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -4
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +7 -25
- package/bundled/skills/recovery-workflow/SKILL.md +8 -8
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +17 -9
- package/bundled/skills/refactor-planner/SKILL.md +23 -41
- package/bundled/skills/refactor-workflow/SKILL.md +1 -2
- package/bundled/team/prizm-dev-team.json +1 -1
- package/bundled/{skills/prizm-kit/assets → templates}/project-memory-template.md +1 -1
- package/package.json +1 -1
- package/src/clean.js +0 -1
- package/src/gitignore-template.js +0 -1
- package/src/scaffold.js +10 -3
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +0 -5
- package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +0 -19
- package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +0 -19
- package/bundled/skills/app-planner/references/project-conventions.md +0 -93
- package/bundled/skills/prizmkit-analyze/SKILL.md +0 -207
- package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +0 -25
- package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +0 -43
- package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +0 -25
- package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +0 -69
- package/bundled/skills/prizmkit-verify/SKILL.md +0 -281
- 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
|
|
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
|
-
-
|
|
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
|
-
-
|
|
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
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
16
|
+
- Config tweaks, typo fixes, trivial one-line changes → edit 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 (
|
|
28
|
+
### Phase 0: Specify (→ spec.md)
|
|
21
29
|
|
|
22
|
-
|
|
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.
|
|
30
|
-
2.
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
4.
|
|
36
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
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 (
|
|
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
|
|
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
|
-
-
|
|
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
|
-
-
|
|
77
|
-
|
|
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.
|
|
88
|
-
2. Append `## Tasks` section to `plan.md` using
|
|
89
|
-
- Phases: Setup (T-001~T-009) →
|
|
90
|
-
- Each task: `- [ ] [T-NNN] [P?] [
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
##
|
|
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
|
-
#
|
|
107
|
-
##
|
|
108
|
-
|
|
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:
|
|
127
|
-
- [ ] [T-010] [
|
|
128
|
-
- [ ] [T-011] [
|
|
129
|
-
### Phase:
|
|
130
|
-
- [ ] [T-100] [P] [
|
|
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
|
-
##
|
|
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
|
-
|
|
|
141
|
-
|
|
142
|
-
|
|
|
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
|
-
#
|
|
1
|
+
# Plan: [TITLE]
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
[
|
|
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
|
-
<!--
|
|
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
|
-
<!--
|
|
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
|
|
80
|
-
- [ ] Data model reviewed — existing schema conventions documented and followed
|
|
81
|
-
- [ ] All
|
|
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]
|
|
99
|
+
- [ ] [T-001] [Description] — file: [path]
|
|
91
100
|
|
|
92
|
-
### Phase:
|
|
93
|
-
- [ ] [T-010] [
|
|
101
|
+
### Phase: Foundation
|
|
102
|
+
- [ ] [T-010] [Description] — file: [path]
|
|
94
103
|
|
|
95
|
-
### Phase:
|
|
96
|
-
|
|
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
|
|
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
|
|
105
|
-
- [ ] [CP-3] After each
|
|
114
|
+
- [ ] [CP-2] After Foundation: base changes verified
|
|
115
|
+
- [ ] [CP-3] After each Core group: acceptance criteria pass
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# [TITLE]
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
|
-
[One paragraph describing the
|
|
4
|
+
[One paragraph describing the purpose and motivation]
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Goals
|
|
7
7
|
|
|
8
|
-
###
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
- [ ]
|
|
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
|
|
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
|
|
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
|
|
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., "§
|
|
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
|
-
> §
|
|
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 §
|
|
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
|