prizmkit 1.1.196 → 1.1.198
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.
- package/bin/create-prizmkit.js +1 -7
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/antigravity/assets/prizmkit-hook.cjs +1 -1
- package/bundled/adapters/antigravity/rules-adapter.js +1 -13
- package/bundled/adapters/claude/paths.js +0 -1
- package/bundled/adapters/claude/settings-adapter.js +3 -8
- package/bundled/adapters/codex/paths.js +0 -1
- package/bundled/adapters/codex/settings-adapter.js +1 -1
- package/bundled/adapters/cursor/assets/prizmkit-hook.cjs +1 -1
- package/bundled/adapters/cursor/rules-adapter.js +1 -13
- package/bundled/adapters/pi/paths.js +0 -1
- package/bundled/dev-pipeline/.env.example +2 -2
- package/bundled/dev-pipeline/README.md +6 -5
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +2 -2
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +15 -25
- package/bundled/dev-pipeline/prizmkit_runtime/iterate.py +1 -69
- package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +1 -114
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +2 -2
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +78 -0
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +4 -234
- package/bundled/dev-pipeline/prizmkit_runtime/status.py +0 -5
- package/bundled/dev-pipeline/prizmkit_runtime/stream_progress.py +9 -1
- package/bundled/dev-pipeline/scripts/feature_list_contract.py +0 -43
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +15 -76
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +9 -112
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +0 -13
- package/bundled/dev-pipeline/scripts/init-pipeline.py +0 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +0 -79
- package/bundled/dev-pipeline/scripts/status_common.py +150 -4
- package/bundled/dev-pipeline/scripts/update-bug-status.py +20 -2
- package/bundled/dev-pipeline/scripts/update-feature-status.py +20 -2
- package/bundled/dev-pipeline/scripts/utils.py +6 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +4 -5
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +5 -101
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +0 -35
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -52
- package/bundled/dev-pipeline/templates/feature-list-schema.json +0 -25
- package/bundled/dev-pipeline/templates/iterate/evaluate-prompt.md +5 -16
- package/bundled/dev-pipeline/templates/iterate/evaluation-schema.json +1 -58
- package/bundled/dev-pipeline/templates/iterate/headless-plan-prompt.md +1 -12
- package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +0 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +0 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +1 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +0 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +0 -5
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +1 -2
- package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +1 -1
- package/bundled/dev-pipeline/templates/sections/retrospective.md +3 -3
- package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +1 -1
- package/bundled/rules/USAGE.md +5 -19
- package/bundled/rules/general/coding-baseline.md +2 -2
- package/bundled/rules/prizm/prizm-progressive-loading.md +2 -1
- package/bundled/skills/_metadata.json +4 -4
- package/bundled/skills/app-planner/SKILL.md +1 -1
- package/bundled/skills/app-planner/references/generated-plan-review.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +6 -7
- package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +2 -20
- package/bundled/skills/bug-planner/SKILL.md +5 -6
- package/bundled/skills/bug-planner/assets/bug-confirmation-template.md +1 -1
- package/bundled/skills/bug-planner/references/input-formats.md +2 -2
- package/bundled/skills/bug-planner/references/schema-validation.md +0 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +2 -9
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +36 -25
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +32 -26
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +33 -25
- package/bundled/skills/feature-pipeline-launcher/references/configuration.md +32 -26
- package/bundled/skills/feature-planner/SKILL.md +4 -10
- package/bundled/skills/feature-planner/references/completeness-review.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +0 -1
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -25
- package/bundled/skills/iterate-pipeline-launcher/SKILL.md +53 -42
- package/bundled/skills/iterate-pipeline-launcher/references/configuration.md +47 -43
- package/bundled/skills/prizmkit-code-review/SKILL.md +1 -1
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +2 -2
- package/bundled/skills/prizmkit-implement/SKILL.md +1 -1
- package/bundled/skills/prizmkit-init/SKILL.md +6 -7
- package/bundled/skills/prizmkit-init/references/config-schema.md +5 -9
- package/bundled/skills/prizmkit-init/references/rules/layer-detection.md +1 -1
- package/bundled/skills/prizmkit-plan/SKILL.md +1 -1
- package/bundled/skills/prizmkit-retrospective/SKILL.md +3 -3
- package/bundled/skills/prizmkit-retrospective/references/rule-evolution-steps.md +11 -17
- package/bundled/skills/prizmkit-workflow/SKILL.md +6 -3
- package/bundled/skills/prizmkit-workflow/references/cold-start-rules.md +8 -7
- package/bundled/templates/project-memory-template.md +2 -1
- package/package.json +1 -1
- package/src/clean.js +29 -7
- package/src/config.js +29 -48
- package/src/index.js +2 -9
- package/src/manifest.js +5 -9
- package/src/platforms.js +0 -14
- package/src/prompts.js +0 -13
- package/src/scaffold.js +100 -327
- package/src/upgrade.js +38 -42
- package/bundled/adapters/claude/rules-adapter.js +0 -25
- package/bundled/adapters/codebuddy/rules-adapter.js +0 -30
- package/bundled/adapters/codex/rules-adapter.js +0 -30
- package/bundled/adapters/pi/rules-adapter.js +0 -13
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +0 -10
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +0 -111
- package/bundled/skills/bug-planner/references/verification.md +0 -26
- package/bundled/skills/feature-planner/references/browser-interaction.md +0 -39
|
@@ -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,
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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. **
|
|
77
|
-
|
|
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
|
|
85
|
-
- record concrete check summaries in top-level `validation` (e.g., `.prizmkit/rules/backend-rules.md
|
|
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,
|
|
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
|
|
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.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
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
|
|
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
|
|
66
|
+
Hard quality checks before finalizing the file:
|
|
66
67
|
|
|
67
68
|
1. **Header stamp**: must contain `> Mode: cold-start-lightweight`.
|
|
68
|
-
2. **Rule
|
|
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. **
|
|
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
|
-
-
|
|
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
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
|
-
// .
|
|
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('
|
|
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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* PrizmKit Config Command
|
|
3
3
|
*
|
|
4
4
|
* Reconfigure an existing PrizmKit installation without a full reinstall.
|
|
5
|
-
* Supports changing platform
|
|
5
|
+
* Supports changing platform and AI CLI.
|
|
6
6
|
*
|
|
7
7
|
* Flow: READ manifest → PROMPT user → COMPUTE DIFF → DISPLAY SUMMARY → EXECUTE
|
|
8
8
|
*
|
|
@@ -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,19 +37,17 @@ 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,
|
|
45
|
-
removePipelineFiles,
|
|
46
46
|
} from './upgrade.js';
|
|
47
47
|
import { detectPlatform } from './detect-platform.js';
|
|
48
48
|
import {
|
|
49
49
|
selectPlatform,
|
|
50
50
|
selectAiCliLaunch,
|
|
51
|
-
confirmPipeline,
|
|
52
51
|
confirmAction,
|
|
53
52
|
} from './prompts.js';
|
|
54
53
|
import { canonicalizePlatformSelection, isKnownPlatform, platformLabel, privateProjectMemoryFile, projectMemoryFile, resolvePayloadPlatforms, uniquePlatforms, unknownPlatformMessage } from './platforms.js';
|
|
@@ -529,16 +528,12 @@ export async function runConfig(directory, options = {}) {
|
|
|
529
528
|
const suiteManifestNeedsNormalization = rawManifestSuite !== 'core';
|
|
530
529
|
const rawManifestRules = oldManifest.options?.rules || 'recommended';
|
|
531
530
|
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
531
|
|
|
536
532
|
const currentConfig = {
|
|
537
533
|
platform: detectedPlatform,
|
|
538
534
|
runtime: normalizedManifestRuntime,
|
|
539
535
|
suite: rawManifestSuite,
|
|
540
536
|
rules: rawManifestRules,
|
|
541
|
-
pipeline: oldManifest.options?.pipeline ?? true,
|
|
542
537
|
aiCli: userConfig.ai_cli || oldManifest.options?.aiCli || '',
|
|
543
538
|
aiCliLaunch: storedAiCliLaunch(userConfig),
|
|
544
539
|
};
|
|
@@ -556,7 +551,6 @@ export async function runConfig(directory, options = {}) {
|
|
|
556
551
|
console.log(` 平台: ${chalk.cyan(platformLabel(currentConfig.platform))}`);
|
|
557
552
|
console.log(` 运行时: ${chalk.cyan(runtimeLabel(currentConfig.runtime))}`);
|
|
558
553
|
console.log(` AI CLI: ${currentConfig.aiCli ? chalk.cyan(currentConfig.aiCli) : chalk.gray('(未设置)')}`);
|
|
559
|
-
console.log(` 流水线: ${currentConfig.pipeline ? chalk.green('启用') : chalk.gray('禁用')}`);
|
|
560
554
|
console.log('');
|
|
561
555
|
|
|
562
556
|
// ── Phase 2: PROMPT for new config ───────────────────────────────────────
|
|
@@ -572,16 +566,14 @@ export async function runConfig(directory, options = {}) {
|
|
|
572
566
|
&& !runtimeOptionNeedsNormalization
|
|
573
567
|
&& !suiteManifestNeedsNormalization
|
|
574
568
|
&& !rulesManifestNeedsNormalization
|
|
575
|
-
&& !extrasManifestNeedsNormalization
|
|
576
569
|
&& !options.platform
|
|
577
570
|
&& options.skills === undefined
|
|
578
571
|
&& options.runtime === undefined
|
|
579
572
|
&& options.aiCli === undefined
|
|
580
573
|
&& options.headlessPromptArg === undefined
|
|
581
|
-
&& options.headlessExtraArgs === undefined
|
|
582
|
-
&& options.pipeline === undefined) {
|
|
574
|
+
&& options.headlessExtraArgs === undefined) {
|
|
583
575
|
console.log(chalk.yellow(' ⚠ 非交互式模式下未指定任何变更。'));
|
|
584
|
-
console.log(chalk.gray(' 使用 --platform, --runtime, --ai-cli, --headless-prompt-arg, --headless-extra-args
|
|
576
|
+
console.log(chalk.gray(' 使用 --platform, --runtime, --ai-cli, --headless-prompt-arg, --headless-extra-args'));
|
|
585
577
|
return;
|
|
586
578
|
}
|
|
587
579
|
|
|
@@ -596,12 +588,11 @@ export async function runConfig(directory, options = {}) {
|
|
|
596
588
|
runtime: optionRuntime || currentConfig.runtime,
|
|
597
589
|
suite: targetSuite,
|
|
598
590
|
rules: targetRules,
|
|
599
|
-
pipeline: options.pipeline !== undefined ? options.pipeline : currentConfig.pipeline,
|
|
600
591
|
aiCli: aiCliLaunchValue.aiCli,
|
|
601
592
|
aiCliLaunch: aiCliLaunchValue.aiCliLaunch,
|
|
602
593
|
};
|
|
603
594
|
} else {
|
|
604
|
-
// Interactive: platform
|
|
595
|
+
// Interactive: platform and AI CLI only
|
|
605
596
|
const detected = detectPlatform();
|
|
606
597
|
|
|
607
598
|
try {
|
|
@@ -610,14 +601,12 @@ export async function runConfig(directory, options = {}) {
|
|
|
610
601
|
const newRuntime = optionRuntime || currentConfig.runtime;
|
|
611
602
|
const newPlatform = await selectPlatform(currentConfig.platform, detected);
|
|
612
603
|
const aiCliSelection = await selectAiCliLaunch(currentConfig.aiCli, detected, currentConfig.aiCliLaunch);
|
|
613
|
-
const newPipeline = await confirmPipeline(currentConfig.pipeline);
|
|
614
604
|
|
|
615
605
|
newConfig = {
|
|
616
606
|
platform: newPlatform,
|
|
617
607
|
runtime: newRuntime,
|
|
618
608
|
suite: targetSuite,
|
|
619
609
|
rules: targetRules,
|
|
620
|
-
pipeline: newPipeline,
|
|
621
610
|
aiCli: aiCliSelection.aiCli,
|
|
622
611
|
aiCliLaunch: aiCliSelection.aiCliLaunch,
|
|
623
612
|
};
|
|
@@ -660,12 +649,6 @@ export async function runConfig(directory, options = {}) {
|
|
|
660
649
|
if (rulesManifestNeedsNormalization) {
|
|
661
650
|
changes.push(`规则: ${currentConfig.rules} → 全部内置规则`);
|
|
662
651
|
}
|
|
663
|
-
if (extrasManifestNeedsNormalization) {
|
|
664
|
-
changes.push('清理已退役的浏览器扩展记录');
|
|
665
|
-
}
|
|
666
|
-
if (newConfig.pipeline !== currentConfig.pipeline) {
|
|
667
|
-
changes.push(`流水线: ${currentConfig.pipeline ? '启用' : '禁用'} → ${newConfig.pipeline ? '启用' : '禁用'}`);
|
|
668
|
-
}
|
|
669
652
|
|
|
670
653
|
// ── Phase 4: DISPLAY SUMMARY + CONFIRM ───────────────────────────────────
|
|
671
654
|
|
|
@@ -719,7 +702,7 @@ export async function runConfig(directory, options = {}) {
|
|
|
719
702
|
const newSkillList = await resolveSkillList();
|
|
720
703
|
const rulesMeta = await loadRulesMetadata();
|
|
721
704
|
const newRuleFiles = resolveRuleNamesForRuntime(rulesMeta, newConfig.runtime).map(name => `${name}.md`);
|
|
722
|
-
const newPipelineFiles =
|
|
705
|
+
const newPipelineFiles = resolvePipelineFileList(newConfig.runtime);
|
|
723
706
|
|
|
724
707
|
// 5a. Migrate project memory before removing dropped platforms
|
|
725
708
|
for (const p of platformsToRemove) {
|
|
@@ -740,7 +723,7 @@ export async function runConfig(directory, options = {}) {
|
|
|
740
723
|
version: pkg.version, platform: newConfig.platform, suite: newConfig.suite,
|
|
741
724
|
skills: newSkillList, rules: newRuleFiles,
|
|
742
725
|
pipeline: newPipelineFiles, aiCli: newConfig.aiCli,
|
|
743
|
-
runtime: newConfig.runtime, rulesPreset: newConfig.rules,
|
|
726
|
+
runtime: newConfig.runtime, rulesPreset: newConfig.rules, payloadPlatforms: newPlatforms,
|
|
744
727
|
});
|
|
745
728
|
const diff = diffManifest(oldManifest, newTempManifest);
|
|
746
729
|
|
|
@@ -750,10 +733,10 @@ export async function runConfig(directory, options = {}) {
|
|
|
750
733
|
console.log(chalk.blue(`\n 删除多余 skills (${platformLabel(p)}):`));
|
|
751
734
|
await removeSkillFiles(p, projectRoot, diff.skills.removed, false);
|
|
752
735
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
736
|
+
}
|
|
737
|
+
if (diff.rules.removed.length) {
|
|
738
|
+
console.log(chalk.blue('\n 删除多余内置 rules:'));
|
|
739
|
+
await removeBuiltinRuleFiles(projectRoot, diff.rules.removed, false);
|
|
757
740
|
}
|
|
758
741
|
}
|
|
759
742
|
|
|
@@ -778,7 +761,7 @@ export async function runConfig(directory, options = {}) {
|
|
|
778
761
|
console.log(chalk.blue(' Skills:'));
|
|
779
762
|
await installSkills(p, newSkillList, projectRoot, false, newConfig.runtime);
|
|
780
763
|
|
|
781
|
-
console.log(chalk.blue('\n Settings &
|
|
764
|
+
console.log(chalk.blue('\n Settings & Hooks:'));
|
|
782
765
|
await installSettings(p, projectRoot, {}, false, newConfig.runtime);
|
|
783
766
|
|
|
784
767
|
console.log(chalk.blue('\n Project Memory:'));
|
|
@@ -786,22 +769,22 @@ export async function runConfig(directory, options = {}) {
|
|
|
786
769
|
}
|
|
787
770
|
}
|
|
788
771
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
}
|
|
804
|
-
} else
|
|
772
|
+
if (allTargetPlatforms.length > 0 && (platformsToAdd.length > 0 || needsReinstall)) {
|
|
773
|
+
console.log(chalk.blue('\n Built-in Rules:'));
|
|
774
|
+
await installBuiltinRules(projectRoot, false, newConfig.runtime);
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
// 5e. Pipeline
|
|
778
|
+
if (newConfig.runtime !== currentConfig.runtime
|
|
779
|
+
|| runtimeManifestNeedsNormalization
|
|
780
|
+
|| runtimeOptionNeedsNormalization
|
|
781
|
+
|| !await fs.pathExists(path.join(projectRoot, '.prizmkit', 'dev-pipeline', 'cli.py'))) {
|
|
782
|
+
console.log(chalk.blue('\n 安装 Pipeline:'));
|
|
783
|
+
await installPipeline(projectRoot, false, {
|
|
784
|
+
runtime: newConfig.runtime,
|
|
785
|
+
previousRuntime: currentConfig.runtime,
|
|
786
|
+
});
|
|
787
|
+
} else {
|
|
805
788
|
const staleManagedPipelineFiles = await findStaleManagedPipelineFiles(projectRoot, newConfig.runtime);
|
|
806
789
|
if (staleManagedPipelineFiles.length) {
|
|
807
790
|
console.log(chalk.blue('\n 移除过期 Pipeline 框架文件:'));
|
|
@@ -846,7 +829,6 @@ export async function runConfig(directory, options = {}) {
|
|
|
846
829
|
aiCli: newConfig.aiCli,
|
|
847
830
|
rulesPreset: newConfig.rules,
|
|
848
831
|
payloadPlatforms: newPlatforms,
|
|
849
|
-
extras: normalizedExtras,
|
|
850
832
|
});
|
|
851
833
|
|
|
852
834
|
// Preserve original installedAt
|
|
@@ -869,6 +851,5 @@ export async function runConfig(directory, options = {}) {
|
|
|
869
851
|
console.log(chalk.gray(` 平台: ${platformLabel(newConfig.platform)}`));
|
|
870
852
|
console.log(chalk.gray(` 运行时: ${runtimeLabel(newConfig.runtime)}`));
|
|
871
853
|
console.log(chalk.gray(` AI CLI: ${newConfig.aiCli || '(未设置)'}`));
|
|
872
|
-
console.log(chalk.gray(` 流水线: ${newConfig.pipeline ? '启用' : '禁用'}`));
|
|
873
854
|
console.log('');
|
|
874
855
|
}
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* create-prizmkit 交互式主流程
|
|
3
3
|
*
|
|
4
4
|
* 引导用户选择目标平台、底层 AI CLI 并确认安装摘要,
|
|
5
|
-
* 默认安装完整 core
|
|
5
|
+
* 默认安装完整 core 技能套件、全部内置规则和 dev-pipeline,
|
|
6
6
|
* 然后调用 scaffold.js 执行纯净安装。
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -68,8 +68,6 @@ export async function runScaffold(directory, options = {}) {
|
|
|
68
68
|
|
|
69
69
|
// 兼容旧 --skills 参数:输出弃用警告并始终归一为 core
|
|
70
70
|
const skillSuite = normalizeSkillSuite(options.skills, { warn: true, warnOnCore: true });
|
|
71
|
-
const pipeline = options.pipeline !== false;
|
|
72
|
-
const playwrightCli = options.playwrightCli !== false;
|
|
73
71
|
|
|
74
72
|
// === 非交互式模式 ===
|
|
75
73
|
if (options.nonInteractive) {
|
|
@@ -81,8 +79,6 @@ export async function runScaffold(directory, options = {}) {
|
|
|
81
79
|
platform: options.platform,
|
|
82
80
|
runtime: normalizeRuntime(options.runtime),
|
|
83
81
|
skills: skillSuite,
|
|
84
|
-
pipeline,
|
|
85
|
-
playwrightCli,
|
|
86
82
|
aiCli: options.aiCli || '',
|
|
87
83
|
aiCliLaunch: resolveAiCliLaunchSelection(options.aiCli || '', {
|
|
88
84
|
headlessPromptArg: options.headlessPromptArg,
|
|
@@ -116,8 +112,7 @@ export async function runScaffold(directory, options = {}) {
|
|
|
116
112
|
console.log(` 运行时: ${chalk.cyan(runtimeLabel(runtime))}`);
|
|
117
113
|
console.log(` 平台: ${chalk.cyan(selectedPlatformLabel)}`);
|
|
118
114
|
console.log(` 技能: ${chalk.cyan(`Core (${coreSkillCount} 个)`)}`);
|
|
119
|
-
console.log(` 流水线: ${
|
|
120
|
-
console.log(` 浏览器工具: ${playwrightCli ? chalk.green('playwright-cli') : chalk.gray('禁用')}`);
|
|
115
|
+
console.log(` 流水线: ${chalk.cyan('dev-pipeline')}`);
|
|
121
116
|
console.log(` 规则: ${chalk.cyan(`全部内置规则 (${ruleCount} 条)`)}`);
|
|
122
117
|
if (aiCli) console.log(` AI CLI: ${chalk.cyan(aiCli)}`);
|
|
123
118
|
console.log(` 目标目录: ${projectRoot}`);
|
|
@@ -134,8 +129,6 @@ export async function runScaffold(directory, options = {}) {
|
|
|
134
129
|
platform,
|
|
135
130
|
runtime,
|
|
136
131
|
skills: skillSuite,
|
|
137
|
-
pipeline,
|
|
138
|
-
playwrightCli,
|
|
139
132
|
aiCli: aiCli || '',
|
|
140
133
|
aiCliLaunch,
|
|
141
134
|
projectRoot,
|