prizmkit 1.1.5 → 1.1.7

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 (38) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/README.md +1 -1
  3. package/bundled/dev-pipeline/assets/feature-list-example.json +2 -2
  4. package/bundled/dev-pipeline/reset-bug.sh +304 -0
  5. package/bundled/dev-pipeline/run-bugfix.sh +55 -8
  6. package/bundled/dev-pipeline/run-feature.sh +12 -4
  7. package/bundled/dev-pipeline/run-refactor.sh +5 -2
  8. package/bundled/dev-pipeline/scripts/init-pipeline.py +19 -5
  9. package/bundled/dev-pipeline/scripts/update-bug-status.py +2 -2
  10. package/bundled/dev-pipeline/scripts/update-feature-status.py +6 -6
  11. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +111 -31
  12. package/bundled/dev-pipeline/templates/feature-list-schema.json +5 -5
  13. package/bundled/dev-pipeline/templates/refactor-list-schema.json +107 -28
  14. package/bundled/dev-pipeline/tests/test_auto_skip.py +1 -1
  15. package/bundled/skills/_metadata.json +10 -2
  16. package/bundled/skills/app-planner/SKILL.md +14 -3
  17. package/bundled/skills/bug-fix-workflow/SKILL.md +2 -0
  18. package/bundled/skills/bug-planner/SKILL.md +59 -4
  19. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +9 -4
  20. package/bundled/skills/feature-planner/SKILL.md +73 -1
  21. package/bundled/skills/feature-planner/references/error-recovery.md +1 -1
  22. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +7 -6
  23. package/bundled/skills/feature-workflow/SKILL.md +4 -1
  24. package/bundled/skills/prizmkit-committer/SKILL.md +1 -0
  25. package/bundled/skills/prizmkit-deploy/SKILL.md +1 -0
  26. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  27. package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
  28. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +4 -4
  29. package/bundled/skills/prizmkit-plan/SKILL.md +3 -3
  30. package/bundled/skills/prizmkit-retrospective/SKILL.md +40 -3
  31. package/bundled/skills/prizmkit-verify/SKILL.md +281 -0
  32. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +402 -0
  33. package/bundled/skills/recovery-workflow/SKILL.md +1 -0
  34. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +7 -3
  35. package/bundled/skills/refactor-planner/SKILL.md +51 -1
  36. package/bundled/skills/refactor-workflow/SKILL.md +4 -0
  37. package/package.json +1 -1
  38. package/src/scaffold.js +24 -12
@@ -117,16 +117,20 @@ Detect user intent from their message, then follow the corresponding workflow:
117
117
 
118
118
  Use `AskUserQuestion` to present the following configuration choices. Each question is a separate selectable option:
119
119
 
120
- **Question 1 — Verbose logging** (multiSelect: false):
120
+ **Question 1 — Critic review** (multiSelect: false):
121
+ - Off (default) — Skip adversarial review
122
+ - On — Enable critic review after bug fix (+2-5 min/bug for critical/high severity)
123
+
124
+ **Question 2 — Verbose logging** (multiSelect: false):
121
125
  - On (default) — Detailed AI session logs including tool calls and subagent activity
122
126
  - Off — Minimal logging
123
127
 
124
- **Question 2 — Max retries** (multiSelect: false):
128
+ **Question 3 — Max retries** (multiSelect: false):
125
129
  - 3 (default)
126
130
  - 1
127
131
  - 5
128
132
 
129
- **Question 3 — Session timeout** (multiSelect: false):
133
+ **Question 4 — Session timeout** (multiSelect: false):
130
134
  - None (default) — No timeout
131
135
  - 30 min — `SESSION_TIMEOUT=1800`
132
136
  - 1 hour — `SESSION_TIMEOUT=3600`
@@ -138,6 +142,7 @@ Detect user intent from their message, then follow the corresponding workflow:
138
142
 
139
143
  | Config choice | Environment variable |
140
144
  |-----------|---------------------|
145
+ | Critic: On | `ENABLE_CRITIC=true` |
141
146
  | Verbose: Off | `VERBOSE=0` |
142
147
  | Verbose: On | `VERBOSE=1` |
143
148
  | Max retries: N | `MAX_RETRIES=N` |
@@ -204,7 +209,7 @@ Detect user intent from their message, then follow the corresponding workflow:
204
209
  **If foreground**: Pipeline runs to completion in the terminal. After it finishes:
205
210
  - Summarize results: total bugs, fixed, failed, skipped
206
211
  - If all fixed: each bug session has already run `prizmkit-retrospective` (structural sync) internally. Ask user what's next.
207
- - If some failed: show failed bug IDs and suggest `retry-bugfix.sh <B-XXX>` or `reset-bug.sh <B-XXX> --clean --run`
212
+ - If some failed: show failed bug IDs and suggest `retry-bugfix.sh <B-XXX>` or `dev-pipeline/reset-bug.sh <B-XXX> --clean --run`
208
213
 
209
214
  **If background daemon**:
210
215
  1. Verify launch:
@@ -79,15 +79,31 @@ Do NOT use this skill when:
79
79
  ```bash
80
80
  python3 ${SKILL_DIR}/scripts/validate-and-generate.py validate --input <output-path> --mode <new|incremental>
81
81
  ```
82
+
83
+ If the script is not available, perform these manual validation checks:
84
+ 1. **ID sequence**: All feature IDs are sequential (F-001, F-002, F-003, ...)
85
+ 2. **No circular dependencies**: No feature depends (directly or transitively) on itself
86
+ 3. **Description length**: Minimum 15 words per description (error), 30/50/80 recommended
87
+ 4. **Dependency references**: All referenced features in dependencies exist in features array
88
+ 5. **Priority enums**: All priority values are exactly "high", "medium", or "low" (case-sensitive)
89
+ 6. **Status enum**: All status values are one of: pending, in_progress, completed, failed, skipped, split, auto_skipped
90
+ 7. **Acceptance criteria**: At least 1 criterion per feature, each is a concrete, measurable statement
91
+ 8. **Browser interaction**: If present, has url, verify_steps array, and optional setup_command
92
+ 9. **Complexity enum**: If present, is one of: low, medium, high
93
+ 10. **Model field**: If present, is a non-empty string
94
+ 11. **Critic field**: If present, is boolean; if true, critic_count should be 1 or 3
95
+ 12. **Root schema**: Has $schema='dev-pipeline-feature-list-v1', project_name, and non-empty features array
82
96
 
83
97
  5. **Use script output as source of truth** — if validation fails, fix and re-run until pass
84
98
 
85
99
  ## Prerequisites
86
100
 
87
101
  Before questions, check optional context files (never block if absent):
88
- - `.prizm-docs/root.prizm` (architecture/project context)
102
+ - `.prizm-docs/root.prizm` (architecture/project context — typically created by app-planner with captured decisions)
89
103
  - `.prizmkit/config.json` (existing stack preferences and detected tech stack)
104
+ - `project-brief.md` (project context from app-planner, if available)
90
105
  - existing `feature-list.json` (required for incremental mode)
106
+ - `.prizmkit/project-conventions.json` (project conventions from app-planner, if available)
91
107
  - If `.prizm-docs/root.prizm` is absent and the project has existing source code, scan the directory structure to understand the codebase layout:
92
108
  ```bash
93
109
  find . -maxdepth 2 -type d -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/__pycache__/*' -not -path '*/vendor/*' | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
@@ -98,6 +114,62 @@ Before questions, check optional context files (never block if absent):
98
114
  - Map config fields to global_context: `language`, `runtime`, `frontend_framework`, `frontend_styling`, `backend_framework`, `database`, `orm`, `testing` → `testing_strategy`, `bundler`, `project_type`.
99
115
  - Do NOT re-ask the user for tech stack info already present in config.json. Show detected stack and confirm.
100
116
 
117
+ ## Global Context Population
118
+
119
+ The `global_context` object in `feature-list.json` provides technology stack information to the pipeline for intelligent code generation.
120
+
121
+ ### Recommended Fields by Project Type
122
+
123
+ **Frontend-only projects:**
124
+ - `language` (required) — e.g., "TypeScript", "JavaScript"
125
+ - `frontend_framework` (required) — e.g., "React", "Vue", "Svelte"
126
+ - `frontend_styling` (recommended) — e.g., "Tailwind CSS", "styled-components"
127
+ - `testing_strategy` (recommended) — e.g., "Jest + React Testing Library"
128
+
129
+ **Backend-only projects:**
130
+ - `language` (required) — e.g., "TypeScript", "Python", "Go"
131
+ - `backend_framework` (required) — e.g., "Express", "Django", "FastAPI"
132
+ - `database` (required if applicable) — e.g., "PostgreSQL", "MongoDB"
133
+ - `testing_strategy` (recommended) — e.g., "Jest", "pytest"
134
+
135
+ **Full-stack projects (include both frontend AND backend fields):**
136
+ - `language`, `frontend_framework`, `backend_framework`, `database`, `testing_strategy` (all recommended)
137
+ - Additional: `frontend_styling`, `orm`, `bundler`, `runtime`
138
+
139
+ ### Auto-Population from app-planner
140
+
141
+ If the project was planned with `app-planner`, `feature-planner` will automatically read:
142
+ - `.prizmkit/config.json` (tech stack detected by app-planner)
143
+ - `project-brief.md` (tech choices made during planning)
144
+ - `.prizm-docs/root.prizm` (architecture decisions)
145
+
146
+ **Recommendation**: Always run `app-planner` before `feature-planner` to ensure `global_context` is pre-populated correctly. This reduces planning time and improves code generation consistency.
147
+
148
+ ### Manual Population (if no app-planner context)
149
+
150
+ If planning features directly without app-planner:
151
+ 1. During Phase 1 (Scope Clarification), identify the project's tech stack
152
+ 2. Ask user or read from existing `package.json` / `pyproject.toml` / `go.mod`
153
+ 3. Populate `global_context` in `feature-list.json` with detected values
154
+ 4. Confirm with user: "Using tech stack: [language] + [frameworks]. Correct?"
155
+
156
+ ### Pipeline Behavior with Missing Fields
157
+
158
+ | Missing Field | Pipeline Behavior |
159
+ |---------------|-------------------|
160
+ | `language` | Uses generic pseudocode patterns; code generation may be generic |
161
+ | `frontend_framework` | Frontend features generate generic HTML/JavaScript; no framework-specific patterns |
162
+ | `backend_framework` | Backend features generate generic API patterns; no framework-specific scaffolding |
163
+ | `database` | Assumes no persistent storage; generates unit tests only with mocks |
164
+ | `testing_strategy` | Defaults to Jest (if JavaScript/TypeScript); pytest (if Python) |
165
+ | All fields empty | Pipeline still works but code quality/consistency may suffer; recommend re-running with app-planner |
166
+
167
+ ### Note
168
+
169
+ **global_context fields are all optional** — pipeline can execute without them. However, including the recommended fields dramatically improves code generation quality and framework-specific best practices.
170
+
171
+ ---
172
+
101
173
  ## Scenario Routing
102
174
 
103
175
  Classify user intent first:
@@ -21,7 +21,7 @@ Group errors by type and apply targeted fixes:
21
21
 
22
22
  | Error Type | Symptom | Fix Offered | Auto-Fix? |
23
23
  |-----------|---------|------------|-----------|
24
- | **Schema mismatch** | `$schema` invalid, missing `app_name`, wrong `features` type | "Set `$schema` to `dev-pipeline-feature-list-v1`, `app_name` to string" | Yes |
24
+ | **Schema mismatch** | `$schema` invalid, missing `project_name`, wrong `features` type | "Set `$schema` to `dev-pipeline-feature-list-v1`, `project_name` to string" | Yes |
25
25
  | **Feature ID issues** | Invalid format (not `F-NNN`), duplicate IDs, undefined refs | "Suggest corrected IDs, show duplicates" | Yes |
26
26
  | **Dependency errors** | Circular dependency, undefined target features | "Show cycle chain (e.g., `F-003 → F-005 → F-003`), suggest break point" | No |
27
27
  | **Missing fields** | Feature missing required keys (title, description, AC) | "List each feature + missing keys, guide patch" | Partial |
@@ -174,9 +174,10 @@ def validate_feature_list(data, planning_mode="new"):
174
174
  "$schema must be '{}', got '{}'".format(SCHEMA_VERSION, schema)
175
175
  )
176
176
 
177
- app_name = data.get("app_name")
177
+ # Support both project_name (canonical) and app_name (legacy)
178
+ app_name = data.get("project_name", data.get("app_name"))
178
179
  if not isinstance(app_name, str) or not app_name.strip():
179
- errors.append("app_name must be a non-empty string")
180
+ errors.append("project_name must be a non-empty string")
180
181
 
181
182
  features = data.get("features")
182
183
  if not isinstance(features, list) or len(features) == 0:
@@ -441,8 +442,8 @@ def generate_template():
441
442
 
442
443
  return {
443
444
  "$schema": SCHEMA_VERSION,
444
- "app_name": "YOUR_APP_NAME",
445
- "app_description": "YOUR_APP_DESCRIPTION",
445
+ "project_name": "YOUR_PROJECT_NAME",
446
+ "project_description": "YOUR_PROJECT_DESCRIPTION",
446
447
  "created_at": now,
447
448
  "created_by": "feature-planner",
448
449
  "source_spec": "",
@@ -545,7 +546,7 @@ def _build_dependency_graph_text(features):
545
546
 
546
547
  def generate_summary_markdown(data):
547
548
  """Generate a markdown summary of the feature list."""
548
- app_name = data.get("app_name", "Unknown")
549
+ app_name = data.get("project_name", data.get("app_name", "Unknown"))
549
550
  features = data.get("features", [])
550
551
 
551
552
  lines = []
@@ -634,7 +635,7 @@ def generate_summary_json(data):
634
635
  })
635
636
 
636
637
  return {
637
- "app_name": data.get("app_name", ""),
638
+ "project_name": data.get("project_name", data.get("app_name", "")),
638
639
  "features": feature_summaries,
639
640
  "stats": {
640
641
  "total_features": len(features),
@@ -240,6 +240,8 @@ Present this summary to the user and get explicit confirmation before proceeding
240
240
  - Pass the structured requirements summary as input — NOT the raw user conversation
241
241
  - For new projects: standard planning mode
242
242
  - For existing projects with `--incremental`: incremental planning mode
243
+ - **Input**: Markdown requirements summary (feature descriptions, user stories, constraints)
244
+ - **Output**: `feature-list.json` (schema: `dev-pipeline-feature-list-v1`) containing `project_name`, `features[]` with id (F-NNN), title, description, priority, dependencies, acceptance_criteria, status
243
245
 
244
246
  2. **Interactive planning** (if feature-planner requires clarification):
245
247
  - Because Phase 1 was thorough, feature-planner should need minimal clarification
@@ -272,11 +274,12 @@ Present this summary to the user and get explicit confirmation before proceeding
272
274
  ```
273
275
 
274
276
  2. **Invoke `feature-pipeline-launcher` skill**:
277
+ - **Input**: Path to validated `feature-list.json`
275
278
  - The launcher handles all prerequisites checks
276
279
  - The launcher presents execution mode choices to the user (foreground/background/manual)
277
280
  - The launcher asks whether to enable Critic Agent (adversarial review) — passes `--critic` flag if chosen
278
281
  - Do NOT duplicate execution mode or critic selection here — let the launcher handle it
279
- - Returns PID/status and log file location
282
+ - **Output**: PID/status, log file path, execution mode selected
280
283
 
281
284
  3. **Verify launch success**:
282
285
  - Confirm pipeline is running
@@ -17,6 +17,7 @@ description: "Pure git commit workflow with safety checks. Stages files, generat
17
17
  | Uncommitted changes exist | `git status` shows modified/added/untracked files | Inform user "nothing to commit" and stop |
18
18
  | `.prizm-docs/` synced (feature/refactor) | `/prizmkit-retrospective` has run | Run `/prizmkit-retrospective` first |
19
19
  | Code review passed (pipeline mode) | `context-snapshot.md` has Review Notes with PASS/PASS_WITH_WARNINGS | Run `/prizmkit-code-review` first |
20
+ | `DEPLOY.md` updated (if applicable) | If `/prizmkit-deploy` ran, `DEPLOY.md` is staged | Run `/prizmkit-deploy` or skip if no infrastructure changes |
20
21
 
21
22
  ### Workflow
22
23
 
@@ -25,6 +25,7 @@ description: "Generate or update DEPLOY.md with local dev setup, testing, produc
25
25
  1. Read `.prizmkit/config.json`:
26
26
  - `deploy_strategy` — user's confirmed deployment approach (may be absent)
27
27
  - `tech_stack` — detected or user-provided technology stack
28
+ - **If `.prizmkit/config.json` does not exist**: proceed without it — infer deployment approach entirely from project file scanning in steps 2-3. Log a warning: "No .prizmkit/config.json found — inferring deployment strategy from project files. Run `/prizmkit-init` to generate config."
28
29
  2. Scan project for deployment-related files:
29
30
  - Container: `Dockerfile`, `docker-compose.yml`, `.dockerignore`
30
31
  - Cloud platforms: `vercel.json`, `netlify.toml`, `fly.toml`, `app.yaml` (GCP), `appspec.yml` (AWS)
@@ -1,5 +1,5 @@
1
1
  # Deployment Guide: [PROJECT_NAME]
2
- <!-- Replace [PROJECT_NAME] with: app_name from feature-list.json, or name from package.json, or the project root directory name (in that priority order) -->
2
+ <!-- Replace [PROJECT_NAME] with: project_name from feature-list.json, or name from package.json, or the project root directory name (in that priority order) -->
3
3
 
4
4
  > Generated by PrizmKit Deploy
5
5
 
@@ -89,5 +89,5 @@ If a session is interrupted mid-implementation:
89
89
 
90
90
  - Code files created/modified as specified in plan.md Tasks section
91
91
  - `plan.md` Tasks section updated with completion markers `[x]`
92
- - `deploy_guide.md` created/updated (only when new frameworks/tools were added)
92
+ - `DEPLOY.md` created/updated (only when new frameworks/tools were added)
93
93
  - Implementation summary output to conversation
@@ -1,6 +1,6 @@
1
1
  # Deploy Guide Update Protocol
2
2
 
3
- When dependency manifests change during implementation, update `deploy_guide.md` at the project root.
3
+ When dependency manifests change during implementation, update `DEPLOY.md` at the project root.
4
4
 
5
5
  ## Detection
6
6
 
@@ -16,7 +16,7 @@ When dependency manifests change during implementation, update `deploy_guide.md`
16
16
 
17
17
  ## Recording
18
18
 
19
- For each genuinely new framework/tool, record in `deploy_guide.md` at project root:
19
+ For each genuinely new framework/tool, record in `DEPLOY.md` at project root:
20
20
 
21
21
  | Field | Description | Source |
22
22
  |-------|-------------|--------|
@@ -27,7 +27,7 @@ For each genuinely new framework/tool, record in `deploy_guide.md` at project ro
27
27
  | **Key Config** | Config files or env vars needed | Config files you just created/modified |
28
28
  | **Notes** | Setup gotchas, required services | Docker services, manual steps, env vars |
29
29
 
30
- ## Template for `deploy_guide.md`
30
+ ## Template for `DEPLOY.md`
31
31
 
32
32
  ```markdown
33
33
  # Deploy Guide
@@ -66,4 +66,4 @@ For each genuinely new framework/tool, record in `deploy_guide.md` at project ro
66
66
 
67
67
  ## Final Step
68
68
 
69
- Stage the file: `git add deploy_guide.md`
69
+ Stage the file: `git add DEPLOY.md`
@@ -30,9 +30,9 @@ Transforms natural language into a structured spec. Skip this phase when:
30
30
  2. Auto-generate 2-4 word feature slug from description
31
31
  3. Determine next feature number by scanning `.prizmkit/specs/`:
32
32
  - List existing `###-*` directories, find highest numeric prefix
33
- - Next = highest + 1 (zero-padded to 3 digits), append `-MMDD` timestamp suffix for collision prevention
33
+ - Next = highest + 1 (zero-padded to 3 digits)
34
34
  - If empty or doesn't exist, start at `001`
35
- 4. Create directory: `.prizmkit/specs/###-feature-name-MMDD/`
35
+ 4. Create directory: `.prizmkit/specs/###-feature-name/`
36
36
  5. Load project context (use first available):
37
37
  - If `context-snapshot.md` exists in the feature dir → read Section 3 'Prizm Context' (skip re-reading .prizm-docs/)
38
38
  - Otherwise → read `.prizm-docs/root.prizm` and relevant L1/L2 docs
@@ -101,7 +101,7 @@ If no input document exists, prompt user to describe the feature (triggers Phase
101
101
 
102
102
  **Input:** "I want users to upload avatars"
103
103
 
104
- **Phase 0 output:** `.prizmkit/specs/003-user-avatar-0402/spec.md`
104
+ **Phase 0 output:** `.prizmkit/specs/003-user-avatar/spec.md`
105
105
  ```markdown
106
106
  # Feature: User Avatar Upload
107
107
  ## User Stories
@@ -24,12 +24,34 @@ For initial doc setup, validation, or migration, use `/prizmkit-prizm-docs` inst
24
24
  - User says "retrospective", "retro", "update docs", "sync docs", "wrap up"
25
25
  - After refactoring or bugfix cycles (structural sync + optional TRAPS update)
26
26
 
27
+ ## PRECONDITION
28
+
29
+ | Mode | Required Input | Expected Source | If Missing |
30
+ |---|---|---|---|
31
+ | **Feature** | Code review verdict (PASS/PASS_WITH_WARNINGS) | `.prizmkit/specs/###-feature-name/` context-snapshot.md Review Notes | Run `/prizmkit-code-review` |
32
+ | **Refactor** | Code review verdict + behavior preservation evidence | `.prizmkit/refactor/<slug>/` context-snapshot.md | Run `/prizmkit-code-review` in refactor mode |
33
+ | **Bugfix** | Code review verdict + regression test evidence | `.prizmkit/bugfix/<BUG_ID>/` context-snapshot.md | Run `/prizmkit-code-review` in bugfix mode |
34
+ | **Standalone** (user-invoked) | Code changes in working tree | `git diff` output | No prerequisite — runs structural sync only |
35
+
27
36
  ## When NOT to Use
28
37
 
29
38
  - Only comments, whitespace, or formatting changed — no structural/knowledge change
30
39
  - Only test files changed — no module-level impact
31
40
  - Only .prizm files changed — avoid circular updates
32
41
 
42
+ ## PRECONDITION: Review Verdict Gate
43
+
44
+ Before executing, check the most recent `/prizmkit-code-review` verdict from the current session context:
45
+
46
+ | Verdict | Action |
47
+ |---------|--------|
48
+ | `PASS` | Proceed normally |
49
+ | `PASS_WITH_WARNINGS` | Proceed normally (warnings are informational) |
50
+ | `NEEDS_FIXES` | **ABORT** — do not sync docs for code that failed review. Output: "Code review verdict is NEEDS_FIXES. Fix the issues identified in code review first, then re-run `/prizmkit-code-review` before proceeding to retrospective." |
51
+ | No verdict found | Proceed with warning: "No code review verdict found — running retrospective without review gate. Consider running `/prizmkit-code-review` first." |
52
+
53
+ This gate prevents updating `.prizm-docs/` for code that hasn't passed review, which would create a false impression that the codebase is in a consistent, reviewed state.
54
+
33
55
  ---
34
56
 
35
57
  ### Job 1: Structural Sync (always runs)
@@ -79,12 +101,27 @@ The pipeline enforces a **docs pass condition**: `.prizm-docs/` must show change
79
101
 
80
102
  | From | To | Condition |
81
103
  |------|----|-----------|
82
- | `prizmkit-code-review` | **this skill** | Review passes or work is complete |
83
- | **this skill** | `prizmkit-deploy` (conditional) | Architecture synced; deploy only if new tech stack detected |
84
- | **this skill** | `prizmkit-committer` (direct) | Architecture synced, no deployment doc update needed |
104
+ | `prizmkit-code-review` | **this skill** | Review verdict is PASS or PASS_WITH_WARNINGS |
105
+ | **this skill** | `prizmkit-deploy` (conditional) | Architecture synced; deploy only if new infrastructure components detected (new DB, cache, MQ, etc.) |
106
+ | **this skill** | `prizmkit-committer` (direct) | Architecture synced, no new infrastructure components |
85
107
  | `prizmkit-deploy` | `prizmkit-committer` | Deploy docs updated, ready to commit |
86
108
  | `prizmkit-committer` | — | Committed |
87
109
 
110
+ ### Deploy Decision Logic
111
+
112
+ After structural sync and knowledge injection are complete, decide the next step:
113
+
114
+ 1. **Check if this is a fast-path change** (bugfix, config tweak, simple refactor) → skip deploy, go to `/prizmkit-committer`
115
+ 2. **Check `.prizmkit/config.json`** for `deploy_strategy` field:
116
+ - If absent → skip deploy (project hasn't configured deployment yet)
117
+ - If present → continue to step 3
118
+ 3. **Scan this session's changes** for new infrastructure indicators:
119
+ - New `Dockerfile`, `docker-compose.yml`, cloud config files (vercel.json, fly.toml, etc.)
120
+ - New database migrations, new cache/queue dependencies in package.json/requirements.txt
121
+ - New environment variables added to source code
122
+ - If any found → invoke `/prizmkit-deploy`
123
+ - If none found → go to `/prizmkit-committer`
124
+
88
125
  ## Output
89
126
 
90
127
  - `.prizm-docs/*.prizm` — Structurally synced + TRAPS/RULES/DECISIONS enriched
@@ -0,0 +1,281 @@
1
+ ---
2
+ name: "prizmkit-verify"
3
+ description: "Automated framework verification for PrizmKit's 4-layer architecture (Skill → Pipeline → Workflow → Script). Use this skill to validate structural integrity, contract consistency between layers, cross-scenario alignment, and adapter/installer correctness. Trigger whenever: verifying framework health, checking skill contracts, auditing layer integration, running pre-release checks, or after significant framework modifications."
4
+ ---
5
+
6
+ # PrizmKit Framework Verification
7
+
8
+ Verify PrizmKit's four-layer architecture for structural integrity, contract consistency, and cross-scenario alignment.
9
+
10
+ ## Execution Modes
11
+
12
+ Parse the user's arguments to determine scope and depth:
13
+
14
+ | Command | What Runs | When to Use |
15
+ |---------|-----------|-------------|
16
+ | `/prizmkit-verify light` | Light checks only (R1-R4) | Quick CI gate, seconds |
17
+ | `/prizmkit-verify medium` | Light + Medium (R1-R4) | Regular development, recommended default |
18
+ | `/prizmkit-verify full` | All rounds (R1-R6) including E2E | Pre-release, after major changes |
19
+ | `/prizmkit-verify --round R1` | Specific round only | Targeted check after editing a layer |
20
+ | `/prizmkit-verify` (no args) | Same as `medium` | Default |
21
+
22
+ ## Architecture Context
23
+
24
+ PrizmKit has four layers, bottom to top:
25
+
26
+ ```
27
+ L1 Skill layer → core/skills/prizmkit-skill/ (10 skills, dev lifecycle)
28
+ L2 Pipeline layer → core/skills/orchestration-skill/pipelines/ (7 skills, planners + launchers)
29
+ L3 Workflow layer → core/skills/orchestration-skill/workflows/ (4 skills, scenario entry points)
30
+ L4 Script layer → dev-pipeline/ (Bash + Python runtime engine)
31
+ ```
32
+
33
+ Three verification depths, cumulative:
34
+ - **Light**: Structural/static checks, scriptable, zero tokens
35
+ - **Medium**: AI reads SKILL.md content, verifies inter-layer contracts
36
+ - **Deep**: End-to-end scenario traces through all 4 layers
37
+
38
+ ## Execution
39
+
40
+ ### Phase 0: Setup
41
+
42
+ 1. Create output directory: `.prizmkit/verify/` (timestamp-based run dir)
43
+ 2. Determine which rounds to run based on user args
44
+ 3. Initialize the report structure
45
+
46
+ ### Phase 1: Horizontal Verification (R1-R4)
47
+
48
+ Run rounds sequentially. For each round, run Light first, then Medium if in scope.
49
+
50
+ ---
51
+
52
+ #### R1: L1 Skill Layer
53
+
54
+ **Target**: All skills in `core/skills/prizmkit-skill/` (expect ~10)
55
+
56
+ **Light checks** — run `${SKILL_DIR}/scripts/verify-light.py --round R1` if available, otherwise check manually:
57
+
58
+ | Check | How | Pass Criteria |
59
+ |-------|-----|---------------|
60
+ | Frontmatter validity | Read each SKILL.md YAML header | `name` + `description` present; `name` is lowercase-hyphens; `name` matches directory name |
61
+ | Asset reference integrity | Grep `${SKILL_DIR}` in each SKILL.md, resolve path relative to skill dir | Every referenced file exists on disk |
62
+ | Cross-skill references | Grep `/prizmkit-*` references in each SKILL.md | Every referenced skill exists under `core/skills/` |
63
+ | Orphaned assets | List files in each skill's `assets/`, `scripts/`, `references/` dirs | Every file is referenced by SKILL.md (warn if not) |
64
+ | Lint: ESLint | Run `npm run lint` | 0 errors (warnings OK) |
65
+ | Lint: Ruff | Run `npm run lint:py` | 0 errors |
66
+
67
+ **Medium checks** — read each SKILL.md FULLY and verify artifact chain contracts:
68
+
69
+ For each adjacent skill pair in the chain:
70
+ `prizmkit-plan → prizmkit-analyze → prizmkit-implement → prizmkit-code-review → prizmkit-retrospective → prizmkit-committer → prizmkit-deploy`
71
+
72
+ | Verification Point | What to Check |
73
+ |-------------------|---------------|
74
+ | Output format defined? | Does the producer skill explicitly describe its output structure (file name, format, key sections)? |
75
+ | Input expectation defined? | Does the consumer skill explicitly state what it reads and in what format? |
76
+ | Format match | Do output and input specifications agree on structure, field names, file paths? |
77
+ | Path convention | Do both skills reference the same directory convention (e.g., `.prizmkit/specs/###-feature-name/`)? |
78
+ | Error handling | What happens if upstream artifact is missing or malformed? Is fallback defined? |
79
+ | Quality gate | Does each consumer check preconditions before proceeding? |
80
+
81
+ Record each pair as: `PASS` / `WARN (gap described)` / `FAIL (mismatch described)`
82
+
83
+ ---
84
+
85
+ #### R2: L2 Pipeline Layer
86
+
87
+ **Target**: All skills in `core/skills/orchestration-skill/pipelines/` (expect 7)
88
+
89
+ **Light checks**:
90
+
91
+ | Check | How | Pass Criteria |
92
+ |-------|-----|---------------|
93
+ | Frontmatter validity | Same as R1 | `name` + `description`; name matches dir |
94
+ | Asset reference integrity | Same as R1 | All `${SKILL_DIR}` refs resolve |
95
+ | Planner→Launcher coupling | For each scenario (feature/bugfix/refactor): check planner mentions correct JSON filename, launcher references correct script | All 3 pairs coupled correctly |
96
+ | Script path references | Launchers reference `dev-pipeline/run-*.sh` | All referenced scripts exist and are executable |
97
+ | Schema consistency | Compare planner SKILL.md output schema with `dev-pipeline/templates/*-list-schema.json` | Field names, types, required fields match |
98
+ | Schema version match | Compare `dev-pipeline/templates/*-list-schema.json` const value with `dev-pipeline/scripts/init-*-pipeline.py` EXPECTED_SCHEMA | Versions identical |
99
+
100
+ **Medium checks** — read each SKILL.md FULLY:
101
+
102
+ For each scenario (feature, bugfix, refactor):
103
+ 1. What JSON format does the planner produce? What fields, what validation?
104
+ 2. What JSON format does the launcher expect? What fields does it read?
105
+ 3. Do they match? Any fields the launcher expects but planner doesn't produce?
106
+ 4. What command does the launcher assemble? What env vars? Do they match `run-*.sh` expectations?
107
+
108
+ ---
109
+
110
+ #### R3: L3 Workflow Layer
111
+
112
+ **Target**: All skills in `core/skills/orchestration-skill/workflows/` (expect 4)
113
+
114
+ **Light checks**:
115
+
116
+ | Check | How | Pass Criteria |
117
+ |-------|-----|---------------|
118
+ | Frontmatter validity | Same as R1 | `name` + `description`; name matches dir |
119
+ | Pipeline skill references | Grep each workflow for planner/launcher skill names | All referenced pipeline skills exist |
120
+ | Checkpoint naming | Grep for `CP-` patterns | Follows `CP-{XW}-{N}` convention |
121
+ | Flow completeness markers | Each workflow has: When to Use, Execution phases, Error handling table, Relationship table | All sections present |
122
+
123
+ **Medium checks** — read each SKILL.md FULLY:
124
+
125
+ | Verification Point | What to Check |
126
+ |-------------------|---------------|
127
+ | Workflow → Pipeline handoff | What does workflow pass to each pipeline skill? Is the input format documented? |
128
+ | Flow completeness | feature-workflow: requirements→planning→launch→monitor? bug-fix-workflow: diagnosis→triage→fix→review→commit? refactor-workflow: goals→planning→launch→monitor? recovery-workflow: detect→diagnose→recover? |
129
+ | Fast path integration | If fast path exists, is there a decision tree for when to use it? |
130
+ | Cross-workflow consistency | Same checkpoint naming, phase structure, error handling patterns? |
131
+
132
+ ---
133
+
134
+ #### R4: L4 Script Layer
135
+
136
+ **Target**: `dev-pipeline/` directory
137
+
138
+ **Light checks**:
139
+
140
+ | Check | How | Pass Criteria |
141
+ |-------|-----|---------------|
142
+ | Shell scripts executable | `ls -la dev-pipeline/*.sh` | All `.sh` files have `+x` permission |
143
+ | Python scripts compile | `python3 -m py_compile` each `.py` file | All compile without error |
144
+ | Bash lib sourcing | Grep `run-*.sh` for `source.*lib/` | Each sources common.sh, heartbeat.sh, branch.sh |
145
+ | JSON templates valid | `python3 -c "import json; json.load(open(f))"` for each `.json` in `templates/` | All parse without error |
146
+ | Ruff Python lint | `ruff check dev-pipeline/scripts/` | 0 errors |
147
+ | Test file existence | List `dev-pipeline/tests/` | At least test files exist for prompt generation |
148
+
149
+ **Medium checks** — read key scripts:
150
+
151
+ | Verification Point | What to Check |
152
+ |-------------------|---------------|
153
+ | Shell → Python integration | For each `run-*.sh`: list all Python scripts invoked, verify each exists, verify argument names match |
154
+ | Bootstrap prompt generation | Read `generate-bootstrap-prompt.py` (or per-scenario variant): does it reference correct skill names? Are all `{{PLACEHOLDER}}` variables populated? |
155
+ | State management | Read `init-*-pipeline.py`: correct schema validation? Proper state dir initialization? |
156
+ | Cross-scenario consistency | Compare `run-feature.sh` vs `run-bugfix.sh` vs `run-refactor.sh`: same structure? Same error handling patterns? Note intentional divergences vs unintentional gaps |
157
+
158
+ ---
159
+
160
+ ### Phase 2: Vertical E2E Verification (R5-R6)
161
+
162
+ Only runs in `full` mode. For each scenario, trace data flow through all 4 layers.
163
+
164
+ #### R5: Feature Scenario
165
+
166
+ Trace "Add user authentication with JWT" through:
167
+
168
+ 1. **L3→L2**: feature-workflow → feature-planner → feature-pipeline-launcher
169
+ - What format does workflow pass to planner?
170
+ - What JSON does planner produce?
171
+ - What command does launcher assemble?
172
+
173
+ 2. **L2→L4**: feature-pipeline-launcher → run-feature.sh
174
+ - What args/env vars are passed?
175
+ - How does init-pipeline.py consume feature-list.json?
176
+ - What bootstrap prompt does generate-bootstrap-prompt.py produce?
177
+
178
+ 3. **L4→L1**: run-feature.sh → AI CLI → Skills
179
+ - What skills does the bootstrap prompt reference?
180
+ - In what order?
181
+ - Are skill names correct?
182
+
183
+ At each transition, verify: **format match**, **field completeness**, **path consistency**, **error propagation**.
184
+
185
+ #### R6: Bugfix + Refactor Scenarios
186
+
187
+ Same trace for:
188
+ - Bugfix: "Fix login crash when email is empty"
189
+ - Refactor: "Extract authentication logic into shared module"
190
+
191
+ Then cross-scenario comparison:
192
+ - Layer transition patterns structurally similar?
193
+ - Schema conventions consistent (F-NNN / B-NNN / R-NNN)?
194
+ - Bootstrap prompt patterns consistent?
195
+ - State management patterns consistent?
196
+ - Intentional divergences documented?
197
+
198
+ ---
199
+
200
+ ### Phase 3: Supplementary Checks
201
+
202
+ These address gaps identified in the first verification run. Include in `medium` and `full` modes.
203
+
204
+ #### S1: Adapter Layer Verification
205
+
206
+ | Check | How |
207
+ |-------|-----|
208
+ | Claude adapter output | Run `node adapters/claude/command-adapter.js` on a sample skill, verify output format |
209
+ | CodeBuddy adapter output | Run `node adapters/codebuddy/skill-adapter.js` on same skill, verify output |
210
+ | Cross-platform equivalence | Diff the two outputs for semantic equivalence |
211
+ | ${SKILL_DIR} resolution | Verify Claude resolves to `.claude/command-assets/`, CodeBuddy to `.codebuddy/skills/` |
212
+
213
+ #### S2: Installer & Distribution Verification
214
+
215
+ | Check | How |
216
+ |-------|-----|
217
+ | _metadata.json completeness | All skills listed in `core/skills/_metadata.json` suites? |
218
+ | Bundle sync | `npm run bundle && npm run bundle:verify` passes |
219
+ | Skill count | Bundled skill count matches source skill count |
220
+
221
+ #### S3: Rules Consistency
222
+
223
+ | Check | How |
224
+ |-------|-----|
225
+ | Rules exist | All files in `core/rules/` referenced by `_rules-metadata.json` |
226
+ | Rule-skill alignment | Rules reference skill names that exist |
227
+
228
+ ---
229
+
230
+ ## Report Format
231
+
232
+ Generate the verification report at `.prizmkit/verify/verify-report-{timestamp}.md`:
233
+
234
+ ```markdown
235
+ # PrizmKit Verification Report
236
+ **Date**: {date} **Mode**: {light|medium|full}
237
+
238
+ ## Summary
239
+ | Round | Layer | Light | Medium | Deep | Issues |
240
+ |-------|-------|-------|--------|------|--------|
241
+ | R1 | L1 Skill | PASS/WARN/FAIL | PASS/WARN/FAIL | — | count |
242
+ | R2 | L2 Pipeline | ... | ... | — | count |
243
+ | R3 | L3 Workflow | ... | ... | — | count |
244
+ | R4 | L4 Script | ... | ... | — | count |
245
+ | R5 | E2E Feature | — | — | PASS/WARN/FAIL | count |
246
+ | R6 | E2E Bug+Refactor | — | — | PASS/WARN/FAIL | count |
247
+ | S1 | Adapters | ... | ... | — | count |
248
+ | S2 | Distribution | ... | ... | — | count |
249
+ | S3 | Rules | ... | ... | — | count |
250
+
251
+ ## Issues by Severity
252
+ ### Critical
253
+ - [C1] Description... (Round, Layer, Location)
254
+
255
+ ### High
256
+ - [H1] Description...
257
+
258
+ ### Medium
259
+ - [M1] Description...
260
+
261
+ ## Cross-Scenario Comparison (full mode only)
262
+ | Dimension | Feature | Bugfix | Refactor | Consistent? |
263
+ |-----------|---------|--------|----------|-------------|
264
+ | ... | ... | ... | ... | ✅/⚠️ |
265
+
266
+ ## Recommendations
267
+ 1. **P0**: ...
268
+ 2. **P1**: ...
269
+ ```
270
+
271
+ ## Parallelization Strategy
272
+
273
+ For efficiency, run independent checks concurrently:
274
+ - R1 Light + R2 Light + R3 Light + R4 Light can run in parallel
275
+ - R1 Medium depends on R1 Light passing
276
+ - R5/R6 depend on R1-R4 completing (need full picture of each layer)
277
+ - S1/S2/S3 can run in parallel with R1-R4
278
+
279
+ ## Previous Verification Findings
280
+
281
+ Reference `docs/framework-verification-report.md` for the baseline findings from the initial verification run. This helps track whether previously identified issues have been resolved.