prizmkit 1.1.118 → 1.1.120

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/bin/create-prizmkit.js +1 -5
  2. package/bundled/VERSION.json +3 -3
  3. package/bundled/dev-pipeline/README.md +41 -38
  4. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +76 -0
  5. package/bundled/dev-pipeline/prizmkit_runtime/config.py +2 -8
  6. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +2 -4
  7. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -1
  8. package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +3 -3
  9. package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +21 -11
  10. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +45 -3
  11. package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +28 -6
  12. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +60 -102
  13. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +1 -19
  14. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -19
  15. package/bundled/dev-pipeline/scripts/{init-dev-team.py → init-change-artifact.py} +6 -16
  16. package/bundled/dev-pipeline/scripts/parse-stream-progress.py +364 -76
  17. package/bundled/dev-pipeline/scripts/utils.py +1 -1
  18. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
  19. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +7 -9
  20. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +2 -2
  21. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
  22. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -1
  23. package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +0 -2
  24. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -1
  25. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +6 -7
  26. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +6 -7
  27. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +4 -2
  28. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +2 -2
  29. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -2
  30. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +20 -0
  31. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +2 -2
  32. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +204 -141
  33. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +16 -10
  34. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +2 -13
  35. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +13 -14
  36. package/bundled/dev-pipeline/tests/test_unified_cli.py +227 -7
  37. package/bundled/skills/_metadata.json +1 -1
  38. package/bundled/skills/app-planner/SKILL.md +2 -2
  39. package/bundled/skills/app-planner/references/architecture-decisions.md +1 -3
  40. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +4 -2
  41. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +40 -1
  42. package/bundled/skills/feature-pipeline-launcher/SKILL.md +4 -2
  43. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +40 -1
  44. package/bundled/skills/prizmkit-code-review/SKILL.md +16 -14
  45. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +9 -9
  46. package/bundled/skills/prizmkit-implement/SKILL.md +21 -1
  47. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +67 -0
  48. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +4 -2
  49. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +40 -1
  50. package/package.json +1 -1
  51. package/src/clean.js +12 -8
  52. package/src/config.js +24 -42
  53. package/src/index.js +1 -10
  54. package/src/manifest.js +3 -9
  55. package/src/metadata.js +0 -26
  56. package/src/prompts.js +0 -13
  57. package/src/scaffold.js +76 -201
  58. package/src/upgrade.js +16 -33
  59. package/bundled/adapters/claude/agent-adapter.js +0 -96
  60. package/bundled/adapters/claude/team-adapter.js +0 -183
  61. package/bundled/adapters/codebuddy/agent-adapter.js +0 -42
  62. package/bundled/adapters/codebuddy/team-adapter.js +0 -46
  63. package/bundled/adapters/codex/agent-adapter.js +0 -38
  64. package/bundled/adapters/codex/team-adapter.js +0 -37
  65. package/bundled/agents/prizm-dev-team-dev.md +0 -123
  66. package/bundled/agents/prizm-dev-team-reviewer.md +0 -113
  67. package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +0 -65
  68. package/bundled/dev-pipeline/templates/bootstrap-tier1.md +0 -436
  69. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +0 -510
  70. package/bundled/team/prizm-dev-team.json +0 -27
@@ -50,7 +50,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
50
50
 
51
51
  0. **NON-INTERACTIVE MODE** — There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
52
52
 
53
- 1. **context-snapshot.md is your single source of truth** — After Phase 1-2 builds it, ALWAYS read context-snapshot.md instead of re-reading individual source files
53
+ 1. **context-snapshot.md is your single source of truth** — After Phase 1-2 makes it available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
54
54
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
55
55
  3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Reviewer subagents must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
56
56
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
@@ -205,14 +205,13 @@ Before starting, check plan.md Tasks:
205
205
 
206
206
  **Build artifacts rule**: After any build/compile command, ensure output is in `.gitignore`. Never commit binaries/build output.
207
207
 
208
- **3a.** Run `/prizmkit-implement` directly — you (the orchestrator) execute the full cycle:
209
- - Read plan.md Tasks from `.prizmkit/specs/{{FEATURE_SLUG}}/`
210
- - Use context-snapshot.md Section 4 File Manifest for targeted reads do NOT re-read files already summarized there
208
+ **3a.** Run `/prizmkit-implement` directly:
209
+ - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
210
+ - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
211
+ - If implementation is delegated to a Dev subagent, the subagent must read `spec.md` if the artifact exists, plus `plan.md` and `context-snapshot.md`, before editing
212
+ - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
211
213
  - Implements task-by-task, marking each `[x]` immediately
212
- - Creates/updates L2 `.prizm` docs when creating new modules
213
- - Defers scoped/full test execution until after the code-review loop completes
214
- - Preserves Reviewer behavior; only the top-level implementation Dev handoff is removed
215
- - If plan.md has >5 tasks: update checkpoints after every 3 tasks
214
+ - Remeber to update checkpoints after finishing a series of tasks
216
215
 
217
216
  **3b. Focused checks only (no test gate here)**:
218
217
  - During implementation, do not run mandatory periodic or full-suite tests.
@@ -507,7 +506,6 @@ Rules for writing completion notes:
507
506
  |----------|------|
508
507
  | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
509
508
  | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
510
- | Team Config | `{{TEAM_CONFIG_PATH}}` |
511
509
  | Project Root | {{PROJECT_ROOT}} |
512
510
  | Feature List Path | {{FEATURE_LIST_PATH}} |
513
511
 
@@ -12,9 +12,9 @@ If `FAST_PATH=true`, skip this phase intentionally:
12
12
 
13
13
  Then continue to the next checkpoint step.
14
14
 
15
- Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`.
15
+ Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The code-review skill loads its skill-owned `references/reviewer-agent-prompt.md` prompt and launches the internal reviewer in `current-workspace / active-checkout / no-worktree` mode.
16
16
 
17
- The skill runs its internal Reviewer Agent → filter → orchestrator fix loop and writes `review-report.md`.
17
+ The skill runs its internal Reviewer Agent → filter → orchestrator fix loop and writes `review-report.md`. Do not request worktree isolation or use `.claude/worktrees/...` / `.prizmkit/state/worktrees/...`; outer runner `USE_WORKTREE` settings do not permit review subagent isolation.
18
18
 
19
19
  **Gate Check — Review Report**:
20
20
 
@@ -4,7 +4,7 @@ You are running in **headless non-interactive mode** with a FINITE context windo
4
4
 
5
5
  0. **NON-INTERACTIVE MODE** — There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
6
6
 
7
- 1. **context-snapshot.md is your single source of truth** — After it is built, ALWAYS read context-snapshot.md instead of re-reading individual source files
7
+ 1. **context-snapshot.md is your single source of truth** — After it is available, use it instead of re-reading individual source files. If you just created or updated it in this session, continue from the in-context content; read it only when resuming/continuing, after context compaction/loss, or when handing work to a subagent.
8
8
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
9
9
  3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Reviewer subagents must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
10
10
  4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
@@ -4,5 +4,4 @@
4
4
  |----------|------|
5
5
  | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
6
6
  | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
- | Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
8
7
  | Project Root | {{PROJECT_ROOT}} |
@@ -4,7 +4,5 @@
4
4
  |----------|------|
5
5
  | Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
6
6
  | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
7
- | Team Config | `{{TEAM_CONFIG_PATH}}` |
8
- | Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
9
7
  | Project Root | {{PROJECT_ROOT}} |
10
8
  | Feature List Path | {{FEATURE_LIST_PATH}} |
@@ -1,12 +1,17 @@
1
1
  ### Architecture Sync & Commit (SINGLE COMMIT) — DO NOT SKIP
2
2
 
3
- **a.** Check if feature already committed:
3
+ **a.** Check if feature already committed by inspecting recent git history for `{{FEATURE_ID}}`:
4
4
  ```bash
5
5
  git log --oneline
6
6
  ```
7
7
  - If a commit for `{{FEATURE_ID}}` already exists → **skip d** (do NOT run /prizmkit-committer, do NOT run git reset, do NOT stage or unstage anything). Proceed directly to e Final verification.
8
8
  - If no existing commit → proceed normally with b–d.
9
9
 
10
+ **Feature Documentation Policy**:
11
+ - Run `/prizmkit-retrospective` before commit to update `.prizmkit/prizm-docs/` with durable structural knowledge from this feature.
12
+ - Capture architecture knowledge when the feature adds interfaces, dependencies, observable behavior, modules, or durable TRAPS/RULES/DECISIONS.
13
+ - Commit prefix: `feat({{FEATURE_ID}}):`.
14
+
10
15
  **b.** Run `/prizmkit-retrospective` (**before commit**, maintains `.prizmkit/prizm-docs/` architecture index):
11
16
  1. **Structural sync**: update KEY_FILES/INTERFACES/DEPENDENCIES/file counts for changed modules
12
17
  2. **Architecture knowledge**: extract TRAPS, RULES, DECISIONS from completed work into `.prizmkit/prizm-docs/`
@@ -32,6 +37,8 @@ git status --short
32
37
  ```
33
38
  Working tree MUST be clean after this step. If any feature-related files remain, stage them explicitly and amend the SAME commit with `git commit --amend --no-edit`; do NOT create a separate commit.
34
39
 
40
+ **Exception**: `session-summary.md` in the artifact directory is a local cross-session artifact generated by `/prizmkit-committer` — it is NOT committed to git. Ignore it in the clean-tree check.
41
+
35
42
  **f.** Write completion summary for downstream dependency context:
36
43
 
37
44
  Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
@@ -11,14 +11,13 @@ Before starting, check plan.md Tasks:
11
11
 
12
12
  **Build artifacts rule**: After any build/compile command, ensure output is in `.gitignore`. Never commit binaries/build output.
13
13
 
14
- **3a.** Run `/prizmkit-implement` directly — you (the orchestrator) execute the full cycle:
15
- - Read plan.md Tasks from `.prizmkit/specs/{{FEATURE_SLUG}}/`
16
- - Use context-snapshot.md Section 4 File Manifest for targeted reads do NOT re-read files already summarized there
14
+ **3a.** Run `/prizmkit-implement` directly:
15
+ - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
16
+ - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
17
+ - If implementation is delegated to a Dev subagent, the subagent must read `spec.md` if the artifact exists, plus `plan.md` and `context-snapshot.md`, before editing
18
+ - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
17
19
  - Implements task-by-task, marking each `[x]` immediately
18
- - Creates/updates L2 `.prizm` docs when creating new modules
19
- - Defers scoped/full test execution until after the code-review loop completes
20
- - Preserves Reviewer behavior; only the top-level implementation Dev handoff is removed
21
- - If plan.md has >5 tasks: update checkpoints after every 3 tasks
20
+ - Remeber to update checkpoints after finishing a series of tasks
22
21
 
23
22
  **3b. Focused checks only (no test gate here)**:
24
23
  - During implementation, do not run mandatory periodic or full-suite tests.
@@ -11,14 +11,13 @@ Before starting, check plan.md Tasks:
11
11
 
12
12
  **Build artifacts rule**: After any build/compile command, ensure output is in `.gitignore`. Never commit binaries/build output.
13
13
 
14
- **3a.** Run `/prizmkit-implement` directly — you (the orchestrator) execute the full cycle:
15
- - Read plan.md Tasks from `.prizmkit/specs/{{FEATURE_SLUG}}/`
16
- - Use context-snapshot.md Section 4 File Manifest for targeted reads do NOT re-read files already summarized there
14
+ **3a.** Run `/prizmkit-implement` directly:
15
+ - Continue from the `spec.md` / `plan.md` / `context-snapshot.md` content you created in Phase 1-2; do not re-read self-authored artifacts just because implementation starts
16
+ - Re-read `plan.md` or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
17
+ - If implementation is delegated to a Dev subagent, the subagent must read `spec.md` if the artifact exists, plus `plan.md` and `context-snapshot.md`, before editing
18
+ - Use context-snapshot.md Section 4 File Manifest for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
17
19
  - Implements task-by-task, marking each `[x]` immediately
18
- - Creates/updates L2 `.prizm` docs when creating new modules
19
- - Defers scoped/full test execution until after the code-review loop completes
20
- - Preserves Reviewer behavior; only the top-level implementation Dev handoff is removed
21
- - If plan.md has >5 tasks: update checkpoints after every 3 tasks
20
+ - Remeber to update checkpoints after finishing a series of tasks
22
21
 
23
22
  **3b. Focused checks only (no test gate here)**:
24
23
  - During implementation, do not run mandatory periodic or full-suite tests.
@@ -6,8 +6,10 @@
6
6
  - Follow Context Budget Rules §10 after build/compile commands.
7
7
 
8
8
  **3a.** Run `/prizmkit-implement` — this handles the implementation cycle:
9
- - Reads plan.md Tasks section from `.prizmkit/specs/{{FEATURE_SLUG}}/`
10
- - Reads context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest)
9
+ - Continue from the plan/context you just created; do not re-read self-authored artifacts just because implementation starts
10
+ - Re-read plan.md or `context-snapshot.md` only when resuming/continuing, when current context was compacted or lost, or when task checkbox state may have changed outside this session
11
+ - If implementation is delegated to a subagent, the subagent must read `plan.md` and `context-snapshot.md` before editing
12
+ - Uses context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest) for targeted source reads; avoid re-reading source files already summarized there unless they changed after the snapshot
11
13
  - Implements task-by-task, marking each `[x]` immediately
12
14
  - Creates/updates L2 `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant L2 based on complexity and importance
13
15
  - Does not run the scoped/full test gate; testing happens after code review in the PrizmKit Test phase
@@ -2,9 +2,9 @@
2
2
 
3
3
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The code-review skill loads its skill-owned `references/reviewer-agent-prompt.md` prompt and launches the internal reviewer in `current-workspace / active-checkout / no-worktree` mode.
6
6
 
7
- The skill runs an internal review-fix loop (Reviewer Agent → filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory.
7
+ The skill runs an internal review-fix loop (Reviewer Agent → filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory. Do not request worktree isolation or use `.claude/worktrees/...` / `.prizmkit/state/worktrees/...`; outer runner `USE_WORKTREE` settings do not permit review subagent isolation.
8
8
 
9
9
  **Gate Check — Review Report**:
10
10
  After `/prizmkit-code-review` returns, verify the review report:
@@ -2,9 +2,11 @@
2
2
 
3
3
  Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The code-review skill loads its skill-owned `references/reviewer-agent-prompt.md` prompt and launches the internal reviewer in `current-workspace / active-checkout / no-worktree` mode.
6
6
 
7
- The skill runs an internal review-fix loop (Reviewer Agent filter orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory.
7
+ If the reviewer spawn fails with team/config/lock errors, retry at most once. If the second attempt fails, do not keep spawning variants and do not enter report-polling loops for review markers; write `failure-log.md` with the spawn error and use the documented inline fallback only when safe.
8
+
9
+ The skill runs an internal review-fix loop (Reviewer Agent → filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory. Do not request worktree isolation or use `.claude/worktrees/...` / `.prizmkit/state/worktrees/...`; outer runner `USE_WORKTREE` settings do not permit review subagent isolation.
8
10
 
9
11
  **Gate Check — Review Report**:
10
12
  After `/prizmkit-code-review` returns, verify the review report:
@@ -9,6 +9,15 @@ Check existing artifacts first:
9
9
  - `context-snapshot.md` exists → use it directly, skip context snapshot building
10
10
  - Some missing → generate only missing files
11
11
 
12
+ Before planning, check whether feature code already exists in the project (use the helper to search source directories identified from `root.prizm` or the project tree scan):
13
+ ```bash
14
+ {{RUNTIME_HELPER_CMD}} text search . --pattern "{{FEATURE_SLUG}}" --json
15
+ ```
16
+
17
+ Record result as `EXISTING_CODE` (helper `match` entries for source files, or empty; ignore `.prizmkit/` artifact matches).
18
+
19
+ If `EXISTING_CODE` is non-empty: your spec/plan/tasks must reflect this existing implementation — document what exists, identify gaps, and do NOT re-implement what is already done.
20
+
12
21
  **Step A — Build Context Snapshot** (skip if `context-snapshot.md` already exists):
13
22
 
14
23
  1. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1/L2 prizm docs
@@ -60,4 +69,15 @@ Before proceeding past CP-1, verify:
60
69
 
61
70
  **CP-1**: Both spec.md and plan.md exist.
62
71
 
72
+ ### Plan Self-Check — Orchestrator Direct
73
+
74
+ Do not spawn a top-level Reviewer subagent for planning analysis. Perform a bounded self-check before implementation:
75
+
76
+ 1. Re-read only `context-snapshot.md`, `spec.md`, and `plan.md`.
77
+ 2. Cross-check spec.md and plan.md Tasks against the feature description and Verification Gates in the Task Contract.
78
+ 3. Verify the plan references the File Manifest and avoids unrelated work.
79
+ 4. If you find CRITICAL issues, fix ONLY those issues in spec.md/plan.md before continuing.
80
+
81
+ **CP-1.5**: Plan self-check complete; no CRITICAL plan issues remain.
82
+
63
83
 
@@ -1,8 +1,8 @@
1
1
  ### Phase 3: Review — Code Review & Behavior Verification
2
2
 
3
- Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`.
3
+ Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The code-review skill loads its skill-owned `references/reviewer-agent-prompt.md` prompt and launches the internal reviewer in `current-workspace / active-checkout / no-worktree` mode.
4
4
 
5
- Do not spawn a top-level Reviewer subagent. The code-review skill owns its internal Reviewer Agent → filter → orchestrator fix loop.
5
+ Do not spawn a top-level Reviewer subagent. The code-review skill owns its internal Reviewer Agent → filter → orchestrator fix loop. Do not request worktree isolation or use `.claude/worktrees/...` / `.prizmkit/state/worktrees/...`; outer runner `USE_WORKTREE` settings do not permit review subagent isolation.
6
6
 
7
7
  **Gate Check — Review Report**:
8
8