prizmkit 1.1.195 → 1.1.197

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 (107) hide show
  1. package/bin/create-prizmkit.js +0 -2
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/adapters/antigravity/assets/prizmkit-hook.cjs +1 -1
  4. package/bundled/adapters/antigravity/rules-adapter.js +1 -13
  5. package/bundled/adapters/claude/paths.js +0 -1
  6. package/bundled/adapters/codex/paths.js +0 -1
  7. package/bundled/adapters/codex/settings-adapter.js +1 -1
  8. package/bundled/adapters/cursor/assets/prizmkit-hook.cjs +1 -1
  9. package/bundled/adapters/cursor/rules-adapter.js +1 -13
  10. package/bundled/adapters/pi/paths.js +0 -1
  11. package/bundled/dev-pipeline/.env.example +2 -2
  12. package/bundled/dev-pipeline/README.md +9 -6
  13. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +2 -2
  14. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +15 -25
  15. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +31 -0
  16. package/bundled/dev-pipeline/prizmkit_runtime/iterate.py +1 -69
  17. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +1 -114
  18. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +2 -2
  19. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +78 -0
  20. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +4 -234
  21. package/bundled/dev-pipeline/prizmkit_runtime/status.py +0 -5
  22. package/bundled/dev-pipeline/prizmkit_runtime/stream_progress.py +9 -1
  23. package/bundled/dev-pipeline/scripts/feature_list_contract.py +0 -43
  24. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -76
  25. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +9 -112
  26. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +0 -13
  27. package/bundled/dev-pipeline/scripts/init-pipeline.py +0 -1
  28. package/bundled/dev-pipeline/scripts/prompt_framework.py +0 -79
  29. package/bundled/dev-pipeline/scripts/status_common.py +150 -4
  30. package/bundled/dev-pipeline/scripts/update-bug-status.py +20 -2
  31. package/bundled/dev-pipeline/scripts/update-feature-status.py +20 -2
  32. package/bundled/dev-pipeline/scripts/utils.py +6 -0
  33. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -5
  34. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -101
  35. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +0 -35
  36. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -52
  37. package/bundled/dev-pipeline/templates/feature-list-schema.json +0 -25
  38. package/bundled/dev-pipeline/templates/iterate/evaluate-prompt.md +5 -16
  39. package/bundled/dev-pipeline/templates/iterate/evaluation-schema.json +1 -58
  40. package/bundled/dev-pipeline/templates/iterate/headless-plan-prompt.md +1 -12
  41. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +0 -1
  42. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +0 -1
  43. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +2 -2
  44. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
  45. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +1 -1
  46. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +0 -2
  47. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  48. package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +0 -5
  49. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +1 -2
  50. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +1 -1
  51. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +3 -3
  52. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  53. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -3
  54. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +1 -1
  55. package/bundled/dev-pipeline/templates/sections/retrospective.md +3 -3
  56. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +1 -1
  57. package/bundled/rules/USAGE.md +5 -19
  58. package/bundled/rules/general/coding-baseline.md +2 -2
  59. package/bundled/rules/prizm/prizm-progressive-loading.md +2 -1
  60. package/bundled/skills/_metadata.json +4 -4
  61. package/bundled/skills/app-planner/SKILL.md +1 -1
  62. package/bundled/skills/app-planner/references/generated-plan-review.md +1 -1
  63. package/bundled/skills/app-planner/references/rules-configuration.md +6 -7
  64. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +2 -20
  65. package/bundled/skills/bug-planner/SKILL.md +5 -6
  66. package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +1 -1
  67. package/bundled/skills/bug-planner/references/input-formats.md +2 -2
  68. package/bundled/skills/bug-planner/references/schema-validation.md +0 -1
  69. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +2 -9
  70. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +36 -25
  71. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +38 -31
  72. package/bundled/skills/feature-pipeline-launcher/SKILL.md +33 -25
  73. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +38 -31
  74. package/bundled/skills/feature-planner/SKILL.md +4 -10
  75. package/bundled/skills/feature-planner/references/completeness-review.md +2 -2
  76. package/bundled/skills/feature-planner/references/new-project-planning.md +0 -1
  77. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -25
  78. package/bundled/skills/iterate-pipeline-launcher/SKILL.md +53 -42
  79. package/bundled/skills/iterate-pipeline-launcher/references/configuration.md +52 -47
  80. package/bundled/skills/prizmkit-code-review/SKILL.md +1 -1
  81. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +2 -2
  82. package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
  83. package/bundled/skills/prizmkit-init/SKILL.md +6 -7
  84. package/bundled/skills/prizmkit-init/references/config-schema.md +5 -9
  85. package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +1 -1
  86. package/bundled/skills/prizmkit-plan/SKILL.md +1 -1
  87. package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
  88. package/bundled/skills/prizmkit-retrospective/references/rule-evolution-steps.md +11 -17
  89. package/bundled/skills/prizmkit-workflow/SKILL.md +6 -3
  90. package/bundled/skills/prizmkit-workflow/references/cold-start-rules.md +8 -7
  91. package/bundled/templates/project-memory-template.md +2 -1
  92. package/package.json +1 -1
  93. package/src/clean.js +29 -7
  94. package/src/config.js +13 -15
  95. package/src/index.js +1 -5
  96. package/src/manifest.js +3 -6
  97. package/src/platforms.js +0 -14
  98. package/src/scaffold.js +93 -313
  99. package/src/upgrade.js +32 -31
  100. package/bundled/adapters/claude/rules-adapter.js +0 -25
  101. package/bundled/adapters/codebuddy/rules-adapter.js +0 -30
  102. package/bundled/adapters/codex/rules-adapter.js +0 -30
  103. package/bundled/adapters/pi/rules-adapter.js +0 -13
  104. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +0 -10
  105. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +0 -111
  106. package/bundled/skills/bug-planner/references/verification.md +0 -26
  107. package/bundled/skills/feature-planner/references/browser-interaction.md +0 -39
@@ -38,7 +38,7 @@ Before editing:
38
38
  2. Read `.prizmkit/prizm-docs/root.prizm` when present.
39
39
  3. Follow its pointers to only the relevant direct-child module index and nested detail documentation. Before modifying source, read the complete relevant detail plus the complete parent/child documents needed to resolve its pointers; grep-only fragments are insufficient modification context.
40
40
  4. If relevant detail documentation is missing, inspect only bounded target source files and narrowly implicated callers/contracts as fallback, record that detailed context was unavailable, and proceed without creating a placeholder. Context loading never creates or modifies documentation.
41
- 5. If the current task lands on frontend, backend, database, or mobile, Read `.prizmkit/rules/<layer>-rules.md` when that exact convention path exists and enforce it consciously during implementation. Never load all four files by default. If a task spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. Use layer-rules only to fill HOW the plan does not specify. When the file does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL) as the active `framework-coding-baseline` HOW guardrail. Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and nested `.prizm` detail facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
41
+ 5. If the current task lands on frontend, backend, database, or mobile, perform an exact path Read of `.prizmkit/rules/builtin/coding-baseline.md`, `.prizmkit/rules/builtin/cohesive-modeling.md`, and `.prizmkit/rules/<layer>-rules.md` when those exact paths exist, and enforce them consciously during implementation. Never load all four files by default. If a task spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. Use layer-rules only to fill HOW the plan does not specify. When `.prizmkit/rules/<layer>-rules.md` does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL) as the active `framework-coding-baseline` HOW guardrail. Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and nested `.prizm` detail facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
42
42
 
43
43
  ## Optional Inline Delegation
44
44
 
@@ -175,17 +175,16 @@ Invoke prizmkit-prizm-docs (Init operation), passing the two-tier module structu
175
175
  If `.prizmkit/config.json` action is `skip`, output `Skipped (exists)` and move to Phase 7; otherwise:
176
176
 
177
177
  6a. Create `.prizmkit/` directory structure (if missing):
178
- - `.prizmkit/config.json` (adoption_mode, platform installation metadata, detected_layers, enabled_rule_profiles)
178
+ - `.prizmkit/config.json` (adoption_mode, platform installation metadata, detected_layers, tech_stack)
179
179
  - `.prizmkit/specs/` (empty)
180
180
  - `.prizmkit/plans/` (empty — needed by Phase 7 and future pipeline tasks)
181
181
 
182
182
  6b. Read `${SKILL_DIR}/references/config-schema.md` for merge strategy, field definitions, and write detected `tech_stack` to `.prizmkit/config.json`.
183
183
 
184
- 6c. Write observed layers and separate rule adoption to `.prizmkit/config.json` (alongside `tech_stack`):
185
- - `"detected_layers": ["frontend", "backend"]` records only the observed layers from Phase 4.5 and is never cleared because the user declines rule configuration.
186
- - `"enabled_rule_profiles": []` records rule adoption separately. Preserve valid existing entries; initialize an empty array when no profiles are enabled.
187
- - For greenfield projects (Phase 4.5 skipped), write both fields as empty arrays until code exists or the user explicitly enables a rule profile.
188
- - Future re-detection updates observed layers without silently enabling or disabling rule profiles.
184
+ 6c. Write observed layers to `.prizmkit/config.json` (alongside `tech_stack`):
185
+ - `"detected_layers": ["frontend", "backend"]` records only the observed layers from Phase 4.5. Active rule adoption is determined directly by the presence of `.prizmkit/rules/<layer>-rules.md` files (never tracked by a separate config boolean/array).
186
+ - For greenfield projects (Phase 4.5 skipped), write `"detected_layers": []` until code exists.
187
+ - Future re-detection updates observed layers without modifying existing `.prizmkit/rules/*` files.
189
188
 
190
189
  **Phase 7: Project Brief Generation**
191
190
 
@@ -242,7 +241,7 @@ $ /prizmkit-init
242
241
  Platform detected: Claude Code | Mode: Brownfield
243
242
  Init Status Check: [missing] .prizmkit/prizm-docs/, config.json, project-brief.md -> generating all.
244
243
  Tech stack: TypeScript, Node.js 20, React + Tailwind CSS, Express.js, PostgreSQL (Prisma), Vitest, Vite
245
- Layer Detection: frontend, backend, database -> saved independently from enabled_rule_profiles
244
+ Layer Detection: frontend, backend, database -> saved to detected_layers
246
245
  Infrastructure Quick Scan: Database=PostgreSQL (Prisma), Deployment=Vercel -> written to main host instruction file (not .private.md)
247
246
  Modules: src/ -> .prizmkit/prizm-docs/src.prizm (L1); core L2: src/routes.prizm, src/models.prizm (source-evidenced; edge dirs structural-only without ->; zero placeholder L2s)
248
247
  Brief: inferred and confirmed -> .prizmkit/plans/project-brief.md
@@ -7,12 +7,11 @@ Handles re-init without losing user edits:
7
7
  - Read existing `config.json` if present
8
8
  - If `tech_stack` field exists AND `_auto_detected` is `false` or absent:
9
9
  → **SKIP** — user has manually configured tech stack, preserve their settings
10
- - Always update `detected_layers` with fresh observed layer-detection results on every init run — detection is based on code that exists, never on whether the user enables custom rules. A rule-configuration choice must not erase detected project facts.
11
- - Preserve valid `enabled_rule_profiles` entries independently from detection. Initialize `[]` only when the field is absent or the user explicitly disables every rule profile.
10
+ - Always update `detected_layers` with fresh observed layer-detection results on every init run — detection is based on code that exists, independent of whether `.prizmkit/rules/<layer>-rules.md` files exist.
12
11
  - If `tech_stack` field exists AND `_auto_detected` is `true`:
13
- → **MERGE** — overwrite auto-detected values with new detection results, but preserve any keys the user added manually (keys not in the new detection result). Overwrite `detected_layers` with new observed results and preserve `enabled_rule_profiles` independently.
12
+ → **MERGE** — overwrite auto-detected values with new detection results, but preserve any keys the user added manually (keys not in the new detection result). Overwrite `detected_layers` with new observed results.
14
13
  - If `tech_stack` field does NOT exist:
15
- → **WRITE** full detected tech stack with `"_auto_detected": true`, write `detected_layers` from observed layer detection, and initialize `enabled_rule_profiles` to `[]` unless the user explicitly enabled profiles
14
+ → **WRITE** full detected tech stack with `"_auto_detected": true` and write `detected_layers` from observed layer detection.
16
15
  - Only include fields that were actually detected (no empty/null values)
17
16
 
18
17
  ## Field Definitions
@@ -23,8 +22,7 @@ Handles re-init without losing user edits:
23
22
  | `platform` | string | Installed host metadata: a single id (`codebuddy`, `claude`, `codex`, `pi`, `cursor`, `antigravity`), a canonical comma-separated subset such as `claude,antigravity`, or the six-name form `codebuddy,claude,codex,pi,cursor,antigravity`. It records installation, not a canonical behavior allowlist. Input alias `all` expands to the six names on write. |
24
23
  | `tech_stack` | object | Detected or user-provided tech stack |
25
24
  | `tech_stack._auto_detected` | boolean | `true` if auto-detected, `false` if user-provided |
26
- | `detected_layers` | string[] | Development layers observed in the project. Written by prizmkit-init Phase 4.5. Values: `frontend` / `backend` / `database` / `mobile`. Empty only when no layers are observed. Always refreshed from code and never cleared by rule-adoption choices. |
27
- | `enabled_rule_profiles` | string[] | Rule profiles the user explicitly enabled. This is independent from `detected_layers`; an empty array means no custom profile is enabled, not that the project has no detected layers. |
25
+ | `detected_layers` | string[] | Development layers observed in the project. Written by prizmkit-init Phase 4.5. Values: `frontend` / `backend` / `database` / `mobile`. Empty only when no layers are observed. Always refreshed from code; active project rules are determined solely by exact existence of `.prizmkit/rules/<layer>-rules.md`. |
28
26
 
29
27
  New writes must use a single host id, a canonical comma-separated subset, or the six concrete names. `all` is an installer input alias only. `both` is not a supported value.
30
28
 
@@ -36,7 +34,6 @@ Fullstack project:
36
34
  "adoption_mode": "passive",
37
35
  "platform": "claude",
38
36
  "detected_layers": ["frontend", "backend", "database"],
39
- "enabled_rule_profiles": [],
40
37
  "tech_stack": {
41
38
  "language": "TypeScript",
42
39
  "runtime": "Node.js 20",
@@ -68,7 +65,6 @@ Pure Python backend:
68
65
  "project_type": "backend",
69
66
  "_auto_detected": true
70
67
  },
71
- "detected_layers": ["backend", "database"],
72
- "enabled_rule_profiles": []
68
+ "detected_layers": ["backend", "database"]
73
69
  }
74
70
  ```
@@ -37,5 +37,5 @@ When mobile signals are detected but ambiguous (e.g., a monorepo with web + mobi
37
37
  ## Output
38
38
 
39
39
  After detection (signals + your own judgment), assemble `detected_layers` array (e.g., `["frontend", "backend", "database"]`).
40
- Store the observed values in memory for Phase 6 config.json writing. Rule-profile adoption is recorded separately and never changes this detection result.
40
+ Store the observed values in memory for Phase 6 config.json writing. Active layer rules are discovered directly from `.prizmkit/rules/<layer>-rules.md` files.
41
41
  If no layers are detected (library/CLI project), the array is empty.
@@ -46,7 +46,7 @@ Before proposing or finalizing a plan:
46
46
  1. Reuse any project context already loaded in the current session (including `{artifact_dir}/context-snapshot.md` when supplied by the caller), and check whether `.prizmkit/prizm-docs/root.prizm`, `.prizmkit/config.json`, or a project brief exists.
47
47
  2. If initialization context is missing, do not block planning; load the README, manifests, project instruction files, source structure, and relevant source files as fallback.
48
48
  3. If Prizm docs exist, read `root.prizm`, follow only its relevant module/detail pointers, and use source fallback when detailed documentation is absent.
49
- 4. If the current requirement lands on frontend, backend, database, or mobile, Read `.prizmkit/rules/<layer>-rules.md` when that exact convention path exists and enforce it consciously as planning criteria. Never load all four files by default. If a requirement spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. When the file does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL). Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and nested `.prizm` detail facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
49
+ 4. If the current requirement lands on frontend, backend, database, or mobile, perform an exact path Read of `.prizmkit/rules/builtin/coding-baseline.md`, `.prizmkit/rules/builtin/cohesive-modeling.md`, and `.prizmkit/rules/<layer>-rules.md` when those exact paths exist, and enforce them consciously as planning criteria. Never load all four files by default. If a requirement spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. When `.prizmkit/rules/<layer>-rules.md` does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL). Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and nested `.prizm` detail facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
50
50
  5. Read `${SKILL_DIR}/references/artifact-identity.md`, validate or generate `artifact_dir` exactly once, and keep it stable throughout this planning invocation.
51
51
 
52
52
  ## Phase 1: Specify (`spec.md`)
@@ -103,9 +103,9 @@ After Phase A documentation synchronization completes (including when Phase A re
103
103
 
104
104
  1. Read `${SKILL_DIR}/references/rule-evolution-steps.md` and follow its complete contract.
105
105
  2. Consume `{artifact_dir}/review-report.md`, `{artifact_dir}/test-report.md`, and `{artifact_dir}/test-result.json` strictly read-only alongside validated `change_paths`; never place `.prizmkit/` paths in `change_paths` or `.prizmkit/rules/` paths in `documentation_paths`.
106
- 3. Admit a clause only if it passes all four AND gates (cross-task reusable—single-module traps belong in Prizm `TRAPS:`, real-evidence-driven, falsifiable `MUST`/`NEVER` with concrete condition or counterexample, and non-redundant with linters/compilers, built-in `core/rules/`, or Prizm detail docs) and avoids every banned category (one-off details, temporary workarounds, unagreed style preferences, vague slogans, and task/date/branch/worktree/artifact metadata).
107
- 4. Enforce strictly incremental, non-append-only governance: never create a missing `.prizmkit/rules/<layer>-rules.md` from scratch; for existing target files, read in full, preserve exact pre-write bytes, deduplicate/merge in place, remove obsolete evolved rules, append `## 5. Project-Evolved Rules` if missing on a pre-existing file, enforce hard caps of 20 items in `## 5. Project-Evolved Rules` and 16 KB raw UTF-8 (12 KB soft warning), re-read actual bytes, and restore exact pre-write bytes on any validation failure.
108
- 5. Auto-persist evidence-backed non-conflicting clauses into `## 5. Project-Evolved Rules` (`RULES_UPDATED` with empty `proposals`); emit `RULES_PROPOSED` without auto-overwriting when altering `Decision Ledger` core choices, relaxing safety/data redlines, resolving cross-layer conflicts, targeting an absent layer file, or exceeding caps; emit `NO_RULE_CHANGE` when no candidate qualifies or bytes are unchanged.
106
+ 3. Admit a clause only if it passes all four AND gates (cross-task reusable—single-module traps belong in Prizm `TRAPS:`, real-evidence-driven, falsifiable `MUST`/`NEVER` with concrete condition or counterexample, and non-redundant with linters/compilers, `.prizmkit/rules/builtin/*`, or Prizm detail docs) and avoids every banned category (one-off details, temporary workarounds, unagreed style preferences, vague slogans, and task/date/branch/worktree/artifact metadata).
107
+ 4. Enforce strictly incremental, non-append-only governance across the four project layer files (`.prizmkit/rules/{frontend,backend,database,mobile}-rules.md`, never `.prizmkit/rules/builtin/*`): never create a missing `.prizmkit/rules/<layer>-rules.md` from scratch; for existing target files, read in full, preserve exact pre-write bytes, deduplicate/merge in place, remove obsolete evolved rules, append `## 5. Project-Evolved Rules` if missing on a pre-existing file, re-read actual bytes to verify structural integrity and zero banned metadata, and restore exact pre-write bytes on any validation failure.
108
+ 5. Auto-persist evidence-backed non-conflicting clauses into `## 5. Project-Evolved Rules` (`RULES_UPDATED` with empty `proposals`); emit `RULES_PROPOSED` without auto-overwriting when altering `Decision Ledger` core choices, relaxing safety/data redlines, resolving cross-layer conflicts, or targeting an absent layer file; emit `NO_RULE_CHANGE` when no candidate qualifies or bytes are unchanged.
109
109
 
110
110
  ## Capacity Blocker Contract
111
111
 
@@ -1,6 +1,6 @@
1
1
  # Project Rules Evolution — Strictly Gated Phase B Steps
2
2
 
3
- Run this optional Phase B (`Project Rules Evolution Check`) after Phase A Prizm documentation synchronization whenever `change_paths` is non-empty. Phase B governs incremental evolution of `.prizmkit/rules/<layer>-rules.md` files without violating the atomic stage boundary.
3
+ Run this optional Phase B (`Project Rules Evolution Check`) after Phase A Prizm documentation synchronization whenever `change_paths` is non-empty. Phase B governs incremental evolution of the four project layer files (`.prizmkit/rules/{frontend,backend,database,mobile}-rules.md`) without violating the atomic stage boundary; never modify `.prizmkit/rules/builtin/*`.
4
4
 
5
5
  ## 1. Read-Only Evidence Intake and Scope Boundary
6
6
 
@@ -22,7 +22,7 @@ A candidate rule clause is eligible **only** when it passes **all four gates sim
22
22
  - a security, data-integrity, concurrency, or wire-compatibility redline; or
23
23
  - a newly added heavy stack or core dependency contract.
24
24
  3. **Falsifiable `MUST` / `NEVER`**: phrased as an unambiguous `MUST:` or `NEVER:` directive with a concrete condition, trigger, or counterexample that a future implementer or reviewer can objectively test as pass/fail.
25
- 4. **Non-Redundant**: not already enforced automatically by project linters, formatters, or compilers; not already covered by built-in `core/rules/` (including `coding-baseline`); and not already owned by a Prizm detail document.
25
+ 4. **Non-Redundant**: not already enforced automatically by project linters, formatters, or compilers; not already covered by built-in rules under `.prizmkit/rules/builtin/` (including `coding-baseline.md` and `cohesive-modeling.md`); and not already owned by a Prizm detail document.
26
26
 
27
27
  ## 3. Explicitly Banned Categories (Always Reject)
28
28
 
@@ -38,13 +38,12 @@ Reject any candidate that falls into any of these categories:
38
38
 
39
39
  Classify every candidate that passes all four gates before modifying any file:
40
40
 
41
- - **Auto-Persist into `## 5. Project-Evolved Rules`**: permitted **only** when the target `.prizmkit/rules/<layer>-rules.md` already exists, the clause is evidence-backed and non-conflicting with existing rules or `Decision Ledger` choices, it does not weaken safety/security/data-integrity redlines, it introduces no cross-layer conflict, and the resulting file stays within the 20-item and 16 KB hard caps.
41
+ - **Auto-Persist into `## 5. Project-Evolved Rules`**: permitted **only** when the target `.prizmkit/rules/<layer>-rules.md` already exists, the clause is evidence-backed and non-conflicting with existing rules or `Decision Ledger` choices, it does not weaken safety/security/data-integrity redlines, and it introduces no cross-layer conflict.
42
42
  - **Emit `RULES_PROPOSED` without Auto-Overwriting**: required whenever a candidate would:
43
43
  1. alter `Decision Ledger` core technology, framework, or architectural choices;
44
44
  2. relax or remove an existing safety, security, authorization, or data-integrity redline;
45
- 3. require resolving a cross-layer conflict between two layer-rules files;
46
- 4. target a missing `.prizmkit/rules/<layer>-rules.md`; or
47
- 5. exceed the 20-item cap in `## 5. Project-Evolved Rules` or the 16 KB (16,384 bytes) raw UTF-8 file cap even after safe deduplication, merging, and obsolete-rule removal.
45
+ 3. require resolving a cross-layer conflict between two layer-rules files; or
46
+ 4. target a missing `.prizmkit/rules/<layer>-rules.md`.
48
47
 
49
48
  Each proposal entry in `rule_evolution.proposals` must carry exact keys:
50
49
 
@@ -52,7 +51,7 @@ Each proposal entry in `rule_evolution.proposals` must carry exact keys:
52
51
  {
53
52
  "target_path": ".prizmkit/rules/<layer>-rules.md",
54
53
  "clause": "MUST/NEVER: <falsifiable clause with concrete condition or counterexample>",
55
- "reason": "<exact confirmation trigger: Decision Ledger change / safety redline relaxation / cross-layer conflict / missing layer file / capacity ceiling>"
54
+ "reason": "<exact confirmation trigger: Decision Ledger change / safety redline relaxation / cross-layer conflict / missing layer file>"
56
55
  }
57
56
  ```
58
57
 
@@ -62,7 +61,7 @@ Status selection rules:
62
61
  - `RULES_UPDATED`: one or more existing layer files updated in place and **zero** proposals (`updated_paths: [...]`, `proposals: []`), with non-empty top-level `validation` evidence.
63
62
  - `RULES_PROPOSED`: one or more proposals emitted (`proposals: [...]`). When all candidates require confirmation, `updated_paths` is `[]`; when an unaffected layer also had a safe non-conflicting auto-persisted update in the same run, keep that path in `updated_paths` and record validation evidence in top-level `validation` while emitting `status: "RULES_PROPOSED"` so pending confirmation is never hidden.
64
63
 
65
- ## 5. Non-Append-Only Governance, Caps, Verification, and Rollback
64
+ ## 5. Non-Append-Only Governance, Verification, and Rollback
66
65
 
67
66
  For every existing `.prizmkit/rules/<layer>-rules.md` receiving an auto-persisted update:
68
67
 
@@ -73,14 +72,9 @@ For every existing `.prizmkit/rules/<layer>-rules.md` receiving an auto-persiste
73
72
  - deduplicate and merge overlapping or synonymous rules in place into one concise falsifiable bullet;
74
73
  - remove an existing evolved rule only when current validated source/dependency evidence proves it obsolete;
75
74
  - preserve stable order for unchanged bullets; never perform blind append-only growth.
76
- 4. **Hard Caps and Warning Band**:
77
- - maximum **20 items** (bullet entries) inside `## 5. Project-Evolved Rules`;
78
- - maximum **16 KB (16,384 bytes)** exact raw UTF-8 size per `.prizmkit/rules/<layer>-rules.md` file;
79
- - **12 KB (12,288 bytes)** soft warning band: when current or candidate size reaches 12,288 bytes, consolidate overlapping bullets and trim redundant phrasing before writing, and record the byte measurement in `validation`.
80
- - if a candidate still exceeds 20 items or 16,384 bytes after safe consolidation, do **not** write the oversized file—keep the original bytes untouched and emit the overflow clause as `RULES_PROPOSED`.
81
- 5. **Byte-Identical Idempotency**: compare complete candidate UTF-8 bytes against preserved pre-write bytes. If identical, skip writing and omit the file from `updated_paths`.
82
- 6. **Post-Write Re-Read Verification & Exact-Byte Rollback**:
75
+ 4. **Byte-Identical Idempotency**: compare complete candidate UTF-8 bytes against preserved pre-write bytes. If identical, skip writing and omit the file from `updated_paths`.
76
+ 5. **Post-Write Re-Read Verification & Exact-Byte Rollback**:
83
77
  - after writing, re-read the actual bytes from disk;
84
- - verify exact raw UTF-8 byte count <= 16,384 bytes, `## 5. Project-Evolved Rules` bullet count <= 20, valid Markdown headings, and zero banned metadata (IDs, dates, branch names, worktree paths, artifact paths);
85
- - record concrete check summaries in top-level `validation` (e.g., `.prizmkit/rules/backend-rules.md raw UTF-8 check: 4820B <= 16384B, evolved rules: 3/20`);
78
+ - verify valid Markdown headings, structural integrity, and zero banned metadata (IDs, dates, branch names, worktree paths, artifact paths);
79
+ - record concrete check summaries in top-level `validation` (e.g., `.prizmkit/rules/backend-rules.md structural hygiene check: passed, evolved rules: 3`);
86
80
  - if **any** post-write check fails, immediately restore every modified layer file to its exact preserved pre-write bytes (never use Git reset, checkout, or stash), re-verify restored bytes, and fail closed with `outcome: "RETRO_BLOCKED"`, `result: null`, exact failure/rollback details in `reason` and `validation`, and `rule_evolution` omitted.
@@ -57,8 +57,8 @@ If `description` is missing and no resumable workflow is supplied, ask for the r
57
57
 
58
58
  Before invoking `prizmkit-plan`, check whether the requirement clearly lands on one or two application layers (`frontend`, `backend`, `database`, or `mobile`) and whether each affected `.prizmkit/rules/<layer>-rules.md` already exists via exact path Read (never load all four files by default and do not depend on git tracking or glob):
59
59
 
60
- - Skip pure documentation, config-only, script, or non-layer tasks, and skip any layer whose `.prizmkit/rules/<layer>-rules.md` already exists (idempotent).
61
- - When one or two affected layer files are absent, read `${SKILL_DIR}/references/cold-start-rules.md` and follow its self-contained non-interactive procedure to generate a concise (<= 4 KB) `Mode: cold-start-lightweight` `.prizmkit/rules/<layer>-rules.md` with verified stack summary, 5–10 high-signal `MUST`/`NEVER` rules, change boundaries, and an empty `## 5. Project-Evolved Rules` section, appending the matching `LAYER_RULES:` pointer only if `.prizmkit/prizm-docs/root.prizm` already exists.
60
+ - Skip pure documentation, config-only, script, non-layer tasks, pure greenfield/empty repositories lacking manifests, toolchain configs, Prizm docs, or source evidence for the affected layer(s), and skip any layer whose `.prizmkit/rules/<layer>-rules.md` already exists (idempotent).
61
+ - When one or two affected layer files are absent and verifiable repository evidence exists, read `${SKILL_DIR}/references/cold-start-rules.md` and follow its self-contained non-interactive procedure to generate a concise `Mode: cold-start-lightweight` `.prizmkit/rules/<layer>-rules.md` with verified stack summary, 5–10 high-signal `MUST`/`NEVER` rules, change boundaries, and an empty `## 5. Project-Evolved Rules` section, appending the matching `LAYER_RULES:` pointer only if `.prizmkit/prizm-docs/root.prizm` already exists.
62
62
  - Perform this preflight independently without depending on any external planning or orchestration Skill, without questionnaire pauses, and without altering the six-stage `workflow-state.json` schema.
63
63
 
64
64
  ### 1. Start with Plan
@@ -109,7 +109,7 @@ Expected transitions:
109
109
 
110
110
  Before accepting a Test transition, require `production_changed` to be a boolean and agree between `test-report.md` and `test-result.json`. A passing result with `production_changed=true` follows the bounded production-repair route below and is not final Test authority for Retrospective.
111
111
 
112
- Before invoking `prizmkit-retrospective`, derive the exact changed project paths outside `.prizmkit/` and pass them as `change_paths` with a concise `change_summary`. Do not ask that atomic Skill to infer scope from this composite's state or earlier artifacts.
112
+ Before invoking `prizmkit-retrospective`, derive the exact changed project paths outside `.prizmkit/` and pass them as `change_paths` with a concise `change_summary`. Do not ask that atomic Skill to infer scope from this composite's state or earlier artifacts. After `prizmkit-retrospective` finishes, inspect `{artifact_dir}/retrospective-result.json` including any optional `rule_evolution` summary (`status`, `updated_paths`, `proposals`).
113
113
 
114
114
  `TEST_NOT_APPLICABLE` is not a valid lifecycle success. Lightweight changes must execute deterministic verification and return `TEST_PASS`.
115
115
 
@@ -270,11 +270,14 @@ stages:
270
270
  - status=completed, stage_result=TEST_PASS
271
271
  - status=completed, stage_result=RETRO_COMPLETE (result=DOCS_UPDATED | NO_DOC_CHANGE)
272
272
  - status=completed, stage_result=COMMITTED
273
+ rule_evolution: NO_RULE_CHANGE | RULES_UPDATED (<paths>) | RULES_PROPOSED (<N> pending confirmation; see <artifact_dir>/retrospective-result.json)
273
274
  commit: <hash>
274
275
  push: not performed automatically
275
276
  next_action: invoke /prizmkit-deploy separately if deployment is needed
276
277
  ```
277
278
 
279
+ When `{artifact_dir}/retrospective-result.json` reports `rule_evolution.status = "RULES_PROPOSED"`, include the `rule_evolution` line above and explicitly list each proposed item (`target_path`, `clause`, `reason`) plus `{artifact_dir}/retrospective-result.json` in the completion report so pending rule confirmations are never hidden.
280
+
278
281
  There is no confirmation-decline state for direct local commit. If Committer returns `COMMIT_BLOCKED`, preserve the committer stage as incomplete with the exact safety, evidence, coherence, or Git blocker and the `/prizmkit-committer operation=interactive-commit` resume entry. `COMMIT_PENDING` remains reserved for a validated Runtime commit request.
279
282
 
280
283
  If blocked, report:
@@ -15,9 +15,10 @@ Strict gate rules:
15
15
 
16
16
  1. Trigger **only** when the requirement clearly lands on **one or two** of `frontend`, `backend`, `database`, or `mobile`.
17
17
  2. Skip pure documentation, configuration-only, build/CI script, or non-layer tasks.
18
- 3. For each affected layer (at most two), check existence by exact path Read of `.prizmkit/rules/<layer>-rules.md` — never load all four files by default and do not depend on git tracking or glob.
19
- 4. If the target `.prizmkit/rules/<layer>-rules.md` already exists, **skip that layer idempotently**; never overwrite or rewrite an existing layer-rules file during cold-start.
20
- 5. Do not alter `workflow-state.json` or add a seventh lifecycle stage; Stage 0.5 is a preflight check prior to `prizmkit-plan`.
18
+ 3. Skip when the repository is a pure greenfield/empty workspace with no verified manifests, toolchain configs, `.prizm` docs, or source files for the affected layer(s) — never fabricate unverified stack facts; proceed directly to `prizmkit-plan` under `.prizmkit/rules/builtin/coding-baseline.md` (`framework-coding-baseline`).
19
+ 4. For each affected layer (at most two), check existence by exact path Read of `.prizmkit/rules/<layer>-rules.md` — never load all four files by default and do not depend on git tracking or glob.
20
+ 5. If the target `.prizmkit/rules/<layer>-rules.md` already exists, **skip that layer idempotently**; never overwrite or rewrite an existing layer-rules file during cold-start.
21
+ 6. Do not alter `workflow-state.json` or add a seventh lifecycle stage; Stage 0.5 is a preflight check prior to `prizmkit-plan`.
21
22
 
22
23
  ## 2. Non-Interactive Repository Evidence Scan
23
24
 
@@ -30,7 +31,7 @@ For each affected missing layer, gather verified signals directly from the repos
30
31
 
31
32
  Never invent unverified frameworks, libraries, or architectural preferences that are not evidenced in the repository.
32
33
 
33
- ## 3. Generate Concise Layer-Rules File (<= 4 KB)
34
+ ## 3. Generate Concise Layer-Rules File
34
35
 
35
36
  Write `.prizmkit/rules/<layer>-rules.md` using the following bounded template:
36
37
 
@@ -62,12 +63,12 @@ Write `.prizmkit/rules/<layer>-rules.md` using the following bounded template:
62
63
  <!-- Governed incremental rules evolved from verified review/test evidence; keep empty on cold-start -->
63
64
  ```
64
65
 
65
- Hard quality and size checks before finalizing the file:
66
+ Hard quality checks before finalizing the file:
66
67
 
67
68
  1. **Header stamp**: must contain `> Mode: cold-start-lightweight`.
68
- 2. **Rule budget**: include **5–10** high-signal, falsifiable `MUST`/`NEVER` rules grounded in observed repository facts (no vague slogans, no task/session/branch/date metadata, no redundant rules already enforced by `coding-baseline` or active linters).
69
+ 2. **Rule focus**: include **5–10** high-signal, falsifiable `MUST`/`NEVER` rules grounded in observed repository facts (no vague slogans, no task/session/branch/date metadata, no redundant rules already enforced by `.prizmkit/rules/builtin/coding-baseline.md` or active linters).
69
70
  3. **Empty Section 5**: retain `## 5. Project-Evolved Rules` empty (comment placeholder only) so future governed evolution has a deterministic target.
70
- 4. **Raw UTF-8 byte ceiling**: measure exact raw UTF-8 bytes after writing; the file must be **<= 4 KB (4,096 bytes)**. If it exceeds 4,096 bytes, tighten prose and re-verify before continuing.
71
+ 4. **Post-write verification**: re-read the written file from disk to verify valid Markdown headings, zero prohibited metadata, and exact integrity before continuing.
71
72
 
72
73
  ## 4. Conditional `root.prizm` Pointer Update
73
74
 
@@ -6,7 +6,8 @@ This project uses PrizmKit with the Prizm documentation system for AI-optimized
6
6
  ### Progressive Loading Protocol
7
7
  - ON SESSION START: Read exact `.prizmkit/prizm-docs/root.prizm` first when it exists; it alone is L0.
8
8
  - ON TASK: Read only relevant direct-child L1 documents (`.prizmkit/prizm-docs/<module>.prizm`) selected through MODULE_INDEX or MODULE_GROUPS pointers.
9
- - LAYER_RULES: If the current task lands on frontend, backend, database, or mobile, Read `.prizmkit/rules/<layer>-rules.md` when that exact convention path exists and enforce it consciously for planning, implementation HOW refinement, and code review. Never load all four files by default. If a task spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. When the file does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL) and record the active rule source (`project-layer-rules` vs `framework-coding-baseline`). Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and L2 `.prizm` facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
9
+ - BUILTIN_RULES: Framework built-in rules live in `.prizmkit/rules/builtin/` (`coding-baseline.md`, `cohesive-modeling.md`, `agent-operational-rules.md`, `prefer-linux-commands.md`, `prizm-progressive-loading.md`, `prizm-documentation.md`, `prizm-commit-workflow.md`); read the relevant files before planning, implementation, review, commit, or documentation work.
10
+ - LAYER_RULES: If the current task lands on frontend, backend, database, or mobile, perform an exact path Read of `.prizmkit/rules/builtin/coding-baseline.md`, `.prizmkit/rules/builtin/cohesive-modeling.md`, and `.prizmkit/rules/<layer>-rules.md` when those paths exist, and enforce them consciously for planning, implementation HOW refinement, and code review. Never load all four files by default. If a task spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. When `.prizmkit/rules/<layer>-rules.md` does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL) and record the active rule source (`project-layer-rules` vs `framework-coding-baseline`). Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and L2 `.prizm` facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
10
11
  - ON FILE EDIT: Read the complete relevant nested L2 and complete parent/child documents needed to resolve its SUBDIRS or DETAILS pointer. Grep-only fragments are insufficient modification context.
11
12
  - IF L2 IS ABSENT: Inspect bounded target source and narrowly implicated contracts without creating a placeholder; documentation creation belongs to brownfield core initialization, Retrospective, or explicit repair.
12
13
  - NEVER load all `.prizm` docs at once, load unrelated modules, or create L3.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.1.195",
3
+ "version": "1.1.197",
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/clean.js CHANGED
@@ -238,13 +238,23 @@ export async function runClean(directory, options = {}) {
238
238
 
239
239
  const results = [];
240
240
 
241
- // ── Full removes (100% PrizmKit-owned paths) ──────────────────────────────
241
+ // ── Full removes (100% PrizmKit-owned paths; preserve .prizmkit/rules/<layer>-rules.md) ──
242
242
  const fullRemoveTargets = [
243
- '.prizmkit',
243
+ path.join('.prizmkit', 'dev-pipeline'),
244
+ path.join('.prizmkit', 'prizm-docs'),
245
+ path.join('.prizmkit', 'plans'),
246
+ path.join('.prizmkit', 'specs'),
247
+ path.join('.prizmkit', 'bugfix'),
248
+ path.join('.prizmkit', 'deploy'),
249
+ path.join('.prizmkit', 'state'),
250
+ path.join('.prizmkit', 'scripts'),
251
+ path.join('.prizmkit', 'backups'),
252
+ path.join('.prizmkit', 'test'),
253
+ path.join('.prizmkit', 'config.json'),
254
+ path.join('.prizmkit', 'manifest.json'),
255
+ path.join('.prizmkit', '.env'),
256
+ path.join('.prizmkit', '.env.example'),
244
257
  '.dev-team',
245
- path.join('.prizmkit', 'plans', 'feature-list.json'), // feature-planner output
246
- path.join('.prizmkit', 'plans', 'bug-fix-list.json'), // bug-planner output
247
- path.join('.prizmkit', 'plans', 'project-brief.md'), // feature-planner project brief
248
258
  path.join('.codebuddy', 'settings.json'),
249
259
  path.join('.claude', 'settings.json'),
250
260
  path.join('.claude', 'team-info.json'),
@@ -301,7 +311,11 @@ export async function runClean(directory, options = {}) {
301
311
  const codexAgentsDir = path.join(projectRoot, '.codex', 'agents');
302
312
  results.push(...await removeKnownEntries(codexAgentsDir, codexAgentFiles, dryRun));
303
313
 
304
- // .claude/rules/ — PrizmKit rule .md files
314
+ // .prizmkit/rules/builtin/ — unified PrizmKit built-in rules (never touch project <layer>-rules.md)
315
+ const builtinRulesDir = path.join(projectRoot, '.prizmkit', 'rules', 'builtin');
316
+ results.push(...await removeKnownEntries(builtinRulesDir, ruleFileNames.map(n => `${n}.md`), dryRun));
317
+
318
+ // .claude/rules/ — legacy PrizmKit rule .md files
305
319
  const claudeRulesDir = path.join(projectRoot, '.claude', 'rules');
306
320
  results.push(...await removeKnownEntries(claudeRulesDir, ruleFileNames.map(n => `${n}.md`), dryRun));
307
321
 
@@ -349,6 +363,14 @@ export async function runClean(directory, options = {}) {
349
363
 
350
364
  if (!dryRun) {
351
365
  for (const relativeDir of [
366
+ '.prizmkit/rules/builtin',
367
+ '.prizmkit/rules',
368
+ '.prizmkit',
369
+ '.claude/rules',
370
+ '.codebuddy/rules',
371
+ '.agents/rules',
372
+ '.codex/rules',
373
+ '.pi/rules',
352
374
  '.cursor/hooks',
353
375
  '.cursor/rules',
354
376
  '.cursor/skills',
@@ -410,7 +432,7 @@ export async function runClean(directory, options = {}) {
410
432
  }
411
433
  console.log('');
412
434
  console.log(chalk.gray(' 注意:.prizmkit/prizm-docs/ 为 AI 生成的项目上下文文档,已一并清理。'));
413
- console.log(chalk.gray(' 用户自定义的 agent/skill/rule 文件未受影响。'));
435
+ console.log(chalk.gray(' 项目分层规则(.prizmkit/rules/<layer>-rules.md)与用户自定义的 agent/skill/rule 文件未受影响。'));
414
436
  console.log('');
415
437
  }
416
438
 
package/src/config.js CHANGED
@@ -24,6 +24,7 @@ import {
24
24
  import {
25
25
  installSkills,
26
26
  installSettings,
27
+ installBuiltinRules,
27
28
  installProjectMemory,
28
29
  installPipeline,
29
30
  installGitHook,
@@ -36,9 +37,9 @@ import {
36
37
  removeStaleManagedPipelineFiles,
37
38
  normalizeMainProjectMemoryContent,
38
39
  removeRetiredAgentTeamArtifacts,
39
- EXTRAS_REGISTRY,
40
40
  } from './scaffold.js';
41
41
  import {
42
+ removeBuiltinRuleFiles,
42
43
  removeSkillFiles,
43
44
  removeAgentFiles,
44
45
  removeRuleFiles,
@@ -529,9 +530,6 @@ export async function runConfig(directory, options = {}) {
529
530
  const suiteManifestNeedsNormalization = rawManifestSuite !== 'core';
530
531
  const rawManifestRules = oldManifest.options?.rules || 'recommended';
531
532
  const rulesManifestNeedsNormalization = rawManifestRules !== 'recommended';
532
- const rawManifestExtras = oldManifest.files?.extras || [];
533
- const normalizedExtras = rawManifestExtras.filter(name => EXTRAS_REGISTRY[name]);
534
- const extrasManifestNeedsNormalization = normalizedExtras.length !== rawManifestExtras.length;
535
533
 
536
534
  const currentConfig = {
537
535
  platform: detectedPlatform,
@@ -572,7 +570,6 @@ export async function runConfig(directory, options = {}) {
572
570
  && !runtimeOptionNeedsNormalization
573
571
  && !suiteManifestNeedsNormalization
574
572
  && !rulesManifestNeedsNormalization
575
- && !extrasManifestNeedsNormalization
576
573
  && !options.platform
577
574
  && options.skills === undefined
578
575
  && options.runtime === undefined
@@ -660,9 +657,6 @@ export async function runConfig(directory, options = {}) {
660
657
  if (rulesManifestNeedsNormalization) {
661
658
  changes.push(`规则: ${currentConfig.rules} → 全部内置规则`);
662
659
  }
663
- if (extrasManifestNeedsNormalization) {
664
- changes.push('清理已退役的浏览器扩展记录');
665
- }
666
660
  if (newConfig.pipeline !== currentConfig.pipeline) {
667
661
  changes.push(`流水线: ${currentConfig.pipeline ? '启用' : '禁用'} → ${newConfig.pipeline ? '启用' : '禁用'}`);
668
662
  }
@@ -740,7 +734,7 @@ export async function runConfig(directory, options = {}) {
740
734
  version: pkg.version, platform: newConfig.platform, suite: newConfig.suite,
741
735
  skills: newSkillList, rules: newRuleFiles,
742
736
  pipeline: newPipelineFiles, aiCli: newConfig.aiCli,
743
- runtime: newConfig.runtime, rulesPreset: newConfig.rules, extras: normalizedExtras, payloadPlatforms: newPlatforms,
737
+ runtime: newConfig.runtime, rulesPreset: newConfig.rules, payloadPlatforms: newPlatforms,
744
738
  });
745
739
  const diff = diffManifest(oldManifest, newTempManifest);
746
740
 
@@ -750,10 +744,10 @@ export async function runConfig(directory, options = {}) {
750
744
  console.log(chalk.blue(`\n 删除多余 skills (${platformLabel(p)}):`));
751
745
  await removeSkillFiles(p, projectRoot, diff.skills.removed, false);
752
746
  }
753
- if (diff.rules.removed.length) {
754
- console.log(chalk.blue(`\n 删除多余 rules (${platformLabel(p)}):`));
755
- await removeRuleFiles(p, projectRoot, diff.rules.removed, false);
756
- }
747
+ }
748
+ if (diff.rules.removed.length) {
749
+ console.log(chalk.blue('\n 删除多余内置 rules:'));
750
+ await removeBuiltinRuleFiles(projectRoot, diff.rules.removed, false);
757
751
  }
758
752
  }
759
753
 
@@ -778,7 +772,7 @@ export async function runConfig(directory, options = {}) {
778
772
  console.log(chalk.blue(' Skills:'));
779
773
  await installSkills(p, newSkillList, projectRoot, false, newConfig.runtime);
780
774
 
781
- console.log(chalk.blue('\n Settings & Rules:'));
775
+ console.log(chalk.blue('\n Settings & Hooks:'));
782
776
  await installSettings(p, projectRoot, {}, false, newConfig.runtime);
783
777
 
784
778
  console.log(chalk.blue('\n Project Memory:'));
@@ -786,6 +780,11 @@ export async function runConfig(directory, options = {}) {
786
780
  }
787
781
  }
788
782
 
783
+ if (allTargetPlatforms.length > 0 && (platformsToAdd.length > 0 || needsReinstall)) {
784
+ console.log(chalk.blue('\n Built-in Rules:'));
785
+ await installBuiltinRules(projectRoot, false, newConfig.runtime);
786
+ }
787
+
789
788
  // 5e. Pipeline changes
790
789
  if (newConfig.pipeline !== currentConfig.pipeline || (newConfig.pipeline && (newConfig.runtime !== currentConfig.runtime || runtimeManifestNeedsNormalization || runtimeOptionNeedsNormalization))) {
791
790
  if (newConfig.pipeline) {
@@ -846,7 +845,6 @@ export async function runConfig(directory, options = {}) {
846
845
  aiCli: newConfig.aiCli,
847
846
  rulesPreset: newConfig.rules,
848
847
  payloadPlatforms: newPlatforms,
849
- extras: normalizedExtras,
850
848
  });
851
849
 
852
850
  // Preserve original installedAt
package/src/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * create-prizmkit 交互式主流程
3
3
  *
4
4
  * 引导用户选择目标平台、底层 AI CLI 并确认安装摘要,
5
- * 默认安装完整 core 技能套件、全部内置规则、dev-pipeline 和最新 playwright-cli,
5
+ * 默认安装完整 core 技能套件、全部内置规则和 dev-pipeline,
6
6
  * 然后调用 scaffold.js 执行纯净安装。
7
7
  */
8
8
 
@@ -69,7 +69,6 @@ export async function runScaffold(directory, options = {}) {
69
69
  // 兼容旧 --skills 参数:输出弃用警告并始终归一为 core
70
70
  const skillSuite = normalizeSkillSuite(options.skills, { warn: true, warnOnCore: true });
71
71
  const pipeline = options.pipeline !== false;
72
- const playwrightCli = options.playwrightCli !== false;
73
72
 
74
73
  // === 非交互式模式 ===
75
74
  if (options.nonInteractive) {
@@ -82,7 +81,6 @@ export async function runScaffold(directory, options = {}) {
82
81
  runtime: normalizeRuntime(options.runtime),
83
82
  skills: skillSuite,
84
83
  pipeline,
85
- playwrightCli,
86
84
  aiCli: options.aiCli || '',
87
85
  aiCliLaunch: resolveAiCliLaunchSelection(options.aiCli || '', {
88
86
  headlessPromptArg: options.headlessPromptArg,
@@ -117,7 +115,6 @@ export async function runScaffold(directory, options = {}) {
117
115
  console.log(` 平台: ${chalk.cyan(selectedPlatformLabel)}`);
118
116
  console.log(` 技能: ${chalk.cyan(`Core (${coreSkillCount} 个)`)}`);
119
117
  console.log(` 流水线: ${pipeline ? chalk.green('启用') : chalk.gray('禁用')}`);
120
- console.log(` 浏览器工具: ${playwrightCli ? chalk.green('playwright-cli') : chalk.gray('禁用')}`);
121
118
  console.log(` 规则: ${chalk.cyan(`全部内置规则 (${ruleCount} 条)`)}`);
122
119
  if (aiCli) console.log(` AI CLI: ${chalk.cyan(aiCli)}`);
123
120
  console.log(` 目标目录: ${projectRoot}`);
@@ -135,7 +132,6 @@ export async function runScaffold(directory, options = {}) {
135
132
  runtime,
136
133
  skills: skillSuite,
137
134
  pipeline,
138
- playwrightCli,
139
135
  aiCli: aiCli || '',
140
136
  aiCliLaunch,
141
137
  projectRoot,
package/src/manifest.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Manifest management for PrizmKit installations.
3
3
  *
4
- * Tracks what was installed (skills, rules, pipeline, extras) so that
4
+ * Tracks what was installed (skills, rules, pipeline) so that
5
5
  * `upgrade` can diff old vs new and `uninstall` can clean orphaned files.
6
6
  *
7
7
  * Manifest is written to <projectRoot>/.prizmkit/manifest.json
@@ -20,7 +20,7 @@ const MANIFEST_FIELDS = new Set([
20
20
  ]);
21
21
  const MANIFEST_OPTION_FIELDS = new Set(['pipeline', 'rules', 'aiCli']);
22
22
  const MANIFEST_FILE_FIELDS = new Set([
23
- 'skills', 'rules', 'pipeline', 'extras', 'payloadPlatforms', 'memory',
23
+ 'skills', 'rules', 'pipeline', 'payloadPlatforms', 'memory',
24
24
  ]);
25
25
  const MANIFEST_MEMORY_FIELDS = new Set(['main', 'private']);
26
26
 
@@ -154,7 +154,6 @@ export function buildManifest({
154
154
  pipeline,
155
155
  aiCli,
156
156
  rulesPreset,
157
- extras,
158
157
  payloadPlatforms,
159
158
  }) {
160
159
  const now = new Date().toISOString();
@@ -177,7 +176,6 @@ export function buildManifest({
177
176
  skills: [...skills],
178
177
  rules: [...rules],
179
178
  pipeline: pipeline ? [...pipeline] : [],
180
- extras: extras ? [...extras] : [],
181
179
  payloadPlatforms: installedPayloadPlatforms,
182
180
  memory: {
183
181
  main: [...new Set(installedPayloadPlatforms.map(projectMemoryFile).filter(Boolean))],
@@ -191,7 +189,7 @@ export function buildManifest({
191
189
  * Diff two manifests and return added/removed items.
192
190
  * @param {Object} oldManifest - previous manifest
193
191
  * @param {Object} newManifest - new manifest to compare against
194
- * @returns {Object} changed managed skills, rules, pipeline files, and extras
192
+ * @returns {Object} changed managed skills, rules, and pipeline files
195
193
  */
196
194
  export function diffManifest(oldManifest, newManifest) {
197
195
  function diffArrays(oldArr, newArr) {
@@ -210,6 +208,5 @@ export function diffManifest(oldManifest, newManifest) {
210
208
  Array.isArray(oldManifest?.files?.pipeline) ? oldManifest.files.pipeline : [],
211
209
  Array.isArray(newManifest?.files?.pipeline) ? newManifest.files.pipeline : [],
212
210
  ),
213
- extras: diffArrays(oldManifest?.files?.extras, newManifest?.files?.extras),
214
211
  };
215
212
  }
package/src/platforms.js CHANGED
@@ -1,4 +1,3 @@
1
- import path from 'path';
2
1
  import { isBuiltInAiCli } from './ai-cli-launch.js';
3
2
 
4
3
  export const PLATFORM_IDS = ['codebuddy', 'claude', 'codex', 'pi', 'cursor', 'antigravity'];
@@ -143,16 +142,3 @@ export function defaultCliForPlatform(platform) {
143
142
  if (platform === 'antigravity') return 'agy';
144
143
  return '';
145
144
  }
146
-
147
- export function nativeSkillRoot(platform, projectRoot) {
148
- if (platform === 'codebuddy') return path.join(projectRoot, '.codebuddy', 'skills');
149
- if (platform === 'codex') return path.join(projectRoot, '.agents', 'skills');
150
- if (platform === 'pi') return path.join(projectRoot, '.pi', 'skills');
151
- if (platform === 'cursor') return path.join(projectRoot, '.cursor', 'skills');
152
- if (platform === 'antigravity') return path.join(projectRoot, '.agents', 'plugins', 'prizmkit', 'skills');
153
- return path.join(projectRoot, '.claude', 'skills');
154
- }
155
-
156
- export function payloadSkillRoots(platform, projectRoot, aiCli = '') {
157
- return resolvePayloadPlatforms(platform, aiCli).map(p => nativeSkillRoot(p, projectRoot));
158
- }