prizmkit 1.0.153 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/bin/create-prizmkit.js +27 -2
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/adapters/claude/paths.js +1 -1
  4. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +482 -57
  5. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +2 -6
  6. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +6 -0
  7. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +6 -0
  8. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +7 -1
  9. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +11 -0
  10. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +9 -0
  11. package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +12 -0
  12. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +7 -0
  13. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +8 -0
  14. package/bundled/dev-pipeline/templates/sections/directory-convention-full.md +9 -0
  15. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +6 -0
  16. package/bundled/dev-pipeline/templates/sections/failure-capture.md +21 -0
  17. package/bundled/dev-pipeline/templates/sections/failure-log-check.md +8 -0
  18. package/bundled/dev-pipeline/templates/sections/feature-context.md +23 -0
  19. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +15 -0
  20. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +15 -0
  21. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +31 -0
  22. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +36 -0
  23. package/bundled/dev-pipeline/templates/sections/phase-commit.md +26 -0
  24. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +14 -0
  25. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +20 -0
  26. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +3 -0
  27. package/bundled/dev-pipeline/templates/sections/phase-critic-code.md +24 -0
  28. package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +45 -0
  29. package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +24 -0
  30. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +36 -0
  31. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +24 -0
  32. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +41 -0
  33. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +32 -0
  34. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +17 -0
  35. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +16 -0
  36. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +28 -0
  37. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +36 -0
  38. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +82 -0
  39. package/bundled/dev-pipeline/templates/sections/phase0-init.md +4 -0
  40. package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +12 -0
  41. package/bundled/dev-pipeline/templates/sections/resume-header.md +2 -0
  42. package/bundled/dev-pipeline/templates/sections/session-context.md +6 -0
  43. package/bundled/dev-pipeline/templates/sections/subagent-timeout-recovery.md +6 -0
  44. package/bundled/skills/_metadata.json +21 -177
  45. package/bundled/skills/app-planner/SKILL.md +22 -3
  46. package/bundled/skills/app-planner/references/project-brief-guide.md +110 -0
  47. package/bundled/skills/bug-fix-workflow/SKILL.md +4 -0
  48. package/bundled/skills/bug-planner/SKILL.md +2 -2
  49. package/bundled/skills/dev-pipeline-launcher/SKILL.md +1 -1
  50. package/bundled/skills/prizm-kit/SKILL.md +18 -47
  51. package/bundled/skills/prizm-kit/assets/project-memory-template.md +1 -1
  52. package/bundled/skills/prizmkit-analyze/SKILL.md +4 -4
  53. package/bundled/skills/prizmkit-init/SKILL.md +4 -4
  54. package/bundled/skills/prizmkit-plan/SKILL.md +126 -108
  55. package/bundled/skills/prizmkit-plan/assets/plan-template.md +1 -2
  56. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +67 -0
  57. package/bundled/skills/refactor-workflow/SKILL.md +142 -124
  58. package/bundled/team/prizm-dev-team.json +2 -8
  59. package/package.json +1 -1
  60. package/src/clean.js +8 -0
  61. package/src/config.js +504 -0
  62. package/src/gitignore-template.js +12 -0
  63. package/src/index.js +3 -22
  64. package/src/prompts.js +210 -0
  65. package/src/scaffold.js +20 -11
  66. package/src/upgrade.js +6 -31
  67. package/bundled/skills/prizmkit-clarify/SKILL.md +0 -93
  68. package/bundled/skills/prizmkit-specify/SKILL.md +0 -118
  69. package/bundled/skills/prizmkit-tool-adr-manager/SKILL.md +0 -67
  70. package/bundled/skills/prizmkit-tool-adr-manager/assets/adr-template.md +0 -26
  71. package/bundled/skills/prizmkit-tool-api-doc-generator/SKILL.md +0 -55
  72. package/bundled/skills/prizmkit-tool-bug-reproducer/SKILL.md +0 -61
  73. package/bundled/skills/prizmkit-tool-ci-cd-generator/SKILL.md +0 -53
  74. package/bundled/skills/prizmkit-tool-db-migration/SKILL.md +0 -64
  75. package/bundled/skills/prizmkit-tool-dependency-health/SKILL.md +0 -122
  76. package/bundled/skills/prizmkit-tool-deployment-strategy/SKILL.md +0 -57
  77. package/bundled/skills/prizmkit-tool-error-triage/SKILL.md +0 -54
  78. package/bundled/skills/prizmkit-tool-log-analyzer/SKILL.md +0 -54
  79. package/bundled/skills/prizmkit-tool-monitoring-setup/SKILL.md +0 -74
  80. package/bundled/skills/prizmkit-tool-onboarding-generator/SKILL.md +0 -69
  81. package/bundled/skills/prizmkit-tool-perf-profiler/SKILL.md +0 -54
  82. package/bundled/skills/prizmkit-tool-security-audit/SKILL.md +0 -129
  83. package/bundled/skills/prizmkit-tool-tech-debt-tracker/SKILL.md +0 -138
  84. /package/bundled/skills/{prizmkit-specify → prizmkit-plan}/assets/spec-template.md +0 -0
@@ -0,0 +1,110 @@
1
+ # Project Brief — Real-Time Accumulation Guide
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.
4
+
5
+ ## Purpose
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.
8
+
9
+ ## Persistence
10
+
11
+ - **File**: `project-brief.md` at project root (same level as `feature-list.json`)
12
+ - **Format**: Markdown with fixed sections, bullet-point style
13
+ - **Size limit**: 500 words max (injected into every session's context window)
14
+ - **Consumed by**: `dev-pipeline/scripts/generate-bootstrap-prompt.py` → `{{PROJECT_BRIEF}}` placeholder
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
28
+
29
+ ```markdown
30
+ # Project Brief
31
+
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]
43
+ ```
44
+
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).
57
+
58
+ ## How the Pipeline Uses It
59
+
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:
61
+
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."
63
+
64
+ If the file does not exist, the placeholder is replaced with `(No project brief available)` — the pipeline runs normally without it.
65
+
66
+ ## Examples
67
+
68
+ ### Minimal Brief (early in conversation)
69
+
70
+ ```markdown
71
+ # Project Brief
72
+
73
+ ## Vision
74
+ - B2B SaaS platform for restaurant inventory management, targeting small-to-medium restaurant chains
75
+
76
+ ## Core Constraints
77
+ - (to be determined)
78
+
79
+ ## Design Decisions
80
+ - (to be determined)
81
+
82
+ ## Key Requirements
83
+ - Must support offline mode for kitchen tablets with unreliable WiFi
84
+ ```
85
+
86
+ ### Mature Brief (after several rounds of discussion)
87
+
88
+ ```markdown
89
+ # Project Brief
90
+
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
+ ```
@@ -148,6 +148,8 @@ 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.
152
+
151
153
  1. **Read project context**: `.prizm-docs/root.prizm` → relevant L1/L2 docs for affected modules
152
154
  2. **Locate affected code**: read the files mentioned in the error/stack trace or identified during diagnosis
153
155
  3. **Check known issues**: search `.prizm-docs/` TRAPS sections for matching patterns
@@ -169,6 +171,8 @@ Ask the user: "Is this summary accurate? Any details to add?"
169
171
 
170
172
  **Goal**: Create a failing test that proves the bug exists.
171
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.
175
+
172
176
  1. **Write a reproduction test** that demonstrates the bug:
173
177
  - Name: `<module>.test.ts` → add a test case named `should handle <bug scenario>`
174
178
  - The test captures the exact failure condition
@@ -44,7 +44,7 @@ Launch the interactive bug planning process through 4 phases.
44
44
  1. **Identify project**: Read project name and description from existing `feature-list.json` or ask user
45
45
  2. **Identify tech stack**: Read from `.prizmkit/config.json` `tech_stack` (preferred), then `feature-list.json` global_context, then `.prizm-docs/root.prizm`. Only ask user if none of these sources provide tech stack info.
46
46
  3. **Identify testing framework**: Read from `.prizmkit/config.json` `tech_stack.testing`, or auto-detect from package.json/requirements.txt/etc., or ask user
47
- 4. **Clarify context** — apply `/prizmkit-clarify` principles: if the project context, affected systems, or bug scope is unclear, ask questions one at a time until you fully understand the environment. No limit on rounds or number of questions.
47
+ 4. **Clarify context** — if the project context, affected systems, or bug scope is unclear, ask questions one at a time (cite the unclear point, give a recommended answer with rationale) until you fully understand the environment. No limit on rounds or number of questions.
48
48
 
49
49
  Output: `project_name`, `project_description`, `global_context` fields populated.
50
50
 
@@ -117,7 +117,7 @@ ALERT: Error rate spike: 500 errors/min on /api/login endpoint
117
117
  - Verification type (suggest `automated` by default, ask user)
118
118
  - Acceptance criteria (auto-suggest based on description, user can edit)
119
119
 
120
- **Per-bug clarification** — apply `/prizmkit-clarify` principles: if the bug's root cause, reproduction steps, expected behavior, or scope is unclear from the provided information, ask focused questions until the bug is fully understood. Do not finalize a bug entry with ambiguous details. No limit on the number of questions per bug.
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
122
  **Multiple bugs per session**: After each bug, ask "Any more bugs to add? (yes/no)"
123
123
 
@@ -42,7 +42,7 @@ Three execution modes are available. The user chooses one before configuring oth
42
42
  **Do NOT use this skill when:**
43
43
  - User wants to plan features (use `app-planner` instead)
44
44
  - User wants to implement a single feature manually within current session (use `prizmkit-implement`)
45
- - User wants to define specs/plan (use `prizmkit-specify` / `prizmkit-plan`)
45
+ - User wants to define specs/plan (use `prizmkit-plan`)
46
46
 
47
47
  ### Prerequisites
48
48
 
@@ -10,47 +10,27 @@ PrizmKit is a comprehensive, independent AI development toolkit that covers the
10
10
 
11
11
  ## When to Use the Full Workflow
12
12
 
13
- **Use full workflow (specify -> plan -> implement):**
14
- - Difficult features or user-facing capabilities
15
- - Multi-file coordinated changes
16
- - Architectural decisions
17
- - Data model or API changes
18
-
19
- The full workflow generates spec, plan, and task artifacts that create a traceable record of what was built and why — this matters for future maintainability and AI context loading.
20
-
21
- **Use fast path (plan → implement → commit):**
22
- - Bug fixes with clear root cause
23
- - Simple refactors (rename, extract)
24
- - Documentation-only changes
25
- - Test additions for existing code
26
-
27
- The fast path skips specify and analyze but still generates a simplified plan.md (with Tasks section) so that implement has a task list to follow.
28
-
29
- For fast-path changes, you can directly generate a simplified plan.md, then use implement and commit commands.
30
-
31
- ## Workflow Example
32
-
33
- **Full workflow** for adding a user avatar upload feature:
13
+ **Full workflow** forms a continuous loop for feature development:
34
14
  ```
35
- /prizmkit-specify writes .prizmkit/specs/001-avatar-upload/spec.md
36
- /prizmkit-plan → writes plan.md with tasks (architecture, data model, API, UI)
37
- /prizmkit-analyze → checks spec↔plan consistency, finds gaps
38
- /prizmkit-implement → executes tasks in order, marks [x] as done
39
- /prizmkit-code-review → diagnoses issues + produces Fix Instructions
40
- /prizmkit-retrospective → syncs .prizm-docs/ with code changes
41
- /prizmkit-deploy → generates/updates DEPLOY.md with deployment procedures
42
- /prizmkit-committer → commits feat(avatar): add upload
15
+ read .prizm-docs → plan (specify + design + tasks) implement → code-review → retrospective → committer
16
+ ↑ ↓
17
+ └────────────────────── next feature ←─────────────────────────┘
43
18
  ```
19
+ - New features or user-facing capabilities
20
+ - Multi-file coordinated changes
21
+ - Architectural decisions, data model or API changes
44
22
 
45
- **Fast path** for fixing a null pointer bug:
23
+ Each cycle produces spec, plan, and task artifacts that create a traceable record of what was built and why — `.prizm-docs/` stays in sync through retrospective, so the next cycle starts with up-to-date context.
24
+
25
+ **Fast path** — for small, well-scoped changes:
46
26
  ```
47
- /prizmkit-plan "fix null check in UserService.getAvatar()" (simplified plan.md)
48
- /prizmkit-implement → executes tasks from plan.md
49
- /prizmkit-committer → commits fix(user): handle null avatar gracefully
27
+ /prizmkit-plan /prizmkit-implement /prizmkit-committer
50
28
  ```
29
+ - Bug fixes with clear root cause
30
+ - Simple refactors (rename, extract)
31
+ - Documentation-only changes, test additions for existing code
51
32
 
52
- ### Fast Path Commands
53
- `/prizmkit-plan` → `/prizmkit-implement` → `/prizmkit-committer`
33
+ Fast path skips specify/analyze/review but still generates a simplified plan.md so implement has a task list to follow.
54
34
 
55
35
  ### Bug Fix Documentation Policy
56
36
 
@@ -69,16 +49,14 @@ PrizmKit produces two complementary knowledge layers:
69
49
 
70
50
  ```
71
51
  .prizm-docs/ → Architecture Index (structure, interfaces, dependencies, traps, rules, decisions)
72
- .prizmkit/specs/ → Feature "what to do" (workflow: spec → plan → code(implement))
52
+ .prizmkit/specs/ → Feature artifacts (spec → plan → implement → review cycle)
73
53
  ```
74
54
 
75
55
  ## Core Skill Reference
76
56
 
77
57
  | Skill | Purpose | Trigger Phrases |
78
58
  |-------|---------|-----------------|
79
- | `/prizmkit-specify` | Natural language → structured spec.md | "specify", "new feature", "I want to add..." |
80
- | `/prizmkit-clarify` | Resolve spec ambiguities interactively | "clarify", "refine spec", "resolve ambiguities" |
81
- | `/prizmkit-plan` | Spec → plan.md with architecture + tasks | "plan", "architect", "break it down", "create tasks" |
59
+ | `/prizmkit-plan` | Specify + plan: natural language → spec.md → plan.md + tasks | "specify", "plan", "new feature", "I want to add...", "architect", "break it down" |
82
60
  | `/prizmkit-analyze` | Cross-doc consistency check (read-only) | "analyze", "check consistency", "validate spec" |
83
61
  | `/prizmkit-implement` | Execute plan.md tasks, write code (TDD) | "implement", "build", "code it", "start coding" |
84
62
  | `/prizmkit-code-review` | Diagnose issues + produce Fix Instructions | "review", "check code", "is it ready to commit" |
@@ -108,15 +86,8 @@ Interactive installer auto-detects your platform and guides you through configur
108
86
  **Option 2: Claude Code Plugin**
109
87
  Install the `prizmkit` plugin via Claude Code's plugin system, then run `/prizmkit-init`.
110
88
 
111
- **Option 3: Manual Install (CodeBuddy)**
112
- ```bash
113
- python3 ${SKILL_DIR}/scripts/install-prizmkit.py --target <project-skills-dir>
114
- ```
115
-
116
89
  ## Hook / Rules Configuration
117
90
 
118
- Both CodeBuddy and Claude Code use unified commands for automatic doc updates and commit enforcement.
119
- Hooks and rules are configured automatically by `prizmkit-init`. See:
120
- - The commit hook template is configured automatically during `prizmkit-init`
91
+ Hooks and rules are configured automatically by `prizmkit-init`:
121
92
  - `assets/project-memory-template.md` for the project memory template
122
93
  - The init skill creates `prizm-documentation.md` and `prizm-commit-workflow.md` rules
@@ -35,6 +35,6 @@ Not every change needs the full spec -> plan workflow. Use fast path for:
35
35
  - Documentation-only changes, test additions for existing code
36
36
  - Fast path: `/prizmkit-plan` (simplified) → `/prizmkit-implement` → `/prizmkit-committer`
37
37
 
38
- Use the full workflow (/prizmkit-specify -> /prizmkit-plan -> /prizmkit-analyze -> /prizmkit-implement) for:
38
+ Use the full workflow (/prizmkit-plan -> /prizmkit-analyze -> /prizmkit-implement) for:
39
39
  - New features, multi-file coordinated changes, architectural decisions, data model or API changes
40
40
  <!-- PRIZMKIT:END -->
@@ -16,7 +16,7 @@ Perform a non-destructive cross-artifact consistency and quality analysis across
16
16
 
17
17
  | Required Artifact | Directory | Check | If Missing |
18
18
  |---|---|---|---|
19
- | `spec.md` | `.prizmkit/specs/###-feature-name/` | File exists | Run `/prizmkit-specify` |
19
+ | `spec.md` | `.prizmkit/specs/###-feature-name/` | File exists | Run `/prizmkit-plan` |
20
20
  | `plan.md` (with Tasks section) | `.prizmkit/specs/###-feature-name/` | File exists + has Tasks section | Run `/prizmkit-plan` |
21
21
 
22
22
  ## Operating Constraints
@@ -35,7 +35,7 @@ Derive absolute paths:
35
35
  - SPEC = `.prizmkit/specs/###-feature-name/spec.md`
36
36
  - PLAN = `.prizmkit/specs/###-feature-name/plan.md` (must include a Tasks section)
37
37
 
38
- Abort with an error message if spec.md or plan.md is missing — instruct the user to run the missing prerequisite command (`/prizmkit-specify` or `/prizmkit-plan`).
38
+ Abort with an error message if spec.md or plan.md is missing — instruct the user to run `/prizmkit-plan`.
39
39
 
40
40
  ### Step 2: Load Artifacts (Progressive Disclosure)
41
41
 
@@ -161,7 +161,7 @@ At end of report, output a concise Next Actions block:
161
161
  - If CRITICAL issues exist: **Recommend resolving before `/prizmkit-implement`**
162
162
  - If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
163
163
  - Provide explicit command suggestions:
164
- - "Run `/prizmkit-specify` to refine requirements"
164
+ - "Run `/prizmkit-plan` to refine requirements"
165
165
  - "Run `/prizmkit-plan` to adjust architecture or tasks"
166
166
  - "Edit plan.md Tasks section to add coverage for requirement X"
167
167
  - "Proceed to `/prizmkit-implement`" (if clean)
@@ -194,7 +194,7 @@ Ask the user: "Would you like me to suggest concrete remediation edits for the t
194
194
  | E1 | Coverage Gap | HIGH | spec.md §FR-3 | "User can export reports as PDF" has no corresponding task in plan.md Tasks section | Add export task to Phase 3 of plan.md |
195
195
  ```
196
196
 
197
- **HANDOFF:** `/prizmkit-implement` (if clean) or `/prizmkit-specify` / `/prizmkit-plan` (if issues found)
197
+ **HANDOFF:** `/prizmkit-implement` (if clean) or `/prizmkit-plan` (if issues found)
198
198
 
199
199
  ## Loop Protection
200
200
 
@@ -16,7 +16,7 @@ Project takeover and bootstrap skill. Scans any project (brownfield or greenfiel
16
16
  ### When NOT to Use
17
17
  - `.prizm-docs/` already exists and is up to date → use `/prizmkit-prizm-docs` (Update) instead
18
18
  - User just wants to update stale docs → use `/prizmkit-prizm-docs` (Update or Rebuild)
19
- - User wants to start a feature → skip init if already initialized, go to `/prizmkit-specify`
19
+ - User wants to start a feature → skip init if already initialized, go to `/prizmkit-plan`
20
20
 
21
21
  ### Error Handling
22
22
  - If `.prizm-docs/` already exists: ask user if they want to reinitialize (overwrites) or update (preserves)
@@ -179,8 +179,8 @@ Tech stack detected:
179
179
  Saved to: `.prizmkit/config.json` → `tech_stack` field
180
180
 
181
181
  Include platform-specific guidance:
182
- - CodeBuddy: "Use `/prizmkit-specify` to start your first feature"
183
- - Claude Code: "Use `/prizmkit-specify` to start your first feature"
182
+ - CodeBuddy: "Use `/prizmkit-plan` to start your first feature"
183
+ - Claude Code: "Use `/prizmkit-plan` to start your first feature"
184
184
 
185
185
  GREENFIELD WORKFLOW (new project):
186
186
  - Skip Step 1 (no code to scan) — but ask the user about their intended tech stack:
@@ -239,7 +239,7 @@ Generated: root.prizm + 4 L1 docs + changelog.prizm
239
239
  Configured: .claude/rules/ (2 files), hooks in settings.json
240
240
  Saved: .prizmkit/config.json (tech_stack recorded)
241
241
 
242
- Next: Use /prizmkit-specify to start your first feature
242
+ Next: Use /prizmkit-plan to start your first feature
243
243
  ```
244
244
 
245
245
  UPDATE SUPPLEMENT (runs after tech stack merge in Update mode):
@@ -1,137 +1,155 @@
1
1
  ---
2
2
  name: "prizmkit-plan"
3
- description: "Generate technical implementation plan and executable task breakdown from feature spec. Produces plan.md with architecture, data model, API contracts, and a Tasks section. Use this skill whenever the user wants to design how a feature will be built, break work into tasks, or think through architecture. Trigger on: 'plan', 'architect', 'how to build', 'design', 'break it down', 'break this into tasks', 'create tasks', 'implementation strategy', 'how should we implement'. Always use after /prizmkit-specify and before /prizmkit-implement. (project)"
3
+ description: "Specify and plan features in one step. Transforms natural language into structured spec.md, then generates plan.md with architecture and executable tasks. Use this skill whenever the user wants to define a feature, write requirements, design implementation, or break work into tasks. Trigger on: 'specify', 'plan', 'new feature', 'I want to add...', 'I want to build...', 'architect', 'design', 'break it down', 'create tasks', 'how to build', 'let's add', 'feature idea'. Always use before /prizmkit-implement. Skip specify phase for bug fixes or simple refactors. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Plan
7
7
 
8
- Generate a comprehensive technical implementation plan from a feature specification. Produces plan.md with architecture approach, component design, data model, API contracts, testing strategy, risk assessment, and an executable Tasks section.
8
+ Define WHAT to build, then design HOW to build it in one continuous flow. Phase 0 produces `spec.md` (requirements), Phase 1-2 produce `plan.md` (architecture + tasks).
9
9
 
10
10
  ### When to Use
11
- - After `/prizmkit-specify` when ready to plan the implementation
12
- - User says "plan", "architect", "how to build", "design", "break it down", "create tasks"
13
- - Before `/prizmkit-implement` to create the task breakdown
14
- - When user wants to understand the full implementation approach before coding
11
+ - New feature user says "specify", "plan", "new feature", "I want to add..."
12
+ - Before `/prizmkit-implement` to create the spec + task breakdown
13
+ - When a feature idea needs to go from concept to executable plan
15
14
 
16
15
  ### When NOT to Use
17
- - No input document exists yet (no spec.md, no refactor-analysis.md, no fix-plan.md)run `/prizmkit-specify` or the appropriate upstream skill first
18
- - Simple bug fix or config change use fast path (`/prizmkit-plan` with simplified output → `/prizmkit-implement` → `/prizmkit-committer`)
19
- - User just wants to explore/researchanswer directly, no plan artifact needed
20
-
21
- **PRECONDITION:**
22
-
23
- | Mode | Required Artifact | Directory | Check | If Missing |
24
- |---|---|---|---|---|
25
- | **Feature** (default) | `spec.md` + `.prizm-docs/root.prizm` | `.prizmkit/specs/###-feature-name/` | File exists | Prompt: "No spec found — run `/prizmkit-specify` first?" |
26
- | **Refactor** | `refactor-analysis.md` | `.prizmkit/refactor/<refactor-slug>/` | File exists | Run upstream refactor workflow |
27
- | **Bugfix** | `fix-plan.md` or bug description from caller | `.prizmkit/bugfix/<BUG_ID>/` | File exists or caller-provided | Run `/bug-fix-workflow` |
28
-
29
- **Auto-detect**: If the calling workflow passes an explicit artifact directory, use that. Otherwise check which input document type exists.
30
-
31
- ## Execution Steps
32
-
33
- **Phase 0 Research:**
34
- 1. Read the input document for requirements:
35
- - **Feature mode**: Read `spec.md` for feature requirements
36
- - **Refactor mode**: Read `refactor-analysis.md` for refactoring goals, scope boundary, and baseline tests
37
- - **Bugfix mode**: Read bug description / `fix-plan.md` for reproduction steps and expected fix
38
- 2. Load project context (use first available source):
39
- - If `.prizmkit/specs/###-feature-name/context-snapshot.md` exists read it for all context (Section 3 'Prizm Context' for docs, Section 4 'File Manifest' for code structure and interfaces). The context-snapshot consolidates project context into one read, saving significant tokens.
40
- - Otherwise → read `.prizm-docs/root.prizm` and relevant `.prizm-docs/` L1/L2 docs for affected modules
16
+ - Bug fix with clear root cause → fast path (skip Phase 0, simplified plan → implement commit)
17
+ - Config tweaks, typo fixesedit directly
18
+ - User already has a detailed spec start from Phase 1
19
+
20
+ ## Execution
21
+
22
+ ### Phase 0: Specify (WHAT)
23
+
24
+ Transforms natural language into a structured spec. Skip this phase when:
25
+ - A `spec.md` already exists for this feature
26
+ - Running in refactor mode (input is `refactor-analysis.md`)
27
+ - Running in bugfix mode (input is `fix-plan.md` or caller-provided description)
28
+
29
+ **Steps:**
30
+
31
+ 1. Ask user for feature description (natural language)
32
+ 2. Auto-generate 2-4 word feature slug from description
33
+ 3. Determine next feature number by scanning `.prizmkit/specs/`:
34
+ - List existing `###-*` directories, find highest numeric prefix
35
+ - Next = highest + 1 (zero-padded to 3 digits), append `-MMDD` timestamp suffix for collision prevention
36
+ - If empty or doesn't exist, start at `001`
37
+ 4. Create directory: `.prizmkit/specs/###-feature-name-MMDD/`
38
+ 5. Load project context (use first available):
39
+ - If `context-snapshot.md` exists in the feature dir → read Section 3 'Prizm Context' (skip re-reading .prizm-docs/)
40
+ - Otherwise → read `.prizm-docs/root.prizm` and relevant L1/L2 docs
41
+ 6. Generate `spec.md` from template (`${SKILL_DIR}/assets/spec-template.md`):
42
+ - Feature title and description
43
+ - User stories (As a... I want... So that...) with acceptance criteria (Given/When/Then)
44
+ - Scope boundaries (In scope / Out of scope)
45
+ - Dependencies and constraints
46
+ - `[NEEDS CLARIFICATION]` markers for all ambiguous items
47
+ 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]`.
48
+ 8. Run quality validation (max 3 iterations): all stories have criteria? scope defined? DB conventions documented?
49
+ 9. **Auto-clarification**: If any `[NEEDS CLARIFICATION]` markers remain, enter interactive clarification immediately.
50
+ → Read `${SKILL_DIR}/references/clarify-guide.md` for question strategy and update rules.
51
+ Resolve all markers before proceeding to Phase 1.
52
+
53
+ **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.
54
+
55
+ ### Phase 1: Design (HOW)
56
+
57
+ **Precondition:**
58
+
59
+ | Mode | Required Input | Directory |
60
+ |---|---|---|
61
+ | **Feature** (default) | `spec.md` (from Phase 0) + `.prizm-docs/root.prizm` | `.prizmkit/specs/###-feature-name/` |
62
+ | **Refactor** | `refactor-analysis.md` | `.prizmkit/refactor/<refactor-slug>/` |
63
+ | **Bugfix** | `fix-plan.md` or caller-provided description | `.prizmkit/bugfix/<BUG_ID>/` |
64
+
65
+ If no input document exists, prompt user to describe the feature (triggers Phase 0).
66
+
67
+ **Steps:**
68
+
69
+ 1. Read the input document (spec.md / refactor-analysis.md / fix-plan.md)
70
+ 2. Load project context if not already loaded in Phase 0:
71
+ - If `context-snapshot.md` exists → read it for docs + code structure
72
+ - Otherwise → read `.prizm-docs/root.prizm` and relevant L1/L2 docs
41
73
  3. Resolve any remaining `[NEEDS CLARIFICATION]` by proposing solutions
42
- 4. Research technical approach based on project's tech stack
43
-
44
- **Phase 1Design:**
45
- 5. Generate `plan.md` from template (`${SKILL_DIR}/assets/plan-template.md`):
46
- - Architecture approach (how feature fits into existing structure)
47
- - Component design (new/modified components)
48
- - Data model changes (new entities, modified schemas)
49
- - **Database design gate** (when feature involves DB changes):
50
- 1. Read ALL existing schema/migration/model files to understand current conventions (naming, constraints, relationships, ID strategy, timestamps)
51
- 2. Ensure new schema follows existing patterns do NOT introduce new conventions unless explicitly justified
52
- 3. Verify every new table/field has: purpose, type, constraints, and relationship to existing entities
53
- 4. If any data model decision is uncertain mark as `[NEEDS CLARIFICATION]` and resolve via `/prizmkit-clarify` BEFORE generating the Tasks section
54
- 5. **RULE**: The Tasks section MUST NOT be generated until all `[NEEDS CLARIFICATION]` items in Data Model are resolved. Unresolved DB design leads to implementation rework that is expensive to fix after code is written.
55
- - Interface design (API endpoints, request/response formats, module interfaces)
56
- - Integration points (external services, internal modules)
57
- - Testing strategy (unit, integration, e2e)
58
- - Risk assessment
59
- 6. Cross-check plan against spec: every user story should map to plan components unmapped stories mean the plan has coverage gaps that will surface during implementation
60
- 7. Check alignment with project rules from `.prizm-docs/root.prizm` RULES sectionviolating project rules causes CRITICAL findings in the analyze phase
61
- 8. **Deployment strategy check:**
62
- - Read `.prizmkit/config.json` `deploy_strategy` field (if `config.json` does not exist, treat as "no deploy_strategy")
63
- - Compare tech stack used in this plan (from Architecture Approach, Integration Points, Data Model) against the stored strategy
64
- - **No `deploy_strategy` in config** first time: ask user for deployment approach (e.g. Docker, Vercel, static hosting, traditional server, cloud platform, etc.) → write to `config.json` as `deploy_strategy` object with `"_user_confirmed": true`. If `config.json` does not exist, create `.prizmkit/` directory and `config.json` with the `deploy_strategy` field (preserve any existing fields if the file already exists).
65
- - **`deploy_strategy` exists, no new tech stack** skip (no question asked)
66
- - **`deploy_strategy` exists, new tech stack detected** (e.g. plan introduces Redis, message queue, new database) → ask user only about the deployment approach for the new component → merge into existing `deploy_strategy`
67
- - Store format in `config.json`:
68
- ```json
69
- {
70
- "deploy_strategy": {
71
- "primary": "docker",
72
- "components": {
73
- "app": "Docker container AWS ECS",
74
- "database": "RDS PostgreSQL",
75
- "cache": "ElastiCache Redis"
76
- },
77
- "notes": "user-provided context about their deployment",
78
- "_user_confirmed": true
79
- }
80
- }
81
- ```
82
- - This step is **skipped entirely in fast-path mode** (bug fixes / simple refactors do not affect deployment)
83
-
84
- **Phase 2 — Task Generation:**
85
- 9. Ask user for implementation strategy (or infer from context): MVP-first / Incremental / Parallel
86
- 10. Append `## Tasks` section to `plan.md` using the tasks template at the end of `${SKILL_DIR}/assets/plan-template.md`:
87
- - Organized by phases: Setup(T-001~T-009) → Foundational(T-010~T-099) → User Stories(T-100+) → Polish(T-900+)
88
- - Each task: `- [ ] [T-NNN] [P?] [US?] Description — file: path/to/file`
89
- - `[P]` marker for tasks that can run in parallel within their phase
90
- - Checkpoint tasks between phases for validation
91
- 11. Verify coverage and traceability:
92
- - Every user story maps to at least one task — orphan stories become orphan features
93
- - Every task references a target file path — pathless tasks leave implementers guessing where to write code
94
- - Risk assessment includes at least one risk with mitigation — helps the implementer prepare for known challenges
95
- 12. Output: `plan.md` path, summary of design decisions, and task count
96
-
97
- **Task ID Conventions:**
98
- - Task IDs use zero-padded numbering: `[T-001]`, `[T-010]`, `[T-100]` — this ensures consistent sorting and visual alignment
99
- - Each user story section should be independently testable — this enables incremental verification during implementation
100
-
101
- **HANDOFF:** `/prizmkit-analyze` or `/prizmkit-implement`
74
+ 4. Generate `plan.md` from template (`${SKILL_DIR}/assets/plan-template.md`):
75
+ - Architecture approach, component design
76
+ - 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)
77
+ - Interface design (API endpoints, request/response formats)
78
+ - Integration points, testing strategy, risk assessment
79
+ 5. Cross-check: every user story maps to plan components — unmapped stories = coverage gaps
80
+ 6. Check alignment with `.prizm-docs/root.prizm` RULES section
81
+ 7. **Deployment strategy check:**
82
+ - Read `.prizmkit/config.json` `deploy_strategy` field
83
+ - No strategy ask user, write to config.json
84
+ - Strategy exists + new tech stack detected ask about new component only
85
+ - Skipped in fast-path mode (bug fixes / simple refactors)
86
+
87
+ ### Phase 2: Task Generation
88
+
89
+ 1. Ask user for strategy (or infer): MVP-first / Incremental / Parallel
90
+ 2. Append `## Tasks` section to `plan.md` using tasks template in `${SKILL_DIR}/assets/plan-template.md`:
91
+ - Phases: Setup (T-001~T-009) Foundational (T-010~T-099) User Stories (T-100+) Polish (T-900+)
92
+ - Each task: `- [ ] [T-NNN] [P?] [US?] Description file: path/to/file`
93
+ - Checkpoint tasks between phases for validation
94
+ 3. Verify coverage:
95
+ - Every user story at least one task
96
+ - Every taska target file path
97
+ - Risk assessment at least one risk with mitigation
98
+ 4. Output: `plan.md` path, summary of design decisions, task count
99
+
100
+ **HANDOFF:** `/prizmkit-implement`
101
+
102
+ ## Handling Vague Inputs
103
+
104
+ When the user's description is vague:
105
+ 1. Extract what IS clear and write it into the spec
106
+ 2. Mark ambiguous parts with `[NEEDS CLARIFICATION]` + recommended default
107
+ 3. Auto-clarification (Phase 0, step 9) resolves interactively before planning
108
+
109
+ Never block progress always produce a usable spec, even with open questions.
102
110
 
103
111
  ## Example
104
112
 
105
- **Input:** spec.md for "User Avatar Upload" feature
113
+ **Input:** "I want users to upload avatars"
106
114
 
107
- **Output:** plan.md excerpt:
115
+ **Phase 0 output:** `.prizmkit/specs/003-user-avatar-0402/spec.md`
116
+ ```markdown
117
+ # Feature: User Avatar Upload
118
+ ## User Stories
119
+ ### US-1: Upload Avatar
120
+ As a registered user, I want to upload a profile picture,
121
+ so that other users can visually identify me.
122
+ **Acceptance Criteria:**
123
+ - Given I am on my profile page
124
+ - When I select an image file and click upload
125
+ - Then my avatar is updated and visible across the platform
126
+ ## Scope
127
+ - **In scope:** Upload, display, remove avatar; image format validation
128
+ - **Out of scope:** Image cropping/editing, avatar history
129
+ ```
130
+
131
+ **Phase 1-2 output:** `plan.md` excerpt:
108
132
  ```markdown
109
133
  ## Architecture Approach
110
134
  Extend existing user profile module. Add S3 integration for file storage.
111
- Reuse existing auth middleware for upload endpoint protection.
112
135
 
113
136
  ## Tasks
114
-
115
- ### Phase 1: Data Layer (T-010~T-019)
137
+ ### Phase: Data Layer (T-010~T-019)
116
138
  - [ ] [T-010] [US-1] Add avatar_url field to User model — file: src/models/user.ts
117
139
  - [ ] [T-011] [US-1] Create S3 upload utility — file: src/lib/s3.ts
118
- - [ ] [T-012] CP: Data layer checkpoint — run migrations + unit tests
119
-
120
- ### Phase 2: API [P] (T-100~T-109)
140
+ ### Phase: API [P] (T-100~T-109)
121
141
  - [ ] [T-100] [P] [US-1] POST /api/avatar upload endpoint — file: src/routes/avatar.ts
122
- - [ ] [T-101] [P] [US-2] DELETE /api/avatar endpoint — file: src/routes/avatar.ts
123
- - [ ] [T-102] CP: API checkpoint — integration tests pass
124
142
  ```
125
143
 
126
- ## Template
144
+ ## Templates
127
145
 
128
- The plan template is located at `${SKILL_DIR}/assets/plan-template.md`.
146
+ - Spec template: `${SKILL_DIR}/assets/spec-template.md`
147
+ - Plan template: `${SKILL_DIR}/assets/plan-template.md`
129
148
 
130
149
  ## Output
131
150
 
132
- Output directory depends on mode:
133
- - **Feature mode**: `.prizmkit/specs/###-feature-name/plan.md`
134
- - **Refactor mode**: `.prizmkit/refactor/<refactor-slug>/plan.md`
135
- - **Bugfix mode**: `.prizmkit/bugfix/<BUG_ID>/plan.md`
136
-
137
- The plan.md includes architecture, component design, data model, interface design, testing strategy, risk assessment, and Tasks section.
151
+ | Mode | Directory | Files |
152
+ |---|---|---|
153
+ | Feature | `.prizmkit/specs/###-feature-name/` | `spec.md` + `plan.md` |
154
+ | Refactor | `.prizmkit/refactor/<refactor-slug>/` | `plan.md` |
155
+ | Bugfix | `.prizmkit/bugfix/<BUG_ID>/` | `plan.md` |
@@ -38,8 +38,7 @@
38
38
  - [ ] All fields have explicit nullability (NOT NULL or nullable)
39
39
 
40
40
  ### Unresolved Questions
41
- <!-- NONE — all DB design questions must be resolved before proceeding to Tasks -->
42
- <!-- If any remain, run /prizmkit-clarify to resolve them first -->
41
+ <!-- NONE — all DB design questions must be resolved inline before proceeding to Tasks -->
43
42
 
44
43
  ## Interface Design
45
44
  [API endpoints, request/response formats, module interfaces — include all details here]