prizmkit 1.1.7 → 1.1.9

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 (132) 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/README.md +64 -64
  6. package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +535 -0
  7. package/bundled/dev-pipeline/assets/feature-list-example.json +0 -1
  8. package/bundled/dev-pipeline/launch-bugfix-daemon.sh +64 -18
  9. package/bundled/dev-pipeline/launch-feature-daemon.sh +15 -12
  10. package/bundled/dev-pipeline/launch-refactor-daemon.sh +64 -18
  11. package/bundled/dev-pipeline/lib/branch.sh +6 -1
  12. package/bundled/dev-pipeline/lib/common.sh +71 -0
  13. package/bundled/dev-pipeline/lib/heartbeat.sh +2 -2
  14. package/bundled/dev-pipeline/reset-bug.sh +10 -9
  15. package/bundled/dev-pipeline/reset-feature.sh +9 -8
  16. package/bundled/dev-pipeline/reset-refactor.sh +10 -9
  17. package/bundled/dev-pipeline/retry-bugfix.sh +67 -29
  18. package/bundled/dev-pipeline/retry-feature.sh +54 -18
  19. package/bundled/dev-pipeline/retry-refactor.sh +112 -29
  20. package/bundled/dev-pipeline/run-bugfix.sh +281 -59
  21. package/bundled/dev-pipeline/run-feature.sh +53 -18
  22. package/bundled/dev-pipeline/run-refactor.sh +392 -66
  23. package/bundled/dev-pipeline/scripts/check-session-status.py +24 -1
  24. package/bundled/dev-pipeline/scripts/cleanup-logs.py +2 -2
  25. package/bundled/dev-pipeline/scripts/detect-stuck.py +195 -85
  26. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +57 -33
  27. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +25 -9
  28. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +104 -17
  29. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -9
  30. package/bundled/dev-pipeline/scripts/init-pipeline.py +10 -10
  31. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +19 -8
  32. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +1 -5
  33. package/bundled/dev-pipeline/scripts/patch-completion-notes.py +191 -0
  34. package/bundled/dev-pipeline/scripts/update-bug-status.py +167 -22
  35. package/bundled/dev-pipeline/scripts/update-feature-status.py +104 -62
  36. package/bundled/dev-pipeline/scripts/update-refactor-status.py +351 -21
  37. package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +1 -1
  38. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +7 -11
  39. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +41 -7
  40. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +27 -3
  41. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +43 -19
  42. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +54 -26
  43. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +6 -15
  44. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +36 -25
  45. package/bundled/dev-pipeline/templates/feature-list-schema.json +109 -31
  46. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +270 -0
  47. package/bundled/dev-pipeline/templates/refactor-list-schema.json +11 -3
  48. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +3 -1
  49. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +1 -0
  50. package/bundled/dev-pipeline/templates/sections/feature-context.md +2 -0
  51. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +29 -2
  52. package/bundled/dev-pipeline/templates/sections/phase-commit.md +22 -0
  53. package/bundled/dev-pipeline/templates/sections/phase-deploy-verification.md +2 -2
  54. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +8 -6
  55. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -5
  56. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +3 -3
  57. package/bundled/skills/_metadata.json +5 -22
  58. package/bundled/skills/app-planner/SKILL.md +98 -72
  59. package/bundled/skills/app-planner/assets/app-design-guide.md +1 -1
  60. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -1
  61. package/bundled/skills/app-planner/references/project-brief-guide.md +69 -66
  62. package/bundled/skills/bug-fix-workflow/SKILL.md +52 -9
  63. package/bundled/skills/bug-planner/SKILL.md +139 -197
  64. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +43 -0
  65. package/bundled/skills/bug-planner/references/critic-and-verification.md +44 -0
  66. package/bundled/skills/bug-planner/references/error-recovery.md +73 -0
  67. package/bundled/skills/bug-planner/references/input-formats.md +53 -0
  68. package/bundled/skills/bug-planner/references/schema-validation.md +25 -0
  69. package/bundled/skills/bug-planner/references/severity-rules.md +16 -0
  70. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +4 -8
  71. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +34 -39
  72. package/bundled/skills/feature-pipeline-launcher/SKILL.md +49 -36
  73. package/bundled/skills/feature-pipeline-launcher/scripts/preflight-check.py +3 -3
  74. package/bundled/skills/feature-planner/SKILL.md +53 -142
  75. package/bundled/skills/feature-planner/assets/evaluation-guide.md +1 -1
  76. package/bundled/skills/feature-planner/assets/planning-guide.md +21 -5
  77. package/bundled/skills/feature-planner/references/browser-interaction.md +2 -4
  78. package/bundled/skills/feature-planner/references/completeness-review.md +57 -0
  79. package/bundled/skills/feature-planner/references/error-recovery.md +16 -35
  80. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +1 -1
  81. package/bundled/skills/feature-planner/references/new-project-planning.md +2 -2
  82. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +19 -20
  83. package/bundled/skills/feature-workflow/SKILL.md +24 -25
  84. package/bundled/skills/prizm-kit/SKILL.md +39 -49
  85. package/bundled/skills/prizmkit-code-review/SKILL.md +51 -64
  86. package/bundled/skills/prizmkit-code-review/rules/dimensions.md +85 -0
  87. package/bundled/skills/prizmkit-code-review/rules/fix-strategy.md +11 -11
  88. package/bundled/skills/prizmkit-committer/SKILL.md +3 -31
  89. package/bundled/skills/prizmkit-deploy/SKILL.md +34 -31
  90. package/bundled/skills/prizmkit-deploy/assets/deploy-template.md +1 -1
  91. package/bundled/skills/prizmkit-implement/SKILL.md +35 -68
  92. package/bundled/skills/prizmkit-init/SKILL.md +112 -65
  93. package/bundled/skills/prizmkit-init/assets/project-brief-template.md +82 -0
  94. package/bundled/skills/prizmkit-plan/SKILL.md +120 -79
  95. package/bundled/skills/prizmkit-plan/assets/plan-template.md +28 -18
  96. package/bundled/skills/prizmkit-plan/assets/spec-template.md +28 -11
  97. package/bundled/skills/prizmkit-plan/references/clarify-guide.md +3 -3
  98. package/bundled/skills/prizmkit-plan/references/verification-checklist.md +60 -0
  99. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +10 -81
  100. package/bundled/skills/prizmkit-prizm-docs/assets/{PRIZM-SPEC.md → prizm-docs-format.md} +41 -526
  101. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +46 -0
  102. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +16 -0
  103. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +14 -0
  104. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +19 -0
  105. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +17 -0
  106. package/bundled/skills/prizmkit-retrospective/SKILL.md +27 -65
  107. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -4
  108. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +7 -25
  109. package/bundled/skills/recovery-workflow/SKILL.md +22 -22
  110. package/bundled/skills/recovery-workflow/evals/evals.json +5 -5
  111. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +43 -10
  112. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +48 -40
  113. package/bundled/skills/refactor-planner/SKILL.md +43 -61
  114. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +17 -17
  115. package/bundled/skills/refactor-workflow/SKILL.md +23 -24
  116. package/bundled/team/prizm-dev-team.json +1 -1
  117. package/bundled/{skills/prizm-kit/assets → templates}/project-memory-template.md +1 -1
  118. package/package.json +1 -1
  119. package/src/clean.js +3 -4
  120. package/src/gitignore-template.js +7 -9
  121. package/src/scaffold.js +14 -5
  122. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-analyze.md +0 -5
  123. package/bundled/dev-pipeline/templates/sections/phase-analyze-agent.md +0 -19
  124. package/bundled/dev-pipeline/templates/sections/phase-analyze-full.md +0 -19
  125. package/bundled/skills/app-planner/references/project-conventions.md +0 -93
  126. package/bundled/skills/prizmkit-analyze/SKILL.md +0 -207
  127. package/bundled/skills/prizmkit-code-review/rules/dimensions-bugfix.md +0 -25
  128. package/bundled/skills/prizmkit-code-review/rules/dimensions-feature.md +0 -43
  129. package/bundled/skills/prizmkit-code-review/rules/dimensions-refactor.md +0 -25
  130. package/bundled/skills/prizmkit-implement/references/deploy-guide-protocol.md +0 -69
  131. package/bundled/skills/prizmkit-verify/SKILL.md +0 -281
  132. package/bundled/skills/prizmkit-verify/scripts/verify-light.py +0 -402
@@ -1,7 +1,7 @@
1
- # Implementation Plan: [FEATURE_TITLE]
1
+ # Plan: [TITLE]
2
2
 
3
- ## Architecture Approach
4
- [How this feature integrates with existing system architecture]
3
+ ## Change Approach
4
+ [Description of the technical approach — how these changes integrate with the existing system]
5
5
 
6
6
  ## Component Design
7
7
 
@@ -11,8 +11,17 @@
11
11
  ### Modified Components
12
12
  - [Component]: [What changes and why]
13
13
 
14
+ ## Behavior Preservation Strategy
15
+ <!-- Include when the task modifies existing behavior. Delete if not applicable (e.g., greenfield feature). -->
16
+ <!-- Strategy: one of test-gate / snapshot / manual -->
17
+ <!-- test-gate: all tests must pass after each task -->
18
+ <!-- snapshot: before-after comparison of outputs -->
19
+ <!-- manual: reviewer verification at checkpoints -->
20
+ - Strategy: [test-gate / snapshot / manual]
21
+ - Baseline: [describe green test suite or snapshot state]
22
+
14
23
  ## Data Model
15
- <!-- Skip this section if the feature does not involve database changes -->
24
+ <!-- Include when changes involve database / data persistence. Delete if not applicable. -->
16
25
  <!-- IMPORTANT: Read existing schema/model files BEFORE designing new tables -->
17
26
 
18
27
  ### Existing Schema Audit
@@ -57,8 +66,7 @@
57
66
  | [Risk] | [H/M/L] | [Plan] |
58
67
 
59
68
  ## Deployment Considerations
60
- <!-- Skip this section if the feature does not affect deployment (no new services, infra, or environment changes) -->
61
- <!-- Only fill when: new external service added, new database/cache introduced, new env vars required, or infra topology changes -->
69
+ <!-- Include when there is deployment impact (new services, infra, environment changes). Delete if not applicable. -->
62
70
 
63
71
  ### New Infrastructure Requirements
64
72
  - [Component]: [Deployment target from config deploy_strategy] — [any special config needed]
@@ -76,30 +84,32 @@
76
84
  - [ ] CI/CD pipeline update needed
77
85
 
78
86
  ## Pre-Implementation Gates
79
- - [ ] Spec coverage: all user stories mapped to components
80
- - [ ] Data model reviewed — existing schema conventions documented and followed
81
- - [ ] All Data Model `[NEEDS CLARIFICATION]` items resolved (mandatory for DB features)
82
- - [ ] API contracts defined
87
+ - [ ] Spec coverage: all goals mapped to components
88
+ - [ ] Data model reviewed — existing schema conventions documented and followed (if applicable)
89
+ - [ ] All `[NEEDS CLARIFICATION]` items resolved
83
90
  - [ ] Testing approach agreed
91
+ - [ ] Behavior preservation strategy defined (if modifying existing behavior)
92
+ - [ ] Root cause confirmed with reproduction test design (if fixing a defect)
84
93
 
85
94
  ## Tasks
86
95
 
87
96
  ### Strategy: [MVP-first | Incremental | Parallel]
88
97
 
89
98
  ### Phase: Setup
90
- - [ ] [T-001] Project scaffolding — file: [path]
99
+ - [ ] [T-001] [Description] — file: [path]
91
100
 
92
- ### Phase: Foundational
93
- - [ ] [T-010] [Data model / Schema changes] — file: [path]
101
+ ### Phase: Foundation
102
+ - [ ] [T-010] [Description] — file: [path]
94
103
 
95
- ### Phase: User Story 1 — [Title]
96
- - [ ] [T-100] [P] [US1] [Task description] file: [path]
104
+ ### Phase: Core
105
+ <!-- Organize by goals (G-1, G-2, ...) or by logical grouping appropriate to the task -->
106
+ - [ ] [T-100] [P] [G-1] [Task description] — file: [path]
97
107
 
98
108
  ### Phase: Polish
99
- - [ ] [T-900] Final integration test
109
+ - [ ] [T-900] Final verification
100
110
  - [ ] [T-901] Documentation update
101
111
 
102
112
  ### Checkpoints
103
113
  - [ ] [CP-1] After Setup: project builds and tests pass
104
- - [ ] [CP-2] After Foundational: data model verified
105
- - [ ] [CP-3] After each US: acceptance criteria pass
114
+ - [ ] [CP-2] After Foundation: base changes verified
115
+ - [ ] [CP-3] After each Core group: acceptance criteria pass
@@ -1,17 +1,19 @@
1
- # Feature: [FEATURE_TITLE]
1
+ # [TITLE]
2
2
 
3
3
  ## Overview
4
- [One paragraph describing the feature purpose and business value]
4
+ [One paragraph describing the purpose and motivation]
5
5
 
6
- ## User Stories
6
+ ## Goals
7
7
 
8
- ### US1: [Story Title]
9
- **As a** [role]
10
- **I want** [capability]
11
- **So that** [benefit]
8
+ ### G-1: [Goal Title]
9
+ [Goal description — use whatever format best suits the task:
10
+ - User Story format: "As a [role], I want [capability], so that [benefit]."
11
+ - Objective format: "Objective: [change to make]. Target state: [desired outcome]."
12
+ - Fix format: "Fix: [symptom]. Root cause: [brief cause]."
13
+ - Or any other clear format.]
12
14
 
13
15
  **Acceptance Criteria:**
14
- - [ ] Given [context], When [action], Then [expected result]
16
+ - [ ] [Criterion 1 Given/When/Then, or a concrete verifiable statement]
15
17
 
16
18
  ## Scope
17
19
 
@@ -21,14 +23,27 @@
21
23
  ### Out of Scope
22
24
  - [Item 1]
23
25
 
26
+ ## Behavior Preservation
27
+ <!-- Include this section when the task modifies existing behavior (refactoring, bug fixes, migrations, etc.). Delete if not applicable. -->
28
+ - [What behavior / contracts / interfaces must remain unchanged]
29
+ - [Existing test suites that must continue to pass]
30
+
31
+ ## Root Cause
32
+ <!-- Include this section when the task is fixing a defect. Delete if not applicable. -->
33
+ - Error classification: [Runtime / Network / Auth / Data / Logic / Config / External]
34
+ - Root cause: [specific code location and mechanism]
35
+ - Affected files: [file list with line numbers]
36
+ - Impact: [blast radius — which modules / features are affected]
37
+
24
38
  ## Dependencies
25
39
  - [Dependency 1]: [Why needed]
26
40
 
27
- ## Data Model (if feature involves database changes)
41
+ ## Data Model
42
+ <!-- Include this section when changes involve database / data persistence. Delete if not applicable. -->
28
43
 
29
44
  ### Existing Schema Reference
30
45
  <!-- Read existing schema/model files BEFORE designing new tables. Document observed conventions here. -->
31
- - Tables reviewed: [list existing tables related to this feature]
46
+ - Tables reviewed: [list existing tables related to this change]
32
47
  - Naming convention: [snake_case/camelCase — match existing]
33
48
  - ID strategy: [UUID/auto-increment — match existing]
34
49
  - Timestamp pattern: [created_at/updated_at — match existing]
@@ -50,7 +65,9 @@
50
65
  [NEEDS CLARIFICATION]: [Ambiguous item]
51
66
 
52
67
  ## Review Checklist
53
- - [ ] All user stories have acceptance criteria
68
+ - [ ] All goals have acceptance criteria
54
69
  - [ ] Scope boundaries are clearly defined
55
70
  - [ ] Dependencies are identified
56
71
  - [ ] No implementation details (WHAT not HOW)
72
+ - [ ] Behavior preservation defined (if modifying existing behavior)
73
+ - [ ] Root cause identified with evidence (if fixing a defect)
@@ -9,7 +9,7 @@ Invoked automatically during `/prizmkit-plan` Phase 0 (specify) when `[NEEDS CLA
9
9
  **Ask one question at a time.** Batching questions produces lower-quality answers.
10
10
 
11
11
  For each question:
12
- 1. Cite the exact location in spec.md (e.g., "§3.2 says...")
12
+ 1. Cite the exact location in spec.md (e.g., "§Goals G-1 says..." or "§Scope says...")
13
13
  2. State what is ambiguous and why it matters for implementation
14
14
  3. Provide a **recommended answer** with rationale — gives the user a concrete starting point to accept, modify, or reject
15
15
 
@@ -45,7 +45,7 @@ If the user says "done", "stop", or "enough" — end immediately and output a su
45
45
  ## Example Exchange
46
46
 
47
47
  **Question:**
48
- > §3.2 says "User can upload files" but doesn't specify file types or size limits.
48
+ > §Goals G-1 says "User can upload files" but doesn't specify file types or size limits.
49
49
  >
50
50
  > **Recommended:** Accept JPEG, PNG, PDF up to 10MB — covers common use cases without straining storage.
51
51
  >
@@ -53,7 +53,7 @@ If the user says "done", "stop", or "enough" — end immediately and output a su
53
53
 
54
54
  **User:** "Also allow SVG, make it 25MB"
55
55
 
56
- **Action:** Update spec.md §3.2 → `File upload: JPEG, PNG, PDF, SVG. Max 25MB per file.` Remove marker.
56
+ **Action:** Update spec.md §Goals G-1 → `File upload: JPEG, PNG, PDF, SVG. Max 25MB per file.` Remove marker.
57
57
 
58
58
  **Follow-up question triggered by answer:**
59
59
  > SVGs can contain embedded scripts (XSS risk). Should uploaded SVGs be sanitized (strip `<script>` + event handlers), or restricted to trusted users only?
@@ -0,0 +1,60 @@
1
+ # Verification Checklist — Spec & Plan Consistency
2
+
3
+ Run this checklist after generating the Tasks section in plan.md. Fix any issues inline before outputting the final plan.
4
+
5
+ ---
6
+
7
+ ## Coverage
8
+
9
+ - [ ] Every goal (G-N) in spec.md has at least one task in plan.md
10
+ - [ ] Every task has a target file path (`— file: path/to/file`)
11
+ - [ ] Risk assessment contains at least one risk with a mitigation plan
12
+ - [ ] If spec includes `## Behavior Preservation` → at least one verification task exists
13
+ - [ ] If spec includes `## Root Cause` → at least one reproduction test task exists
14
+
15
+ ## Duplication Detection
16
+
17
+ - [ ] No near-duplicate requirements exist across spec.md sections (same intent, different wording)
18
+ - [ ] If duplicates found, consolidate to the clearer phrasing and remove the other
19
+
20
+ ## Orphan Detection
21
+
22
+ - [ ] No task exists without a mapped goal (orphan task)
23
+ - [ ] No plan component exists without a corresponding spec requirement
24
+
25
+ ## Ambiguity Scan
26
+
27
+ - [ ] No unresolved `[NEEDS CLARIFICATION]`, TBD, TODO, or `???` markers remain
28
+ - [ ] No vague criteria without measurable thresholds (e.g., "fast", "secure", "scalable", "intuitive" — replace with concrete numbers or conditions)
29
+
30
+ ## Terminology Consistency
31
+
32
+ - [ ] Same concept uses the same name in both spec.md and plan.md (no terminology drift)
33
+ - [ ] Data entities referenced in plan.md exist in spec.md (and vice versa)
34
+
35
+ ## Task Ordering
36
+
37
+ - [ ] No task references the output of a later task without an explicit dependency note
38
+ - [ ] Foundation tasks precede Core tasks that depend on them
39
+ - [ ] Checkpoint tasks exist between phases
40
+
41
+ ## Rules Alignment
42
+
43
+ - [ ] No spec or plan element conflicts with `.prizm-docs/root.prizm` RULES MUST/NEVER directives
44
+ - [ ] Tech stack choices in plan.md match `.prizm-docs/root.prizm` TECH_STACK (if defined)
45
+
46
+ ## Database Design (skip if no Data Model section)
47
+
48
+ - [ ] New entity/field naming follows conventions documented in "Existing Schema Audit"
49
+ - [ ] All fields have explicit nullability (NOT NULL or nullable)
50
+ - [ ] Foreign key constraints and indexes are defined
51
+ - [ ] ID strategy and timestamp patterns match existing tables
52
+ - [ ] No unresolved questions remain in Data Model "Unresolved Questions" section
53
+ - [ ] Style Conformance Checklist in plan.md is fully checked
54
+
55
+ ## Action on Failure
56
+
57
+ If any check fails:
58
+ 1. Fix the issue directly in spec.md or plan.md
59
+ 2. Re-run the failed checks only
60
+ 3. Do not proceed to output until all checks pass
@@ -5,7 +5,7 @@ description: "Project documentation specification and standard for AI-optimized
5
5
 
6
6
  # Prizm Docs - AI Documentation Framework
7
7
 
8
- Full specification: ${SKILL_DIR}/assets/PRIZM-SPEC.md
8
+ Full specification: ${SKILL_DIR}/assets/prizm-docs-format.md
9
9
 
10
10
  ## Intent Routing
11
11
 
@@ -39,113 +39,42 @@ This skill handles 6 operations. When invoked, determine the user's intent and e
39
39
  ## Operation: Init
40
40
 
41
41
  Bootstrap .prizm-docs/ for the current project.
42
-
43
42
  PRECONDITION: No .prizm-docs/ directory exists, or user confirms overwrite.
44
-
45
- STEPS:
46
- 1. Detect project type by scanning for build system files (go.mod, package.json, requirements.txt, Cargo.toml, pom.xml, *.csproj). Identify primary language, framework, build command, test command, and entry points.
47
- 2. Discover modules using semantic MODULE_DISCOVERY_CRITERIA (see PRIZM-SPEC Section 9.1 Step 2):
48
- - A directory qualifies as a module if it contains source files forming a logical unit, contains entry/config/interface files, contains qualifying sub-modules, or is referenced by multiple modules as a dependency.
49
- - TOP-LEVEL modules: directories directly under project root (or under src/ for src-based layouts) that qualify.
50
- - SUB-MODULES: directories INSIDE a top-level module that qualify. Listed in the parent L1 doc's SUBDIRS section.
51
- - HIERARCHY RULE: directory X inside top-level module M maps to .prizm-docs/<M>/<X>.prizm, never to .prizm-docs/<X>.prizm.
52
- - Exclude .git/, node_modules/, vendor/, build/, dist/, __pycache__/, target/, bin/, .claude/, .codebuddy/, .prizmkit/, .prizm-docs/, dev-pipeline/. If total module count > 30, ask user for include/exclude patterns.
53
- 3. Create .prizm-docs/ directory structure mirroring the source tree exactly. For each top-level module M that has sub-modules, create the subdirectory .prizm-docs/<M>/.
54
- 4. Generate root.prizm (L0) with PROJECT, LANG, FRAMEWORK, BUILD, TEST, ENTRY, MODULE_INDEX with multi-level entries as needed for efficient navigation (constrained by 4KB limit), RULES extracted from CODEBUDDY.md/CLAUDE.md/README/linter configs, PATTERNS, and CROSS_CUTTING (cross-module concerns spanning 2+ modules). Set PRIZM_VERSION: 4. Max 4KB. No UPDATED timestamp — git tracks modification times.
55
- - If module count > 15: use MODULE_GROUPS format instead of MODULE_INDEX — group modules by functional domain (3-8 domains, inferred from directory structure and module responsibilities). See PRIZM-SPEC for MODULE_GROUPS format.
56
- - For each module entry, auto-generate 3-6 keyword tags by scanning the module's key source files for: exported function/class names, imported library names, domain-specific terms in file/directory names. Add tags in square brackets after the module name (e.g., `- auth [login, session, jwt]: ...`). Tags are optional but recommended for projects with 10+ modules.
57
- 5. Generate L1 .prizm files (structural index only) for ALL modules, each at its correct mirrored path:
58
- - Top-level module M → write .prizm-docs/<M>.prizm (include SUBDIRS section with pointers to sub-module docs)
59
- - Sub-module S inside M → write .prizm-docs/<M>/<S>.prizm
60
- Each L1 includes MODULE (full relative path), FILES count, RESPONSIBILITY, SUBDIRS with pointers, KEY_FILES (5-10 most important), DEPENDENCIES (imports, imported-by, external), RULES (1-3 most critical only). L1 does NOT include INTERFACES, DATA_FLOW, TRAPS, or DECISIONS (those are L2, generated lazily). Max 4KB each.
61
- 6. Skip L2 docs during init — L2 is created lazily on first file modification or when AI needs deep understanding (ON_DEEP_READ trigger). L2 contains behavioral detail: INTERFACES, DATA_FLOW, TRAPS, DECISIONS, full RULES, domain-specific sections.
62
- 7. Create changelog.prizm with initial entry: `- YYYY-MM-DD | root | add: initialized prizm documentation framework`
63
- 8. Configure UserPromptSubmit hook in platform settings per ${SKILL_DIR}/assets/PRIZM-SPEC.md Section 11.
64
- 9. Validate all generated docs: size limits (L0 <= 4KB, L1 <= 4KB), pointer resolution (every -> reference resolves), no circular dependencies, KEY: value format compliance, no anti-patterns (prose, code blocks, markdown headers), L1 does not contain INTERFACES/DATA_FLOW/TRAPS/DECISIONS, no UPDATED timestamps (git is authority).
65
- 10. Report summary: modules discovered, L1 docs generated, files excluded, warnings.
66
-
67
- OUTPUT: List of generated files, module count, and validation results.
43
+ → Read `${SKILL_DIR}/references/op-init.md` for detailed steps.
68
44
 
69
45
  ## Operation: Update
70
46
 
71
47
  Update .prizm-docs/ to reflect recent code changes.
72
-
73
48
  PRECONDITION: .prizm-docs/ exists with root.prizm.
74
-
75
- STEPS:
76
- 1. Get changed files via `git diff --cached --name-status`. If nothing staged, use `git diff --name-status`. If no git changes at all, do full rescan comparing code against existing docs — this includes checking for modules that have source files but no L2 doc.
77
- 2. Map changed files to modules by matching against MODULE_INDEX or MODULE_GROUPS in root.prizm. Group changes by module.
78
- 3. Classify each change: A (added) -> new KEY_FILES entries. D (deleted) -> remove entries, update counts. M (modified) -> check dependency changes. R (renamed) -> update all path references.
79
- 4. Update affected docs: L2 first (KEY_FILES, INTERFACES, DATA_FLOW, DEPENDENCIES, TRAPS, CHANGELOG), then L1 (FILES count, KEY_FILES, DEPENDENCIES — L1 does NOT contain INTERFACES/DATA_FLOW/TRAPS/DECISIONS), then L0 (MODULE_INDEX or MODULE_GROUPS counts, CROSS_CUTTING) only if structural change. No UPDATED timestamps — git tracks modification times.
80
- 5. Skip updates if: only internal implementation changed (no interface/dependency change), only comments/whitespace/formatting, only .prizm files changed. DO NOT skip test file changes or bug fixes — they may reveal TRAPS worth capturing in L2.
81
- 6. If new directory qualifies as a module (per MODULE_DISCOVERY_CRITERIA) and matches no existing module: create L1 immediately, add to MODULE_INDEX. If the current diff includes Added or Modified source files in this module → also create L2 immediately using the L2 GENERATION TEMPLATE. Otherwise defer L2.
82
- 6a. **L2 gap check** (runs during full rescan mode only — when no git changes detected): For each existing module in MODULE_INDEX, check if L2 doc exists. If L2 is missing and the module has source files with meaningful logic (not trivial config/wrapper) → create L2 using the L2 GENERATION TEMPLATE. This ensures Update fills documentation gaps left by previous sessions.
83
- 7. Append entries to changelog.prizm using format: `- YYYY-MM-DD | <module-path> | <verb>: <description>`
84
- 8. Enforce size limits: L0 > 4KB -> consolidate. L1 > 4KB -> trim KEY_FILES descriptions, ensure RULES <= 3 entries. L2 > 5KB -> split or archive.
85
- 9. Stage updated .prizm files via `git add .prizm-docs/`
86
-
87
- OUTPUT: List of updated/created/skipped docs with reasons.
49
+ → Read `${SKILL_DIR}/references/op-update.md` for detailed steps.
88
50
 
89
51
  ## Operation: Status
90
52
 
91
53
  Check freshness of all .prizm docs.
92
-
93
54
  PRECONDITION: .prizm-docs/ exists with root.prizm.
94
-
95
- STEPS:
96
- 1. Get last git modification time of root.prizm via `git log -1 --format="%ai" -- .prizm-docs/root.prizm`.
97
- 2. Count commits since that time via `git log --since="<timestamp>" --oneline | wc -l`.
98
- 3. For each L1/L2 doc, compare git modification time of the .prizm file (`git log -1 --format="%ai" -- <prizm-file>`) against latest git modification of source files in that module (`git log -1 --format="%ai" -- <module-path>/`).
99
- 4. Classify each doc as: FRESH (prizm file updated after latest source change), STALE (source changed more recently than prizm file), MISSING (module exists but no .prizm doc).
100
- 5. Flag any docs exceeding size limits.
101
-
102
- OUTPUT: Freshness report table with columns: DOC_PATH | LEVEL | STATUS | PRIZM_LAST_MOD | SOURCE_LAST_MOD.
55
+ → Read `${SKILL_DIR}/references/op-status.md` for detailed steps.
103
56
 
104
57
  ## Operation: Rebuild
105
58
 
106
59
  Regenerate docs for a specific module from scratch. Requires a module path argument.
107
-
108
60
  PRECONDITION: .prizm-docs/ exists. Module path is valid.
109
-
110
- STEPS:
111
- 1. Delete existing L1 and all L2 docs for the specified module.
112
- 2. Re-scan the module directory for files, interfaces, dependencies, subdirectories.
113
- 3. Generate fresh L1 doc with full module analysis.
114
- 4. Generate L2 docs for all sub-modules immediately (unlike init, rebuild generates L2 right away to capture current state).
115
- 5. Update MODULE_INDEX (or MODULE_GROUPS) in root.prizm with new file counts and pointers. Re-evaluate grouping: if total module count > 15 and currently using MODULE_INDEX, convert to MODULE_GROUPS. Regenerate keyword tags for rebuilt modules.
116
- 6. Append rebuild entry to changelog.prizm: `- YYYY-MM-DD | <module-path> | refactor: rebuilt module documentation from scratch`
117
- 7. Validate regenerated docs against size limits and format rules.
118
-
119
- OUTPUT: Regenerated doc summary with before/after comparison.
61
+ → Read `${SKILL_DIR}/references/op-rebuild.md` for detailed steps.
120
62
 
121
63
  ## Operation: Validate
122
64
 
123
65
  Check format compliance and consistency of all .prizm docs.
124
-
125
66
  PRECONDITION: .prizm-docs/ exists.
126
-
127
- STEPS:
128
- 1. FORMAT CHECK: Verify all .prizm files use KEY: value format. Flag any prose paragraphs, code blocks (```), markdown headers (##), emoji, ASCII art, or horizontal rules. Flag TRAPS entries missing severity prefix ([CRITICAL], [HIGH], or [LOW]). Note: [REVIEW] preceding severity (e.g., `[REVIEW][HIGH]`) is a valid temporary staleness marker, not a format violation.
129
- 2. SIZE CHECK: Verify size limits: L0 <= 4KB, L1 <= 4KB, L2 <= 5KB. Report files exceeding limits with current size.
130
- 3. POINTER CHECK: Verify all arrow (->) references resolve to existing .prizm files. Report broken pointers.
131
- 4. STALENESS CHECK: Compare git modification time of each .prizm file against source directory. Flag docs where source was modified more recently.
132
- 5. COMPLETENESS CHECK: Verify root.prizm has all required fields (PRIZM_VERSION, PROJECT, LANG, MODULE_INDEX or MODULE_GROUPS). Verify L1 docs have MODULE, FILES, RESPONSIBILITY, DEPENDENCIES (no INTERFACES/TRAPS/DECISIONS). Verify L2 docs have MODULE, FILES, KEY_FILES, DEPENDENCIES, INTERFACES, TRAPS.
133
- 6. ANTI-PATTERN CHECK: Flag duplicate information across levels, implementation details in L0/L1, TODO items, session-specific context.
134
- 7. RULES HIERARCHY CHECK: Verify L1/L2 RULES do not contradict root.prizm RULES. L1/L2 may only supplement with module-specific exceptions.
135
- 8. TRAPS STALENESS CHECK: For each L2 doc where TRAPS section has more than 8 entries, verify that TRAPS include staleness metadata (`STALE_IF:` or `REF:` fields). Flag TRAPS without any staleness metadata as `NEEDS_METADATA` — these are not auto-removed, but flagged for the next `/prizmkit-retrospective` to enrich with `STALE_IF:` globs or `REF:` hashes.
136
-
137
- OUTPUT: Validation report with PASS/FAIL per check, list of issues with file paths and suggested fixes.
67
+ → Read `${SKILL_DIR}/references/op-validate.md` for detailed steps.
138
68
 
139
69
  ## Operation: Migrate
140
70
 
141
71
  Convert existing documentation to .prizm-docs/ format.
142
-
143
- PRECONDITION: Existing docs/ or docs/AI_CONTEXT/ directory with documentation files. No .prizm-docs/ directory (or user confirms overwrite).
72
+ PRECONDITION: Existing docs/ or docs/AI_CONTEXT/ directory. No .prizm-docs/ (or user confirms overwrite).
144
73
 
145
74
  STEPS:
146
75
  1. DISCOVER existing docs: Scan docs/, docs/AI_CONTEXT/, README.md, ARCHITECTURE.md, and any structured documentation files.
147
76
  2. EXTRACT information from existing docs: project metadata, module descriptions, architecture patterns, rules, decisions, dependencies.
148
- 3. MAP existing doc content to Prizm levels: project-wide info -> L0 root.prizm, module-level info -> L1 docs, detailed module info -> L2 docs.
77
+ 3. MAP existing doc content to Prizm levels: project-wide info -> L0 root.prizm, module-level info -> L1 docs (MODULE, FILES, RESPONSIBILITY, KEY_FILES, DEPENDENCIES), detailed module info -> L2 docs (INTERFACES, DATA_FLOW, TRAPS, DECISIONS, domain-specific sections).
149
78
  4. CONVERT prose content to KEY: value format. Strip markdown formatting, tables, diagrams. Condense explanatory text into single-line values.
150
79
  5. GENERATE .prizm-docs/ structure following standard init procedure but seeded with extracted information instead of scanning source code alone.
151
80
  6. VALIDATE migrated docs against Prizm format rules and size limits.
@@ -161,7 +90,7 @@ OUTPUT: Migration report with list of source docs processed, generated .prizm fi
161
90
  - **No git history available**: Fall back to filesystem timestamps for freshness checks; warn user that accuracy may be reduced.
162
91
 
163
92
  ### Key Protocols (reference)
164
- For detailed protocol specifications, see PRIZM-SPEC:
93
+ For detailed protocol specifications, see prizm-docs-format.md:
165
94
  - Progressive Loading: Section 6.1
166
95
  - Auto-Update: Section 7.1
167
96
  - RULES hierarchy: Section 3.1
@@ -184,5 +113,5 @@ Changed: src/routes/avatar.ts (A), src/models/user.ts (M)
184
113
  Updated: .prizm-docs/routes.prizm — added avatar.ts to KEY_FILES, new POST /api/avatar interface
185
114
  Updated: .prizm-docs/models.prizm — updated User interface with avatar_url field
186
115
  Skipped: .prizm-docs/services.prizm — no changes in services module
187
- Appended: changelog.prizm — "2026-03-18 | routes | add: avatar upload endpoint"
116
+ Appended: changelog.prizm — "routes | add: avatar upload endpoint"
188
117
  ```