prizmkit 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/skill-adapter.js +21 -7
  3. package/bundled/agents/prizm-dev-team-reviewer.md +53 -173
  4. package/bundled/dev-pipeline/.env.example +45 -0
  5. package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +535 -0
  6. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  7. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +57 -12
  8. package/bundled/dev-pipeline/launch-feature-daemon.sh +3 -1
  9. package/bundled/dev-pipeline/launch-refactor-daemon.sh +57 -12
  10. package/bundled/dev-pipeline/lib/branch.sh +6 -1
  11. package/bundled/dev-pipeline/lib/common.sh +71 -0
  12. package/bundled/dev-pipeline/lib/heartbeat.sh +2 -2
  13. package/bundled/dev-pipeline/retry-bugfix.sh +60 -23
  14. package/bundled/dev-pipeline/retry-feature.sh +47 -12
  15. package/bundled/dev-pipeline/retry-refactor.sh +105 -23
  16. package/bundled/dev-pipeline/run-bugfix.sh +265 -44
  17. package/bundled/dev-pipeline/run-feature.sh +35 -1
  18. package/bundled/dev-pipeline/run-refactor.sh +376 -51
  19. package/bundled/dev-pipeline/scripts/check-session-status.py +24 -1
  20. package/bundled/dev-pipeline/scripts/detect-stuck.py +195 -85
  21. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +31 -19
  22. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +19 -3
  23. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +98 -11
  24. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +30 -5
  25. package/bundled/dev-pipeline/scripts/init-pipeline.py +3 -3
  26. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +15 -4
  27. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -5
  28. package/bundled/dev-pipeline/scripts/patch-completion-notes.py +191 -0
  29. package/bundled/dev-pipeline/scripts/update-bug-status.py +159 -14
  30. package/bundled/dev-pipeline/scripts/update-feature-status.py +79 -37
  31. package/bundled/dev-pipeline/scripts/update-refactor-status.py +343 -13
  32. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +1 -1
  33. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +7 -11
  34. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +41 -7
  35. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +27 -3
  36. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +43 -19
  37. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -26
  38. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +5 -14
  39. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +36 -25
  40. package/bundled/dev-pipeline/templates/feature-list-schema.json +23 -11
  41. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +270 -0
  42. package/bundled/dev-pipeline/templates/refactor-list-schema.json +10 -2
  43. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +3 -1
  44. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +1 -0
  45. package/bundled/dev-pipeline/templates/sections/feature-context.md +2 -0
  46. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +29 -2
  47. package/bundled/dev-pipeline/templates/sections/phase-commit.md +22 -0
  48. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +8 -6
  50. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -5
  51. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  52. package/bundled/skills/_metadata.json +5 -22
  53. package/bundled/skills/app-planner/SKILL.md +92 -66
  54. package/bundled/skills/app-planner/assets/app-design-guide.md +1 -1
  55. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
  56. package/bundled/skills/app-planner/references/project-brief-guide.md +69 -66
  57. package/bundled/skills/bug-fix-workflow/SKILL.md +47 -4
  58. package/bundled/skills/bug-planner/SKILL.md +130 -188
  59. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +43 -0
  60. package/bundled/skills/bug-planner/references/critic-and-verification.md +44 -0
  61. package/bundled/skills/bug-planner/references/error-recovery.md +73 -0
  62. package/bundled/skills/bug-planner/references/input-formats.md +53 -0
  63. package/bundled/skills/bug-planner/references/schema-validation.md +25 -0
  64. package/bundled/skills/bug-planner/references/severity-rules.md +16 -0
  65. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +1 -5
  66. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +5 -10
  67. package/bundled/skills/feature-pipeline-launcher/SKILL.md +16 -3
  68. package/bundled/skills/feature-planner/SKILL.md +33 -122
  69. package/bundled/skills/feature-planner/assets/evaluation-guide.md +1 -1
  70. package/bundled/skills/feature-planner/assets/planning-guide.md +21 -5
  71. package/bundled/skills/feature-planner/references/browser-interaction.md +2 -4
  72. package/bundled/skills/feature-planner/references/completeness-review.md +57 -0
  73. package/bundled/skills/feature-planner/references/error-recovery.md +15 -34
  74. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +1 -1
  75. package/bundled/skills/feature-planner/references/new-project-planning.md +2 -2
  76. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -2
  77. package/bundled/skills/feature-workflow/SKILL.md +3 -4
  78. package/bundled/skills/prizm-kit/SKILL.md +39 -49
  79. package/bundled/skills/prizmkit-code-review/SKILL.md +51 -64
  80. package/bundled/skills/prizmkit-code-review/rules/dimensions.md +85 -0
  81. package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +11 -11
  82. package/bundled/skills/prizmkit-committer/SKILL.md +3 -31
  83. package/bundled/skills/prizmkit-deploy/SKILL.md +34 -31
  84. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  85. package/bundled/skills/prizmkit-implement/SKILL.md +35 -68
  86. package/bundled/skills/prizmkit-init/SKILL.md +112 -65
  87. package/bundled/skills/prizmkit-init/assets/project-brief-template.md +82 -0
  88. package/bundled/skills/prizmkit-plan/SKILL.md +120 -79
  89. package/bundled/skills/prizmkit-plan/assets/plan-template.md +28 -18
  90. package/bundled/skills/prizmkit-plan/assets/spec-template.md +28 -11
  91. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +3 -3
  92. package/bundled/skills/prizmkit-plan/references/verification-checklist.md +60 -0
  93. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +10 -81
  94. package/bundled/skills/prizmkit-prizm-docs/assets/{PRIZM-SPEC.md → prizm-docs-format.md} +41 -526
  95. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +46 -0
  96. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +16 -0
  97. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +14 -0
  98. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +19 -0
  99. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +17 -0
  100. package/bundled/skills/prizmkit-retrospective/SKILL.md +27 -65
  101. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -4
  102. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +7 -25
  103. package/bundled/skills/recovery-workflow/SKILL.md +8 -8
  104. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +17 -9
  105. package/bundled/skills/refactor-planner/SKILL.md +23 -41
  106. package/bundled/skills/refactor-workflow/SKILL.md +1 -2
  107. package/bundled/team/prizm-dev-team.json +1 -1
  108. package/bundled/{skills/prizm-kit/assets → templates}/project-memory-template.md +1 -1
  109. package/package.json +1 -1
  110. package/src/clean.js +0 -1
  111. package/src/gitignore-template.js +0 -1
  112. package/src/scaffold.js +10 -3
  113. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +0 -5
  114. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +0 -19
  115. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +0 -19
  116. package/bundled/skills/app-planner/references/project-conventions.md +0 -93
  117. package/bundled/skills/prizmkit-analyze/SKILL.md +0 -207
  118. package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +0 -25
  119. package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +0 -43
  120. package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +0 -25
  121. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +0 -69
  122. package/bundled/skills/prizmkit-verify/SKILL.md +0 -281
  123. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +0 -402
@@ -39,7 +39,9 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
39
39
 
40
40
  ## ⚠️ Context Budget Rules (CRITICAL — read before any phase)
41
41
 
42
- You are running in headless mode with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
42
+ You are running in **headless non-interactive mode** with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
43
+
44
+ 0. **NON-INTERACTIVE MODE** — There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
43
45
 
44
46
  1. **context-snapshot.md is your single source of truth** — After Phase 1 builds it, ALWAYS read context-snapshot.md instead of re-reading individual source files
45
47
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
@@ -167,7 +169,7 @@ Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", mode=
167
169
  Prompt:
168
170
  > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
169
171
  > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
170
- > 2. Run prizmkit-analyze: cross-check `plan.md` (including Tasks section) against feature description and acceptance criteria for consistency.
172
+ > 2. Cross-check `plan.md` (including Tasks section) against feature description and acceptance criteria for consistency.
171
173
  > 3. Before flagging CRITICAL or HIGH issues, read the relevant source files listed in the File Manifest to verify.
172
174
  > Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
173
175
 
@@ -262,28 +264,28 @@ Spawn Reviewer subagent (Agent tool, subagent_type="prizm-dev-team-reviewer", ru
262
264
 
263
265
  Prompt:
264
266
  > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
265
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
266
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
267
- > - Section 3: Prizm Context (RULES, PATTERNS to check against)
268
- > - Section 4: File Manifest (original file structure)
269
- > - '## Implementation Log': what Dev changed, key decisions, discoveries
270
- > 2. Run prizmkit-code-review (both phases): Phase 1 diagnostic review (spec compliance, code quality, correctness), then Phase 2 fix strategy formulation for any findings. Read ONLY files listed in Implementation Log for diagnosis; MAY read additional files for impact analysis.
271
- > 3. Run the full test suite using `{{TEST_CMD}}` — **ONLY if the Implementation Log does not already confirm all tests passing**. If the log states tests passed, trust it and skip the re-run. When running: `{{TEST_CMD}} 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep the file for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all user stories.
272
- > 4. Write structured '## Review Notes' to context-snapshot.md with Fix Instructions (Root Cause, Impact, Fix Strategy, Code Guidance, Verification for each finding) and Re-Review Expectations.
273
- > Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
267
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md` for goals and acceptance criteria
268
+ > 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` for architecture decisions and completed tasks
269
+ > 3. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for RULES, PATTERNS, TRAPS
270
+ > 4. Run /prizmkit-code-review with artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/: Phase 1 diagnostic review across all applicable dimensions, then Phase 2 fix strategy formulation for any findings. Read ONLY files referenced in completed plan.md tasks for diagnosis; MAY read additional files for impact analysis.
271
+ > 5. Run the full test suite using `{{TEST_CMD}}`. When running: `{{TEST_CMD}} 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep the file for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all goals.
272
+ > 6. review-report.md will be written to .prizmkit/specs/{{FEATURE_SLUG}}/ by prizmkit-code-review.
273
+ > Report: number of findings found, or 'no findings' if clean."
274
274
 
275
275
  Wait for Reviewer to return.
276
276
 
277
- **Gate Check — Review Notes**:
278
- After Reviewer agent returns, verify the Review Notes were written:
277
+ **Gate Check — Review Report**:
278
+ After Reviewer agent returns, verify the review report was written:
279
279
  ```bash
280
- grep -q "## Review Notes" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
280
+ grep -q "## Findings" .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md && echo "GATE:PASS" || echo "GATE:MISSING"
281
281
  ```
282
- If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '## Review Notes' section to context-snapshot.md with structured Fix Instructions. Include: verdict, findings with Root Cause/Impact/Fix Strategy/Code Guidance/Verification, and Re-Review Expectations."
282
+ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write review-report.md to .prizmkit/specs/{{FEATURE_SLUG}}/ with findings."
283
+
284
+ **Verdict decision** (L4 responsibility): Read review-report.md findings count. If findings exist → NEEDS_FIXES. If no findings → PASS.
283
285
 
284
- - If NEEDS_FIXES: spawn Dev to fix (Dev reads Fix Instructions in snapshot), re-run Review (max 3 rounds)
286
+ - If NEEDS_FIXES: spawn Dev to fix (Dev reads Fix Instructions in review-report.md), re-run Review (max 3 rounds)
285
287
 
286
- **CP-3**: Tests pass, verdict is not NEEDS_FIXES.
288
+ **CP-3**: Tests pass, no unresolved findings.
287
289
 
288
290
  {{IF_BROWSER_INTERACTION}}
289
291
  ### Phase 5.5: Browser Verification (playwright-cli) — MANDATORY
@@ -329,7 +331,7 @@ You just implemented this feature — you know the project's tech stack and buil
329
331
  3. **Assess and record** — append to context-snapshot.md:
330
332
  - **ALL builds pass** → `## Deploy Verification: PASS` — proceed to commit
331
333
  - **Some builds fail with fixable errors** → fix and re-verify (already handled in step 2)
332
- - **Cannot build locally** (missing system-level deps you cannot install) → Generate `DEPLOY.md` with:
334
+ - **Cannot build locally** (missing system-level deps you cannot install) → Generate `.prizmkit/deploy.md` with:
333
335
  ```
334
336
  # Local Development Setup
335
337
 
@@ -345,7 +347,7 @@ You just implemented this feature — you know the project's tech stack and buil
345
347
  ## Verify
346
348
  [how to confirm the app is running correctly]
347
349
  ```
348
- Record: `## Deploy Verification: PARTIAL — see DEPLOY.md for missing prerequisites`
350
+ Record: `## Deploy Verification: PARTIAL — see .prizmkit/deploy.md for missing prerequisites`
349
351
 
350
352
  Deploy verification does NOT block the commit, but you MUST attempt it.
351
353
 
@@ -386,6 +388,28 @@ Working tree MUST be clean after this step. If any feature-related files remain,
386
388
 
387
389
  **Exception**: `session-summary.md` in the artifact directory is a local cross-session artifact generated by `/prizmkit-committer` — it is NOT committed to git. Ignore it in the clean-tree check.
388
390
 
391
+ **6e.** Write completion summary for downstream dependency context:
392
+
393
+ Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
394
+
395
+ ```json
396
+ {
397
+ "completion_notes": [
398
+ "<each item: one key change, API, model, or integration point that downstream features may need>",
399
+ "Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
400
+ "Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
401
+ "Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
402
+ ]
403
+ }
404
+ ```
405
+
406
+ Rules for writing completion notes:
407
+ - Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
408
+ - Each note should be self-contained and concise (one line, under 120 characters preferred)
409
+ - Include 3-8 notes covering the most important changes
410
+ - Do NOT include test files, config changes, or internal implementation details unless they affect other features
411
+ - If this feature has no downstream dependents, still write the summary (it serves as documentation)
412
+
389
413
  ## Critical Paths
390
414
 
391
415
  | Resource | Path |
@@ -39,7 +39,9 @@ You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATU
39
39
 
40
40
  ## ⚠️ Context Budget Rules (CRITICAL — read before any phase)
41
41
 
42
- You are running in headless mode with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
42
+ You are running in **headless non-interactive mode** with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
43
+
44
+ 0. **NON-INTERACTIVE MODE** — There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
43
45
 
44
46
  1. **context-snapshot.md is your single source of truth** — After Phase 1-2 builds it, ALWAYS read context-snapshot.md instead of re-reading individual source files
45
47
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
@@ -204,7 +206,7 @@ Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", mode=
204
206
  Prompt:
205
207
  > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
206
208
  > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
207
- > 2. Run prizmkit-analyze: cross-check `spec.md` and `plan.md` (including Tasks section) for consistency.
209
+ > 2. Cross-check `spec.md` and `plan.md` (including Tasks section) for consistency.
208
210
  > 3. Before flagging CRITICAL or HIGH issues, read the relevant source files listed in the File Manifest to verify.
209
211
  > Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
210
212
 
@@ -337,36 +339,35 @@ Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_i
337
339
 
338
340
  Prompt:
339
341
  > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
340
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
341
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
342
- > - Section 3: Prizm Context (RULES, PATTERNS to check against)
343
- > - Section 4: File Manifest (original file structure)
344
- > - '## Implementation Log': what Dev changed, key decisions, discoveries
345
- > 2. Run prizmkit-code-review (both phases): Phase 1 diagnostic review (spec compliance, code quality, correctness), then Phase 2 fix strategy formulation for any findings. Read ONLY files listed in Implementation Log for diagnosis; MAY read additional files for impact analysis.
346
- > 3. Run the full test suite using `{{TEST_CMD}}` — **ONLY if the Implementation Log does not already confirm all tests passing**. If Implementation Log states tests passed, trust it and skip the re-run. When running tests: `{{TEST_CMD}} 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep `/tmp/review-test-out.txt` for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all user stories from spec.md.
347
- > 4. Write structured '## Review Notes' to context-snapshot.md with Fix Instructions (Root Cause, Impact, Fix Strategy, Code Guidance, Verification for each finding) and Re-Review Expectations.
348
- > Report verdict: PASS, PASS_WITH_WARNINGS, or NEEDS_FIXES."
342
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md` for goals and acceptance criteria
343
+ > 2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` for architecture decisions and completed tasks
344
+ > 3. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for RULES, PATTERNS, TRAPS
345
+ > 4. Run /prizmkit-code-review with artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/: Phase 1 diagnostic review across all applicable dimensions, then Phase 2 fix strategy formulation for any findings. Read ONLY files referenced in completed plan.md tasks for diagnosis; MAY read additional files for impact analysis.
346
+ > 5. Run the full test suite using `{{TEST_CMD}}`. When running tests: `{{TEST_CMD}} 2>&1 | tee /tmp/review-test-out.txt | tail -20`, then grep `/tmp/review-test-out.txt` for details — do NOT re-run the suite multiple times. Write and execute integration tests covering all goals from spec.md.
347
+ > 6. review-report.md will be written to .prizmkit/specs/{{FEATURE_SLUG}}/ by prizmkit-code-review.
348
+ > Report: number of findings found, or 'no findings' if clean."
349
349
 
350
350
  Wait for Reviewer to return.
351
351
 
352
- **Gate Check — Review Notes**:
353
- After Reviewer agent returns, verify the Review Notes were written:
352
+ **Gate Check — Review Report**:
353
+ After Reviewer agent returns, verify the review report was written:
354
354
  ```bash
355
- grep -q "## Review Notes" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md && echo "GATE:PASS" || echo "GATE:MISSING"
355
+ grep -q "## Findings" .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md && echo "GATE:PASS" || echo "GATE:MISSING"
356
356
  ```
357
- If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '## Review Notes' section to context-snapshot.md with structured Fix Instructions. Include: verdict, findings with Root Cause/Impact/Fix Strategy/Code Guidance/Verification, and Re-Review Expectations."
357
+ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write review-report.md to .prizmkit/specs/{{FEATURE_SLUG}}/ with findings."
358
+
359
+ **Verdict decision** (L4 responsibility): Read review-report.md findings count. If findings exist → NEEDS_FIXES. If no findings → PASS.
358
360
 
359
361
  - If NEEDS_FIXES: spawn Dev to fix with this prompt:
360
- > "Read {{DEV_SUBAGENT_PATH}}. Fix NEEDS_FIXES issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
361
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — '## Review Notes' section contains structured Fix Instructions with exact steps.
362
- > 2. Follow Fix Instructions in order (respect Depends On / Blocks dependencies). Each FIX-N has: Root Cause, Fix Strategy, Code Guidance, and Verification criteria.
363
- > 3. After each fix, run the Verification command listed in that FIX-N to confirm it works.
362
+ > "Read {{DEV_SUBAGENT_PATH}}. Fix issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
363
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/review-report.md` — contains structured Fix Instructions with exact steps.
364
+ > 2. Follow Fix Instructions in order (respect Depends On / Blocks dependencies). Each finding has: Root Cause, Fix Strategy, Code Guidance, and Verification criteria.
365
+ > 3. After each fix, run the Verification command listed in that finding to confirm it works.
364
366
  > 4. Run `{{TEST_CMD}}` to verify no regressions.
365
- > 5. Append fix summary to '## Implementation Log' in context-snapshot.md.
366
- > 6. Do NOT execute any git commands."
367
+ > 5. Do NOT execute any git commands."
367
368
  Then re-run Review (max 3 rounds).
368
369
 
369
- **CP-3**: Integration tests pass, verdict is not NEEDS_FIXES.
370
+ **CP-3**: Integration tests pass, no unresolved findings.
370
371
 
371
372
  {{IF_BROWSER_INTERACTION}}
372
373
  ### Phase 5.5: Browser Verification (playwright-cli) — MANDATORY
@@ -412,7 +413,7 @@ You just implemented this feature — you know the project's tech stack and buil
412
413
  3. **Assess and record** — append to context-snapshot.md:
413
414
  - **ALL builds pass** → `## Deploy Verification: PASS` — proceed to commit
414
415
  - **Some builds fail with fixable errors** → fix and re-verify (already handled in step 2)
415
- - **Cannot build locally** (missing system-level deps you cannot install) → Generate `DEPLOY.md` with:
416
+ - **Cannot build locally** (missing system-level deps you cannot install) → Generate `.prizmkit/deploy.md` with:
416
417
  ```
417
418
  # Local Development Setup
418
419
 
@@ -428,7 +429,7 @@ You just implemented this feature — you know the project's tech stack and buil
428
429
  ## Verify
429
430
  [how to confirm the app is running correctly]
430
431
  ```
431
- Record: `## Deploy Verification: PARTIAL — see DEPLOY.md for missing prerequisites`
432
+ Record: `## Deploy Verification: PARTIAL — see .prizmkit/deploy.md for missing prerequisites`
432
433
 
433
434
  Deploy verification does NOT block the commit, but you MUST attempt it.
434
435
 
@@ -442,7 +443,12 @@ If the project cannot be started locally (e.g., requires external services, data
442
443
 
443
444
  ### Phase 6: Retrospective & Commit (SINGLE COMMIT) — DO NOT SKIP
444
445
 
445
- **For bug fixes**: run `/prizmkit-retrospective` for structural sync only (skip knowledge injection unless a new TRAPS was discovered). Use `fix(<scope>):` commit prefix.
446
+ **Bug Fix Documentation Policy**:
447
+ - DEFAULT: Run `/prizmkit-retrospective` with structural sync only (update file counts, interfaces, dependencies). Skip knowledge injection.
448
+ - UPDATE DOCS (run full retrospective — Job 1 + Job 2) when bug fix causes: interface signature changes, dependency additions/removals, observable behavior changes to existing features, or newly discovered TRAPs.
449
+ - Simple bugs: No new spec.md/plan.md needed. Use fast path.
450
+ - Complex bugs (multi-module, cascading): Use `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/<BUG_ID>/`.
451
+ - Commit prefix: `fix(<scope>):` (not `feat:`).
446
452
 
447
453
  **6a.** Check if feature already committed:
448
454
  ```bash
@@ -457,7 +463,7 @@ git log --oneline | grep "{{FEATURE_ID}}" | head -3
457
463
  - **L2 coverage check**: For any module/sub-module with source files created or significantly modified in this session but no L2 `.prizm` doc — evaluate whether L2 is warranted and create if so. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
458
464
  - Stage doc changes: `git add .prizm-docs/`
459
465
  ⚠️ Do NOT commit here. Only stage.
460
- - **For bug-fix sessions**: structural sync only, skip knowledge injection unless a genuinely new pitfall was discovered
466
+ - **For bug-fix sessions**: structural sync (Job 1) by default. Run knowledge injection (Job 2) when the fix causes interface signature changes, dependency additions/removals, observable behavior changes, or reveals new TRAPs
461
467
 
462
468
  **6c.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
463
469
  ```bash
@@ -479,6 +485,28 @@ Working tree MUST be clean after this step. If any feature-related files remain,
479
485
 
480
486
  **Exception**: `session-summary.md` in the artifact directory is a local cross-session artifact generated by `/prizmkit-committer` — it is NOT committed to git. Ignore it in the clean-tree check.
481
487
 
488
+ **6f.** Write completion summary for downstream dependency context:
489
+
490
+ Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
491
+
492
+ ```json
493
+ {
494
+ "completion_notes": [
495
+ "<each item: one key change, API, model, or integration point that downstream features may need>",
496
+ "Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
497
+ "Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
498
+ "Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
499
+ ]
500
+ }
501
+ ```
502
+
503
+ Rules for writing completion notes:
504
+ - Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
505
+ - Each note should be self-contained and concise (one line, under 120 characters preferred)
506
+ - Include 3-8 notes covering the most important changes
507
+ - Do NOT include test files, config changes, or internal implementation details unless they affect other features
508
+ - If this feature has no downstream dependents, still write the summary (it serves as documentation)
509
+
482
510
  ## Critical Paths
483
511
 
484
512
  | Resource | Path |
@@ -71,12 +71,11 @@
71
71
  "priority": {
72
72
  "type": "string",
73
73
  "enum": [
74
- "critical",
75
74
  "high",
76
75
  "medium",
77
76
  "low"
78
77
  ],
79
- "description": "Fix priority. Pipeline processes critical before high before medium before low; within same level, array order determines sequence."
78
+ "description": "Fix priority. Pipeline processes high before medium before low; within same level, array order determines sequence. Both critical and high severity map to high priority."
80
79
  },
81
80
  "error_source": {
82
81
  "type": "object",
@@ -120,11 +119,6 @@
120
119
  }
121
120
  }
122
121
  },
123
- "affected_feature": {
124
- "type": "string",
125
- "pattern": "^F-\\d{3}(-[A-Z])?$",
126
- "description": "Related original Feature ID (if any), for TRAPS cross-reference"
127
- },
128
122
  "affected_modules": {
129
123
  "type": "array",
130
124
  "items": {
@@ -171,16 +165,13 @@
171
165
  "type": "string",
172
166
  "enum": [
173
167
  "pending",
174
- "triaging",
175
- "reproducing",
176
- "fixing",
177
- "verifying",
168
+ "in_progress",
178
169
  "completed",
179
170
  "failed",
180
- "needs_info",
181
- "skipped"
171
+ "skipped",
172
+ "needs_info"
182
173
  ],
183
- "description": "Bug fix status, maps to pipeline phases"
174
+ "description": "Bug fix status. Subset of feature status enum plus needs_info."
184
175
  },
185
176
  "critic": {
186
177
  "type": "boolean",
@@ -18,12 +18,19 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
18
18
 
19
19
  **CRITICAL SESSION LIFECYCLE RULE**: You MUST NOT exit until ALL work is complete and session-status.json is written. When you spawn subagents, you MUST **wait for each to finish** (run_in_background=false) before proceeding. Do NOT spawn an agent in the background and exit — that kills the session.
20
20
 
21
+ **NON-INTERACTIVE MODE**: You are running in headless non-interactive mode. There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
22
+
21
23
  **MANDATORY TEAM REQUIREMENT**: You MUST use the `prizm-dev-team` agents (Dev + Reviewer). This is NON-NEGOTIABLE. All implementation and review work MUST be performed by the appropriate team agents (Dev, Reviewer). You are the orchestrator — handle coordination, planning, and commit phases directly.
22
24
 
23
- **BUG FIX DOCUMENTATION POLICY**: Bug fixes MUST NOT be recorded as new documentation entries:
24
- - Run `/prizmkit-retrospective` with structural sync only (Job 1) skip knowledge injection unless a genuinely new TRAP was discovered
25
- - Do NOT create spec/plan/tasks under `.prizmkit/specs/`
26
- - Do NOT update `.prizm-docs/` module docs for pure bug fixes (unless TRAPS update is needed)
25
+ **BUG FIX DOCUMENTATION POLICY**:
26
+ - **DEFAULT**: Run `/prizmkit-retrospective` with structural sync only (Job 1). Skip knowledge injection (Job 2).
27
+ - **UPDATE DOCS** (run full retrospective — Job 1 + Job 2) when the bug fix causes:
28
+ Interface signature changes
29
+ • Dependency additions/removals
30
+ • Observable behavior changes to existing features
31
+ • Newly discovered TRAPs (gotchas/pitfalls)
32
+ - **Simple bugs** (single file, clear root cause, ≤10 lines): Direct triage → fix → commit. No spec/plan needed. Artifacts: `fix-plan.md` + `fix-report.md` only.
33
+ - **Complex bugs** (cross-module, cascading, data model/API changes): Use `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/` → generates `spec.md` + `plan.md`. Then use `/prizmkit-implement` to execute the plan. Artifacts: `spec.md` + `plan.md` + `fix-report.md`.
27
34
  - Commit with `fix(<scope>):` prefix, NOT `feat:`
28
35
 
29
36
  ### Team Definition Reference
@@ -43,10 +50,6 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
43
50
 
44
51
  {{ACCEPTANCE_CRITERIA}}
45
52
 
46
- ### Affected Feature
47
-
48
- {{AFFECTED_FEATURE}}
49
-
50
53
  ### Environment
51
54
 
52
55
  {{ENVIRONMENT}}
@@ -60,12 +63,19 @@ You are the **bug fix session orchestrator**. Fix Bug {{BUG_ID}}: "{{BUG_TITLE}}
60
63
  **ALWAYS** use per-bug subdirectory `.prizmkit/bugfix/{{BUG_ID}}/`:
61
64
 
62
65
  ```
66
+ Simple bugs:
63
67
  .prizmkit/bugfix/{{BUG_ID}}/
64
68
  ├── fix-plan.md ← Phase 1 output (generated after triage)
65
69
  └── fix-report.md ← Phase 5 output (generated after commit)
70
+
71
+ Complex bugs (cross-module, data model/API changes):
72
+ .prizmkit/bugfix/{{BUG_ID}}/
73
+ ├── spec.md ← /prizmkit-plan output (goals, root cause, scope)
74
+ ├── plan.md ← /prizmkit-plan output (fix approach, tasks)
75
+ └── fix-report.md ← Phase 5 output (generated after commit)
66
76
  ```
67
77
 
68
- **IMPORTANT**: Only 2 artifact files per bug, NEVER more. This is a fixed convention.
78
+ **IMPORTANT**: Simple bugs produce 2 artifact files (fix-plan.md + fix-report.md). Complex bugs produce 3 artifact files (spec.md + plan.md + fix-report.md).
69
79
 
70
80
  ## Workflow Checkpoint System
71
81
 
@@ -189,18 +199,15 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
189
199
 
190
200
  - Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
191
201
  Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. For bug {{BUG_ID}}:
192
- 1. Run `/prizmkit-code-review` scoped to CHANGED FILES ONLY (both phases: diagnostic + fix strategy)
193
- 2. Review dimensions (adjusted for bug fix):
194
- - Fix correctness: Does it address the root cause?
195
- - Regression safety: Does it break existing behavior?
196
- - Code quality: Is the fix clean and maintainable?
197
- - Test coverage: Is the reproduction test adequate?
198
- 3. Run full test suite and verify ALL tests pass
199
- 4. If findings exist, produce Fix Instructions with Root Cause, Impact, Fix Strategy, Code Guidance, and Verification criteria
200
- 5. Report verdict: PASS / PASS_WITH_WARNINGS / NEEDS_FIXES
202
+ 1. Read `.prizmkit/bugfix/{{BUG_ID}}/fix-plan.md` for goals, root cause, and fix approach (always exists for both simple and complex bugs)
203
+ 2. Read `.prizmkit/bugfix/{{BUG_ID}}/plan.md` (if it exists, complex bugs only) for architecture decisions and completed tasks
204
+ 3. Run `/prizmkit-code-review` with artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/ scoped to CHANGED FILES ONLY (both phases: diagnostic + fix strategy)
205
+ 4. Run full test suite and verify ALL tests pass
206
+ 5. review-report.md will be written to .prizmkit/bugfix/{{BUG_ID}}/ by prizmkit-code-review
207
+ 6. Report: number of findings found, or 'no findings' if clean
201
208
  "
202
209
  - **Wait for Reviewer to return**
203
- - If NEEDS_FIXES: return to Phase 3 for refinement following Fix Instructions (max 2 review rounds)
210
+ - **Verdict decision** (L4 responsibility): If findings exist → return to Phase 3 for refinement (max 2 review rounds). If no findings → proceed.
204
211
  - **CP-BF-4**: Code review passes, all tests green
205
212
  - **Checkpoint update**: set step `prizmkit-code-review` to `"completed"` in `{{CHECKPOINT_PATH}}`
206
213
 
@@ -224,18 +231,21 @@ Reference `{{TEAM_CONFIG_PATH}}` for agent definitions:
224
231
  - Update the affected module's TRAPS section in `.prizm-docs/`
225
232
  - Format: `- TRAP: <description> | FIX: <solution> | DATE: YYYY-MM-DD`
226
233
 
227
- 2. Run `/prizmkit-committer` with:
234
+ 2. Run `/prizmkit-retrospective` following the BUG FIX DOCUMENTATION POLICY above:
235
+ - **DEFAULT**: Structural sync only (Job 1)
236
+ - **Full retrospective** (Job 1 + Job 2): Only if the fix changes interfaces, dependencies, observable behavior, or reveals new TRAPs
237
+
238
+ 3. Run `/prizmkit-committer` with:
228
239
  - Commit message: `fix({{FIX_SCOPE}}): {{BUG_TITLE}}`
229
240
  - Include both fix code and reproduction test
230
- - Do NOT run `/prizmkit-retrospective` with REGISTRY archiving
231
241
  - Do NOT push (user will push manually)
232
242
 
233
- 3. Write the complete fix report to `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md`
243
+ 4. Write the complete fix report to `.prizmkit/bugfix/{{BUG_ID}}/fix-report.md`
234
244
 
235
245
  The fix-report.md MUST contain these sections:
236
246
  - Bug Resolution Summary (ID, title, status, phases completed, duration)
237
247
  - What Was Fixed (changes made, diff summary, commit message)
238
- - Verification Results (reproduction test before/after, regression tests, review verdict)
248
+ - Verification Results (reproduction test before/after, regression tests, review findings)
239
249
  - Knowledge Captured (TRAPS updated, prevention recommendation)
240
250
  - Acceptance Criteria Verification (checklist with pass/fail for each criterion)
241
251
 
@@ -289,8 +299,9 @@ Write to: `{{SESSION_STATUS_PATH}}`
289
299
 
290
300
  - **MANDATORY**: Use `prizm-dev-team` agents — single-agent execution is FORBIDDEN
291
301
  - **Only 2 artifact files per bug**: fix-plan.md + fix-report.md — NEVER more
292
- - **Do NOT create** spec.md or plan.md for bug fixes
293
- - **Do NOT run** `/prizmkit-retrospective` knowledge injection for bugs (structural sync only, unless genuinely new TRAP discovered)
302
+ - **Simple bugs**: No spec/plan needed — artifacts are `fix-plan.md` + `fix-report.md` only
303
+ - **Complex bugs** (cross-module, data model/API changes): Use `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/` `spec.md` + `plan.md` + `fix-report.md`
304
+ - **DEFAULT**: Run `/prizmkit-retrospective` structural sync only (Job 1). Run full retrospective (Job 1 + Job 2) when fix changes interfaces, dependencies, observable behavior, or reveals new TRAPs
294
305
  - **Commit with** `fix(<scope>):` prefix, NOT `feat:`
295
306
  - **Update TRAPS** in `.prizm-docs/` only if a genuinely new pitfall was discovered
296
307
  - Dev agents use TDD approach: reproduction test goes from RED → GREEN
@@ -27,9 +27,6 @@
27
27
  "created_by": {
28
28
  "type": "string"
29
29
  },
30
- "source_spec": {
31
- "type": "string"
32
- },
33
30
  "features": {
34
31
  "type": "array",
35
32
  "minItems": 1,
@@ -47,15 +44,18 @@
47
44
  "properties": {
48
45
  "id": {
49
46
  "type": "string",
50
- "pattern": "^F-\\d{3}(-[A-Z])?$"
47
+ "pattern": "^F-\\d{3}(-[A-Z])?$",
48
+ "description": "Feature ID, format F-001, F-002... Optional sub-feature suffix: F-001-A"
51
49
  },
52
50
  "title": {
53
51
  "type": "string",
54
- "minLength": 1
52
+ "minLength": 1,
53
+ "description": "Feature title — brief description of the functionality"
55
54
  },
56
55
  "description": {
57
56
  "type": "string",
58
- "minLength": 1
57
+ "minLength": 1,
58
+ "description": "Detailed feature description: what it does, why it's needed"
59
59
  },
60
60
  "priority": {
61
61
  "type": "string",
@@ -73,21 +73,24 @@
73
73
  "low",
74
74
  "medium",
75
75
  "high"
76
- ]
76
+ ],
77
+ "description": "Estimated implementation complexity. Determines pipeline execution tier: low=lite, medium=standard, high=full."
77
78
  },
78
79
  "dependencies": {
79
80
  "type": "array",
80
81
  "items": {
81
82
  "type": "string",
82
83
  "pattern": "^F-\\d{3}(-[A-Z])?$"
83
- }
84
+ },
85
+ "description": "IDs of features that must be completed before this one"
84
86
  },
85
87
  "acceptance_criteria": {
86
88
  "type": "array",
87
89
  "minItems": 1,
88
90
  "items": {
89
91
  "type": "string"
90
- }
92
+ },
93
+ "description": "Conditions that must be met for the feature to be considered complete"
91
94
  },
92
95
  "status": {
93
96
  "type": "string",
@@ -99,7 +102,8 @@
99
102
  "skipped",
100
103
  "split",
101
104
  "auto_skipped"
102
- ]
105
+ ],
106
+ "description": "Feature status. Pipeline manages status transitions automatically."
103
107
  },
104
108
  "session_granularity": {
105
109
  "type": "string",
@@ -108,7 +112,8 @@
108
112
  "sub_feature",
109
113
  "auto"
110
114
  ],
111
- "default": "feature"
115
+ "default": "feature",
116
+ "description": "Session execution strategy: feature=one-session-per-feature, sub_feature=one-session-per-sub-feature, auto=pipeline-decides"
112
117
  },
113
118
  "sub_features": {
114
119
  "type": "array",
@@ -152,6 +157,13 @@
152
157
  3
153
158
  ]
154
159
  },
160
+ "completion_notes": {
161
+ "type": "array",
162
+ "items": {
163
+ "type": "string"
164
+ },
165
+ "description": "AI-generated summary of key changes from this feature session. Used to provide rich dependency context to downstream features. Each item is a concise statement about what was built/changed (e.g. APIs added, models created, key file paths)."
166
+ },
155
167
  "browser_interaction": {
156
168
  "type": "object",
157
169
  "description": "Browser verification config for features with UI. Requires playwright-cli. Pipeline uses this to verify UI behavior after implementation.",