prizmkit 1.1.156 → 1.1.160

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 (92) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codebuddy/settings-adapter.js +76 -25
  3. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +9 -2
  4. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +1 -1
  5. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +20 -11
  6. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +42 -15
  7. package/bundled/dev-pipeline/scripts/update-feature-status.py +7 -0
  8. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  9. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +1 -1
  10. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +6 -6
  11. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +4 -3
  12. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +2 -2
  13. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -2
  14. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +115 -4
  15. package/bundled/dev-pipeline/tests/test_reset_modes.py +137 -0
  16. package/bundled/dev-pipeline/tests/test_runtime_commit.py +68 -13
  17. package/bundled/dev-pipeline/tests/test_unified_cli.py +12 -7
  18. package/bundled/rules/prizm/prizm-commit-workflow.md +7 -7
  19. package/bundled/rules/prizm/prizm-documentation.md +24 -65
  20. package/bundled/rules/prizm/prizm-progressive-loading.md +9 -8
  21. package/bundled/skills/_metadata.json +1 -1
  22. package/bundled/skills/prizmkit/SKILL.md +1 -13
  23. package/bundled/skills/prizmkit-code-review/SKILL.md +29 -10
  24. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +5 -4
  25. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +15 -0
  26. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +61 -0
  27. package/bundled/skills/prizmkit-committer/SKILL.md +50 -38
  28. package/bundled/skills/prizmkit-deploy/SKILL.md +172 -198
  29. package/bundled/skills/prizmkit-deploy/references/capability-contract.md +137 -0
  30. package/bundled/skills/prizmkit-deploy/references/deploy-record-schema.json +1053 -0
  31. package/bundled/skills/prizmkit-deploy/references/deployment-declaration-schema.json +291 -0
  32. package/bundled/skills/prizmkit-deploy/references/legacy-migration.md +90 -0
  33. package/bundled/skills/prizmkit-deploy/references/policy-and-execution.md +170 -0
  34. package/bundled/skills/prizmkit-deploy/references/real-resource-test-policy.md +73 -0
  35. package/bundled/skills/prizmkit-deploy/references/verification-and-recovery.md +164 -0
  36. package/bundled/skills/prizmkit-deploy/scripts/validate-deploy-artifact.py +371 -0
  37. package/bundled/skills/prizmkit-implement/SKILL.md +2 -2
  38. package/bundled/skills/prizmkit-init/SKILL.md +38 -42
  39. package/bundled/skills/prizmkit-init/references/config-schema.md +11 -7
  40. package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +3 -3
  41. package/bundled/skills/prizmkit-init/references/update-supplement.md +5 -5
  42. package/bundled/skills/prizmkit-plan/SKILL.md +5 -4
  43. package/bundled/skills/prizmkit-plan/assets/plan-template.md +4 -1
  44. package/bundled/skills/prizmkit-plan/references/verification-checklist.md +3 -2
  45. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +17 -11
  46. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +95 -155
  47. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +6 -5
  48. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +4 -2
  49. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +9 -10
  50. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +6 -5
  51. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -12
  52. package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
  53. package/bundled/skills/prizmkit-test/SKILL.md +26 -13
  54. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +8 -4
  55. package/bundled/skills/prizmkit-test/references/independent-test-review.md +7 -3
  56. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +33 -10
  57. package/bundled/skills/prizmkit-test/references/test-report-template.md +33 -11
  58. package/bundled/skills/prizmkit-workflow/SKILL.md +33 -3
  59. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +23 -5
  60. package/bundled/templates/hooks/commit-intent-status.py +9 -41
  61. package/bundled/templates/hooks/commit-intent.json +3 -3
  62. package/bundled/templates/hooks/diff-prizm-docs.py +3 -1
  63. package/bundled/templates/hooks/prizm-pre-commit.py +32 -6
  64. package/bundled/templates/hooks/run-python-hook.cjs +44 -0
  65. package/bundled/templates/hooks/validate-prizm-docs.py +399 -173
  66. package/bundled/templates/project-memory-template.md +19 -19
  67. package/package.json +1 -1
  68. package/src/clean.js +6 -7
  69. package/src/gitignore-template.js +8 -12
  70. package/src/scaffold.js +125 -71
  71. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +0 -178
  72. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +0 -89
  73. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +0 -145
  74. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +0 -109
  75. package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +0 -120
  76. package/bundled/skills/prizmkit-deploy/references/database-setup.md +0 -65
  77. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +0 -150
  78. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +0 -78
  79. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +0 -49
  80. package/bundled/skills/prizmkit-deploy/references/deployment-modes.md +0 -50
  81. package/bundled/skills/prizmkit-deploy/references/direct-upload.md +0 -26
  82. package/bundled/skills/prizmkit-deploy/references/dns-setup.md +0 -42
  83. package/bundled/skills/prizmkit-deploy/references/docker-deploy.md +0 -31
  84. package/bundled/skills/prizmkit-deploy/references/firewall-setup.md +0 -37
  85. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +0 -21
  86. package/bundled/skills/prizmkit-deploy/references/nginx-blue-green.md +0 -59
  87. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +0 -164
  88. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +0 -221
  89. package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +0 -49
  90. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +0 -41
  91. package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +0 -20
  92. package/bundled/skills/prizmkit-deploy/references/ssl-setup.md +0 -56
@@ -25,7 +25,13 @@ Recommended project initialization skill. Scans any brownfield or greenfield pro
25
25
 
26
26
  ### Artifact Ownership
27
27
 
28
- All paths under `.prizmkit/` are framework-internal and remain outside automated task commits. Initialization must not stage or commit them. Root instruction or platform-support files written during setup also remain support data rather than task-owned source.
28
+ `.prizmkit/**` is the PrizmKit framework directory. Initialization may read and write only its declared managed artifacts, but it does not stage, commit, force-add, change or interpret `.gitignore`, require Git history, or decide whether those paths are ignored, untracked, or tracked. The project controls Git visibility; initialization behavior is otherwise identical. Root instruction and platform-support files remain support data rather than initialization-owned commit output.
29
+
30
+ ## Host-Neutral Interaction and Discovery
31
+
32
+ - Ask required questions through the current Host's available user-interaction capability. If no structured interaction capability exists, ask directly in ordinary conversation and wait for the user's answer.
33
+ - Describe required filesystem evidence and bounded discovery results semantically. Do not require a specific tool name, shell, command, or operating system.
34
+ - Platform-specific commands may be shown only as non-normative examples after the Host has established that they are available; an unavailable example never blocks an equivalent Host-native operation.
29
35
 
30
36
  ## Execution Steps
31
37
 
@@ -75,19 +81,9 @@ BROWNFIELD WORKFLOW (existing project):
75
81
  2. Map directory structure using a TWO-TIER model — flat structures lose the nesting relationships that AI needs to navigate the codebase:
76
82
  - TOP-LEVEL modules: directories directly under project root that contain source files or sub-directories with source files (e.g. `src/`, `internal/`, `lib/`)
77
83
  - SUB-MODULES: directories INSIDE a top-level module (e.g. `src/routes/`, `src/models/`)
78
- - A sub-module maps to `.prizmkit/prizm-docs/<M>/<S>.prizm`, never to `.prizmkit/prizm-docs/<S>.prizm` flattening would create ambiguous paths when two modules have identically-named sub-modules
79
- - Exclude: `.git/`, `node_modules/`, `vendor/`, `build/`, `dist/`, `__pycache__/`, `target/`, `bin/`, `.agents/`, `.codex/`, `.claude/`, `.codebuddy/`, `.prizmkit/`
80
- - **Scan command** — run this to get a 2-level directory tree (excludes noise directories):
81
- ```bash
82
- find . -maxdepth 2 -type d \
83
- -not -path '*/node_modules/*' -not -path '*/.git/*' \
84
- -not -path '*/dist/*' -not -path '*/build/*' \
85
- -not -path '*/__pycache__/*' -not -path '*/vendor/*' \
86
- -not -path '*/.agents/*' -not -path '*/.codex/*' \
87
- -not -path '*/.claude/*' -not -path '*/.codebuddy/*' \
88
- -not -path '*/.prizmkit/*' -not -path '*/target/*' \
89
- | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
90
- ```
84
+ - Exact `root.prizm` is L0; top-level module M maps to direct-child `.prizmkit/prizm-docs/<M>.prizm` (L1); sub-module S maps to nested `.prizmkit/prizm-docs/<M>/<S>.prizm` (L2). Deeper source ownership remains L2 and never creates L3.
85
+ - Exclude: `.git/`, `node_modules/`, `vendor/`, `build/`, `dist/`, `__pycache__/`, `target/`, `bin/`, `.agents/`, `.codex/`, `.claude/`, `.codebuddy/`, `.pi/`, and the complete `.prizmkit/` framework directory. This excludes installed `.prizmkit/dev-pipeline/` artifacts but not canonical top-level `dev-pipeline/` source.
86
+ - **Bounded discovery contract** — use the current Host's available directory-listing or file-search capability to enumerate at most two directory levels, apply the exclusions above before analysis, preserve parent/child relationships, and report the resulting project-relative structure. Do not require a POSIX shell pipeline or any other operating-system-specific command.
91
87
  3. Identify entry points by language convention
92
88
  4. Catalog dependencies (external packages)
93
89
  5. Count source files per directory
@@ -106,7 +102,7 @@ After tech stack detection, determine which development layers exist in the proj
106
102
  - **backend**: Express/FastAPI/Gin/etc. in dependencies, or `routes/`/`controllers/` with server code
107
103
  - **database**: Prisma/TypeORM/SQLAlchemy/etc. in dependencies, or `migrations/`/`prisma/` directory
108
104
  - **mobile**: `pubspec.yaml` (Flutter), `react-native` in package.json, or simultaneous `ios/`+`android/` directories
109
- 3. For mobile signals — if ambiguous (e.g., monorepo with web + ios/android dirs), use `AskUserQuestion` to confirm: "Mobile platform signals detected. Is this project a mobile app?" Options: "Yes, this is a mobile app" / "No, these are for another purpose".
105
+ 3. For mobile signals — if ambiguous (e.g., monorepo with web + ios/android dirs), ask the user directly: "Mobile platform signals detected. Is this project a mobile app?" Offer "Yes, this is a mobile app" and "No, these are for another purpose" as clear choices, using the Host-neutral interaction contract above.
110
106
  4. Assemble `detected_layers` array (e.g., `["frontend", "backend", "database"]`). If no layers detected (library/CLI project), array is empty.
111
107
 
112
108
  **Phase 4.6: Infrastructure Quick Scan**
@@ -120,7 +116,7 @@ Detect database and deployment signals, then ask 1-2 brief questions. This phase
120
116
  - **Database signals**: ORM/database client dependencies in `package.json`, `requirements.txt`, `go.mod`, `Cargo.toml`, `pyproject.toml` (look for: prisma, typeorm, sequelize, mongoose, sqlalchemy, django, gorm, diesel, sqlx, pg, mysql2, etc.); directories named `migrations/`, `db/`, `schema/`, `prisma/`; environment variables `DATABASE_URL`, `DB_HOST`, `DB_NAME`, `MONGO_URI` in `.env*` files
121
117
  - **Deployment signals**: `Dockerfile`, `docker-compose.yml`, `vercel.json`, `fly.toml`, `railway.json`, `netlify.toml`, `cloudflare.json`, `.github/workflows/`, `Procfile`, `app.yaml`, `serverless.yml`, `terraform/`, `pulumi/`
122
118
 
123
- 2. **Brief inquiry** (using `AskUserQuestion`, max 2 questions):
119
+ 2. **Brief inquiry** (ask through the Host-neutral interaction contract, max 2 questions):
124
120
 
125
121
  **Question 1 — Database**:
126
122
  - If database signals detected: pre-fill with detected info
@@ -172,38 +168,38 @@ Detect database and deployment signals, then ask 1-2 brief questions. This phase
172
168
  After Infrastructure Quick Scan completes, check if `detected_layers` is non-empty (from Phase 4.5). If layers were detected, offer a lightweight entry point for rules configuration.
173
169
 
174
170
  1. If `detected_layers` is empty (library/CLI project) → skip this phase entirely, proceed to Phase 5.
175
- 2. If layers detected, use `AskUserQuestion`:
171
+ 2. If layers are detected, ask through the Host-neutral interaction contract:
176
172
 
177
173
  **Question**: "Detected **{list detected layers}** code. Would you like to set up custom development rules for AI to follow? This helps AI generate code that matches your conventions."
178
174
  - **Configure later (Recommended)** — Record layers and configure rules later
179
175
  - **Skip entirely** — no custom rules, AI uses general best practices
180
176
 
181
- 3. If user picked "Skip entirely" → clear `detected_layers` to empty array, proceed to Phase 5.
182
- 4. If user picked "Configure later" → keep `detected_layers`, proceed to Phase 5. The layers will be written to config.json in Phase 6.
177
+ 3. If the user picked "Skip entirely" → preserve `detected_layers` as observed project facts, set `enabled_rule_profiles` to an empty array, and proceed to Phase 5.
178
+ 4. If the user picked "Configure later" → preserve `detected_layers`, keep `enabled_rule_profiles` unchanged when already configured or initialize it to an empty array, and proceed to Phase 5. Detection never implies rule adoption.
183
179
 
184
180
  **Phase 5: Prizm Documentation Generation**
185
181
  Invoke prizmkit-prizm-docs (Init operation), passing the two-tier module structure from Phase 4:
186
- - Create `.prizmkit/prizm-docs/` directory structure mirroring the source tree (sub-module dirs become subdirectories under `.prizmkit/prizm-docs/<top-level>/`)
187
- - Generate `root.prizm` (L0) with project meta and MODULE_INDEX listing only top-level modules. If module count > 15, use MODULE_GROUPS format instead (group by functional domain).
188
- - For each module entry in MODULE_INDEX/MODULE_GROUPS, include keyword tags extracted from the module's source files scan for: exported symbols, imported packages, domain terms in file/directory names. Format: `- module-name [tag1, tag2, tag3]: ...`. Tags help AI match user intent to relevant modules.
189
- - Generate L1 docs for top-level modules at `.prizmkit/prizm-docs/<M>.prizm` and for sub-modules at `.prizmkit/prizm-docs/<M>/<S>.prizm`
190
- - Skip L2 (lazy generation) L2 is created later by `/prizmkit-retrospective` when a changed module has meaningful behavior or durable knowledge. During implementation, if an affected L2 is missing, `/prizmkit-implement` reads the target source files as fallback instead of blocking.
191
- - Do not create auxiliary `changelog.prizm`, CHANGELOG sections/files, UPDATED/date metadata, feature/bug/refactor/task/session/run/pipeline/workflow IDs, branch names, absolute worktree paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths; git history is the source of change history
182
+ - Create only documentation directories needed by complete documents; do not create placeholder sub-module files.
183
+ - Generate exact `root.prizm` (L0) with `PRIZM_VERSION: 4`, project meta, and MODULE_INDEX listing only top-level modules. If module count > 15 or measured capacity requires it, use MODULE_GROUPS.
184
+ - For each module entry in MODULE_INDEX/MODULE_GROUPS, include only high-value intent tags and a pointer to one direct-child L1 at `.prizmkit/prizm-docs/<M>.prizm`.
185
+ - Generate one direct-child L1 structural index for each top-level module. Record source submodules structurally, but emit a SUBDIRS pointer only when its complete nested L2 exists.
186
+ - Skip all L2 during Init. Before later source modification, read a complete existing relevant L2 and complete resolving pointer documents; if absent, inspect bounded relevant source as fallback without creating a placeholder. `/prizmkit-retrospective` may later create a complete Value-Gate-qualified L2.
187
+ - Do not create auxiliary `changelog.prizm`, CHANGELOG sections/files, UPDATED/date metadata, feature/bug/refactor/task/session/run/pipeline/workflow IDs, branch names, absolute worktree paths, or `.prizmkit/specs` / `.prizmkit/dev-pipeline` artifact paths; temporal history is outside Prizm memory
192
188
 
193
189
  **Phase 6: Workspace Initialization**
194
190
  6a. Create `.prizmkit/` directory structure (if missing):
195
- - `.prizmkit/config.json` (adoption_mode, speckit_hooks_enabled, platform)
191
+ - `.prizmkit/config.json` (adoption_mode, platform installation metadata, detected_layers, enabled_rule_profiles)
196
192
  - `.prizmkit/specs/` (empty)
197
193
  - `.prizmkit/plans/` (empty — needed by Phase 7 and future pipeline tasks)
198
194
 
199
195
  6b. Write detected tech stack to `.prizmkit/config.json`:
200
196
  → Read `${SKILL_DIR}/references/config-schema.md` for merge strategy, field definitions, and examples.
201
197
 
202
- 6c. Write `detected_layers` to `.prizmkit/config.json` (alongside `tech_stack`):
203
- - Field: `"detected_layers": ["frontend", "backend"]` the layers from Phase 4.5
204
- - If user chose "Skip entirely" in Phase 4.7, write empty array `[]`
205
- - For greenfield projects (Phase 4.5 skipped): write `[]` no code layers to configure rules for yet; user can configure rules later when code exists
206
- - This field indicates which development layers exist in the project and can be used to determine available rule configuration options.
198
+ 6c. Write observed layers and separate rule adoption to `.prizmkit/config.json` (alongside `tech_stack`):
199
+ - `"detected_layers": ["frontend", "backend"]` records only the observed layers from Phase 4.5 and is never cleared because the user declines rule configuration.
200
+ - `"enabled_rule_profiles": []` records rule adoption separately. Preserve valid existing entries; initialize an empty array when no profiles are enabled.
201
+ - For greenfield projects (Phase 4.5 skipped), write both fields as empty arrays until code exists or the user explicitly enables a rule profile.
202
+ - Future re-detection updates observed layers without silently enabling or disabling rule profiles.
207
203
 
208
204
  **Phase 7: Project Brief Generation**
209
205
 
@@ -301,7 +297,7 @@ Tech stack detected:
301
297
 
302
298
  Layer Detection:
303
299
  Detected layers: frontend, backend, database (from dependency + directory signals)
304
- Stored for config.json
300
+ Observed layers stored in config.json independently from rule-profile adoption
305
301
 
306
302
  Infrastructure Quick Scan:
307
303
  Database: PostgreSQL (Prisma) — detected from dependencies
@@ -309,19 +305,19 @@ Infrastructure Quick Scan:
309
305
  → Written to the detected main platform instruction file `### Infrastructure` (not `.private.md`)
310
306
 
311
307
  Rules Quick Entry:
312
- Matched layers: frontend (React), backend (Express.js), database (Prisma) → keeping default rules
308
+ Matched layers: frontend (React), backend (Express.js), database (Prisma) → no rule profiles enabled yet
313
309
 
314
310
  Modules discovered:
315
- src/routes/ → .prizmkit/prizm-docs/routes.prizm (12 files)
316
- src/models/ → .prizmkit/prizm-docs/models.prizm (8 files)
317
- src/services/ .prizmkit/prizm-docs/services.prizm (15 files)
318
- src/middleware/ .prizmkit/prizm-docs/middleware.prizm (5 files)
311
+ src/ → .prizmkit/prizm-docs/src.prizm (top-level L1)
312
+ src/routes/ → nested source submodule (no placeholder L2 during Init)
313
+ src/models/ nested source submodule (no placeholder L2 during Init)
314
+ src/services/ nested source submodule (no placeholder L2 during Init)
319
315
 
320
316
  Project brief: inferred from codebase → confirmed by user
321
317
  → .prizmkit/plans/project-brief.md
322
318
 
323
- Generated: root.prizm + 4 L1 docs
324
- Saved: .prizmkit/config.json (tech_stack + detected_layers recorded)
319
+ Generated: root.prizm + 1 direct-child L1 doc
320
+ Saved: .prizmkit/config.json (tech_stack + detected_layers + enabled_rule_profiles recorded)
325
321
 
326
322
  Next: Use /prizmkit-plan to start your first feature
327
323
  ```
@@ -349,9 +345,9 @@ Tech stack changes detected:
349
345
  = frontend: React (unchanged)
350
346
 
351
347
  Documentation gap-fill:
352
- + app/share/[token].prizm (L2) — created (3 source files, meaningful logic)
353
- = routes.prizm (L1) up to date
354
- ~ models.prizm (L1) — FILES count updated (8 → 10)
348
+ = app.prizm (direct-child L1) — up to date
349
+ source fallback: app/share/[token] (nested L2 absent; no placeholder created)
350
+ ~ app.prizm (L1) — concise source summary updated
355
351
 
356
352
  Project brief: inferred from codebase → confirmed by user
357
353
  → .prizmkit/plans/project-brief.md (generated)
@@ -7,11 +7,12 @@ 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 new layer detection results on every init run — layer detection is based on code that exists, not user preference. This ensures greenfield projects that later gain code get their `detected_layers` populated correctly. Note: the final value written is still determined by Phase 6c (e.g., if user chose "Skip entirely" in Phase 4.7, Phase 6c writes `[]` regardless of detection results).
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.
11
12
  - If `tech_stack` field exists AND `_auto_detected` is `true`:
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 layer detection results.
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.
13
14
  - If `tech_stack` field does NOT exist:
14
- → **WRITE** full detected tech stack with `"_auto_detected": true`, and write `detected_layers` from layer detection
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
15
16
  - Only include fields that were actually detected (no empty/null values)
16
17
 
17
18
  ## Field Definitions
@@ -19,12 +20,13 @@ Handles re-init without losing user edits:
19
20
  | Field | Type | Description |
20
21
  |-------|------|-------------|
21
22
  | `adoption_mode` | string | `"passive"` \| `"advisory"` \| `"active"` |
22
- | `platform` | string | `"codebuddy"` \| `"claude"` \| `"codex"` \| `"all"` |
23
+ | `platform` | string | Installed payload metadata: `"codebuddy"` \| `"claude"` \| `"codex"` \| `"pi"` \| `"all"`. It records installation, not a canonical behavior allowlist. |
23
24
  | `tech_stack` | object | Detected or user-provided tech stack |
24
25
  | `tech_stack._auto_detected` | boolean | `true` if auto-detected, `false` if user-provided |
25
- | `detected_layers` | string[] | Development layers detected in the project. Written by prizmkit-init Phase 4.5. Used to determine available rule configuration options. Values: `frontend` / `backend` / `database` / `mobile`. Empty array when no layers detected or user skipped rules. Always updated on every init run based on fresh code detection not gated by `_auto_detected` (see Merge Strategy above). |
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. |
26
28
 
27
- Legacy manifests may still contain `both` for read-only migration compatibility. New config writes must use `codebuddy`, `claude`, `codex`, or `all`.
29
+ Legacy manifests may still contain `both` for read-only migration compatibility. New config writes must use `codebuddy`, `claude`, `codex`, `pi`, or `all`.
28
30
 
29
31
  ## Examples
30
32
 
@@ -34,6 +36,7 @@ Fullstack project:
34
36
  "adoption_mode": "passive",
35
37
  "platform": "claude",
36
38
  "detected_layers": ["frontend", "backend", "database"],
39
+ "enabled_rule_profiles": [],
37
40
  "tech_stack": {
38
41
  "language": "TypeScript",
39
42
  "runtime": "Node.js 20",
@@ -65,6 +68,7 @@ Pure Python backend:
65
68
  "project_type": "backend",
66
69
  "_auto_detected": true
67
70
  },
68
- "detected_layers": ["backend", "database"]
71
+ "detected_layers": ["backend", "database"],
72
+ "enabled_rule_profiles": []
69
73
  }
70
74
  ```
@@ -28,7 +28,7 @@
28
28
 
29
29
  ## Mobile Confirmation
30
30
 
31
- When mobile signals are detected but ambiguous (e.g., a monorepo with web + mobile), use `AskUserQuestion`:
31
+ When mobile signals are detected but ambiguous (e.g., a monorepo with web + mobile), ask the user through the current Host's available interaction capability; use ordinary conversation when no structured interaction is available:
32
32
 
33
33
  > "Mobile platform signals detected (ios/ + android/ directories). Is this project
34
34
  > a mobile app, or are these directories for another purpose?"
@@ -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 in memory for Phase 6 config.json writing.
41
- If no layers detected (library/CLI project), array is empty.
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.
41
+ If no layers are detected (library/CLI project), the array is empty.
@@ -2,8 +2,8 @@
2
2
 
3
3
  Runs after tech stack merge in Update mode:
4
4
 
5
- 1. **Module scan**: Re-scan project directories using the same TWO-TIER model from Step 1. Compare discovered modules against existing MODULE_INDEX in root.prizm.
6
- 2. **Missing L1 check**: For any discovered module with no corresponding L1 `.prizm` doc create L1 immediately and add to MODULE_INDEX.
7
- 3. **Missing L2 check**: For any module/sub-module that has source files with meaningful logic but no L2 `.prizm` doc create L2 using the L2 GENERATION TEMPLATE. Judgment call: skip trivial wrapper directories or single-config modules.
8
- 4. **Stale L1 check**: For existing L1 docs, verify FILES count and KEY_FILES are still accurate. Update if source directory contents have changed significantly.
9
- 5. **Report**: Include in the Update report: modules added, L1 docs created, L2 docs created, stale docs refreshed.
5
+ 1. **Bounded module scan**: Re-scan only the registered top-level source modules and concrete structural gaps using the same two-tier model. Exclude the complete `.prizmkit/` framework directory, including installed `.prizmkit/dev-pipeline/`, but do not exclude a repository's canonical top-level `dev-pipeline/` source module.
6
+ 2. **Missing L1 check**: For a discovered top-level module with no direct-child L1, build one complete Value-Gate-filtered structural candidate at `.prizmkit/prizm-docs/<M>.prizm` and add a resolving root pointer only after the candidate validates.
7
+ 3. **Missing L2 context**: For an affected source submodule with no nested L2, inspect only the bounded source files and narrowly implicated contracts needed to determine the gap. Do not create a placeholder. A complete L2 may be created only when current durable facts pass the Value Gate and mirrored/semantic identity, ownership, pointer, format, and capacity checks all pass.
8
+ 4. **Existing target reconciliation**: Read every complete affected target and complete resolving parent/child pointer document. Apply Cleanup by semantic meaning, preserve protected knowledge, build candidates bottom-up, skip byte-identical replacements, and re-read actual bytes after writes.
9
+ 5. **Failure and report**: If any post-write check fails, restore exact pre-write bytes and remove invalid new targets before reporting a blocker. Report modules/details added, skipped source fallbacks, stale summaries reconciled, and capacity/pointer validation. Never stage, commit, force-add, change or interpret `.gitignore`, require Git history, or classify tracking state as documentation health.
@@ -83,10 +83,11 @@ Precondition: `spec.md` exists with no unresolved blocker.
83
83
 
84
84
  1. Choose an MVP-first, incremental, or safe parallel task strategy.
85
85
  2. Append `## Tasks` to `plan.md` using `${SKILL_DIR}/assets/plan-template.md`.
86
- 3. Include setup, foundation, core, polish, and checkpoint tasks only when applicable.
87
- 4. Mark `[P]` only for tasks that can safely execute independently.
88
- 5. Include appropriate implementation-local and regression verification tasks without executing them during planning.
89
- 6. Run `${SKILL_DIR}/references/verification-checklist.md` and repair plan defects.
86
+ 3. Include setup, foundation, core, and polish phases only when applicable; do not manufacture empty phases for a small plan.
87
+ 4. Every formal plan must contain at least one concrete risk with mitigation and at least one verification checkpoint. A small plan may use one final checkpoint instead of artificial phase checkpoints.
88
+ 5. Mark `[P]` only for tasks that can safely execute independently.
89
+ 6. Include appropriate implementation-local and regression verification tasks without executing them during planning.
90
+ 7. Run `${SKILL_DIR}/references/verification-checklist.md` and repair plan defects.
90
91
 
91
92
  ## Phase 4: Plan/Spec Review Loop
92
93
 
@@ -61,6 +61,7 @@
61
61
  - E2E: [Approach]
62
62
 
63
63
  ## Risk Assessment
64
+ <!-- Every formal plan keeps at least one concrete risk and mitigation. Use a truthful low-impact risk for small changes rather than filler. -->
64
65
  | Risk | Impact | Mitigation |
65
66
  |------|--------|------------|
66
67
  | [Risk] | [H/M/L] | [Plan] |
@@ -107,12 +108,14 @@
107
108
 
108
109
  ### Phase: Polish
109
110
  - [ ] [T-900] Final verification
110
- - [ ] [T-901] Documentation update
111
+ - [ ] [T-901] Update required project/user-facing documentation <!-- Conditional; Prizm memory synchronization is Retrospective-owned, not an implementation task. -->
111
112
 
112
113
  ### Checkpoints
114
+ <!-- Every formal plan has at least one verification checkpoint. Keep only checkpoints for phases that actually exist; a small plan may use one final checkpoint. -->
113
115
  - [ ] [CP-1] After Setup: project builds and tests pass
114
116
  - [ ] [CP-2] After Foundation: base changes verified
115
117
  - [ ] [CP-3] After each Core group: acceptance criteria pass
118
+ - [ ] [CP-FINAL] Final: planned acceptance and regression verification passes
116
119
 
117
120
  ## Independent Plan Review
118
121
  <!-- Append this terminal audit record after the Main-Agent review and the optional independent-review attempt. -->
@@ -8,7 +8,8 @@ Run this checklist after generating the Tasks section in plan.md. Fix any issues
8
8
 
9
9
  - [ ] Every goal (G-N) in spec.md has at least one task in plan.md
10
10
  - [ ] Every task has a target file path (`— file: path/to/file`)
11
- - [ ] Risk assessment contains at least one risk with a mitigation plan
11
+ - [ ] Risk assessment contains at least one concrete risk with a mitigation plan
12
+ - [ ] The plan contains at least one verification checkpoint; a small plan may use one final checkpoint
12
13
  - [ ] If spec includes `## Behavior Preservation` → at least one verification task exists
13
14
  - [ ] If spec includes `## Root Cause` → at least one reproduction test task exists
14
15
 
@@ -36,7 +37,7 @@ Run this checklist after generating the Tasks section in plan.md. Fix any issues
36
37
 
37
38
  - [ ] No task references the output of a later task without an explicit dependency note
38
39
  - [ ] Foundation tasks precede Core tasks that depend on them
39
- - [ ] Checkpoint tasks exist between phases
40
+ - [ ] Checkpoints exist between dependent phases that are present; plans without multiple phases use one final checkpoint
40
41
 
41
42
  ## Rules Alignment
42
43
 
@@ -61,7 +61,7 @@ Critical-knowledge rule: a still-valid public or wire contract, cross-module con
61
61
 
62
62
  Before Update or Rebuild writes an existing target:
63
63
 
64
- 1. Read the target and its resolving parent/child pointers first.
64
+ 1. Read the complete target and complete resolving parent/child pointer documents first.
65
65
  2. Build a protected set of still-valid critical knowledge under the Value Gate.
66
66
  3. Match facts by semantic meaning, not wording; update an equivalent entry in place and merge synonymous entries.
67
67
  4. Remove stale, duplicate, parent-copied, source-derivable, and otherwise low-value material.
@@ -70,6 +70,12 @@ Before Update or Rebuild writes an existing target:
70
70
 
71
71
  Append-only synchronization is prohibited. If protected knowledge cannot fit after safe cleanup, movement to the owning child, or an unambiguous semantic split, report the blocker instead of deleting knowledge.
72
72
 
73
+ ### Framework Directory and Git Neutrality
74
+
75
+ `.prizmkit/**` is the PrizmKit framework directory. This Skill may read and write only its managed documentation and recovery artifacts, but it never owns project Git policy: do not add, remove, force-add, stage, commit, or interpret `.gitignore` entries for `.prizmkit/**`, and do not require Git history or treat ignored, untracked, or tracked state as a documentation error. Generation, reconciliation, validation, capacity behavior, and failure restoration are identical in all three tracking states apart from ordinary Git visibility.
76
+
77
+ Exact path classification is mandatory: only `.prizmkit/prizm-docs/root.prizm` is L0; a direct `.prizm` child of `.prizmkit/prizm-docs/` other than root is L1; every nested `.prizm` document is L2. Before source modification, read the complete relevant L2 plus complete parent/child documents needed to resolve its pointers. If relevant L2 is absent, inspect bounded relevant source and create no placeholder as part of context loading.
78
+
73
79
  ### Capacity and Sharding Invariants
74
80
 
75
81
  Use the canonical capacity classifier: exact raw UTF-8 bytes; L0 `root.prizm` limit 4096B; direct-child L1 limit 4096B; nested L2 limit 5120B. Bands are normal below 80%, warning from 80% to below 90%, strong warning from 90% through 100%, and error above 100%.
@@ -159,7 +165,8 @@ Steps:
159
165
  6. Generate `.prizmkit/prizm-docs/` using the Init structure seeded only with retained content; use `MODULE_GROUPS` when the L0 map cannot fit within 4096B.
160
166
  7. Run the canonical capacity classifier. Warning-only results remain successful; remediate strong-warning/error generated targets toward 3277–3686B for L0/L1 or 4096–4607B for L2 without deleting protected knowledge. An unresolved hard-limit, ambiguous or unstable concern identity, ownership problem, or slug collision is blocking; never resolve it with a task-named or numbered shard.
161
167
  8. Validate format, required semantic L2 fields, source-file ownership, pointer resolution, hierarchy, capacity, and critical-knowledge preservation.
162
- 9. Report files processed, generated `.prizm` files, omitted low-value categories, capacity results, and manual decisions required.
168
+ 9. Write complete validated candidates bottom-up, compare candidate/current bytes to avoid byte-identical rewrites, re-read actual bytes, and restore every prior target byte-for-byte or remove an invalid new target if any post-write check fails.
169
+ 10. Report files processed, generated `.prizm` files, omitted low-value categories, capacity results, and manual decisions required.
163
170
 
164
171
  ## Recovery Backup Contract
165
172
 
@@ -174,10 +181,10 @@ If that path exists, use the lowest available suffix `.001`, `.002`, and so on,
174
181
  ## Error Handling
175
182
 
176
183
  - `root.prizm` corrupted or invalid: create the byte-for-byte recovery backup above, then rebuild affected docs from source.
177
- - Broken pointers: create the missing `.prizm` file if the source module exists; remove the pointer if the source module was deleted.
184
+ - Broken pointers: inspect the bounded owning source and parent context. Create a complete Value-Gate-qualified detail only through the selected documentation operation; otherwise remove a stale pointer or report the ambiguity. Never emit a placeholder merely to make a pointer resolve.
178
185
  - Capacity warning or strong warning: report the exact classifier fields and clean/organize only when required by the governing capacity policy; automatic remediation targets 80% to below 90%.
179
186
  - Size limit exceeded: fail validation until Value/Cleanup filtering, deduplication, movement to the owning child, or an unambiguous semantic split brings the target within its hard limit; never delete protected knowledge or raise the limit.
180
- - No git history: fall back to filesystem timestamps for freshness checks and warn that accuracy is reduced.
187
+ - Freshness checks use current source/document filesystem evidence and never require Git history or branch/tracking state.
181
188
 
182
189
  ## Key Protocols
183
190
 
@@ -196,10 +203,9 @@ For detailed protocol specifications, read `assets/prizm-docs-format.md`:
196
203
 
197
204
  ```text
198
205
  Generated .prizmkit/prizm-docs/:
199
- root.prizm (L0) — 3 modules in MODULE_INDEX
200
- routes.prizm (L1) — module structure and dependencies
201
- models.prizm (L1) module structure and dependencies
202
- services.prizm (L1) — module structure and dependencies
206
+ root.prizm (L0) — top-level module map
207
+ src.prizm (L1) — direct-child source-module structure and dependencies
208
+ (no nested L2 placeholders during Init)
203
209
  ```
204
210
 
205
211
  L1 docs are structural indexes. Interface signatures, data flow, TRAPS, and DECISIONS belong in L2 docs.
@@ -208,7 +214,7 @@ L1 docs are structural indexes. Interface signatures, data flow, TRAPS, and DECI
208
214
 
209
215
  ```text
210
216
  Changed outside normal dev loop: src/routes/avatar.ts (A), src/models/user.ts (M)
211
- Updated: .prizmkit/prizm-docs/routes.prizm — added avatar route file mapping
212
- Created: .prizmkit/prizm-docs/routes/avatar.prizm — recorded new route interfaces and traps
213
- Updated: .prizmkit/prizm-docs/models.prizm — file count changed
217
+ Updated: .prizmkit/prizm-docs/src/routes.prizm — complete nested route detail
218
+ Updated: .prizmkit/prizm-docs/src/models.prizm — complete nested model detail
219
+ Updated: .prizmkit/prizm-docs/src.prizm — concise direct-child summaries and resolving pointers
214
220
  ```