prizmkit 1.0.138 → 1.0.140

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.0.138",
3
- "bundledAt": "2026-03-28T14:47:53.378Z",
4
- "bundledFrom": "cc919b1"
2
+ "frameworkVersion": "1.0.140",
3
+ "bundledAt": "2026-03-28T16:26:29.027Z",
4
+ "bundledFrom": "7a812fc"
5
5
  }
@@ -130,7 +130,7 @@ grep -q '^/binary-name$' .gitignore || echo '/binary-name' >> .gitignore
130
130
  ```
131
131
  Never commit compiled binaries, build output, or generated artifacts.
132
132
 
133
- **Before starting**: detect the test command and record baseline:
133
+ **3a.** Detect the test command and record baseline:
134
134
  ```bash
135
135
  # Try in order, use first that exits 0
136
136
  node --test tests/**/*.test.js 2>&1 | tail -3 # Node built-in
@@ -141,26 +141,22 @@ Record the working command as `TEST_CMD`. Then record baseline failures (if any)
141
141
  $TEST_CMD 2>&1 | tee /tmp/test-baseline.txt | tail -20
142
142
  ```
143
143
 
144
- For each task in plan.md Tasks section:
145
- 1. Read the relevant section from `context-snapshot.md` (no need to re-read individual files)
146
- 2. Write/edit the code
147
- 3. Run tests after each task: `$TEST_CMD 2>&1 | tee /tmp/test-out.txt | tail -20` then grep `/tmp/test-out.txt` for failure details; never re-run just to apply a different filter
148
- 4. Mark task `[x]` in plan.md Tasks section immediately
144
+ **3b.** Run `/prizmkit-implement` this handles the full implementation cycle:
145
+ - Reads plan.md Tasks section from `.prizmkit/specs/{{FEATURE_SLUG}}/`
146
+ - Reads context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest)
147
+ - Implements task-by-task with TDD, marking each `[x]` immediately
148
+ - Creates/updates L2 `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant L2 based on complexity and importance
149
+ - Runs tests using `TEST_CMD` after each task
150
+ - Writes '## Implementation Log' to `context-snapshot.md`
149
151
 
150
- After all tasks complete:
151
- 1. Run the full test suite to ensure nothing is broken
152
- 2. Verify each acceptance criterion from Section 1 of context-snapshot.md is met — check mentally, do NOT re-read files you already wrote
153
- 3. If any criterion is not met, fix it now (max 2 fix rounds)
152
+ **3c.** After implement completes, verify:
153
+ 1. All tasks in plan.md are `[x]`
154
+ 2. Run the full test suite to ensure nothing is broken
155
+ 3. Verify each acceptance criterion from Section 1 of context-snapshot.md is met — check mentally, do NOT re-read files you already wrote
156
+ 4. If any criterion is not met, fix it now (max 2 fix rounds)
154
157
 
155
158
  **CP-2**: All acceptance criteria met, all tests pass.
156
159
 
157
- After verification, append to `context-snapshot.md`:
158
- ```
159
- ## Implementation Log
160
- Files changed/created: [list]
161
- Key decisions: [list]
162
- ```
163
-
164
160
  {{IF_BROWSER_INTERACTION}}
165
161
  ### Phase 3.5: Browser Verification (playwright-cli)
166
162
 
@@ -188,7 +184,8 @@ If any step fails, log the failure and continue. Do NOT retry browser verificati
188
184
  **4a.** Run `/prizmkit-retrospective` — maintains `.prizm-docs/` (architecture index):
189
185
  1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizm-docs/` files
190
186
  2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizm-docs/`
191
- 3. Stage doc changes: `git add .prizm-docs/`
187
+ 3. **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.
188
+ 4. Stage doc changes: `git add .prizm-docs/`
192
189
  ⚠️ Do NOT commit here. Only stage.
193
190
 
194
191
  **4b.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
@@ -194,20 +194,13 @@ Wait for Critic to return.
194
194
  Spawn Dev subagent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
195
195
 
196
196
  Prompt:
197
- > "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}) using TDD.
198
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
199
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
200
- > **⚠️ DO NOT re-read source files that are already listed in Section 4 File Manifest.** Only read a source file directly if: (a) NOT in the manifest, (b) needing an implementation detail beyond the interface summary, or (c) needing a constant/enum/field-name value not captured in the interface column.
201
- > 2. Read `plan.md` (including Tasks section) from `.prizmkit/specs/{{FEATURE_SLUG}}/`.
202
- > 3. Implement task-by-task. Mark each `[x]` in plan.md Tasks section **immediately** after completion (do NOT batch).
203
- > 4. Use `TEST_CMD=<TEST_CMD>` to run tests — do NOT explore alternative test commands. **When tests fail: run `$TEST_CMD 2>&1 | tee /tmp/test-out.txt` ONCE, then grep `/tmp/test-out.txt` for failure details. Never re-run the full suite just to apply a different filter.**
204
- > 5. After ALL tasks done, append '## Implementation Log' to context-snapshot.md with:
205
- > - Files changed/created (with paths)
206
- > - Key implementation decisions and rationale
207
- > - Deviations from plan.md (if any)
208
- > - Notable discoveries (unexpected behavior, hidden dependencies, new TRAPS)
209
- > 6. Do NOT execute any git commands (no git add/commit/reset/push).
210
- > 7. If `<TEST_CMD>` shows failures, check against BASELINE_FAILURES=`<BASELINE_FAILURES>`. Failures present in the baseline are pre-existing — list them explicitly in your COMPLETION_SIGNAL.
197
+ > "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
198
+ > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
199
+ > ⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
200
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
201
+ > 2. Run `/prizmkit-implement` to execute the tasks in plan.md. Use `TEST_CMD=<TEST_CMD>` for testing. Baseline failures: `BASELINE_FAILURES=<BASELINE_FAILURES>`.
202
+ > 3. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
203
+ > 4. Do NOT execute any git commands (no git add/commit/reset/push).
211
204
  > Do NOT exit until all tasks are [x] and the '## Implementation Log' section is written in context-snapshot.md."
212
205
 
213
206
  Wait for Dev to return. All tasks must be `[x]`, tests pass.
@@ -302,7 +295,8 @@ If any step fails, log the failure and continue. Do NOT retry browser verificati
302
295
  **6a.** Run `/prizmkit-retrospective` — maintains `.prizm-docs/` (architecture index):
303
296
  1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizm-docs/` files
304
297
  2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizm-docs/`
305
- 3. Stage doc changes: `git add .prizm-docs/`
298
+ 3. **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.
299
+ 4. Stage doc changes: `git add .prizm-docs/`
306
300
  ⚠️ Do NOT commit here. Only stage.
307
301
 
308
302
  **6b.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
@@ -274,20 +274,13 @@ grep -c '^\- \[ \]' .prizmkit/specs/{{FEATURE_SLUG}}/plan.md 2>/dev/null || echo
274
274
  Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false).
275
275
 
276
276
  Prompt:
277
- > "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}) using TDD.
278
- > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST.
279
- > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
280
- > **⚠️ DO NOT re-read source files that are already listed in Section 4 File Manifest.** The manifest already contains their key interfaces. Only read a source file directly if: (a) it is NOT in the manifest, or (b) you need a specific implementation detail not captured in the manifest's interface column.
281
- > 2. Read `plan.md` (including Tasks section) from `.prizmkit/specs/{{FEATURE_SLUG}}/`.
282
- > 3. Implement task-by-task. Mark each `[x]` in plan.md Tasks section **immediately** after completion (do NOT batch).
283
- > 4. Use `TEST_CMD=<TEST_CMD>` to run tests — do NOT explore alternative test commands. **When tests fail: run `$TEST_CMD 2>&1 | tee /tmp/test-out.txt` ONCE, then grep `/tmp/test-out.txt` for failure details. Never re-run the full suite just to apply a different filter.**
284
- > 5. After ALL tasks done, append '## Implementation Log' to context-snapshot.md with:
285
- > - Files changed/created (with paths)
286
- > - Key implementation decisions and rationale
287
- > - Deviations from plan.md (if any)
288
- > - Notable discoveries (unexpected behavior, hidden dependencies, new TRAPS)
289
- > 6. Do NOT execute any git commands (no git add/commit/reset/push).
290
- > 7. If `<TEST_CMD>` shows failures, check against BASELINE_FAILURES=`<BASELINE_FAILURES>`. Failures present in the baseline are pre-existing — list them explicitly in your COMPLETION_SIGNAL.
277
+ > "Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
278
+ > **IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
279
+ > ⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
280
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
281
+ > 2. Run `/prizmkit-implement` to execute the tasks in plan.md. Use `TEST_CMD=<TEST_CMD>` for testing. Baseline failures: `BASELINE_FAILURES=<BASELINE_FAILURES>`.
282
+ > 3. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
283
+ > 4. Do NOT execute any git commands (no git add/commit/reset/push).
291
284
  > Do NOT exit until all tasks are [x] and the '## Implementation Log' section is written in context-snapshot.md."
292
285
 
293
286
  **Gate Check — Implementation Log**:
@@ -303,10 +296,8 @@ Wait for Dev to return. **If Dev times out before all tasks are `[x]`**:
303
296
  > "Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
304
297
  > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has File Manifest, 'Implementation Log' (if present) shows what was already done.
305
298
  > 2. Run `git diff HEAD` to see actual code changes already made.
306
- > 3. Read plan.md Tasks section — complete ONLY the remaining `[ ]` tasks. Do NOT redo completed `[x]` tasks.
307
- > 4. Use `TEST_CMD=<TEST_CMD>` to run tests.
308
- > 5. Append progress to '## Implementation Log' in context-snapshot.md.
309
- > 6. Do NOT execute any git commands."
299
+ > 3. Run `/prizmkit-implement` to complete the remaining `[ ]` tasks. Use `TEST_CMD=<TEST_CMD>` for testing.
300
+ > 4. Do NOT execute any git commands."
310
301
  3. Max 2 recovery retries. After 2 failures, orchestrator implements remaining tasks directly.
311
302
 
312
303
  All tasks `[x]`, tests pass.
@@ -412,6 +403,7 @@ git log --oneline | grep "{{FEATURE_ID}}" | head -3
412
403
  **6b.** Run `/prizmkit-retrospective` (**before commit**, maintains `.prizm-docs/` architecture index):
413
404
  - **Structural sync**: update KEY_FILES/INTERFACES/DEPENDENCIES/file counts for changed modules
414
405
  - **Architecture knowledge** (feature sessions only): extract TRAPS, RULES, DECISIONS from completed work into `.prizm-docs/`
406
+ - **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.
415
407
  - Stage doc changes: `git add .prizm-docs/`
416
408
  ⚠️ Do NOT commit here. Only stage.
417
409
  - **For bug-fix sessions**: structural sync only, skip knowledge injection unless a genuinely new pitfall was discovered
@@ -39,7 +39,10 @@ Execute implementation by following the task breakdown in plan.md. Respects task
39
39
  3. Check if checkpoint tasks are complete before proceeding to next phase
40
40
  4. For each unchecked task in order:
41
41
  a. If task has `[P]` marker, it can run in parallel with other `[P]` tasks in the same group
42
- b. Read L2 doc for target file's module (if exists) — TRAPS save you from repeating known mistakes
42
+ b. Read L2 doc for target file's module. TRAPS save you from repeating known mistakes.
43
+ - If L2 exists: check TRAPS and DECISIONS before modifying files.
44
+ - If L2 does not exist and this task creates a new module directory or adds significant source files: create L2 using the L2 GENERATION TEMPLATE (see PRIZM-SPEC). Seed KEY_FILES and DEPENDENCIES from the files being created. TRAPS and DECISIONS can be minimal initially — `/prizmkit-retrospective` will enrich them.
45
+ - Judgment call: not every directory needs L2. Create L2 when the module has meaningful logic, non-obvious coupling, or design decisions worth preserving. Skip for trivial wrapper directories or single-config modules.
43
46
  c. Apply TDD where applicable: write a failing test first, then implement until it passes. For UI components or configuration changes where unit tests don't apply, skip the test-first step.
44
47
  d. Mark task as `[x]` in `plan.md` Tasks section immediately — not batched at the end. Immediate marking means the plan always reflects true progress, even if the session is interrupted.
45
48
  e. After all tasks, append '## Implementation Log' to `context-snapshot.md` (if running in pipeline context): files changed/created, key decisions, notable discoveries.
@@ -36,7 +36,7 @@ Project takeover and bootstrap skill. Scans any project (brownfield or greenfiel
36
36
  MODE DETECTION:
37
37
  - If `.prizm-docs/` exists: Ask user if they want to reinitialize or update
38
38
  - **Reinitialize**: overwrites `.prizm-docs/` and `config.json` tech_stack (fresh start)
39
- - **Update**: re-scans tech stack and merges changes into existing `config.json` (see Step 3b merge strategy); updates `root.prizm` TECH_STACK if changed; preserves existing `.prizm-docs/` L1/L2 docs
39
+ - **Update**: re-scans tech stack and merges changes into existing `config.json` (see Step 3b merge strategy); updates `root.prizm` TECH_STACK if changed; preserves existing `.prizm-docs/` L1/L2 docs; checks for missing L1/L2 docs and creates them for modules with source files (see Update Supplement below)
40
40
  - If project has source code: brownfield mode
41
41
  - If project is nearly empty: greenfield mode
42
42
 
@@ -242,6 +242,14 @@ Saved: .prizmkit/config.json (tech_stack recorded)
242
242
  Next: Use /prizmkit-specify to start your first feature
243
243
  ```
244
244
 
245
+ UPDATE SUPPLEMENT (runs after tech stack merge in Update mode):
246
+
247
+ 1. **Module scan**: Re-scan project directories using the same TWO-TIER model from Step 1. Compare discovered modules against existing MODULE_INDEX in root.prizm.
248
+ 2. **Missing L1 check**: For any discovered module with no corresponding L1 `.prizm` doc → create L1 immediately and add to MODULE_INDEX.
249
+ 3. **Missing L2 check**: For any module/sub-module that has source files with meaningful logic but no L2 `.prizm` doc → create L2 using the L2 GENERATION TEMPLATE. Judgment call: skip trivial wrapper directories or single-config modules.
250
+ 4. **Stale L1 check**: For existing L1 docs, verify FILES count and KEY_FILES are still accurate. Update if source directory contents have changed significantly.
251
+ 5. **Report**: Include in the Update report: modules added, L1 docs created, L2 docs created, stale docs refreshed.
252
+
245
253
  **Re-init after PrizmKit upgrade (existing config preserved):**
246
254
  ```
247
255
  $ /prizmkit-init
@@ -255,6 +263,11 @@ Tech stack changes detected:
255
263
  = language: TypeScript (unchanged)
256
264
  = frontend: React (unchanged)
257
265
 
266
+ Documentation gap-fill:
267
+ + app/share/[token].prizm (L2) — created (3 source files, meaningful logic)
268
+ = routes.prizm (L1) — up to date
269
+ ~ models.prizm (L1) — FILES count updated (8 → 10)
270
+
258
271
  Merged into .prizmkit/config.json (2 fields updated, user overrides preserved)
259
272
  ```
260
273
 
@@ -71,12 +71,13 @@ Update .prizm-docs/ to reflect recent code changes.
71
71
  PRECONDITION: .prizm-docs/ exists with root.prizm.
72
72
 
73
73
  STEPS:
74
- 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.
74
+ 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.
75
75
  2. Map changed files to modules by matching against MODULE_INDEX in root.prizm. Group changes by module.
76
76
  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.
77
77
  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 counts, CROSS_CUTTING) only if structural change. No UPDATED timestamps — git tracks modification times.
78
78
  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.
79
- 6. If new directory qualifies as a module (per MODULE_DISCOVERY_CRITERIA) and matches no existing module: create L1 immediately, add to MODULE_INDEX, defer L2.
79
+ 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.
80
+ 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.
80
81
  7. Append entries to changelog.prizm using format: `- YYYY-MM-DD | <module-path> | <verb>: <description>`
81
82
  8. Enforce size limits: L0 > 4KB -> consolidate. L1 > 4KB -> trim KEY_FILES descriptions, ensure RULES <= 3 entries. L2 > 5KB -> split or archive.
82
83
  9. Stage updated .prizm files via `git add .prizm-docs/`
@@ -162,7 +163,7 @@ When working in a project with .prizm-docs/:
162
163
 
163
164
  - ON SESSION START: Always read .prizm-docs/root.prizm (L0). This is the project map.
164
165
  - ON TASK: Read L1 docs for relevant modules referenced in MODULE_INDEX.
165
- - ON FILE EDIT: Read L2 doc before modifying files. Check TRAPS and DECISIONS sections.
166
+ - ON FILE EDIT: Read L2 doc before modifying files. Check TRAPS and DECISIONS sections. If L2 does not exist and you are creating/modifying significant source files in this module → generate L2 using the L2 GENERATION TEMPLATE before proceeding.
166
167
  - ON DEEP READ: If you need deep understanding of a module without modifying it, generate L2 if it doesn't exist.
167
168
  - NEVER load all .prizm docs at once. Progressive loading saves tokens.
168
169
  - BUDGET: Typical task should consume 3000-5000 tokens of Prizm docs total.
@@ -59,14 +59,16 @@ git diff --name-status
59
59
 
60
60
  **1d.** Update affected docs (bottom-up: L2 → L1 → L0):
61
61
 
62
- - **L2** (if exists): Update KEY_FILES, INTERFACES, DATA_FLOW, DEPENDENCIES, CHANGELOG, TRAPS, DECISIONS
62
+ - **L2**: If L2 exists update KEY_FILES, INTERFACES, DATA_FLOW, DEPENDENCIES, CHANGELOG, TRAPS, DECISIONS. If L2 does NOT exist AND the module has Added or Modified source files in the current diff with meaningful logic (not trivial config) → create L2 using the L2 GENERATION TEMPLATE, then populate from source.
63
63
  - **L1**: Update FILES count, KEY_FILES (if major files added/removed), DEPENDENCIES (if module-level deps changed). **L1 does NOT contain INTERFACES, DATA_FLOW, TRAPS, or DECISIONS** — those belong in L2 only.
64
64
  - **L0 root.prizm**: Update MODULE_INDEX file counts only if counts changed. Update CROSS_CUTTING if cross-module concerns changed. Update only if structural change (module added/removed).
65
65
 
66
66
  **1d-migrate.** Legacy TRAPS format migration (opportunistic):
67
67
  While updating an affected L1/L2 doc, if you encounter TRAPS entries **without** a severity prefix (e.g., `- foo | FIX: bar` instead of `- [LOW] foo | FIX: bar`), prepend `[LOW]` as a conservative default. This clears legacy format debt incrementally — only in files already being touched, never as a bulk operation.
68
68
 
69
- **1e.** If new directory qualifies as a module (per MODULE_DISCOVERY_CRITERIA in PRIZM-SPEC Section 9.1 Step 2) and matches no existing module: create L1 doc immediately, add to MODULE_INDEX, defer L2.
69
+ **1e.** If new directory qualifies as a module (per MODULE_DISCOVERY_CRITERIA in PRIZM-SPEC Section 9.1 Step 2) and matches no existing module:
70
+ 1. Create L1 doc immediately, add to MODULE_INDEX.
71
+ 2. If the current diff includes Added or Modified source files with meaningful logic in this module → create L2 immediately using the L2 GENERATION TEMPLATE. Otherwise defer L2 to the next session that touches this module.
70
72
 
71
73
  **1f.** Enforce size limits:
72
74
  - L0 > 4KB → consolidate MODULE_INDEX
@@ -143,7 +145,7 @@ When writing TRAPS:
143
145
  **QUALITY GATE**: Every item must answer: "If a new AI session reads only `.prizm-docs/` and this entry, does it gain actionable understanding?" If not, discard. Do not record trivially observable code patterns — the AI can read the code directly.
144
146
 
145
147
  **2c.** Inject into the correct `.prizm-docs/` file:
146
- - Module-level TRAPS/RULES/DECISIONS → the affected **L2** `.prizm` file's corresponding section (TRAPS/DECISIONS/RULES belong in L2, not L1)
148
+ - Module-level TRAPS/RULES/DECISIONS → the affected **L2** `.prizm` file. If the target L2 does not exist, create it first using the L2 GENERATION TEMPLATE before injecting knowledge. (TRAPS/DECISIONS/RULES belong in L2, not L1.)
147
149
  - Project-level RULES/PATTERNS → `root.prizm`
148
150
  - Cross-module concerns spanning 2+ modules → `root.prizm` CROSS_CUTTING section
149
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.0.138",
3
+ "version": "1.0.140",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {