prizmkit 1.0.18 → 1.0.20

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.18",
3
- "bundledAt": "2026-03-15T15:11:59.897Z",
4
- "bundledFrom": "fed9f20"
2
+ "frameworkVersion": "1.0.20",
3
+ "bundledAt": "2026-03-15T16:09:11.089Z",
4
+ "bundledFrom": "4f7e6fe"
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.18",
2
+ "version": "1.0.20",
3
3
  "skills": {
4
4
  "prizm-kit": {
5
5
  "description": "Full-lifecycle dev toolkit. Covers spec-driven development, Prizm context docs, code quality, debugging, deployment, and knowledge management.",
@@ -17,10 +17,17 @@ PRECONDITION: No .prizm-docs/ directory exists, or user confirms overwrite.
17
17
 
18
18
  STEPS:
19
19
  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.
20
- 2. Discover modules by finding directories with 3+ source files. Recognize common patterns (controllers/, services/, models/, components/, hooks/, utils/, lib/, pkg/, internal/, cmd/, api/, routes/, middleware/). Exclude vendor/, node_modules/, .git/, build/, dist/, __pycache__/, target/, bin/. If module count > 30, ask user for include/exclude patterns.
21
- 3. Create .prizm-docs/ directory structure mirroring the source tree.
22
- 4. Generate root.prizm (L0) with PROJECT, LANG, FRAMEWORK, BUILD, TEST, ENTRY, MODULE_INDEX with arrow pointers, RULES extracted from CODEBUDDY.md/README/linter configs, and PATTERNS. Set PRIZM_VERSION: 2, UPDATED: today's date. Max 4KB.
23
- 5. Generate L1 .prizm files for each discovered module. Each L1 includes MODULE, FILES count, RESPONSIBILITY, SUBDIRS with pointers, KEY_FILES (5-10 most important), INTERFACES (public/exported only), DEPENDENCIES (imports, imported-by, external), RULES, DATA_FLOW. Max 3KB each.
20
+ 2. Discover modules in TWO tiers DO NOT FLATTEN the directory hierarchy:
21
+ - TOP-LEVEL modules: directories directly under project root (or under src/ for src-based layouts) that contain 3+ source files OR contain sub-directories with 3+ source files. These go into MODULE_INDEX.
22
+ - SUB-MODULES: directories INSIDE a top-level module that contain 3+ source files. These are NOT top-level modules they are listed in the parent L1 doc's SUBDIRS section only.
23
+ - HIERARCHY RULE: if directory X lives inside top-level module M, it maps to .prizm-docs/<M>/<X>.prizm NEVER to .prizm-docs/<X>.prizm.
24
+ - Exclude vendor/, node_modules/, .git/, build/, dist/, __pycache__/, target/, bin/. If top-level module count > 30, ask user for include/exclude patterns.
25
+ 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>/. NEVER place a sub-module's .prizm file at the .prizm-docs/ root.
26
+ 4. Generate root.prizm (L0) with PROJECT, LANG, FRAMEWORK, BUILD, TEST, ENTRY, MODULE_INDEX listing ONLY top-level modules with arrow pointers to .prizm-docs/<M>.prizm, RULES extracted from CODEBUDDY.md/CLAUDE.md/README/linter configs, and PATTERNS. Sub-modules must NOT appear in MODULE_INDEX. Set PRIZM_VERSION: 2, UPDATED: today's date. Max 4KB.
27
+ 5. Generate L1 .prizm files for ALL modules (top-level and sub-modules), each at its correct mirrored path:
28
+ - Top-level module M → write .prizm-docs/<M>.prizm (include SUBDIRS section with pointers to sub-module docs)
29
+ - Sub-module S inside M → write .prizm-docs/<M>/<S>.prizm
30
+ Each L1 includes MODULE (full relative path), FILES count, RESPONSIBILITY, SUBDIRS with pointers (for top-level only), KEY_FILES (5-10 most important), INTERFACES (public/exported only), DEPENDENCIES (imports, imported-by, external), RULES, DATA_FLOW. Max 3KB each.
24
31
  6. DO NOT generate L2 docs during init. L2 is created lazily on first file modification in a sub-module, or when AI needs deep understanding of a module (ON_DEEP_READ trigger).
25
32
  7. Create changelog.prizm with initial entry: `- YYYY-MM-DD | root | add: initialized prizm documentation framework`
26
33
  8. Configure UserPromptSubmit hook in .codebuddy/settings.json per ${SKILL_DIR}/assets/PRIZM-SPEC.md Section 11.
@@ -468,33 +468,62 @@ STEPS:
468
468
  - Java: *Application.java, Main.java
469
469
 
470
470
  2. DISCOVER_MODULES:
471
- SCAN source directories:
472
- - Find directories containing 3+ source files of the primary language
473
- - Recognize common patterns: controllers/, services/, models/, components/, hooks/, utils/, lib/, pkg/, internal/, cmd/, api/, routes/, middleware/
474
- - Each qualifying directory = one module candidate
471
+ SCAN source directories, preserving the tree structure (DO NOT FLATTEN):
472
+
473
+ a. IDENTIFY TOP-LEVEL modules: directories directly under project root (or directly under src/ for src-based layouts) that either:
474
+ - Contain 3+ source files of the primary language, OR
475
+ - Contain sub-directories that each have 3+ source files
476
+ RESULT: top_modules = [dev-pipeline, src, internal, app, ...]
477
+
478
+ b. IDENTIFY SUB-MODULES: for each top-level module M, find directories INSIDE M that contain 3+ source files
479
+ RESULT: sub_modules[M] = [scripts, lib, templates, ...] (relative names, not full paths)
480
+
481
+ 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.
482
+ WRONG: dev-pipeline/scripts/ treated as top-level module -> .prizm-docs/scripts.prizm
483
+ CORRECT: dev-pipeline/scripts/ is a sub-module of dev-pipeline -> .prizm-docs/dev-pipeline/scripts.prizm
484
+
485
+ d. MODULE_INDEX in root.prizm lists ONLY top-level modules from step 2a.
486
+ Sub-modules appear in their parent's L1 doc SUBDIRS section, not in MODULE_INDEX.
487
+
475
488
  - EXCLUDE: vendor/, node_modules/, .git/, build/, dist/, __pycache__/, target/, bin/
476
- IF module count > 30: ASK user for include/exclude patterns
489
+ IF top-level module count > 30: ASK user for include/exclude patterns
477
490
 
478
491
  3. CREATE_DIRECTORY_STRUCTURE:
479
492
  Create .prizm-docs/ directory
480
- Create subdirectories mirroring source module tree
493
+ For each top-level module M that has sub-modules: create .prizm-docs/<M>/ directory
494
+ RULE: .prizm-docs/ directory tree must mirror the source directory tree exactly
495
+ EXAMPLE:
496
+ source: dev-pipeline/scripts/ -> prizm: .prizm-docs/dev-pipeline/scripts.prizm
497
+ source: dev-pipeline/lib/ -> prizm: .prizm-docs/dev-pipeline/lib.prizm
498
+ source: dev-pipeline/ -> prizm: .prizm-docs/dev-pipeline.prizm
499
+ NEVER create .prizm-docs/scripts.prizm for a directory that lives at dev-pipeline/scripts/
481
500
 
482
501
  4. GENERATE_ROOT (L0):
483
502
  Fill: PROJECT, LANG, FRAMEWORK, BUILD, TEST, ENTRY from step 1
484
- Build: MODULE_INDEX from step 2 (one entry per module with file count and pointer)
485
- Extract: RULES from existing CODEBUDDY.md, README, .editorconfig, linter configs
503
+ Build: MODULE_INDEX — list ONLY top-level modules from step 2a, one entry per module with pointer to .prizm-docs/<M>.prizm
504
+ NEVER list sub-modules in MODULE_INDEX (sub-modules are navigated via L1 SUBDIRS pointers)
505
+ Extract: RULES from existing CODEBUDDY.md, CLAUDE.md, README, .editorconfig, linter configs
486
506
  Extract: PATTERNS from common code patterns observed in step 2
487
507
  Set: PRIZM_VERSION: 2, UPDATED: today's date
488
508
 
489
509
  5. GENERATE_L1_DOCS:
490
- FOR EACH module in MODULE_INDEX:
491
- SCAN module directory:
492
- - Count all source files
510
+ FOR EACH top-level module M in MODULE_INDEX:
511
+ SCAN M directory:
512
+ - Count all source files (direct files only, not recursive)
493
513
  - Identify exported/public interfaces (language-specific: exported funcs in Go, export in JS/TS, public in Java, pub in Rust)
494
514
  - Trace import/require/use statements for DEPENDENCIES
495
- - Identify subdirectories for SUBDIRS
515
+ - List sub-modules from step 2b in SUBDIRS with pointers: .prizm-docs/<M>/<sub>.prizm
496
516
  - Identify 5-10 most important files for KEY_FILES
497
- WRITE: .prizm-docs/<mirrored-path>.prizm
517
+ WRITE: .prizm-docs/<M>.prizm
518
+
519
+ FOR EACH sub-module S of top-level module M:
520
+ SCAN M/S directory:
521
+ - Count all source files in S
522
+ - Identify exported/public interfaces within S
523
+ - Trace dependencies within S
524
+ - Identify key files in S
525
+ WRITE: .prizm-docs/<M>/<S>.prizm
526
+ NOTE: This is still an L1 doc (module index level), written at the mirrored sub-path
498
527
 
499
528
  6. SKIP_L2:
500
529
  DO NOT generate L2 docs during initialization.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
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": {
package/src/index.js CHANGED
@@ -86,11 +86,46 @@ export async function runScaffold(directory, options) {
86
86
  });
87
87
 
88
88
  // 1.5. AI CLI 命令配置(独立于平台,决定实际运行的可执行命令)
89
- const aiCli = await input({
90
- message: '底层 AI CLI 可执行命令 (可自定义,如 claude-internal --dangerously-skip-permissions):',
91
- default: detected.suggestedCli,
89
+ const cliChoices = [
90
+ {
91
+ name: `cbc — CodeBuddy CLI${detected.cbc ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
92
+ value: 'cbc',
93
+ },
94
+ {
95
+ name: `claude — Claude Code${detected.claude ? chalk.green(' ✓ 已安装') : chalk.gray(' (未检测到)')}`,
96
+ value: 'claude',
97
+ },
98
+ {
99
+ name: '自定义 — 输入其他命令',
100
+ value: '__custom__',
101
+ },
102
+ {
103
+ name: '跳过 — 稍后手动配置',
104
+ value: '',
105
+ },
106
+ ];
107
+
108
+ // 如果检测到的推荐命令不在固定列表里,默认选"自定义"
109
+ const knownCliValues = ['cbc', 'claude'];
110
+ const cliDefault = knownCliValues.includes(detected.suggestedCli)
111
+ ? detected.suggestedCli
112
+ : (detected.suggestedCli ? '__custom__' : '');
113
+
114
+ const cliSelection = await select({
115
+ message: '选择底层 AI CLI 可执行命令:',
116
+ choices: cliChoices,
117
+ default: cliDefault,
92
118
  });
93
119
 
120
+ let aiCli = cliSelection;
121
+ if (cliSelection === '__custom__') {
122
+ aiCli = await input({
123
+ message: '输入自定义 AI CLI 命令:',
124
+ default: knownCliValues.includes(detected.suggestedCli) ? '' : detected.suggestedCli,
125
+ validate: (v) => v.trim() ? true : '请输入命令',
126
+ });
127
+ }
128
+
94
129
  // 2. 选择技能套件
95
130
  const skillSuiteChoice = await select({
96
131
  message: '选择技能套件:',