prizmkit 1.1.111 → 1.1.112

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 (110) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
  3. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
  4. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +19 -73
  5. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +283 -421
  6. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
  7. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
  8. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
  9. package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
  10. package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
  11. package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
  12. package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
  13. package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
  14. package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
  15. package/bundled/dev-pipeline/scripts/utils.py +171 -0
  16. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  17. package/bundled/dev-pipeline/templates/bootstrap-tier2.md +10 -18
  18. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +14 -25
  19. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
  20. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
  21. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
  22. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
  23. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
  24. package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
  25. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
  26. package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
  27. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
  28. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
  32. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
  33. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
  34. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
  35. package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
  36. package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
  37. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +1 -1
  38. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
  39. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
  40. package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
  41. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
  42. package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
  43. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
  44. package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
  45. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
  47. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
  48. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
  49. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
  50. package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
  51. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +17 -5
  52. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +197 -0
  53. package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
  54. package/bundled/dev-pipeline/tests/test_utils.py +66 -1
  55. package/bundled/skills/_metadata.json +1 -1
  56. package/bundled/skills/app-planner/SKILL.md +8 -7
  57. package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
  58. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
  59. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
  60. package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
  61. package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
  62. package/bundled/skills/bug-planner/SKILL.md +6 -5
  63. package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
  64. package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
  65. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +30 -1
  66. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +16 -16
  67. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
  68. package/bundled/skills/feature-pipeline-launcher/SKILL.md +19 -11
  69. package/bundled/skills/feature-planner/SKILL.md +9 -11
  70. package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
  71. package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
  72. package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
  73. package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
  74. package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
  75. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
  76. package/bundled/skills/feature-workflow/SKILL.md +169 -298
  77. package/bundled/skills/prizmkit/SKILL.md +103 -57
  78. package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
  79. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
  80. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +12 -1
  81. package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
  82. package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
  83. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
  84. package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
  85. package/bundled/skills/prizmkit-init/SKILL.md +4 -3
  86. package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
  87. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
  88. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
  89. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
  90. package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
  91. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
  92. package/bundled/skills/prizmkit-test/SKILL.md +138 -141
  93. package/bundled/skills/prizmkit-test/references/examples.md +10 -8
  94. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
  95. package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
  96. package/bundled/skills/recovery-workflow/SKILL.md +195 -256
  97. package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
  98. package/bundled/skills/recovery-workflow/references/detection.md +48 -39
  99. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
  100. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +29 -11
  101. package/bundled/skills/refactor-planner/SKILL.md +2 -2
  102. package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
  103. package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
  104. package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
  105. package/bundled/skills/refactor-workflow/SKILL.md +173 -307
  106. package/package.json +1 -1
  107. package/src/scaffold.js +5 -0
  108. package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
  109. package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
  110. package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +0 -116
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "prizmkit"
3
- description: "Full-lifecycle dev toolkit index. Routes to the right PrizmKit skill for spec-driven development, Prizm docs, code quality, deployment, and knowledge management. Use when the user asks 'which command?', 'help', 'how do I start a feature', 'get started', 'what tools', 'dev workflow', 'lifecycle', or '/prizmkit'. Use this as the entry point for the full PrizmKit development lifecycle. (project)"
3
+ description: "Full-lifecycle PrizmKit development toolkit index. Routes users to the right core skill for project init, planning, implementation, review, docs maintenance, testing, commit, and deploy. Use when the user asks 'which command?', 'help', 'how do I start a feature', 'get started', 'what tools', 'dev workflow', 'lifecycle', or '/prizmkit'. Clarifies Direct edit vs Fast path vs Full path and asks whether ambiguous 'ship it' means commit or deploy. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit — Full-Lifecycle Development Toolkit
@@ -10,84 +10,130 @@ description: "Full-lifecycle dev toolkit index. Routes to the right PrizmKit ski
10
10
  - User wants to understand the PrizmKit development lifecycle
11
11
  - User invokes "/prizmkit" or asks about dev workflow
12
12
  - User is new to the project and needs orientation
13
+ - User says an ambiguous phrase such as "ship it" and intent could mean commit or deploy
13
14
 
14
15
  ### When NOT to Use
15
- - User already knows which specific skill to use — invoke it directly
16
- - Mid-implementation — use the specific skill needed (/prizmkit-implement, /prizmkit-code-review, etc.)
17
- - User wants to execute immediately without orientation — go directly to /prizmkit-plan or /prizmkit-implement
16
+ - User already knows which specific skill to use — invoke that skill directly
17
+ - Mid-implementation — use the specific skill needed (`/prizmkit-implement`, `/prizmkit-code-review`, etc.)
18
+ - User wants to execute immediately without orientation — route to the correct specific skill
18
19
 
19
20
  ## Task Execution Model
20
21
 
21
- PrizmKit uses **headless mode** each task runs as an independent AI CLI session with NO context carryover between tasks. Every session starts by reading docs and ends by maintaining docs.
22
+ PrizmKit uses self-contained task sessions. Each task starts by reading project context and ends by preserving durable knowledge when the change warrants it.
22
23
 
23
- **Per-task flow**:
24
- ```
25
- read docs → plan → implement → code-review → retrospective → committer
26
- ```
24
+ Per-task context normally comes from:
27
25
 
28
- Each task begins by reading context at two levels:
26
+ **Application level**:
27
+ - `.prizmkit/prizm-docs/root.prizm` — L0 project architecture index
28
+ - `.prizmkit/plans/project-brief.md` — product vision generated during project initialization
29
+ - `.prizmkit/config.json` — tech stack and runtime config
29
30
 
30
- **Application level** (read every session):
31
- - `.prizmkit/prizm-docs/root.prizm` — L0 project architecture index (modules, tech stack, conventions)
32
- - `.prizmkit/plans/project-brief.md` user's product vision checklist (generated during project initialization)
33
- - `.prizmkit/config.json` tech stack config, deploy strategy
31
+ **Task level**:
32
+ - `spec.md` / `plan.md` — change artifact for the current task
33
+ - Relevant `.prizmkit/prizm-docs/<module>.prizm` L1 docs
34
+ - Relevant L2 docs when they exist; if an L2 doc is missing, implementation reads the target source files as fallback and retrospective may create L2 afterward
34
35
 
35
- **Task level** (read for the specific task):
36
- - `spec.md` / `plan.md` — task specification and implementation plan
37
- - `.prizmkit/prizm-docs/<module>.prizm` (L1/L2) — architecture docs for affected modules (TRAPS, DECISIONS, INTERFACES)
36
+ ## Lifecycle Paths
38
37
 
39
- Each cycle produces spec, plan, and task artifacts that create a traceable record of what was built and why. `.prizmkit/prizm-docs/` stays in sync through retrospective, so the next session starts with up-to-date context.
38
+ Choose the lightest path that still protects correctness. Explain the chosen path briefly before proceeding.
40
39
 
41
- **Fast path** — for small, well-scoped changes, always ask user whether to use fast path:
42
- ```
43
- /prizmkit-plan /prizmkit-implement /prizmkit-committer
40
+ ### Direct edit
41
+
42
+ Use for low-risk work with no meaningful behavior or interface impact.
43
+
44
+ Examples:
45
+ - Typo or wording fixes
46
+ - Pure formatting
47
+ - Small documentation edits
48
+ - Tiny config tweaks with no behavior change
49
+
50
+ Direct edit does not create `spec.md` or `plan.md`. Run only the verification that fits the edit.
51
+
52
+ ### Fast path
53
+
54
+ Use for small, well-scoped behavior changes where a full lifecycle would add more process than value.
55
+
56
+ Default flow:
57
+
58
+ ```text
59
+ simplified /prizmkit-plan -> /prizmkit-implement -> conditional test/retro -> /prizmkit-committer
44
60
  ```
45
61
 
46
- ### Development Scenarios
62
+ Rules:
63
+ - Use a simplified `plan.md` with a Tasks section so implementation can resume safely.
64
+ - Full `/prizmkit-code-review` is optional unless risk or user request requires it.
65
+ - Run `/prizmkit-test` only when the change hits the risk-triggered testing criteria.
66
+ - Run `/prizmkit-retrospective` only when structure, interfaces, dependencies, behavior, or durable project knowledge changed.
47
67
 
48
- PrizmKit supports any development scenario through the same skill chain. `/prizmkit-plan` produces `spec.md` + `plan.md` regardless of the task type:
68
+ ### Full path
49
69
 
50
- | Scenario | Artifacts | When to Use |
51
- |----------|-----------|-------------|
52
- | **Feature** | `spec.md` → `plan.md` → code | New functionality, UI, API, data model changes |
53
- | **Bug Fix** | `spec.md` → `plan.md` → code | Complex defects, regressions, crash fixes. Simple bugs can use fast path directly. |
54
- | **Refactor** | `spec.md` → `plan.md` → code | Restructure, extract, rename, performance. No behavior change. |
70
+ Use for high-risk work, multi-module changes, new capabilities, architecture changes, public API/interface changes, data model/schema changes, security/permission/payment logic, or unclear requirements.
71
+
72
+ Default flow:
55
73
 
56
- All three follow the same per-task flow. Detailed documentation policies (when to update `.prizmkit/prizm-docs/`, when to skip steps) are defined within each skill — not here.
74
+ ```text
75
+ /prizmkit-plan -> /prizmkit-implement -> risk-triggered /prizmkit-test if needed -> /prizmkit-code-review -> /prizmkit-retrospective -> /prizmkit-committer
76
+ ```
77
+
78
+ Rules:
79
+ - `/prizmkit-plan` produces a full `spec.md` and `plan.md`.
80
+ - `/prizmkit-code-review` is the default quality gate.
81
+ - `/prizmkit-retrospective` is the normal development writer for `.prizmkit/prizm-docs/`.
82
+ - `/prizmkit-test` is risk-triggered rather than always mandatory.
57
83
 
58
- ### Best Practices for AI-Driven Development
84
+ ## Risk-Triggered Testing
59
85
 
60
- **Monorepo structure recommended**: Keep frontend, backend, and shared libraries in one repository. AI needs visibility into the full call chain — cross-repo references are invisible to it. If you have a multi-repo setup, add all related repos to the AI workspace so module boundaries and API contracts are discoverable.
86
+ Recommend or require `/prizmkit-test` when the change affects:
87
+ - Observable behavior
88
+ - Public interfaces or API contracts
89
+ - Data models, migrations, or schema
90
+ - Security, permissions, authentication, billing, payments, or entitlements
91
+ - Deployment readiness or user-requested quality verification
61
92
 
62
- **Module organization**: Ensure every meaningful module has a `.prizmkit/prizm-docs/` L1 doc. AI reads TRAPS and DECISIONS before modifying files undocumented modules get no guardrails.
93
+ Skip `/prizmkit-test` for pure docs, formatting, internal renames with no behavior change, or tiny config tweaks unless the user asks for tests.
63
94
 
64
- **Small, focused tasks**: Break large features into tasks that can each be completed in one AI session. The pipeline handles this automatically via `/prizmkit-plan` task decomposition.
95
+ ## Development Scenarios
96
+
97
+ PrizmKit supports any development scenario through the same skill chain. `/prizmkit-plan` produces a change artifact (`spec.md` + `plan.md`) regardless of whether the task is a feature, bug fix, refactor, or migration.
98
+
99
+ | Scenario | Artifacts | When to Use |
100
+ |----------|-----------|-------------|
101
+ | Feature | `spec.md` -> `plan.md` -> code | New functionality, UI, API, data model changes |
102
+ | Bug fix | `spec.md` -> `plan.md` -> code | Complex defects, regressions, crash fixes; simple bugs can use Direct edit or Fast path |
103
+ | Refactor | `spec.md` -> `plan.md` -> code | Restructure, extract, rename, performance work with behavior preservation |
65
104
 
66
105
  ## Core Skill Reference
67
106
 
68
107
  | Skill | Purpose | Trigger Phrases |
69
108
  |-------|---------|-----------------|
70
- | `/prizmkit-plan` | Specify and plan: turns natural language into spec.md + plan.md with architecture and executable tasks. Use as the **first implementation step** in the lifecycle, before /prizmkit-implement. | "specify", "plan", "new feature", "I want to add...", "architect", "break it down" |
71
- | `/prizmkit-implement` | Execute plan.md tasks with **TDD approach**, respecting task ordering and dependencies. Use after /prizmkit-plan as the **implementation step** of the lifecycle. | "implement", "build", "code it", "start coding" |
72
- | `/prizmkit-code-review` | **Iterative review-fix loop** against spec and plan (max 3 rounds until PASS). Spawns a reviewer agent; the main orchestrator applies accepted fixes directly. Use after /prizmkit-implement as the **quality gate**. | "review", "check code", "code review", "is it ready to commit" |
73
- | `/prizmkit-retrospective` | Incremental .prizmkit/prizm-docs/ maintainer: (1) **structural sync** of KEY_FILES/INTERFACES/DEPENDENCIES, (2) inject **TRAPS/RULES/DECISIONS**. Run after code review and **before committing**. | "retrospective", "retro", "update docs", "sync docs", "wrap up" |
74
- | `/prizmkit-committer` | **Pure git commit** with safety checks: stages files, generates Conventional Commits message, commits. Does NOT modify docs run /prizmkit-retrospective first. Use as the **final lifecycle step**. | "commit", "submit", "finish", "ship it" |
75
- | `/prizmkit-test` | **Full-stack test orchestration**: detects architecture, analyzes coverage gaps, generates missing unit/integration/E2E tests with a boundary coverage matrix, and outputs a unified report. Use after development and **before deploy** for quality verification. | "test", "run tests", "check quality", "verify code", "generate tests", "add tests" |
76
- | `/prizmkit-deploy` | **Universal deployment gateway**: discovers project type/target, automates SSH Linux PM2+Nginx+blue-green deploys, and manages operations status, logs, restart, rollback, health checks. | "deploy", "ship it", "go live", "rollback", "deploy status" |
77
- | `/prizmkit-init` | **Project bootstrap**: scans codebase, generates .prizmkit/prizm-docs/ and project brief, detects tech stack. Use as the **first lifecycle step for new projects**, or after `npx prizmkit install`. | "init", "initialize", "take over this project", "bootstrap" |
78
- | `/prizmkit-prizm-docs` | **Doc system spec and management**: defines the 3-level .prizmkit/prizm-docs/ hierarchy (L0/L1/L2), format rules, size limits, and loading protocol. Use for doc init/status/rebuild/validate/migrate. For **incremental code-driven updates**, use /prizmkit-retrospective instead. | "check docs", "rebuild docs", "validate docs", "prizm docs" |
79
-
80
- **Reading guide**:
81
- - Need code structure/modules/interfaces/traps/decisions? → `.prizmkit/prizm-docs/`
82
-
83
- ## Quick Start (First-Time Setup)
84
-
85
- 1. `npx prizmkit install .` installs skills, rules (`prizm-documentation.md`, `prizm-commit-workflow.md`), hooks, platform scaffolding
86
- 2. `/prizmkit-init` → scans project code, generates `.prizmkit/prizm-docs/`, detects tech stack, populates `.prizmkit/config.json`
87
- 3. `/prizmkit-plan` specify your first feature produces spec.md + plan.md
88
- 4. `/prizmkit-implement` → TDD implementation following the plan
89
- 5. `/prizmkit-code-review` → review before commit
90
- 6. `/prizmkit-retrospective` → sync `.prizmkit/prizm-docs/` with changes
91
- 7. `/prizmkit-committer` safe Conventional Commit
92
-
93
- > **Note**: Rules and hooks are installed by `npx prizmkit install`, not by `/prizmkit-init`.
109
+ | `/prizmkit-init` | Project bootstrap entry point: use before planning in a newly installed/taken-over project; scans codebase, generates `.prizmkit/prizm-docs/`, config, and project brief. | "init", "initialize", "take over this project", "bootstrap" |
110
+ | `/prizmkit-plan` | First implementation planning step: run ahead of `/prizmkit-implement` to turn natural language into `spec.md` + `plan.md` with executable tasks. | "specify", "plan", "new task", "architect", "break it down" |
111
+ | `/prizmkit-implement` | Implementation step: use after `/prizmkit-plan` to execute `plan.md` tasks with TDD where applicable, task order, and checkpoints. | "implement", "build", "code it", "start coding" |
112
+ | `/prizmkit-test` | Risk-triggered quality gate: run after implementation when behavior, interfaces, data, security, or deploy risk requires tests and boundary coverage. | "test", "run tests", "verify", "quality check", "boundary tests" |
113
+ | `/prizmkit-code-review` | Full path quality gate: run after implementation; requires the dedicated reviewer agent in the active checkout and stops if that launch mode is unavailable. | "review", "check code", "code review", "is it ready to commit" |
114
+ | `/prizmkit-retrospective` | Docs maintenance step: run after review/implementation when structure, interfaces, dependencies, behavior, or durable knowledge changed. | "retrospective", "retro", "update docs", "sync docs", "wrap up" |
115
+ | `/prizmkit-committer` | Final lifecycle commit step: use after required gates are satisfied; safely stages and creates a Conventional Commit without changing changelog by default. | "commit", "submit", "finish", "done" |
116
+ | `/prizmkit-prizm-docs` | Documentation system entry point: use for init/status/rebuild/validate/migrate or out-of-band repair, not normal development sync. | "initialize docs", "check docs", "rebuild docs", "validate docs", "docs drifted" |
117
+ | `/prizmkit-deploy` | Deployment lifecycle entry point: use after code is ready to release or for existing deployment operations. | "deploy", "go live", "take live", "release", "rollback", "deploy status" |
118
+
119
+ ## Ambiguous Ship Intent
120
+
121
+ If the user says only "ship it", ask whether they mean:
122
+
123
+ 1. Commit the current changes with `/prizmkit-committer`.
124
+ 2. Deploy or release the project with `/prizmkit-deploy`.
125
+
126
+ Do not route ambiguous "ship it" directly to commit or deploy without clarification.
127
+
128
+ ## Quick Start
129
+
130
+ 1. `npx prizmkit install .` — install skills, rules, hooks, and platform scaffolding
131
+ 2. `/prizmkit-init` — scan project, generate docs/config/brief
132
+ 3. `/prizmkit-plan` create a change artifact for the first non-trivial task
133
+ 4. `/prizmkit-implement` — implement plan tasks
134
+ 5. Run `/prizmkit-test` if risk-triggered
135
+ 6. Run `/prizmkit-code-review` for Full path or when requested/risk-triggered
136
+ 7. Run `/prizmkit-retrospective` if docs or durable knowledge changed
137
+ 8. `/prizmkit-committer` — safe Conventional Commit
138
+
139
+ > Rules and hooks are installed by `npx prizmkit install`, not by `/prizmkit-init`.
@@ -1,182 +1,163 @@
1
1
  ---
2
2
  name: "prizmkit-code-review"
3
- description: "Iterative review-fix loop against spec and plan. Spawns the dedicated prizm-dev-team-reviewer agent, filters findings, then the main orchestrator applies accepted fixes directly. Loops until PASS (max 3 rounds). Use after /prizmkit-implement as quality gate. Trigger on: 'review', 'check code', 'code review', 'is it ready to commit'. (project)"
3
+ description: "Iterative review-fix loop against spec and plan. Always uses the dedicated prizm-dev-team-reviewer agent in the active checkout with current-workspace / active-checkout / no-worktree launch; the Main Agent filters findings and applies accepted fixes directly. If the current platform cannot start an active-checkout reviewer, stop with tool incompatibility instead of falling back to Main-Agent self-review. Loops until PASS or max 3 rounds. Use after /prizmkit-implement for Full path quality gate or when the user says 'review', 'check code', 'code review', or 'is it ready to commit'. (project)"
4
4
  ---
5
5
 
6
6
  # PrizmKit Code Review
7
7
 
8
- An iterative review-fix loop that reviews code changes against the spec and plan, then automatically fixes accepted issues. Uses two separated roles:
8
+ An iterative review-fix loop that checks workspace changes against the task spec and plan. It separates review judgment from fix application by requiring a dedicated `prizm-dev-team-reviewer` subagent in the active checkout. Main Agent applies accepted fixes directly after filtering reviewer findings.
9
9
 
10
- - **Reviewer Agent** (`prizm-dev-team-reviewer`, read-only): analyzes orchestrator-provided workspace context against spec goals and plan decisions, then produces structured findings
11
- - **Main Agent** (orchestrator): filters Reviewer findings for reasonableness, applies accepted fixes directly in the active checkout, and coordinates the loop
10
+ Review modes:
11
+ - `reviewer-agent-active-checkout`: required mode. Always spawn `prizm-dev-team-reviewer` in the current active checkout with no worktree or remote isolation.
12
+ - `not-run-no-changes`: no workspace changes were detected.
12
13
 
13
- The loop repeats until the Reviewer finds no issues or the max round limit is reached.
14
+ If the platform cannot launch `prizm-dev-team-reviewer` in current-workspace / active-checkout / no-worktree mode, stop with this tool incompatibility message:
15
+
16
+ ```text
17
+ Cannot run /prizmkit-code-review because this platform cannot start prizm-dev-team-reviewer in the active checkout without worktree isolation.
18
+ ```
14
19
 
15
20
  ### When to Use
16
- - After `/prizmkit-implement` to verify code quality before commit
17
- - User says "review", "check code", "review my implementation"
18
- - As a quality gate before `/prizmkit-committer`
21
+ - After `/prizmkit-implement` as the Full path quality gate
22
+ - For Fast path only when risk, scope, or user request warrants review
23
+ - User says "review", "check code", "review my implementation", or "is it ready to commit"
24
+ - Before `/prizmkit-committer` when the chosen lifecycle path requires review
19
25
 
20
26
  ### When NOT to Use
21
- - Trivial changes (typo, single-line config) commit directly
22
- - No spec.md or plan.md exists nothing to review against
27
+ - Direct edit or low-risk Fast path where review is not required
28
+ - No spec.md or plan.md exists and there is no clear task goal to review against
29
+ - Trivial typo, formatting, or config-only changes that the user wants committed directly
23
30
 
24
31
  ## Input
25
32
 
26
33
  | Parameter | Required | Description |
27
34
  |-----------|----------|-------------|
28
- | `artifact_dir` | No | Directory containing spec.md + plan.md. If omitted, scan `.prizmkit/` subdirectories for the most recently modified directory with a `plan.md` whose tasks are all completed. When invoked as a handoff step, reuse the caller's `artifact_dir` rather than re-detecting. |
35
+ | `artifact_dir` | No | Directory containing `spec.md` + `plan.md`. If omitted, scan `.prizmkit/` subdirectories for the most recently modified directory with a completed `plan.md`. When invoked as a handoff step, reuse the caller's `artifact_dir` rather than re-detecting. |
29
36
 
30
37
  ## Phase 0: Context Loading
31
38
 
32
- 1. **Read spec.md** from the artifact directory extract goals and acceptance criteria.
33
- 2. **Read plan.md** from the artifact directory extract architecture decisions and completed tasks.
34
- 3. **Read scoped test report when present**:
35
- - If `{artifact_dir}/test-report-path.txt` exists, read the path, then read that `/prizmkit-test` report.
36
- - Extract `Scope`, `Generated / Updated Tests`, `In-Scope Failures`, `Baseline Failures`, `Out of Scope Gaps`, `Boundary Matrix` / `Boundary Completion Gate` when present, and `Verdict`.
37
- - If `context-snapshot.md` contains `## PrizmKit Test Gate`, read that summary too.
38
- - If this is a feature artifact under `.prizmkit/specs/` and no test report pointer or summary exists, pass `No scoped /prizmkit-test report found (expected for pre-test review)` into the Reviewer context as informational scope context only. Do not ask the Reviewer to report it as a missing gate unless the calling workflow explicitly requires a prior test report.
39
- 4. **Read dev rules** (if configured): If `.prizmkit/prizm-docs/root.prizm` exists, read it and check for a `RULES:` line. If present, read all referenced `.prizmkit/rules/<layer>-rules.md` files. If `root.prizm` or a referenced rules file does not exist, continue with "No custom dev rules configured — use general best practices."
40
- 5. **Capture workspace context from the active checkout** (do NOT open a separate worktree or clone):
41
- - Run `git status` to list modified, staged, untracked, and deleted files.
42
- - Run `git diff` for unstaged changes and `git diff --cached` for staged changes.
43
- - For new (untracked) files and renamed files in `git status`, note their full paths so the Reviewer can request targeted reads.
44
- - Capture the current project context: read `.prizmkit/prizm-docs/root.prizm` for relevant RULES, and the artifact's `plan.md` for architecture decisions — this is the reviewer's context baseline.
45
- - The workspace context is the **primary review scope**. The Reviewer must review this context and request only targeted file reads for lines it needs — it must not rediscover or re-index the whole repository.
46
- - If no changes are detected, skip Phase 1 and proceed to Phase 2 with verdict PASS, rounds 0, and an empty findings list. Always write `review-report.md`; downstream pipeline steps use it as the review gate.
39
+ 1. Read `spec.md` from the artifact directory and extract goals plus acceptance criteria.
40
+ 2. Read `plan.md` from the artifact directory and extract architecture decisions plus completed tasks.
41
+ 3. Read scoped `/prizmkit-test` report when present:
42
+ - If `{artifact_dir}/test-report-path.txt` exists, read the pointed report.
43
+ - Extract Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate, and Verdict when present.
44
+ - If no test report exists, pass `No scoped /prizmkit-test report found` as informational context. Do not treat missing tests as a review finding unless the current lifecycle path explicitly required testing.
45
+ 4. Read dev rules when configured: load `.prizmkit/prizm-docs/root.prizm`, then referenced `.prizmkit/rules/<layer>-rules.md` files if any exist.
46
+ 5. Capture active checkout workspace context:
47
+ - `git status`
48
+ - `git diff`
49
+ - `git diff --cached`
50
+ - full paths for untracked and renamed files
51
+ - relevant root.prizm RULES and plan decisions
52
+ 6. If no changes are detected, skip Phase 1 and write `review-report.md` with verdict PASS, rounds 0, and review mode `not-run-no-changes`.
47
53
 
48
54
  ## Phase 1: Review-Fix Loop
49
55
 
50
56
  ### Gate Mode Detection
51
57
 
52
- The loop exit conditions are enforced by a gatekeeper. Check Python availability first:
58
+ Check Python availability:
53
59
 
54
60
  ```bash
55
61
  python3 --version 2>/dev/null && echo "SCRIPT_MODE" || echo "TEXT_MODE"
56
62
  ```
57
63
 
58
- - **Script mode** (Python available): Use `${SKILL_DIR}/scripts/check_loop.py` to enforce exit conditions with round tracking, max-rounds enforcement, and divergence detection. The script prevents accidentally exceeding the 3-round limit.
59
- - **Text mode** (no Python): Follow §Text Fallback Constraints identical behavior enforced manually.
64
+ - Script mode: use `${SKILL_DIR}/scripts/check_loop.py` for round tracking, max-round enforcement, and divergence detection.
65
+ - Text mode: follow §Text Fallback Constraints manually with identical behavior.
60
66
 
61
67
  ### Step 0: Initialize Loop State
62
68
 
63
- The script is stateless — no `--reset` or runtime files. Initialize these values before starting:
64
-
65
- **Script mode** — `findings_history = []`, `max_rounds = 3`, `round = 1`.
66
- **Text mode** track manually: `round = 1`, `findings_history = []`.
69
+ - `round = 1`
70
+ - `max_rounds = 3`
71
+ - `findings_history = []`
72
+ - `review_mode = reviewer-agent-active-checkout` after confirming the dedicated reviewer can launch in the active checkout
67
73
 
68
- ### Loop Flow
69
-
70
- ```
71
- 1. Spawn Reviewer Agent (`subagent_type: prizm-dev-team-reviewer`) → findings or PASS
72
- 2. Parse result:
73
- - PASS → Call Loop Exit Gate → Phase 2
74
- - NEEDS_FIXES → count findings → Step 3 (do not call gate yet)
75
- 3. Main Agent filters findings → Call Loop Exit Gate → if endLoop: Phase 2
76
- 4. Main Agent applies accepted fixes directly in the active checkout
77
- 5. Increment round and return to Step 1
78
- ```
74
+ ### Step 1: Launch Required Reviewer
79
75
 
80
- ### Loop Exit Gate
76
+ Always spawn `prizm-dev-team-reviewer` using the dedicated subagent contract:
81
77
 
82
- Call the gate only in these cases:
83
-
84
- 1. Reviewer returned `PASS`.
85
- 2. Main Agent has finished filtering `NEEDS_FIXES` findings.
86
-
87
- Do not call the gate for `NEEDS_FIXES` before filtering, because `accepted_count` is not known yet. Only exit the loop when `endLoop` is `true` — the gate is the sole authority on exit decisions.
88
-
89
- **Script mode invocation:**
90
- ```bash
91
- echo '{"reviewer_result":"NEEDS_FIXES","accepted_count":2,"findings_count":3,"round":1,"findings_history":[],"max_rounds":3,"filtering_done":true}' | python3 ${SKILL_DIR}/scripts/check_loop.py
78
+ ```yaml
79
+ subagent_type: prizm-dev-team-reviewer
80
+ isolation: current-workspace / active-checkout / no-worktree
92
81
  ```
93
82
 
94
- | Input field | Type | Description |
95
- |-------------|------|-------------|
96
- | `reviewer_result` | `"PASS"` or `"NEEDS_FIXES"` | Reviewer's verdict |
97
- | `accepted_count` | int | Findings accepted by Main Agent. Use `0` for Reviewer PASS or when all findings were rejected after filtering. |
98
- | `findings_count` | int | Total findings returned by Reviewer this round |
99
- | `round` | int | Current round number (1-based, model-supplied — the script does not auto-increment) |
100
- | `findings_history` | `[int, ...]` | Findings count per round, used for divergence detection. Initialize as `[]`. Pass back the value from the previous gate call's output. |
101
- | `max_rounds` | int | Maximum review rounds before forced exit. Default `3`. |
102
- | `filtering_done` | bool | `true` only after Main Agent has filtered `NEEDS_FIXES` findings. For Reviewer PASS, this may be omitted. |
103
-
104
- Output: `{"endLoop": bool, "reason": str, "verdict": "PASS"|"NEEDS_FIXES"|null, "round": int, "maxRounds": int, "divergenceWarning": bool, "findings_history": [int, ...]}`
105
-
106
- The script enforces three exit conditions in order: (1) Reviewer PASS → exit with verdict PASS, (2) filtered `NEEDS_FIXES` with zero accepted findings → exit with verdict PASS, (3) max rounds reached after filtering → exit with verdict NEEDS_FIXES. It records `findings_count` once per round by round index, so repeated gate calls cannot duplicate history entries. If `divergenceWarning` is true, warn the user the loop may not be converging.
83
+ 1. Pass the active-checkout context from Phase 0 and the prompt template from `${SKILL_DIR}/references/reviewer-agent-prompt.md`.
84
+ 2. The captured git diff, staged diff, untracked files, spec, plan, dev rules, and scoped test report are the primary review scope.
85
+ 3. Never use `worktree`, remote isolation, copied checkouts, `Explore`, or a generic code explorer as a substitute for the PrizmKit reviewer. Do not request or create worktree isolation for this review path, including tool-created `.claude/worktrees/...` directories or pipeline-managed `.prizmkit/state/worktrees/...` directories. Pipeline `USE_WORKTREE` controls implementation infrastructure only; it does not change `/prizmkit-code-review` active-checkout review location.
86
+ 4. Never perform Main-Agent self-review or fallback review; the Main Agent's job is filtering and fixing, not acting as the reviewer.
87
+ 5. If the platform cannot launch the reviewer in the active checkout without worktree isolation, stop with the tool incompatibility message from this skill's introduction.
107
88
 
108
- **Text mode** enforce §Text Fallback Constraints manually with identical logic.
89
+ ### Step 2: Run Review
109
90
 
110
- ### Text Fallback Constraints
111
-
112
- When Python is unavailable, apply these rules exactly they match the script's logic:
91
+ Round context:
92
+ - Round 1: examine all current changes comprehensively.
93
+ - Round 2+: focus on whether prior fixes are correct, whether fixes introduced new issues, and whether accepted findings remain.
113
94
 
114
- 1. **PASS exit**: Reviewer returns `PASS` → exit loop, verdict PASS.
115
- 2. **Pre-filter NEEDS_FIXES**: Count findings and continue to filtering. Do not apply all-rejected or max-round exits before filtering.
116
- 3. **All-rejected exit**: After filtering, if all findings were rejected exit loop, verdict PASS.
117
- 4. **Max rounds**: After filtering, if `round >= 3` and accepted findings remain → exit loop, verdict NEEDS_FIXES. Write `review-report.md` with unresolved findings.
118
- 5. **Divergence**: If findings count strictly increases for 3 consecutive recorded rounds, warn user the loop may not converge.
119
- 6. **Counter**: Increment `round` after each complete cycle (Steps 1-4). Track `findings_history` by round index to detect divergence — record `findings_count` once per round.
95
+ Review result:
96
+ - `PASS`: no findings.
97
+ - `NEEDS_FIXES`: one or more findings with severity, dimension, location, problem, and suggested fix.
120
98
 
121
- ### Step 1: Spawn Reviewer Agent
99
+ ### Step 3: Loop Exit Gate
122
100
 
123
- Include the dev rules read in Phase 0 step 4 and the workspace context captured in Phase 0 step 5 in the Reviewer prompt.
101
+ Call the gate only in these cases:
124
102
 
125
- **Reviewer Agent Invocation Contract (MANDATORY):**
103
+ 1. Review returned `PASS`.
104
+ 2. Main Agent has filtered `NEEDS_FIXES` findings.
126
105
 
127
- | Parameter | Value | Rationale |
128
- |-----------|-------|-----------|
129
- | `subagent_type` | `prizm-dev-team-reviewer` | Dedicated PrizmKit reviewer agent |
130
- | `run_in_background` | `false` | Orchestrator waits for review results |
131
- | `isolation` | **omit or `"none"`** — default/no worktree isolation | Reviewer must review the active checkout's changes, not a separate repository copy |
132
- | worktree tool access | **Forbidden** — do NOT pass `EnterWorktree` tool; do NOT request or create `.claude/worktrees/...` subagent worktrees | Tool-created worktrees defeat checkout-scoped review |
106
+ Do not call the gate for `NEEDS_FIXES` before filtering because `accepted_count` is not known yet.
133
107
 
134
- PrizmKit pipeline-managed linked git worktrees under `.prizmkit/state/worktrees/...` are separate infrastructure controlled by `USE_WORKTREE` and are not relevant to the Reviewer invocation.
108
+ Script mode invocation:
135
109
 
136
- Do not route the PrizmKit reviewer flow through `Explore` or a generic code-explorer agent.
110
+ ```bash
111
+ echo '{"reviewer_result":"NEEDS_FIXES","accepted_count":2,"findings_count":3,"round":1,"findings_history":[],"max_rounds":3,"filtering_done":true}' | python3 ${SKILL_DIR}/scripts/check_loop.py
112
+ ```
137
113
 
138
- **Fallback clause**: If the current platform or Agent-tool invocation path cannot guarantee a no-worktree Reviewer Agent (e.g., the platform does not support `prizm-dev-team-reviewer` or always creates worktree isolation for subagents), perform the review pass **in the Main Agent as a read-only pass** in the active checkout — do NOT edit files during that pass. Use the same review dimensions and output format as the Reviewer prompt template, and write `review-report.md` directly.
114
+ Gate output determines whether to end the loop. If `divergenceWarning` is true, warn the user that the loop may not be converging.
139
115
 
140
- Read `${SKILL_DIR}/references/reviewer-agent-prompt.md` for the full prompt template — fill `{goals}`, `{plan decisions}`, `{scoped test report}`, `{workspace context}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning.
116
+ ### Text Fallback Constraints
141
117
 
142
- Round context varies by round:
143
- - Round 1: "This is the first review. Examine all changes comprehensively."
144
- - Round 2+: "Previous round found issues that were fixed. Focus on: (1) whether previous fixes are correct, (2) whether fixes introduced new problems, (3) any remaining issues. Do not re-report issues that have already been fixed."
118
+ When Python is unavailable, apply these rules manually:
145
119
 
146
- ### Step 2: Check Result + Gate
120
+ 1. `PASS` exits with verdict PASS.
121
+ 2. `NEEDS_FIXES` continues to filtering before any all-rejected or max-round exit.
122
+ 3. If all findings are rejected after filtering, exit with verdict PASS.
123
+ 4. If `round >= 3` after filtering and accepted findings remain, exit with verdict NEEDS_FIXES.
124
+ 5. If findings count strictly increases for 3 consecutive recorded rounds, warn about possible divergence.
125
+ 6. Record `findings_history` once per round and increment `round` after a complete review/filter/fix cycle.
147
126
 
148
- Parse the Reviewer Agent's output:
149
- - If `Result: PASS` → call the **Loop Exit Gate** with `{"reviewer_result": "PASS", "accepted_count": 0, "findings_count": 0, "round": <current_round>, "findings_history": <current_history>, "max_rounds": 3}`. If `endLoop=true`, proceed to Phase 2.
150
- - If `Result: NEEDS_FIXES` → count findings, do not call the gate yet, then continue to Step 3.
127
+ ### Step 4: Main Agent Filters Findings
151
128
 
152
- ### Step 3: Main Agent Filters Findings + Gate
129
+ For each finding, decide whether it is reasonable:
153
130
 
154
- Review each finding and decide whether it's reasonable. This prevents unnecessary or harmful changes.
131
+ - Is this relevant to the current changes?
132
+ - Is this a real problem rather than subjective style preference?
133
+ - Would fixing this improve the code without broad out-of-scope refactoring?
134
+ - Does it conflict with spec, plan, dev rules, or current test evidence?
155
135
 
156
- **For each finding, evaluate:**
157
- - Is this relevant to the current changes? (Reject findings about unmodified, unrelated code.)
158
- - Is this a real problem or a subjective style preference? (Reject pure style preferences unless they violate clear project conventions.)
159
- - Would fixing this improve the code without introducing risk? (Reject fixes that require large refactors outside scope.)
136
+ Output per finding:
137
+ - Accepted: queue for direct Main Agent fix work.
138
+ - Rejected: record a short reason such as out of scope, not a defect, or too risky for current task.
160
139
 
161
- **Output per finding:**
162
- - **Accepted**: The finding is reasonable — queue it for direct Main Agent fix work.
163
- - **Rejected** (with reason): Brief explanation (e.g., "Out of scope", "Style preference, not a defect").
140
+ After filtering, call the Loop Exit Gate. If `endLoop=true`, proceed to Phase 2.
164
141
 
165
- After filtering: call the **Loop Exit Gate** with `{"reviewer_result": "NEEDS_FIXES", "accepted_count": <N>, "findings_count": <total findings this round>, "round": <current_round>, "findings_history": <current_history>, "max_rounds": 3, "filtering_done": true}`. If `endLoop=true`, proceed to Phase 2.
142
+ ### Step 5: Main Agent Applies Accepted Fixes
166
143
 
167
- ### Step 4: Main Agent Applies Accepted Fixes
144
+ The Main Agent applies accepted findings directly in the active checkout. Do not spawn a separate Dev Agent for fixes.
168
145
 
169
- Do not spawn a Dev Agent or any review-fix developer subagent. The Main Agent applies accepted findings directly in the active checkout, using the spec context and filtered findings as the fix list. If an accepted finding cannot be safely fixed within scope, record the reason and carry it into `review-report.md` as unresolved.
146
+ If an accepted finding cannot be safely fixed within scope, record the reason and carry it into `review-report.md` as unresolved.
170
147
 
171
- After direct fixes are complete, record results and return to Step 1 for the next round.
148
+ After fixes are complete, record results, increment the round, and return to Step 2.
172
149
 
173
150
  ## Phase 2: Output
174
151
 
175
152
  Always write `review-report.md` to the artifact directory, including no-change PASS results. Read `${SKILL_DIR}/references/review-report-template.md` for the full output format.
176
153
 
177
- - `PASS`: Reviewer returned no findings (or all remaining findings were rejected as unreasonable)
178
- - `NEEDS_FIXES`: 3 rounds completed but unresolved findings remain
179
-
180
- Also output a completion summary to conversation.
154
+ Required report fields:
155
+ - Verdict: `PASS` or `NEEDS_FIXES`
156
+ - Review Mode: `reviewer-agent-active-checkout` or `not-run-no-changes`
157
+ - Rounds and total findings
158
+ - Fixed, rejected, and unresolved findings
159
+ - Final summary
181
160
 
182
- **HANDOFF:** `/prizmkit-retrospective` (if PASS) or inform the caller of remaining issues (if NEEDS_FIXES after max rounds)
161
+ Completion summary:
162
+ - `PASS`: hand off to `/prizmkit-retrospective` when docs or durable knowledge changed, otherwise `/prizmkit-committer`.
163
+ - `NEEDS_FIXES`: inform the caller of remaining unresolved findings.
@@ -6,6 +6,7 @@ Used in Phase 2 of `/prizmkit-code-review`. Always write `review-report.md` to t
6
6
  # Review Report
7
7
 
8
8
  ## Verdict: <PASS|NEEDS_FIXES>
9
+ ## Review Mode: <reviewer-agent-active-checkout|not-run-no-changes>
9
10
  ## Rounds: <number of review rounds completed; use 0 for no-change PASS>
10
11
  ## Total findings: <total> → Fixed: <fixed>, Rejected: <rejected>, Unresolved: <unresolved>
11
12
 
@@ -15,7 +15,18 @@ You are the dedicated PrizmKit Reviewer agent (`prizm-dev-team-reviewer`). Revie
15
15
  {summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists for a feature artifact, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow explicitly requires a prior test report.}
16
16
 
17
17
  ## Workspace Context
18
- {git status, unstaged diff summary, staged diff summary, and new-file paths captured by the Main Agent in Phase 0 from the active checkout. This is your primary review scope — use this context to understand what changed. Request targeted file reads only when you need specific line-level detail for a finding, not to re-discover or re-index the repository. Do not read files that are not in the workspace context unless you need them to verify impact (callers, dependents, shared patterns). Do not switch to a separate worktree or repository copy — the Main Agent has provided everything needed to understand the change set.}
18
+ {git status, unstaged diff summary, staged diff summary, current working directory, expected active checkout git top-level, and new-file paths captured by the Main Agent in Phase 0 from the active checkout. This is your primary review scope — use this context to understand what changed. Request targeted file reads only when you need specific line-level detail for a finding, not to re-discover or re-index the repository. Do not read files that are not in the workspace context unless you need them to verify impact (callers, dependents, shared patterns). Do not switch to a separate worktree or repository copy — the Main Agent has provided everything needed to understand the change set.}
19
+
20
+ ## Active Checkout Guard
21
+ The orchestrator must provide the expected active checkout git top-level in Workspace Context. Before reviewing, verify that your current git top-level matches that expected active checkout.
22
+
23
+ If your current checkout is different, or appears to be under `.claude/worktrees/`, `.prizmkit/state/worktrees/`, a remote checkout, or any copied/temporary checkout:
24
+ - Stop immediately.
25
+ - Do not review files.
26
+ - Do not produce normal findings.
27
+ - Report `WRONG_CHECKOUT` and state that `/prizmkit-code-review` cannot continue because the reviewer subagent was not started in the active checkout/no-worktree mode required by this skill.
28
+
29
+ Worktree review is not supported by `/prizmkit-code-review`; do not continue from a worktree even if the files appear similar.
19
30
 
20
31
  ## Dev Rules (per-layer conventions)
21
32
  {rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}