prizmkit 1.1.196 → 1.1.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-prizmkit.js +0 -2
- 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/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 +13 -15
- package/src/index.js +1 -5
- package/src/manifest.js +3 -6
- package/src/platforms.js +0 -14
- package/src/scaffold.js +93 -313
- package/src/upgrade.js +32 -31
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Configuration Reference — Iterate Pipeline Command Builder
|
|
2
2
|
|
|
3
|
-
Use this reference to run bounded
|
|
3
|
+
Use this reference to run start-time bounded read-only AI CLI capability probing, present the Default Parameters Overview Table, apply the four ordered adaptive placement branches, and translate confirmed user choices into command fragments. This skill constructs and returns pipeline commands; it never executes pipeline runs or mutates state unless explicitly requested by the user.
|
|
4
4
|
|
|
5
5
|
## Configured AI CLI Prerequisite Command
|
|
6
6
|
|
|
@@ -15,48 +15,52 @@ python3 ./.prizmkit/dev-pipeline/cli.py diagnostics ai-cli
|
|
|
15
15
|
|
|
16
16
|
`diagnostics ai-cli` reports `detected_cli`, `platform`, `source`, `runtime_mode`, `model_arg_supported`, `effort_flag_mode`, `supported_effort_values`, and `cli_available`, and exits non-zero if no AI CLI can be resolved (`detected_cli: (not found)`).
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Start-Time Read-Only CLI Capability Probe
|
|
19
19
|
|
|
20
|
-
- **
|
|
21
|
-
- **
|
|
22
|
-
1. Run `python3 ./.prizmkit/dev-pipeline/cli.py diagnostics ai-cli` — or `AI_CLI=<cli> python3 ./.prizmkit/dev-pipeline/cli.py diagnostics ai-cli` whenever the user explicitly specifies a
|
|
20
|
+
- **Non-start intents (skip probing)**: For `status`, `logs`, and `stop` intents (and resume requests whose mode and options are already explicitly confirmed), skip all read-only CLI probing (`diagnostics ai-cli` and `--help`) and output `Read-only CLI probe: skipped (non-start intent)`.
|
|
21
|
+
- **Start intent probe sequence**: Immediately after Step 2 execution-mode confirmation on every Start intent and unconfirmed Iterate Resume (before presenting Step 3 model/effort choices), execute this bounded read-only sequence:
|
|
22
|
+
1. Run `python3 ./.prizmkit/dev-pipeline/cli.py diagnostics ai-cli` — or `AI_CLI=<cli> python3 ./.prizmkit/dev-pipeline/cli.py diagnostics ai-cli` whenever the user explicitly specifies a temporary `AI_CLI=<cli>` override (and preserve `AI_CLI=<cli>` in the returned launch command) — then read the structured capability fields directly: `detected_cli`, `platform`, `source`, `model_arg_supported` (`true`|`false`), `effort_flag_mode` (`flag`|`config`|`none`|`custom_ignored`), `supported_effort_values` (comma-separated values or `none`), and `cli_available` (`true`|`false`). Consume these structured fields directly with zero legacy fallback parsing; if any required capability field is absent, treat the probe as failed under Branch 1.
|
|
23
23
|
2. If `effort_flag_mode` is `custom_ignored`, route directly to Branch 2 without requiring `<cli> --help`.
|
|
24
24
|
3. Otherwise, verify that `cli_available` is `true` and the resolved `detected_cli` executable exists on `PATH` (when not `(not found)`), then run `<cli> --help` (and `<cli> exec --help` when the CLI exposes an `exec` subcommand or `effort_flag_mode` is `config`) to inspect live model flags, independent effort/thinking options, or model-embedded intensity syntax.
|
|
25
25
|
4. Keep every probe strictly read-only and bounded: never invoke prompt runs, interactive logins, file writes, Git mutations, or pipeline commands (`run`, `daemon start`, `stop`, `reset`). Record a concise summary of observed capability facts in `Read-only CLI probe:`.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Default Parameters Overview Table
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Display this table at the start of Step 3 (noting any pre-specified `--focus`, `--max-rounds`, or temporary `AI_CLI=<cli>` override as already specified so it is carried forward without re-asking):
|
|
30
|
+
|
|
31
|
+
| Parameter | Default | Meaning |
|
|
30
32
|
|---|---|---|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
- Custom interval — add `--checkpoint-every N` (positive integer >= 1; also activates checkpoint pauses when combined with `--max-rounds`).
|
|
45
|
-
- Disable checkpoint pauses — add `--no-checkpoint`.
|
|
46
|
-
2. **Max retries per feature**
|
|
47
|
-
- Default (3) — omit `MAX_RETRIES` or set `MAX_RETRIES=3`.
|
|
48
|
-
- Custom non-negative integer N — add `MAX_RETRIES=N`.
|
|
49
|
-
3. **Model (`MODEL`)**
|
|
33
|
+
| `focus` | Full product scope *(omit `--focus`)* | Evaluate the entire product without restricting to one focus area (env fallback: `ITERATE_FOCUS`) |
|
|
34
|
+
| `max-rounds` | AI autonomous judgment *(omit `--max-rounds`)* | Stop automatically when goals are reached or no high-value improvements remain (env fallback: `MAX_ROUNDS`) |
|
|
35
|
+
| `VERBOSE` | `1` | Enable verbose runtime session logging (runtime default is `0`; launcher emits `VERBOSE=1` by default) |
|
|
36
|
+
| `MAX_RETRIES` | `3` | Maximum retry attempts per feature task before marking failed |
|
|
37
|
+
| `STOP_ON_FAILURE` | `1` | Stop Phase C delivery or backlog draining immediately when a feature task fails (runtime default; omit when kept, emit `STOP_ON_FAILURE=0` to continue to other eligible features) |
|
|
38
|
+
| `checkpoint` | Every 5 completed rounds *(autonomous mode)* | Pause for human review (`PAUSE_CHECKPOINT_REVIEW`; skipped when `--max-rounds` is set unless `--checkpoint-every` is explicit) |
|
|
39
|
+
| `safety cap` | 10 rounds *(omit `PRIZMKIT_ITERATE_SAFETY_CAP`)* | Autonomous safety cap before pausing (`PAUSE_SAFETY_CAP`; applies when `--max-rounds` is omitted; coinciding thresholds prioritize `PAUSE_SAFETY_CAP`) |
|
|
40
|
+
|
|
41
|
+
## Focused Configuration Flow
|
|
42
|
+
|
|
43
|
+
Collect configuration in one focused round after showing the Default Parameters Overview Table. Always configure `MODEL` before `PRIZMKIT_EFFORT`:
|
|
44
|
+
|
|
45
|
+
1. **Model (`MODEL`)**
|
|
50
46
|
- Default — omit `MODEL` so the resolved AI CLI uses its default model.
|
|
51
47
|
- Explicit model — add `MODEL=<name>` (or single-quoted `MODEL='<model-with-level>'` for parameterized model syntax) when `model_arg_supported` is `true` (or when probing failed without diagnostics confirming `model_arg_supported: false` and the user explicitly confirms a model name).
|
|
52
48
|
- If `diagnostics ai-cli` reports `effort_flag_mode: custom_ignored`, warn clearly that the active custom launch profile ignores both `MODEL` and `PRIZMKIT_EFFORT` (pass provider flags via `.prizmkit/config.json` `ai_cli_launch.extra_args`). If `model_arg_supported: false` is reported for an unresolved/unsupported profile, warn that `MODEL` is not forwarded and leave it unset.
|
|
53
49
|
- **Per-item precedence**: global `MODEL` governs Phase A/B iterate evaluation and headless planning sessions and serves as the default for feature execution, while any individual feature item's `"model"` field in `.prizmkit/plans/feature-list.json` takes precedence over global `MODEL` when that feature runs.
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
50
|
+
2. **Reasoning effort (`PRIZMKIT_EFFORT`)** *(conditional — Branch 4 only)*
|
|
51
|
+
- Ask and emit `PRIZMKIT_EFFORT` strictly from the four ordered placement branches below (never hardcode one universal effort list or CLI allowlist).
|
|
52
|
+
- Omit the question and never emit `PRIZMKIT_EFFORT` under Branches 1–3, empty capability intersection, or model-embedded intensity syntax.
|
|
53
|
+
- Default under Branch 4 — omit `PRIZMKIT_EFFORT`.
|
|
54
|
+
3. **Customize other default parameters?**
|
|
55
|
+
- `No (Recommended — use all defaults from the table)` — apply table defaults directly without asking routine parameters one by one.
|
|
56
|
+
- `Yes — customize specific defaults` — ask one follow-up prompt collecting and validating only the specific table overrides:
|
|
57
|
+
- `focus`: shell-quoted `--focus "<direction>"` (or omit for full product scope).
|
|
58
|
+
- `max-rounds`: positive integer >= 1 (`--max-rounds N`; skips default 5-round checkpoint pause unless `--checkpoint-every` is explicit).
|
|
59
|
+
- `VERBOSE`: boolean (`1` to enable; `0` or omit `VERBOSE` to disable).
|
|
60
|
+
- `MAX_RETRIES`: non-negative integer `N` (`MAX_RETRIES=N`).
|
|
61
|
+
- `STOP_ON_FAILURE`: boolean (`1` runtime default — omit; `0` explicitly emit `STOP_ON_FAILURE=0` to continue to other eligible features after a failure).
|
|
62
|
+
- `checkpoint`: positive integer >= 1 (`--checkpoint-every N`) or `--no-checkpoint` to disable checkpoint pauses.
|
|
63
|
+
- `safety cap`: positive integer >= 1 (`PRIZMKIT_ITERATE_SAFETY_CAP=N`; autonomous mode only).
|
|
60
64
|
|
|
61
65
|
## Adaptive Placement Branches (Evaluate 1 → 4 Strictly in Order)
|
|
62
66
|
|
|
@@ -64,43 +68,43 @@ Evaluate branches strictly from 1 to 4 using `diagnostics ai-cli` capability fie
|
|
|
64
68
|
|
|
65
69
|
1. **Branch 1 — Probe failed, CLI missing, or insufficient help output**:
|
|
66
70
|
- Condition: `diagnostics ai-cli` fails or exits non-zero, `detected_cli` is `(not found)` or missing on `PATH`, `cli_available` is `false`, required capability fields (`model_arg_supported`, `effort_flag_mode`, `supported_effort_values`, `cli_available`) are absent, OR (when `effort_flag_mode` is not `custom_ignored`) `<cli> --help` fails or yields insufficient output.
|
|
67
|
-
- Action: Never guess or synthesize `PRIZMKIT_EFFORT`. Omit `PRIZMKIT_EFFORT
|
|
71
|
+
- Action: Never guess or synthesize `PRIZMKIT_EFFORT`. Omit the `PRIZMKIT_EFFORT` question and variable, state the exact probe gap in `Read-only CLI probe:` and warnings, and allow an optional explicit `MODEL=<name>` only if diagnostics did not confirm `model_arg_supported: false` (otherwise leave `MODEL` unset).
|
|
68
72
|
2. **Branch 2 — Model-embedded intensity syntax or `custom_ignored` profile**:
|
|
69
73
|
- Condition: `effort_flag_mode` is `custom_ignored` (routed directly without letting `<cli> --help` failure trigger Branch 1), OR (`model_arg_supported` is `true`, no compatible independent effort mechanism applies — `effort_flag_mode` is `none`, or `supported_effort_values` is `none`, or `effort_flag_mode` is `flag` with no compatible effort/thinking flag in `--help`, excluding compatible `effort_flag_mode: config` — AND live `--help` documents encoding intensity inside the model identifier syntax such as `<model>:<level>` or parameterized model notation).
|
|
70
|
-
- Action: Omit `PRIZMKIT_EFFORT
|
|
74
|
+
- Action: Omit the `PRIZMKIT_EFFORT` question and variable. Under `custom_ignored`, warn clearly that the active custom launch profile ignores both `MODEL` and `PRIZMKIT_EFFORT` (configure provider flags via `.prizmkit/config.json` `ai_cli_launch.extra_args`), never emit `PRIZMKIT_EFFORT` (the runtime rejects non-empty `PRIZMKIT_EFFORT` pre-launch on custom profiles), and leave `MODEL` unset unless the user explicitly overrides. Under model-embedded intensity syntax, guide the user to set `MODEL=<model-with-level>` (or leave `MODEL` unset for the CLI default).
|
|
71
75
|
3. **Branch 3 — Independent effort explicitly unsupported**:
|
|
72
76
|
- Condition: Branches 1 and 2 do not match, AND `effort_flag_mode` is `none`, OR `supported_effort_values` is `none`, OR `effort_flag_mode` is `flag` yet live `--help` shows no compatible effort/thinking option (excluding compatible `effort_flag_mode: config`).
|
|
73
|
-
- Action: Do not emit `PRIZMKIT_EFFORT` (keep it unset so the runtime does not reject it pre-launch). Still permit `MODEL=<name>` when `model_arg_supported` is `true`.
|
|
77
|
+
- Action: Do not ask for or emit `PRIZMKIT_EFFORT` (keep it unset so the runtime does not reject it pre-launch). Still permit `MODEL=<name>` when `model_arg_supported` is `true`.
|
|
74
78
|
4. **Branch 4 — Independent effort compatible**:
|
|
75
79
|
- Condition: (`effort_flag_mode` is `flag` with live `--help` confirming a compatible effort/thinking option, OR `effort_flag_mode` is `config`) AND `supported_effort_values` is non-empty (not `none`).
|
|
76
|
-
- Action: When live `--help` enumerates concrete effort/thinking values, intersect those enumerated choices with `supported_effort_values`; if the intersection is empty, omit `PRIZMKIT_EFFORT` and disclose the capability mismatch rather than emitting an unvalidated value. Otherwise present the valid choices and emit `PRIZMKIT_EFFORT=<value>` (or omit for default). If the confirmed `MODEL` value
|
|
80
|
+
- Action: When live `--help` enumerates concrete effort/thinking values, intersect those enumerated choices with `supported_effort_values`; if the intersection is empty, omit the `PRIZMKIT_EFFORT` question and variable and disclose the capability mismatch rather than emitting an unvalidated value. Otherwise present the valid choices and emit `PRIZMKIT_EFFORT=<value>` (or omit for default). If the confirmed `MODEL` value (including one supplied in the same Step 3 round) already embeds a reasoning-effort suffix or parameter, omit `PRIZMKIT_EFFORT` by default and include a conflict-avoidance notice explaining that intensity is already encoded in `MODEL` so conflicting settings are not sent together.
|
|
77
81
|
|
|
78
82
|
## Command Construction Rules
|
|
79
83
|
|
|
80
|
-
- Foreground (`run iterate`): place environment assignments (`AI_CLI=...` when overridden, `VERBOSE=...`, `MAX_RETRIES=...`, `MODEL=...`, `PRIZMKIT_EFFORT=...`, `PRIZMKIT_ITERATE_SAFETY_CAP=...`) before `prizmkit` or `python3
|
|
81
|
-
- Background daemon (`daemon iterate start`): place environment assignments inside one `--env "..."` value
|
|
84
|
+
- Foreground (`run iterate`): place environment assignments (`AI_CLI=...` when overridden, `VERBOSE=...`, `MAX_RETRIES=...`, `STOP_ON_FAILURE=0` when disabled, `MODEL=...`, `PRIZMKIT_EFFORT=...`, `PRIZMKIT_ITERATE_SAFETY_CAP=...`) before `prizmkit` or `python3`. Default table values emit `VERBOSE=1` and omit `STOP_ON_FAILURE=1` because Runtime defaults `STOP_ON_FAILURE` to `1`.
|
|
85
|
+
- Background daemon (`daemon iterate start`): place environment assignments inside one `--env "..."` value. Default table values emit `--env "VERBOSE=1"` and omit `STOP_ON_FAILURE=1`.
|
|
82
86
|
- **Parameterized `MODEL` quoting**:
|
|
83
87
|
- Foreground: single-quote parameterized `MODEL` values containing colons, square brackets, parentheses, spaces, commas, or shell metacharacters:
|
|
84
88
|
```bash
|
|
85
89
|
# Short CLI
|
|
86
|
-
MODEL='<model-with-level>' VERBOSE=1
|
|
90
|
+
MODEL='<model-with-level>' VERBOSE=1 \
|
|
87
91
|
prizmkit run iterate
|
|
88
92
|
|
|
89
93
|
# Canonical Python Runtime
|
|
90
|
-
MODEL='<model-with-level>' VERBOSE=1
|
|
94
|
+
MODEL='<model-with-level>' VERBOSE=1 \
|
|
91
95
|
python3 ./.prizmkit/dev-pipeline/cli.py run iterate
|
|
92
96
|
```
|
|
93
97
|
- Background daemon: wrap `--env` in double quotes and single-quote the `MODEL` value inside it to preserve non-space parameterized syntax (colons, square brackets, parentheses, commas) on both POSIX and Windows:
|
|
94
98
|
```bash
|
|
95
99
|
# Short CLI
|
|
96
100
|
prizmkit daemon iterate start \
|
|
97
|
-
--env "VERBOSE=1
|
|
101
|
+
--env "VERBOSE=1 MODEL='<model-with-level>'"
|
|
98
102
|
|
|
99
103
|
# Canonical Python Runtime
|
|
100
104
|
python3 ./.prizmkit/dev-pipeline/cli.py daemon iterate start \
|
|
101
|
-
--env "VERBOSE=1
|
|
105
|
+
--env "VERBOSE=1 MODEL='<model-with-level>'"
|
|
102
106
|
```
|
|
103
|
-
If a `MODEL` value contains spaces, quote the whole `MODEL=...` assignment inside `--env` (for example, `--env "VERBOSE=1
|
|
107
|
+
If a `MODEL` value contains spaces, quote the whole `MODEL=...` assignment inside `--env` (for example, `--env "VERBOSE=1 'MODEL=<model with spaces>'"`) so both POSIX and Windows daemon env parsing preserve spaces cleanly.
|
|
104
108
|
- Do not pass `--dry-run` to `daemon iterate start`; `--dry-run` is supported only on foreground `run iterate`.
|
|
105
109
|
- Include only confirmed options and shell-quote custom `--focus` values and paths.
|
|
106
110
|
- Return only the confirmed execution mode (foreground or background daemon), providing both the short `prizmkit` command and the canonical `python3 ./.prizmkit/dev-pipeline/cli.py` command.
|
|
@@ -68,7 +68,7 @@ Inspect each visible path through the applicable contract: production behavior t
|
|
|
68
68
|
2. At the start of each execution, initialize a replacement report through the Report Renderer Contract and `${SKILL_DIR}/references/review-report-template.md`.
|
|
69
69
|
3. Within that execution, append every review round, repair batch, independent-review event, final verification, and exactly one `## Final Result` through the renderer or its visible equivalent fallback.
|
|
70
70
|
4. Start from the Main Agent's current requirement context and inspect the complete workspace inventory first: `git status --short`, the staged diff, and the unstaged diff. Include all non-ignored untracked, deleted, renamed, and copied paths in the correctness scope before producing findings.
|
|
71
|
-
5. Load active coding rules consciously before producing findings: if the reviewed changes land on frontend, backend, database, or mobile, Read `.prizmkit/rules/<layer>-rules.md` when
|
|
71
|
+
5. Load active coding rules consciously before producing findings: if the reviewed changes land 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 as code-review criteria. Never load all four files by default. If changes span 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) as `framework-coding-baseline`. 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.
|
|
72
72
|
6. Append one validated `scope-classification` renderer event containing the exact complete Git-visible in-scope paths and the active rule source (`active_rule_source`: `project-layer-rules` naming loaded path(s), `framework-coding-baseline` naming detected language/stack conventions, or `not-applicable` for non-layer changes). Do not maintain excluded-path metadata or claim ignored content was reviewed.
|
|
73
73
|
7. Reuse current context and load only missing or potentially stale material required to resolve a concrete ambiguity, verify an acceptance criterion, or understand a changed contract.
|
|
74
74
|
8. Inspect unchanged callers, dependents, contracts, or tests only when the in-scope diff changes or may violate an interface, shared behavior, or regression boundary. Do not perform an unconditional repository-wide dependency sweep.
|
|
@@ -65,7 +65,7 @@ The Main Agent supplies:
|
|
|
65
65
|
- the complete current Git-visible workspace status;
|
|
66
66
|
- all staged and unstaged tracked changes;
|
|
67
67
|
- all non-ignored untracked, deleted, renamed, and copied content;
|
|
68
|
-
- active rule source (`project-layer-rules` with the loaded `.prizmkit/rules/<layer>-rules.md` path(s) and
|
|
68
|
+
- active rule source (`project-layer-rules` with the loaded `.prizmkit/rules/<layer>-rules.md` path(s) and `.prizmkit/rules/builtin/{coding-baseline,cohesive-modeling}.md`, or `framework-coding-baseline` with `.prizmkit/rules/builtin/coding-baseline.md`, `.prizmkit/rules/builtin/cohesive-modeling.md`, and detected language/stack conventions) plus the three-tier override precedence;
|
|
69
69
|
- implementation task completion and targeted verification results;
|
|
70
70
|
- response number and total budget;
|
|
71
71
|
- prior adjudication, actual repairs, and repair verification on continuation or replacement.
|
|
@@ -108,7 +108,7 @@ Execution boundaries:
|
|
|
108
108
|
- Return REVIEW_BLOCKED rather than delegate or provide an incomplete success result.
|
|
109
109
|
- Do not expose private reasoning traces. Return only the required output.
|
|
110
110
|
|
|
111
|
-
First validate input consistency. Then review requirement and acceptance-criteria alignment, implementation completeness, concrete failure scenarios, error handling, security, authorization, data integrity, transaction/concurrency/state-transition behavior, public and internal contracts, compatibility and regression risk, test-boundary or evidence defects that can conceal incorrect behavior, and compliance with the active coding rules (`project-layer-rules` from exact `.prizmkit/rules/<layer>-rules.md` paths when present, or `framework-coding-baseline` with
|
|
111
|
+
First validate input consistency. Then review requirement and acceptance-criteria alignment, implementation completeness, concrete failure scenarios, error handling, security, authorization, data integrity, transaction/concurrency/state-transition behavior, public and internal contracts, compatibility and regression risk, test-boundary or evidence defects that can conceal incorrect behavior, and compliance with the active coding rules (`project-layer-rules` from exact `.prizmkit/rules/<layer>-rules.md` and `.prizmkit/rules/builtin/{coding-baseline,cohesive-modeling}.md` paths when present, or `framework-coding-baseline` with `.prizmkit/rules/builtin/coding-baseline.md`, `.prizmkit/rules/builtin/cohesive-modeling.md`, and detected language/stack conventions when `<layer>-rules.md` is absent) under three-tier override precedence without clarification pauses (Tier 1 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 framework `coding-baseline` and language conventions; L0 `RULES:` MUST/NEVER remain authoritative for that key).
|
|
112
112
|
|
|
113
113
|
Do not rewrite the plan, modify code, execute tests, or perform broad exploratory repository discovery.
|
|
114
114
|
|
|
@@ -38,7 +38,7 @@ Before editing:
|
|
|
38
38
|
2. Read `.prizmkit/prizm-docs/root.prizm` when present.
|
|
39
39
|
3. Follow its pointers to only the relevant direct-child module index and nested detail documentation. Before modifying source, read the complete relevant detail plus the complete parent/child documents needed to resolve its pointers; grep-only fragments are insufficient modification context.
|
|
40
40
|
4. If relevant detail documentation is missing, inspect only bounded target source files and narrowly implicated callers/contracts as fallback, record that detailed context was unavailable, and proceed without creating a placeholder. Context loading never creates or modifies documentation.
|
|
41
|
-
5. If the current task lands on frontend, backend, database, or mobile, Read `.prizmkit/rules/<layer>-rules.md` when
|
|
41
|
+
5. If the current task lands on frontend, backend, database, or mobile, perform an exact path Read of `.prizmkit/rules/builtin/coding-baseline.md`, `.prizmkit/rules/builtin/cohesive-modeling.md`, and `.prizmkit/rules/<layer>-rules.md` when those exact paths exist, and enforce them consciously during implementation. Never load all four files by default. If a task spans two layers, read both existing files. Map browser UI work to frontend, service or API work to backend, schema migration or ORM work to database, and iOS, Android, React Native, or Flutter work to mobile. Discover by exact path Read; do not depend on git tracking or glob. Use layer-rules only to fill HOW the plan does not specify. When `.prizmkit/rules/<layer>-rules.md` does not exist, do not block and do not silently skip—explicitly activate the built-in `coding-baseline` plus detected language/stack conventions (e.g., strict typing and no unhandled promises in TypeScript, no bare `except:` or mutable default arguments in Python, explicit `err` handling in Go, parameterized SQL) as the active `framework-coding-baseline` HOW guardrail. Enforce three-tier override precedence without a clarification pause: Tier 1 (highest) repository explicit contracts, current source and nested `.prizm` detail facts, committed OpenAPI/schemas, project linters/compilers, and host project instruction conventions; Tier 2 `.prizmkit/rules/<layer>-rules.md`; Tier 3 (fallback) framework `coding-baseline` and language conventions—when rules conflict, those current sources win without a clarification pause. L0 `RULES:` MUST/NEVER remain authoritative for that key.
|
|
42
42
|
|
|
43
43
|
## Optional Inline Delegation
|
|
44
44
|
|
|
@@ -175,17 +175,16 @@ Invoke prizmkit-prizm-docs (Init operation), passing the two-tier module structu
|
|
|
175
175
|
If `.prizmkit/config.json` action is `skip`, output `Skipped (exists)` and move to Phase 7; otherwise:
|
|
176
176
|
|
|
177
177
|
6a. Create `.prizmkit/` directory structure (if missing):
|
|
178
|
-
- `.prizmkit/config.json` (adoption_mode, platform installation metadata, detected_layers,
|
|
178
|
+
- `.prizmkit/config.json` (adoption_mode, platform installation metadata, detected_layers, tech_stack)
|
|
179
179
|
- `.prizmkit/specs/` (empty)
|
|
180
180
|
- `.prizmkit/plans/` (empty — needed by Phase 7 and future pipeline tasks)
|
|
181
181
|
|
|
182
182
|
6b. Read `${SKILL_DIR}/references/config-schema.md` for merge strategy, field definitions, and write detected `tech_stack` to `.prizmkit/config.json`.
|
|
183
183
|
|
|
184
|
-
6c. Write observed layers
|
|
185
|
-
- `"detected_layers": ["frontend", "backend"]` records only the observed layers from Phase 4.5
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
- Future re-detection updates observed layers without silently enabling or disabling rule profiles.
|
|
184
|
+
6c. Write observed layers to `.prizmkit/config.json` (alongside `tech_stack`):
|
|
185
|
+
- `"detected_layers": ["frontend", "backend"]` records only the observed layers from Phase 4.5. Active rule adoption is determined directly by the presence of `.prizmkit/rules/<layer>-rules.md` files (never tracked by a separate config boolean/array).
|
|
186
|
+
- For greenfield projects (Phase 4.5 skipped), write `"detected_layers": []` until code exists.
|
|
187
|
+
- Future re-detection updates observed layers without modifying existing `.prizmkit/rules/*` files.
|
|
189
188
|
|
|
190
189
|
**Phase 7: Project Brief Generation**
|
|
191
190
|
|
|
@@ -242,7 +241,7 @@ $ /prizmkit-init
|
|
|
242
241
|
Platform detected: Claude Code | Mode: Brownfield
|
|
243
242
|
Init Status Check: [missing] .prizmkit/prizm-docs/, config.json, project-brief.md -> generating all.
|
|
244
243
|
Tech stack: TypeScript, Node.js 20, React + Tailwind CSS, Express.js, PostgreSQL (Prisma), Vitest, Vite
|
|
245
|
-
Layer Detection: frontend, backend, database -> saved
|
|
244
|
+
Layer Detection: frontend, backend, database -> saved to detected_layers
|
|
246
245
|
Infrastructure Quick Scan: Database=PostgreSQL (Prisma), Deployment=Vercel -> written to main host instruction file (not .private.md)
|
|
247
246
|
Modules: src/ -> .prizmkit/prizm-docs/src.prizm (L1); core L2: src/routes.prizm, src/models.prizm (source-evidenced; edge dirs structural-only without ->; zero placeholder L2s)
|
|
248
247
|
Brief: inferred and confirmed -> .prizmkit/plans/project-brief.md
|
|
@@ -7,12 +7,11 @@ Handles re-init without losing user edits:
|
|
|
7
7
|
- Read existing `config.json` if present
|
|
8
8
|
- If `tech_stack` field exists AND `_auto_detected` is `false` or absent:
|
|
9
9
|
→ **SKIP** — user has manually configured tech stack, preserve their settings
|
|
10
|
-
- Always update `detected_layers` with fresh observed layer-detection results on every init run — detection is based on code that exists,
|
|
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.
|