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
@@ -10,22 +10,18 @@ LICENSE: MIT
10
10
 
11
11
  ## Table of Contents
12
12
 
13
- 1. Overview (L32–49)
14
- 2. Architecture (L50–127)
15
- 3. Document Format Specification (L128–308)
16
- 4. Format Conventions (L309–321)
17
- 5. Path Mapping Rules (L322–351)
18
- 6. Progressive Loading Protocol (L352–411)
19
- 7. Auto-Update Protocol (L412–491)
20
- 8. Anti-Patterns (L492–511)
21
- 9. Initialization Procedure (L512–646)
22
- 10. Skill Definition (L647–768)
23
- 11. Hook Configuration (L769–823)
24
- 12. Language-Specific Initialization Hints (L824–857)
25
- 13. Minimal Viable Prizm (L858–875)
26
- 14. Version History (L876–920)
27
- 15. Conflict Resolution (L921–978)
28
- 16. Version Migration (L979–1087)
13
+ 1. Overview
14
+ 2. Architecture
15
+ 3. Document Format Specification
16
+ 4. Format Conventions
17
+ 5. Path Mapping Rules
18
+ 6. Progressive Loading Protocol
19
+ 7. Auto-Update Protocol
20
+ 8. Anti-Patterns
21
+ 9. Initialization Procedure
22
+ 10. Skill Definition
23
+ 11. Hook Configuration
24
+ 12. Language-Specific Initialization Hints
29
25
 
30
26
  ---
31
27
 
@@ -448,68 +444,9 @@ GOAL: Keep prizm docs synchronized with source code
448
444
 
449
445
  ## 7.2 Update Decision Logic
450
446
 
451
- ALGORITHM: prizm_update
452
-
453
- 1. GET_CHANGES:
454
- Run: git diff --cached --name-status
455
- If nothing staged: Run: git diff --name-status
456
- Result: List of (status, file_path) pairs
457
-
458
- 2. MAP_TO_MODULES:
459
- FOR EACH changed file:
460
- Find its module by matching against MODULE_INDEX in root.prizm
461
- Group changes by module
462
-
463
- 3. CLASSIFY_CHANGES:
464
- FOR EACH changed file:
465
- A (added): May need new entries in KEY_FILES, INTERFACES
466
- D (deleted): Remove from KEY_FILES, update FILES count
467
- M (modified): Check if public interfaces or dependencies changed
468
- R (renamed): Update all path references in affected docs
469
-
470
- 4. UPDATE_DOCS:
471
- FOR EACH affected module:
472
- a. IF L2 doc exists for this module:
473
- UPDATE: KEY_FILES (add/remove/modify)
474
- UPDATE: INTERFACES (if signatures changed)
475
- UPDATE: DATA_FLOW (if data flow changed)
476
- UPDATE: DEPENDENCIES (if imports changed)
477
- UPDATE: TRAPS (if new pitfalls discovered)
478
- APPEND: CHANGELOG entry
479
- b. IF L1 doc exists:
480
- UPDATE: FILES count
481
- UPDATE: KEY_FILES (if major files added/removed)
482
- UPDATE: DEPENDENCIES (if module-level deps changed)
483
- (NOTE: L1 does NOT contain INTERFACES/DATA_FLOW/TRAPS/DECISIONS — those are in L2 only)
484
- c. UPDATE root.prizm (L0):
485
- UPDATE: MODULE_INDEX file counts
486
- UPDATE: CROSS_CUTTING (if cross-module concerns changed)
487
- ONLY IF: module added, removed, or project-wide structural change
488
-
489
- 5. SKIP_CONDITIONS:
490
- SKIP if: Only internal implementation changed (no interface/dependency change)
491
- SKIP if: Only comments, whitespace, or formatting changed
492
- SKIP if: Only .prizm files changed (avoid circular updates)
493
-
494
- DO NOT SKIP (may reveal TRAPS worth capturing in L2):
495
- - Test file changes that expose edge cases, boundary conditions, or regression patterns
496
- - Bug fixes that reveal non-obvious failure modes (the root cause is itself a TRAP)
497
-
498
- 6. CREATE_NEW_DOCS:
499
- IF new directory qualifies as a module (see MODULE_DISCOVERY_CRITERIA, Section 9.1 Step 2) AND matches no existing module:
500
- CREATE: L1 doc immediately
501
- ADD: entry to MODULE_INDEX in root.prizm
502
- DEFER: L2 creation to first modification or deep read
503
-
504
- 7. SIZE_ENFORCEMENT:
505
- AFTER each update, check file sizes:
506
- L0 > 4KB: Consolidate MODULE_INDEX entries, remove lowest-value RULES
507
- L1 > 4KB: Move detailed KEY_FILES descriptions to L2, trim RULES to top 3
508
- L2 > 5KB: Split into sub-module docs or archive old CHANGELOG entries
509
-
510
- 8. STAGE_DOCS:
511
- Run: git add .prizm-docs/
512
- (Prizm docs are committed alongside source code changes)
447
+ SUMMARY: Get changed files → map to modules → classify (A/D/M/R) → update docs bottom-up (L2→L1→L0) → skip if no structural impact → enforce size limits → stage.
448
+
449
+ DETAILED_STEPS: → ${SKILL_DIR}/references/op-update.md
513
450
 
514
451
  ## 7.3 Changelog Update
515
452
 
@@ -546,114 +483,29 @@ NEVER: TRAPS entries without severity prefix ([CRITICAL], [HIGH], or [LOW])
546
483
  OPERATION: Init (invoked via prizmkit-prizm-docs skill)
547
484
  PRECONDITION: No .prizm-docs/ directory exists (or user confirms overwrite)
548
485
 
549
- ALGORITHM: prizm_init
550
-
551
486
  INPUT: Project root directory
552
487
  OUTPUT: .prizm-docs/ with root.prizm, changelog.prizm, and L1 docs for discovered modules
553
488
 
554
- STEPS:
555
-
556
- 1. DETECT_PROJECT:
557
- SCAN project root for build system files:
558
- - go.mod -> Go
559
- - package.json -> JavaScript/TypeScript
560
- - requirements.txt, pyproject.toml, setup.py -> Python
561
- - Cargo.toml -> Rust
562
- - pom.xml, build.gradle -> Java
563
- - *.csproj, *.sln -> C#
564
- IDENTIFY: primary language, framework, build command, test command
565
- FIND: entry points by convention:
566
- - Go: main.go, cmd/*/main.go
567
- - JS/TS: package.json "main"/"bin", index.ts, index.js
568
- - Python: __main__.py, manage.py, app.py
569
- - Rust: main.rs, lib.rs
570
- - Java: *Application.java, Main.java
571
-
572
- 2. DISCOVER_MODULES:
573
- SCAN source directories, preserving the tree structure (DO NOT FLATTEN):
574
-
575
- MODULE_DISCOVERY_CRITERIA — a directory qualifies as a module if ANY of the following is true:
576
- - Contains source files that collectively form a logical unit (shared responsibility)
577
- - Contains entry points, configuration files, or interface definitions
578
- - Contains sub-directories that themselves qualify as modules
579
- - Is referenced by multiple other modules as a dependency
580
-
581
- A directory does NOT qualify if ALL of the following are true:
582
- - Contains only generated/derived files (build output, compiled assets)
583
- - Contains only vendored/third-party code
584
- - Is in the EXCLUDE list
585
-
586
- a. IDENTIFY TOP-LEVEL modules: directories directly under project root (or directly under src/ for src-based layouts) that qualify per MODULE_DISCOVERY_CRITERIA.
587
- RESULT: top_modules = [src, internal, app, lib, ...]
588
-
589
- b. IDENTIFY SUB-MODULES: for each top-level module M, find directories INSIDE M that qualify per MODULE_DISCOVERY_CRITERIA.
590
- RESULT: sub_modules[M] = [scripts, lib, templates, ...] (relative names, not full paths)
591
-
592
- c. HIERARCHY RULE: if directory X lives inside top-level module M, X is a sub-module of M — NOT a separate top-level module.
593
- WRONG: src/routes/ treated as top-level module -> .prizm-docs/routes.prizm
594
- CORRECT: src/routes/ is a sub-module of src -> .prizm-docs/src/routes.prizm
595
-
596
- d. MODULE_INDEX in root.prizm lists modules at the depth needed for efficient navigation.
597
- Multi-level entries are allowed (no hard depth limit). If navigating from L0 to a commonly-used module would require 3+ hops via SUBDIRS pointers, add an intermediate entry to MODULE_INDEX.
598
- The 4KB L0 size limit naturally constrains how many entries can be listed.
599
-
600
- - EXCLUDE: .git/, node_modules/, vendor/, build/, dist/, __pycache__/, target/, bin/, .claude/, .codebuddy/, .prizmkit/, .prizm-docs/, dev-pipeline/
601
- IF total module count > 30: ASK user for include/exclude patterns
602
-
603
- 3. CREATE_DIRECTORY_STRUCTURE:
604
- Create .prizm-docs/ directory
605
- For each top-level module M that has sub-modules: create .prizm-docs/<M>/ directory
606
- RULE: .prizm-docs/ directory tree must mirror the source directory tree exactly
607
- EXAMPLE:
608
- source: src/routes/ -> prizm: .prizm-docs/src/routes.prizm
609
- source: src/models/ -> prizm: .prizm-docs/src/models.prizm
610
- source: src/ -> prizm: .prizm-docs/src.prizm
611
- NEVER create .prizm-docs/routes.prizm for a directory that lives at src/routes/
612
-
613
- 4. GENERATE_ROOT (L0):
614
- Fill: PROJECT, LANG, FRAMEWORK, BUILD, TEST, ENTRY from step 1
615
- Build: MODULE_INDEX (or MODULE_GROUPS if 15+ modules — see Section 3.1) — list modules at the depth needed for efficient navigation, with arrow pointers
616
- Extract: RULES from existing README, .editorconfig, linter configs
617
- Extract: PATTERNS from common code patterns observed in step 2
618
- Extract: CROSS_CUTTING — identify patterns/constraints that span 2+ modules
619
- Set: PRIZM_VERSION: 4
620
-
621
- 5. GENERATE_L1_DOCS (structural index only):
622
- FOR EACH module in MODULE_INDEX:
623
- SCAN the module directory:
624
- - Count all source files (direct files only, not recursive)
625
- - Trace import/require/use statements for DEPENDENCIES
626
- - List sub-modules in SUBDIRS with pointers
627
- - Identify 5-10 most important files for KEY_FILES
628
- - Identify 1-3 most critical module-specific rules for RULES summary
629
- DO NOT include INTERFACES, DATA_FLOW, TRAPS, or DECISIONS (those are L2, generated lazily)
630
- WRITE: .prizm-docs/<mirrored-path>.prizm
631
-
632
- FOR EACH sub-module S of a parent module M:
633
- SCAN M/S directory with same structural-index approach as above
634
- WRITE: .prizm-docs/<M>/<S>.prizm (L1 structural index at the mirrored sub-path)
635
-
636
- 6. SKIP_L2:
637
- DO NOT generate L2 docs during initialization.
638
- RATIONALE: L2 contains behavioral detail (INTERFACES, DATA_FLOW, TRAPS, DECISIONS) that requires deep code understanding. Generating shallow L2 docs during init would produce misleading content. L2 docs are generated lazily when AI first modifies files in a module or performs a deep read (ON_DEEP_READ trigger).
639
-
640
- 7. CREATE_CHANGELOG:
641
- Write .prizm-docs/changelog.prizm with single entry:
642
- - root | add: initialized prizm documentation framework
643
-
644
- 8. VALIDATE:
645
- CHECK: All generated files are within size limits (L0 <= 4KB, L1 <= 4KB)
646
- CHECK: Every MODULE_INDEX pointer resolves to an existing .prizm file
647
- CHECK: No circular dependencies in DEPENDENCIES sections
648
- CHECK: KEY: value format compliance (no prose, no code blocks, no markdown headers)
649
- CHECK: No anti-patterns per Section 8
650
- CHECK: L1 docs do not contain INTERFACES/DATA_FLOW/TRAPS/DECISIONS
651
-
652
- 9. CONFIGURE_HOOK:
653
- Add UserPromptSubmit hook to .codebuddy/settings.json (see Section 11)
654
-
655
- 10. REPORT:
656
- Output summary: modules discovered, L1 docs generated, files excluded, warnings
489
+ SUMMARY: Detect project type → discover modules (MODULE_DISCOVERY_CRITERIA) → create mirrored directory structure → generate root.prizm (L0) → generate L1 docs → skip L2 (lazy) → create changelog → configure hook → validate → report.
490
+
491
+ DETAILED_STEPS: → ${SKILL_DIR}/references/op-init.md
492
+
493
+ KEY_CONCEPTS:
494
+
495
+ MODULE_DISCOVERY_CRITERIA a directory qualifies as a module if ANY of the following is true:
496
+ - Contains source files that collectively form a logical unit (shared responsibility)
497
+ - Contains entry points, configuration files, or interface definitions
498
+ - Contains sub-directories that themselves qualify as modules
499
+ - Is referenced by multiple other modules as a dependency
500
+
501
+ A directory does NOT qualify if ALL of the following are true:
502
+ - Contains only generated/derived files (build output, compiled assets)
503
+ - Contains only vendored/third-party code
504
+ - Is in the EXCLUDE list
505
+
506
+ HIERARCHY RULE: if directory X lives inside top-level module M, X is a sub-module of M — NOT a separate top-level module.
507
+
508
+ EXCLUDE: .git/, node_modules/, vendor/, build/, dist/, __pycache__/, target/, bin/, .claude/, .codebuddy/, .prizmkit/, .prizm-docs/, dev-pipeline/
657
509
 
658
510
  ## 9.2 Post-Init Behavior
659
511
 
@@ -682,117 +534,12 @@ The Prizm skill is defined at: ${SKILL_DIR}/SKILL.md
682
534
 
683
535
  OPERATIONS (all invoked via the prizmkit-prizm-docs skill):
684
536
 
685
- Init - Bootstrap .prizm-docs/ for a new project (Section 9)
686
- Update - Sync docs with code changes (Section 7)
687
- Status - Check freshness of all docs
688
- Rebuild - Regenerate docs for a specific module
689
- Validate - Check format compliance and consistency (Section 10.2)
690
- Migrate - Convert existing docs to .prizm-docs/ format (Section 10.3)
691
-
692
- ## 10.2 Validate Operation
693
-
694
- OPERATION: Validate (invoked via prizmkit-prizm-docs skill)
695
- PRECONDITION: .prizm-docs/ directory exists
696
-
697
- ALGORITHM: prizm_validate
698
-
699
- STEPS:
700
-
701
- 1. FORMAT_CHECK:
702
- FOR EACH .prizm file:
703
- VERIFY: All content uses KEY: value format or dash-prefixed list items
704
- FLAG: Prose paragraphs (lines without KEY: prefix or - prefix)
705
- FLAG: Code blocks (``` markers)
706
- FLAG: Markdown headers (## / ### markers)
707
- FLAG: Emoji, ASCII art, horizontal rules
708
- FLAG: Markdown tables
709
-
710
- 2. SIZE_CHECK:
711
- VERIFY: root.prizm <= 4KB
712
- VERIFY: All L1 files <= 4KB
713
- VERIFY: All L2 files <= 5KB
714
- REPORT: Files exceeding limits with current size and limit
715
-
716
- 3. POINTER_CHECK:
717
- FOR EACH arrow pointer (->) in all .prizm files:
718
- VERIFY: Target file exists on disk
719
- REPORT: Broken pointers with source file, line, and missing target
720
-
721
- 4. STALENESS_CHECK:
722
- FOR EACH .prizm file:
723
- COMPARE: git last-modified time of .prizm file vs git last-modified time of corresponding source directory
724
- COMMAND: `git log -1 --format="%ai" -- <prizm-file>` vs `git log -1 --format="%ai" -- <source-dir>/`
725
- FLAG: Docs where source was modified more recently than the .prizm file as potentially stale
726
-
727
- 5. COMPLETENESS_CHECK:
728
- root.prizm MUST have: PRIZM_VERSION, PROJECT, LANG, MODULE_INDEX, RULES
729
- L1 docs MUST have: MODULE, FILES, RESPONSIBILITY, DEPENDENCIES
730
- L1 docs MUST NOT have: INTERFACES, DATA_FLOW, TRAPS, DECISIONS (those belong in L2)
731
- L2 docs MUST have: MODULE, FILES, KEY_FILES, DEPENDENCIES, INTERFACES, TRAPS
732
- REPORT: Missing required fields per file
733
-
734
- 6. ANTI_PATTERN_CHECK:
735
- FLAG: Duplicate information across levels (same content in L0 and L1)
736
- FLAG: Behavioral detail in L1 (INTERFACES, DATA_FLOW, TRAPS, DECISIONS belong in L2 only)
737
- FLAG: TODO items or future plans in any .prizm file
738
- FLAG: Session-specific context or conversation history
739
-
740
- 7. RULES_HIERARCHY_CHECK:
741
- EXTRACT: RULES from root.prizm (authoritative)
742
- FOR EACH L1/L2 doc with RULES section:
743
- CHECK: No contradiction with root.prizm RULES
744
- VERIFY: L1/L2 RULES only add module-specific exceptions
745
- FLAG: Direct contradictions with root.prizm RULES
746
-
747
- OUTPUT: Validation report with PASS/FAIL per check category, issue list with file paths and line references, suggested fixes for common problems.
748
-
749
- ## 10.3 Migrate Operation
750
-
751
- OPERATION: Migrate (invoked via prizmkit-prizm-docs skill)
752
- PRECONDITION: Existing documentation (docs/, docs/AI_CONTEXT/, README.md, ARCHITECTURE.md, etc.). No .prizm-docs/ directory (or user confirms overwrite).
753
-
754
- ALGORITHM: prizm_migrate
755
-
756
- STEPS:
757
-
758
- 1. DISCOVER_EXISTING_DOCS:
759
- SCAN for: docs/, docs/AI_CONTEXT/, README.md, ARCHITECTURE.md, CONTRIBUTING.md, API docs
760
- CATALOG: List all found documentation files with sizes and types
761
-
762
- 2. EXTRACT_INFORMATION:
763
- FROM each doc, extract:
764
- - Project metadata (name, language, framework, build/test commands)
765
- - Module descriptions and responsibilities
766
- - Architecture patterns and layers
767
- - Rules, conventions, and constraints
768
- - Decisions and their rationale
769
- - Dependencies and relationships
770
- - Known issues and traps
771
-
772
- 3. MAP_TO_PRIZM_LEVELS:
773
- Project-wide info -> root.prizm (L0): PROJECT, LANG, FRAMEWORK, RULES, PATTERNS
774
- Module-level info -> L1 docs: MODULE, RESPONSIBILITY, INTERFACES, DEPENDENCIES
775
- Detailed module info -> L2 docs: KEY_FILES, TRAPS, domain-specific sections
776
-
777
- 4. CONVERT_FORMAT:
778
- Strip markdown formatting (headers, tables, horizontal rules, emphasis)
779
- Convert prose to KEY: value pairs
780
- Convert lists to dash-prefixed items
781
- Convert code blocks to file_path:line_number references
782
- Condense multi-sentence explanations to single-line values
783
-
784
- 5. GENERATE_PRIZM_DOCS:
785
- Follow standard init procedure (Section 9) but seed with extracted information
786
- Merge source-code-scanned data with documentation-extracted data
787
- Prefer documentation-extracted RULES (they capture rationale)
788
- Prefer source-code-scanned INTERFACES and DEPENDENCIES (they are current)
789
-
790
- 6. VALIDATE:
791
- Run full validation per Section 10.2
792
- Flag any content that could not be automatically converted
793
-
794
- 7. REPORT:
795
- Output: Source files processed, .prizm files generated, content successfully migrated, content requiring manual review, warnings
537
+ Init - Bootstrap .prizm-docs/ for a new project. ${SKILL_DIR}/references/op-init.md
538
+ Update - Sync docs with code changes. ${SKILL_DIR}/references/op-update.md
539
+ Status - Check freshness of all docs. → ${SKILL_DIR}/references/op-status.md
540
+ Rebuild - Regenerate docs for a specific module. → ${SKILL_DIR}/references/op-rebuild.md
541
+ Validate - Check format compliance and consistency. ${SKILL_DIR}/references/op-validate.md
542
+ Migrate - Convert existing docs to .prizm-docs/ format. Steps inline in SKILL.md.
796
543
 
797
544
  ---
798
545
 
@@ -882,235 +629,3 @@ Python import ..., from ... import ...
882
629
  Rust use crate::..., use super::..., extern crate
883
630
  Java import package.Class
884
631
  C# using Namespace
885
-
886
- ---
887
-
888
- # SECTION 13: MINIMAL VIABLE PRIZM
889
-
890
- For any project, the minimum viable Prizm setup is:
891
-
892
- FILES:
893
- .prizm-docs/root.prizm # Project meta + module index (L0)
894
- .prizm-docs/changelog.prizm # Change log
895
-
896
- This is enough to give AI a project overview and track changes.
897
- L1 and L2 docs can be added incrementally as AI works in specific areas.
898
-
899
- BOOTSTRAP:
900
- Invoke prizmkit-prizm-docs skill (Init operation)
901
-
902
- Or manually create these two files following the templates in Section 3.
903
-
904
- ---
905
-
906
- # SECTION 14: VERSION HISTORY
907
-
908
- V1 (2026-03-02): Initial specification
909
- - 3-level progressive loading (L0, L1, L2)
910
- - KEY: value format, AI-only audience
911
- - UserPromptSubmit hook with type: prompt for auto-update
912
- - Mirrored directory structure under .prizm-docs/
913
- - Lazy L2 generation strategy
914
- - Universal language support
915
-
916
- V2 (2026-03-02): Enhanced specification
917
- - Added ON_DEEP_READ trigger for L2 generation (L2 created during deep analysis, not just modifications)
918
- - Added Validate operation for format compliance and consistency checking
919
- - Added Migrate operation for converting existing docs to .prizm-docs/ format
920
- - Added RULES hierarchy: root.prizm RULES authoritative, L1/L2 supplement only with module-specific exceptions
921
- - Added Section 15: Conflict Resolution for multi-person collaboration merge strategies
922
- - Added Section 16: Version Migration for upgrading between spec versions
923
- - Changed fixed skill path to ${SKILL_DIR} convention for cross-IDE compatibility
924
- - Enhanced Section 9.1 with ON_DEEP_READ trigger alongside ON_MODIFY
925
- - Updated PRIZM_SPEC_VERSION to 2
926
-
927
- V3 (2026-03-25): Knowledge quality and resilience
928
- - TRAPS entries now MUST have severity prefix: [CRITICAL], [HIGH], or [LOW]
929
- - TRAPS optional fields: REF (commit hash for traceability), STALE_IF (glob for auto-expiry detection)
930
- - Added TRAPS staleness check in retrospective (step 1g): auto-archive stale TRAPS when count > 10
931
- - Added Failure Capture Protocol: bootstrap templates write failure-log.md on session failure for cross-session learning
932
- - Added retrospective data source: failure-log.md DISCOVERED_TRAPS are prioritized for .prizm-docs/ injection
933
- - Added TRAPS_FORMAT_REFERENCE as spec-only block (must NOT appear in generated .prizm files)
934
- - Added V2→V3 migration: auto-tag legacy TRAPS with [LOW] default severity
935
- - Updated PRIZM_SPEC_VERSION to 3
936
-
937
- V4 (2026-03-28): L1/L2 boundary clarification and doc quality
938
- - L1 redefined as structural index: removed INTERFACES, DATA_FLOW, TRAPS, DECISIONS from L1 template
939
- - L1 RULES now summary only (1-3 critical rules); full RULES list in L2
940
- - L1 size limit raised from 3KB to 4KB
941
- - MODULE_INDEX allows multi-level entries; no hard depth limit, constrained by L0 4KB
942
- - Module discovery changed from "3+ source files" to semantic MODULE_DISCOVERY_CRITERIA
943
- - Added CROSS_CUTTING section to root.prizm for cross-module architectural knowledge
944
- - Added cross-cutting/ subdirectory in .prizm-docs/ for detailed cross-cutting concern docs
945
- - Relaxed update skip conditions: test files and bug fixes can generate TRAPS
946
- - Added V3→V4 migration: move INTERFACES/DATA_FLOW/TRAPS/DECISIONS from L1 to L2
947
- - Updated PRIZM_SPEC_VERSION to 4
948
-
949
- ---
950
-
951
- # SECTION 15: CONFLICT RESOLUTION
952
-
953
- ## 15.1 Multi-Person Collaboration
954
-
955
- CONTEXT: When multiple developers (human or AI) work on the same project, .prizm-docs/ files may have merge conflicts since they are committed to git.
956
-
957
- ## 15.2 Merge Strategies by Section Type
958
-
959
- APPEND_ONLY_SECTIONS:
960
- - changelog.prizm: Append-only. Use standard git merge. Both sides' entries are kept. Sort by date descending after merge.
961
- - DECISIONS (in any .prizm file): Append-only. Keep all entries from both sides on merge conflicts.
962
- - REJECTED (in any .prizm file): Append-only. Keep all entries from both sides.
963
- - CHANGELOG (in L2 docs): Append-only. Keep all entries from both sides.
964
-
965
- LATEST_WINS_SECTIONS:
966
- - FILES: Take the higher count (or recount from source)
967
- - KEY_FILES: Take the version from the branch with more recent git commit timestamp
968
- - INTERFACES: Take the version from the branch with more recent git commit timestamp (L2 only)
969
- - DATA_FLOW: Take the version from the branch with more recent git commit timestamp (L2 only)
970
- - DEPENDENCIES: Take the version from the branch with more recent git commit timestamp
971
- - MODULE_INDEX: Merge entries from both sides, take latest counts, keep all pointers
972
- - CROSS_CUTTING: Merge entries from both sides, keep all concerns
973
- - RULES: Take the version from the branch with more recent git commit timestamp
974
- - TRAPS: Union of both sides (traps are safety-critical, never discard)
975
-
976
- ## 15.3 Conflict Resolution Algorithm
977
-
978
- ALGORITHM: prizm_merge_conflict
979
-
980
- 1. DETECT: Identify conflicted .prizm files from git merge markers (<<<<<<<, =======, >>>>>>>)
981
-
982
- 2. FOR EACH conflicted file:
983
- a. PARSE both versions (ours and theirs) into sections by ALL CAPS KEY
984
- b. FOR EACH section:
985
- IF section is APPEND_ONLY (DECISIONS, REJECTED, CHANGELOG):
986
- MERGE: Concatenate entries from both versions, deduplicate by content, sort by date
987
- IF section is LATEST_WINS:
988
- COMPARE: git commit timestamps from both branches
989
- TAKE: Version from the more recent commit
990
- IF section is TRAPS:
991
- UNION: Keep all entries from both versions, deduplicate by content
992
- c. REASSEMBLE: Write merged sections back to file
993
- d. VALIDATE: Check size limits and format compliance
994
-
995
- 3. STAGE: git add resolved .prizm files
996
-
997
- 4. IF manual intervention needed:
998
- FLAG: Sections where both versions modified the same KEY: value line with different values
999
- REPORT: List conflicted keys for human review
1000
-
1001
- ## 15.4 Prevention
1002
-
1003
- BEST_PRACTICE: Run prizmkit-prizm-docs Update operation immediately before committing to minimize drift
1004
- BEST_PRACTICE: Keep .prizm doc changes small and focused (section-level, not file-level rewrites)
1005
- BEST_PRACTICE: Coordinate on MODULE_INDEX changes (adding/removing modules) to avoid structural conflicts
1006
-
1007
- ---
1008
-
1009
- # SECTION 16: VERSION MIGRATION
1010
-
1011
- ## 16.1 Migration Principles
1012
-
1013
- BACKWARD_COMPATIBLE: V4 can parse V3 docs without errors, but Validate will flag L1 docs containing INTERFACES/DATA_FLOW/TRAPS/DECISIONS and auto-migration (Section 16.4) will move them to L2
1014
- FORWARD_COMPATIBLE: V3 tools will ignore V4-only fields (CROSS_CUTTING) they do not recognize
1015
- MIGRATION_TRIGGER: AI detects PRIZM_VERSION in root.prizm and applies migration if needed
1016
-
1017
- ## 16.2 V1 to V2 Migration
1018
-
1019
- TRIGGER: Automatic on first prizmkit-prizm-docs Update or Validate operation after spec upgrade
1020
-
1021
- ALGORITHM: prizm_migrate_v1_to_v2
1022
-
1023
- 1. UPDATE_VERSION:
1024
- Change: PRIZM_VERSION: 1 -> PRIZM_VERSION: 2
1025
- In: root.prizm
1026
-
1027
- 2. ADD_RULES_HIERARCHY:
1028
- VERIFY: root.prizm has RULES section
1029
- ADD comment-free note: root.prizm RULES are authoritative
1030
- SCAN: L1/L2 docs for RULES sections
1031
- FLAG: Any L1/L2 RULES that contradict root.prizm RULES for manual review
1032
-
1033
- 3. VALIDATE:
1034
- Run full Validate operation
1035
- REPORT: Migration results and any issues found
1036
-
1037
- 4. UPDATE_CHANGELOG:
1038
- APPEND: - YYYY-MM-DD | root | update: migrated from PRIZM_VERSION 1 to 2
1039
-
1040
- ## 16.3 V2 to V3 Migration
1041
-
1042
- TRIGGER: Automatic on first prizmkit-prizm-docs Update or Validate operation after spec upgrade
1043
-
1044
- ALGORITHM: prizm_migrate_v2_to_v3
1045
-
1046
- 1. UPDATE_VERSION:
1047
- Change: PRIZM_VERSION: 2 -> PRIZM_VERSION: 3
1048
- In: root.prizm
1049
-
1050
- 2. MIGRATE_TRAPS_FORMAT:
1051
- SCAN: All L1 and L2 .prizm files for TRAPS entries
1052
- FOR EACH TRAPS entry without severity prefix ([CRITICAL], [HIGH], or [LOW]):
1053
- PREPEND: [LOW] as conservative default severity
1054
- EXAMPLE: `- foo is dangerous | FIX: use bar` becomes `- [LOW] foo is dangerous | FIX: bar`
1055
- RATIONALE: [LOW] is the safest default — it preserves the trap without over-alarming.
1056
- AI or user can manually upgrade severity to [HIGH] or [CRITICAL] during next retrospective.
1057
-
1058
- 3. VALIDATE:
1059
- Run full Validate operation
1060
- REPORT: Migration results — number of TRAPS entries migrated, files updated
1061
-
1062
- 4. UPDATE_CHANGELOG:
1063
- APPEND: - YYYY-MM-DD | root | update: migrated from PRIZM_VERSION 2 to 3 (TRAPS severity prefixes added)
1064
-
1065
- ## 16.4 V3 to V4 Migration
1066
-
1067
- TRIGGER: Automatic on first prizmkit-prizm-docs Update or Validate operation after spec upgrade
1068
-
1069
- ALGORITHM: prizm_migrate_v3_to_v4
1070
-
1071
- 1. UPDATE_VERSION:
1072
- Change: PRIZM_VERSION: 3 -> PRIZM_VERSION: 4
1073
- In: root.prizm
1074
-
1075
- 2. MIGRATE_L1_CONTENT_TO_L2:
1076
- FOR EACH L1 .prizm file:
1077
- IF file contains INTERFACES, DATA_FLOW, TRAPS, or DECISIONS sections:
1078
- IF corresponding L2 doc exists at the child path:
1079
- MERGE: Append sections into L2 doc (do not overwrite existing L2 content)
1080
- ELSE:
1081
- CREATE: New L2 doc with moved sections + MODULE/FILES/RESPONSIBILITY from L1
1082
- REMOVE: Those sections from L1 file
1083
- IF file has RULES with > 3 entries:
1084
- KEEP: Top 3 most critical entries in L1 RULES
1085
- MOVE: Full RULES list to L2 RULES section
1086
- RATIONALE: L1 is now a structural index only. Behavioral detail belongs in L2.
1087
-
1088
- 3. UPDATE_SIZE_REFS:
1089
- All internal size checks: L1 <= 3KB -> L1 <= 4KB
1090
-
1091
- 4. ADD_CROSS_CUTTING:
1092
- IF root.prizm does not have CROSS_CUTTING section:
1093
- ADD: Empty CROSS_CUTTING section after PATTERNS
1094
- RATIONALE: Placeholder for future cross-module concern entries.
1095
-
1096
- 5. VALIDATE:
1097
- Run full Validate operation
1098
- REPORT: Migration results — L1 sections moved to L2, RULES trimmed, files updated
1099
-
1100
- 6. UPDATE_CHANGELOG:
1101
- APPEND: - YYYY-MM-DD | root | update: migrated from PRIZM_VERSION 3 to 4 (L1/L2 boundary redefined, CROSS_CUTTING added)
1102
-
1103
- ## 16.5 Future Version Migration Pattern
1104
-
1105
- FOR any future version N to N+1:
1106
-
1107
- 1. READ: root.prizm PRIZM_VERSION
1108
- 2. IF version < target: Apply migration steps sequentially (V1->V2, V2->V3, etc.)
1109
- 3. EACH migration step:
1110
- a. Update PRIZM_VERSION
1111
- b. Add new required fields with sensible defaults
1112
- c. Transform existing fields if format changed
1113
- d. Validate result
1114
- e. Append migration entry to changelog
1115
- 4. NEVER: Delete existing fields during migration (only add or transform)
1116
- 5. ALWAYS: Keep backward compatibility (old tools should still parse new format)
@@ -0,0 +1,46 @@
1
+ # Operation: Init — Detailed Steps
2
+
3
+ Bootstrap .prizm-docs/ for the current project.
4
+
5
+ PRECONDITION: No .prizm-docs/ directory exists, or user confirms overwrite.
6
+
7
+ STEPS:
8
+ 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.
9
+ 2. Discover modules using MODULE_DISCOVERY_CRITERIA:
10
+ - 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.
11
+ - TOP-LEVEL modules: directories directly under project root (or under src/ for src-based layouts) that qualify.
12
+ - SUB-MODULES: directories INSIDE a top-level module that qualify. Listed in the parent L1 doc's SUBDIRS section.
13
+ - HIERARCHY RULE: directory X inside top-level module M maps to .prizm-docs/<M>/<X>.prizm, never to .prizm-docs/<X>.prizm.
14
+ - 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.
15
+ 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>/.
16
+ 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.
17
+ - If `.prizmkit/plans/project-brief.md` exists: add `PROJECT_BRIEF: .prizmkit/plans/project-brief.md` to root.prizm (generated by prizmkit-init). If not present, skip — prizmkit-init Phase 7 will add it later.
18
+ - 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-docs-format.md for MODULE_GROUPS format.
19
+ - 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.
20
+ 5. Generate L1 .prizm files (structural index only) for ALL modules, each at its correct mirrored path:
21
+ - Top-level module M → write .prizm-docs/<M>.prizm (include SUBDIRS section with pointers to sub-module docs)
22
+ - Sub-module S inside M → write .prizm-docs/<M>/<S>.prizm
23
+ 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.
24
+ 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.
25
+ 7. Create changelog.prizm with initial entry: `- root | add: initialized prizm documentation framework`
26
+ 8. Configure UserPromptSubmit hook in platform settings per ${SKILL_DIR}/assets/prizm-docs-format.md.md Section 11.
27
+ 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).
28
+ 10. Report summary: modules discovered, L1 docs generated, files excluded, warnings.
29
+
30
+ OUTPUT: List of generated files, module count, and validation results.
31
+
32
+ ## Post-Init Behavior
33
+
34
+ After initialization, L2 docs are created incrementally:
35
+
36
+ ON_MODIFY trigger:
37
+ - First time AI modifies a file in sub-module S within module M:
38
+ IF .prizm-docs/<M>/<S>.prizm does not exist:
39
+ AI reads the source files in S, generates L2 doc, then proceeds with modification
40
+ - This ensures L2 docs have real depth, written when AI has actual context
41
+
42
+ ON_DEEP_READ trigger:
43
+ - When AI needs to deeply understand a module but not modify it (e.g., code review, architecture analysis, dependency tracing, explaining complex logic):
44
+ IF .prizm-docs/<M>/<S>.prizm does not exist:
45
+ AI reads the source files in S, generates L2 doc for future reference
46
+ - This ensures L2 docs are available for read-heavy analysis tasks, not just modifications
@@ -0,0 +1,16 @@
1
+ # Operation: Rebuild — Detailed Steps
2
+
3
+ Regenerate docs for a specific module from scratch. Requires a module path argument.
4
+
5
+ PRECONDITION: .prizm-docs/ exists. Module path is valid.
6
+
7
+ STEPS:
8
+ 1. Delete existing L1 and all L2 docs for the specified module.
9
+ 2. Re-scan the module directory for files, interfaces, dependencies, subdirectories.
10
+ 3. Generate fresh L1 doc with full module analysis.
11
+ 4. Generate L2 docs for all sub-modules immediately (unlike init, rebuild generates L2 right away to capture current state).
12
+ 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. **Preserve** any `PROJECT_BRIEF:` line in root.prizm.
13
+ 6. Append rebuild entry to changelog.prizm: `- <module-path> | refactor: rebuilt module documentation from scratch`
14
+ 7. Validate regenerated docs against size limits and format rules.
15
+
16
+ OUTPUT: Regenerated doc summary with before/after comparison.