prizmkit 1.1.127 → 1.1.128

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 (24) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/claude/command-adapter.js +2 -75
  3. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +14 -11
  4. package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +0 -1
  5. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +3 -3
  6. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
  7. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +3 -3
  8. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -4
  9. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
  10. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -4
  11. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -4
  12. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -4
  13. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +4 -5
  14. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +11 -7
  15. package/bundled/dev-pipeline/tests/test_runtime_helper.py +9 -3
  16. package/bundled/dev-pipeline/tests/test_unified_cli.py +11 -16
  17. package/bundled/skills/_metadata.json +3 -3
  18. package/bundled/skills/prizmkit-code-review/SKILL.md +54 -122
  19. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +9 -36
  20. package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +21 -111
  21. package/package.json +1 -1
  22. package/src/scaffold.js +5 -16
  23. package/bundled/skills/prizmkit-code-review/assets/reviewer-role.json +0 -19
  24. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -120
@@ -1,5 +1,5 @@
1
1
  {
2
- "frameworkVersion": "1.1.127",
3
- "bundledAt": "2026-07-12T15:13:24.439Z",
4
- "bundledFrom": "d634625"
2
+ "frameworkVersion": "1.1.128",
3
+ "bundledAt": "2026-07-12T17:44:30.283Z",
4
+ "bundledFrom": "341ff48"
5
5
  }
@@ -7,6 +7,8 @@
7
7
  * - Only `description` in frontmatter
8
8
  * - `${SKILL_DIR}` references rewritten to relative paths
9
9
  * - Skills with assets/scripts use directory structure
10
+ *
11
+ * Code-review-specific named agents are retired; review runs in the Main Agent.
10
12
  */
11
13
 
12
14
  import { parseFrontmatter, buildMarkdown } from '../shared/frontmatter.js';
@@ -20,67 +22,6 @@ function toClaudePrizmkitCommand(sub) {
20
22
  return `prizmkit-${normalized}`;
21
23
  }
22
24
 
23
- const REVIEWER_ROLE_SKILL = 'prizmkit-code-review';
24
- const REVIEWER_ROLE_FILE = 'prizmkit-code-reviewer.md';
25
- const REVIEWER_REQUIRED_UNAVAILABLE = new Set([
26
- 'workspace-mutation',
27
- 'shell-execution',
28
- 'downstream-execution-creation',
29
- 'delegation-equivalent-behavior',
30
- 'orchestration-reentry',
31
- 'skill-invocation',
32
- ]);
33
- const CLAUDE_OBSERVATIONAL_TOOLS = new Map([
34
- ['read-files', 'Read'],
35
- ['search-content', 'Grep'],
36
- ['search-paths', 'Glob'],
37
- ]);
38
-
39
- function buildReviewerRoleDefinition(roleManifest) {
40
- if (!roleManifest || roleManifest.role_name !== 'prizmkit-code-reviewer') {
41
- throw new Error('prizmkit-code-review requires assets/reviewer-role.json');
42
- }
43
- const unavailable = new Set(roleManifest.unavailable_capabilities || []);
44
- for (const capability of REVIEWER_REQUIRED_UNAVAILABLE) {
45
- if (!unavailable.has(capability)) {
46
- throw new Error(`Reviewer role must make ${capability} unavailable`);
47
- }
48
- }
49
- if (roleManifest.execution_mode !== 'foreground-independent-review') {
50
- throw new Error('Reviewer role must use foreground independent review');
51
- }
52
-
53
- const tools = (roleManifest.observational_capabilities || []).map(capability => {
54
- const tool = CLAUDE_OBSERVATIONAL_TOOLS.get(capability);
55
- if (!tool) throw new Error(`Unsupported Reviewer observational capability: ${capability}`);
56
- return tool;
57
- });
58
- if (tools.length === 0) throw new Error('Reviewer role requires observational capabilities');
59
-
60
- return `---
61
- name: ${roleManifest.role_name}
62
- description: ${roleManifest.description}
63
- tools: ${tools.join(', ')}
64
- permissionMode: dontAsk
65
- maxTurns: 80
66
- ---
67
-
68
- You are a capability-restricted read-only Reviewer execution role.
69
-
70
- Read and follow the complete prompt supplied by the Main Agent. Perform the complete review yourself. Your tool allowlist intentionally excludes workspace mutation, shell execution, skill invocation, downstream execution creation, delegation-equivalent behavior, and orchestration re-entry.
71
-
72
- If the supplied review cannot be completed with the available read-only capabilities and current context, return \`BLOCKED\` with the missing capability or context. Do not delegate, request a helper, mutate the workspace, or claim \`PASS\` from incomplete work.
73
- `;
74
- }
75
-
76
- export function getClaudeSkillAgentDefinitions(skillName, roleManifest = null) {
77
- if (skillName !== REVIEWER_ROLE_SKILL) return [];
78
- return [{
79
- fileName: REVIEWER_ROLE_FILE,
80
- content: buildReviewerRoleDefinition(roleManifest),
81
- }];
82
- }
83
-
84
25
  /**
85
26
  * Convert a core SKILL.md to Claude Code command.md format.
86
27
  * @param {string} skillContent - Content of the core SKILL.md
@@ -158,20 +99,6 @@ export async function installCommand(corePath, targetRoot) {
158
99
  for (const subdir of subdirs) {
159
100
  cpSync(path.join(corePath, subdir), path.join(targetDir, subdir), { recursive: true });
160
101
  }
161
-
162
- // Install platform-native capability roles generated from canonical skill semantics.
163
- const roleManifestPath = path.join(corePath, 'assets', 'reviewer-role.json');
164
- const roleManifest = existsSync(roleManifestPath)
165
- ? JSON.parse(await readFile(roleManifestPath, 'utf8'))
166
- : null;
167
- const agentDefinitions = getClaudeSkillAgentDefinitions(skillName, roleManifest);
168
- if (agentDefinitions.length > 0) {
169
- const agentsDir = path.join(targetRoot, '.claude', 'agents');
170
- mkdirSync(agentsDir, { recursive: true });
171
- for (const definition of agentDefinitions) {
172
- await writeFile(path.join(agentsDir, definition.fileName), definition.content);
173
- }
174
- }
175
102
  } else {
176
103
  // Single file command
177
104
  const targetDir = path.join(targetRoot, COMMANDS_DIR);
@@ -2,18 +2,19 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- `dev-pipeline` drives feature, bugfix, and refactor sessions through the unified Python outer loop. Each iteration spawns a new AI CLI session with a bootstrap prompt that makes the main session orchestrator responsible for planning, implementation, review coordination, testing, retrospective, and commit.
5
+ `dev-pipeline` drives feature, bugfix, and refactor sessions through the unified Python outer loop. Each iteration starts an AI CLI session with a bootstrap prompt that makes the main session orchestrator responsible for planning, implementation, review, testing, retrospective, and commit.
6
+
7
+ Skill behavior is owned by canonical skills:
6
8
 
7
- Implementation and review behavior is owned by skills:
8
9
  - `/prizmkit-implement` executes plan tasks directly and may use its local implementation-subagent reference for narrow active-checkout delegation.
9
- - `/prizmkit-code-review` owns its internal inline reviewer subagent review loop through its local reviewer prompt reference.
10
+ - `/prizmkit-code-review` runs its complete bounded review and repair loop directly in the Main Agent.
10
11
 
11
12
  ## Architecture
12
13
 
13
14
  ```text
14
15
  dev-pipeline (outer loop)
15
16
  |
16
- +-- cli.py feature/bugfix/refactor Python runtime CLI — picks next item, spawns CLI
17
+ +-- cli.py feature/bugfix/refactor Python runtime CLI — picks next item, starts CLI
17
18
  +-- scripts/ Python state and prompt management scripts
18
19
  +-- templates/ Session prompt templates and sections
19
20
  |
@@ -22,7 +23,7 @@ dev-pipeline (outer loop)
22
23
  +-- Context snapshot + specify + plan (orchestrator)
23
24
  +-- Local plan/spec review loop inside prizmkit-plan
24
25
  +-- Implement through /prizmkit-implement
25
- +-- Code review through /prizmkit-code-review inline reviewer loop
26
+ +-- Main-Agent code review through /prizmkit-code-review
26
27
  +-- Scoped test gate and browser attempt
27
28
  +-- Retrospective & commit (orchestrator)
28
29
  ```
@@ -30,24 +31,26 @@ dev-pipeline (outer loop)
30
31
  ## Skill-Owned References
31
32
 
32
33
  | Skill | Reference | Purpose |
33
- |-------|-----------|---------|
34
+ |---|---|---|
34
35
  | `/prizmkit-implement` | skill-local `references/implementation-subagent-procedure.md` | Optional narrow implementation delegation contract |
35
- | `/prizmkit-code-review` | skill-local `references/reviewer-agent-prompt.md` | Required independent reviewer-loop prompt |
36
+ | `/prizmkit-code-review` | skill-local `references/review-report-template.md` | Main-Agent review progress and terminal-result contract |
36
37
 
37
- The orchestrator role is handled by the main agent directly no separate platform agent definition or team topology is installed.
38
+ The orchestrator role is handled by the Main Agent directly. Code review does not install or invoke a separate platform agent definition.
38
39
 
39
40
  ## Active Checkout Contract
40
41
 
41
- Any skill-level implementation or review subagent must run in the expected active git top-level. The prompt contract forbids git worktrees, tool-created worktree isolation, copied repository checkouts, remote isolated checkouts, branch switching, and operating outside the expected active checkout.
42
+ Any optional implementation subagent must run in the expected active git top-level. Its prompt contract forbids git worktrees, tool-created worktree isolation, copied repository checkouts, remote isolated checkouts, branch switching, and operating outside the expected active checkout.
43
+
44
+ Code review always runs in the Main Agent's current workspace so staged, unstaged, and untracked content remains authoritative.
42
45
 
43
- Pipeline runner-owned linked worktrees are an outer runtime option. They do not authorize skill-level subagents to create or enter their own worktrees.
46
+ Pipeline runner-owned linked worktrees are an outer runtime option. They do not authorize a skill-level execution unit to create or enter another worktree.
44
47
 
45
48
  ## Pipeline Scripts
46
49
 
47
50
  Located at `.prizmkit/dev-pipeline/scripts/`:
48
51
 
49
52
  | Script | Purpose |
50
- |--------|---------|
53
+ |---|---|
51
54
  | `init-pipeline.py` | Initialize feature pipeline state |
52
55
  | `init-bugfix-pipeline.py` | Initialize bugfix pipeline state |
53
56
  | `init-refactor-pipeline.py` | Initialize refactor pipeline state |
@@ -258,7 +258,6 @@ def _text_final_verdict(args: argparse.Namespace) -> HelperResult:
258
258
  markers = {
259
259
  "PASS": "REVIEW_PASS",
260
260
  "NEEDS_FIXES": "REVIEW_NEEDS_FIXES",
261
- "BLOCKED": "REVIEW_BLOCKED",
262
261
  }
263
262
  marker = markers.get(verdict)
264
263
  if not marker:
@@ -97,9 +97,9 @@ Implement the minimal fix (red → green):
97
97
  """\
98
98
  Verify fix quality:
99
99
  1. Run `/prizmkit-code-review` with the current bugfix artifact directory.
100
- 2. The Main Agent self-reviews for up to ten rounds; semantic risk limits independent Reviewers to low=0, medium=1, high=2.
101
- 3. Reviewer 2 requires an accepted high finding from Reviewer 1 plus repair, tests, and Main-Agent reconvergence; Reviewer 3 is forbidden.
102
- 4. Continue only after the report's last Final Result is valid; preserve append-only progress for recovery.""",
100
+ 2. The Main Agent reviews the complete current change for up to ten rounds, directly repairs accepted findings, and verifies repairs.
101
+ 3. Converge only when accepted and unresolved findings are both zero; missing required evidence or round-ten non-convergence produces NEEDS_FIXES.
102
+ 4. Do not spawn a code-review-specific subagent. Continue only after the report's last Final Result is valid; preserve append-only progress for recovery.""",
103
103
  ),
104
104
  6: (
105
105
  "User Verification",
@@ -30,7 +30,7 @@ Infer what needs to be done from the feature context above and follow the standa
30
30
 
31
31
  3. **Implement**: Run `/prizmkit-implement` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to execute the plan using TDD (write tests first, then implement).
32
32
 
33
- 4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The Main Agent self-reviews for up to ten rounds; semantic risk then limits independent Reviewers to `low=0`, `medium=1`, `high=2`, with Reviewer 2 only after an accepted high finding is repaired and reconverged. Reviewer 3 is forbidden. Require the last `## Final Result` verdict before continuing.
33
+ 4. **Review**: Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The Main Agent reviews the complete current change for up to ten rounds, directly repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero. Do not spawn a code-review-specific subagent. Require the last `## Final Result` verdict before continuing.
34
34
 
35
35
  5. **Test**: Run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to generate and verify tests only for this feature's changed scope after review. Do not use bugfix/refactor artifact directories for this gate.
36
36
 
@@ -240,13 +240,13 @@ For each Verification Gate from the Task Contract, write one evidence line to Im
240
240
 
241
241
  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.
242
242
 
243
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill first runs a Main-Agent self-review loop for up to ten completed rounds, then semantic risk permits independent Reviewers at limits `low=0`, `medium=1`, `high=2`. High risk starts Reviewer 2 only after an accepted high finding was repaired, tested, and reconverged; Reviewer 3 is forbidden. The skill owns launch parameters, current-checkout preference, forced-worktree changed-content fallback, and append-only report progress.
243
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds, directly repairs accepted findings, verifies repairs, and converges when accepted and unresolved findings are both zero. Do not spawn a code-review-specific subagent. Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`. The skill owns append-only report progress.
244
244
 
245
245
  **Gate Check — Final Review Result**:
246
246
  ```bash
247
247
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md
248
248
  ```
249
- Handle `REVIEW_PASS`, `REVIEW_NEEDS_FIXES`, and `REVIEW_BLOCKED` according to task policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text or synthesize a passing result through Main-Agent self-review.
249
+ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to task policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text or synthesize a passing result through Main-Agent self-review.
250
250
 
251
251
  **CP-3**: Review has a valid Final Result and the report preserves this execution's progress.
252
252
 
@@ -266,7 +266,7 @@ Gate requirements:
266
266
  - Record unrelated historical gaps under `Out of Scope Gaps`; do not generate tests for them and do not fail this feature because of them.
267
267
  - Accept only a current-run `.prizmkit/test/*/test-report.md` whose `Scope` mode is `this-change`, whose `Artifact Dir` matches `.prizmkit/specs/{{FEATURE_SLUG}}/`, whose `Verdict` is `PASS`, whose `Boundary Completion Gate` reports `Completion gate passed: yes` with zero `Boundary-missing` and zero `Happy-path-only`, and whose `Boundary Validation` result is `passed`.
268
268
  - Only after a valid `PASS`, write the report path to `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt` and append a 3-5 bullet `## PrizmKit Test Gate` summary to `context-snapshot.md`.
269
- - If the report verdict is `NEEDS_FIXES`, fix in-scope implementation/test issues and rerun `/prizmkit-test`. If the report is `BLOCKED`, missing, stale, or for the wrong scope/artifact dir, write `failure-log.md` and stop for recovery.
269
+ - If the report verdict is `NEEDS_FIXES`, fix in-scope implementation/test issues and rerun `/prizmkit-test`. If the report is missing, stale, invalid, or for the wrong scope/artifact dir, write `failure-log.md` and stop for recovery.
270
270
 
271
271
  {{IF_BROWSER_INTERACTION}}
272
272
  ### Phase 5.5: Browser Verification — MANDATORY
@@ -180,15 +180,15 @@ After implement completes, verify:
180
180
  If `FAST_PATH=true` (≤ 2 tasks, obvious root cause), skip this phase entirely and mark checkpoint step `prizmkit-code-review` as `skipped` before continuing.
181
181
 
182
182
  Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
183
- - The skill first runs up to ten Main-Agent self-review rounds, then semantic risk limits independent Reviewers to `low=0`, `medium=1`, `high=2`
184
- - High risk starts Reviewer 2 only after an accepted high finding was repaired, tested, and reconverged; Reviewer 3 is forbidden
185
- - The skill preserves its independent Reviewer prompt and appends progress to `review-report.md`
183
+ - The skill runs up to ten Main-Agent review rounds, directly repairs accepted findings, and verifies each repair
184
+ - Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`
185
+ - The skill appends Main-Agent review and repair progress to `review-report.md`
186
186
 
187
187
  **Gate Check — Final Review Result**:
188
188
  ```bash
189
189
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/bugfix/{{BUG_ID}}/review-report.md
190
190
  ```
191
- Handle `REVIEW_PASS`, `REVIEW_NEEDS_FIXES`, and `REVIEW_BLOCKED` according to task policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or replace required independent review with Main-Agent self-review.
191
+ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to task policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or replace required independent review with Main-Agent self-review.
192
192
 
193
193
  {{IF_BROWSER_INTERACTION}}
194
194
 
@@ -139,7 +139,7 @@ Apply the browser behavior preservation protocol where UI behavior can be affect
139
139
 
140
140
  ### Phase 4: Review — Code Review & Behavior Verification
141
141
 
142
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` directly from the main orchestrator. The skill first runs up to ten Main-Agent self-review rounds, then semantic risk limits independent Reviewers to `low=0`, `medium=1`, `high=2`. High risk starts Reviewer 2 only after an accepted high finding was repaired, tested, and reconverged; Reviewer 3 is forbidden.
142
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/` directly from the main orchestrator. The skill runs up to ten Main-Agent review rounds, directly repairs accepted findings, and verifies each repair. Missing required evidence, unsafe repair, failed verification, or round-ten non-convergence produces `NEEDS_FIXES`.
143
143
 
144
144
  Review requirements:
145
145
  - verify refactor quality against spec.md and plan.md;
@@ -151,9 +151,9 @@ Review requirements:
151
151
  ```bash
152
152
  {{RUNTIME_HELPER_CMD}} text final-verdict .prizmkit/refactor/{{REFACTOR_ID}}/review-report.md
153
153
  ```
154
- Handle `REVIEW_PASS`, `REVIEW_NEEDS_FIXES`, and `REVIEW_BLOCKED` according to behavior-preservation policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or replace required independent review with Main-Agent self-review.
154
+ Handle `REVIEW_PASS` and `REVIEW_NEEDS_FIXES` according to behavior-preservation policy. `REVIEW_INCOMPLETE` or `REVIEW_INVALID` means review did not complete: inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or replace required independent review with Main-Agent self-review.
155
155
 
156
- **Checkpoint update**: set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete it for blocked, incomplete, or invalid reports.
156
+ **Checkpoint update**: set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete it for incomplete or invalid reports.
157
157
 
158
158
  ---
159
159
 
@@ -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}}/`. The skill first runs a Main-Agent self-review loop for up to ten completed rounds, then semantic risk permits independent Reviewers at limits `low=0`, `medium=1`, `high=2`. High risk starts Reviewer 2 only after Reviewer 1 produced an accepted high finding that was repaired, tested, and reconverged. Reviewer 3 is forbidden.
15
+ Otherwise, run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
16
16
 
17
- The skill owns its unchanged independent Reviewer prompt, current-checkout preference, forced-worktree changed-content fallback, one bounded infrastructure retry per required Reviewer position, and append-only progress in `review-report.md`.
17
+ The skill owns the full loop and append-only progress in `review-report.md`. Do not spawn a top-level or code-review-specific subagent. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
18
18
 
19
19
  **Gate Check — Final Review Result**:
20
20
 
@@ -24,7 +24,6 @@ The skill owns its unchanged independent Reviewer prompt, current-checkout prefe
24
24
 
25
25
  - `REVIEW_PASS` → proceed.
26
26
  - `REVIEW_NEEDS_FIXES` → log unresolved findings and proceed only when explicit task policy allows them.
27
- - `REVIEW_BLOCKED` → log infrastructure evidence and stop so recovery can retry.
28
- - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text and do not replace required independent review with Main-Agent self-review.
27
+ - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` inspect progress once, write `failure-log.md`, and stop. Do not accept old or incidental verdict text and do not synthesize a passing result outside the skill.
29
28
 
30
29
  **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result, or `skipped` for FAST_PATH.
@@ -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 a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill first runs a Main-Agent self-review loop for up to ten completed rounds, then semantic risk permits independent Reviewers at limits `low=0`, `medium=1`, `high=2`. High risk starts Reviewer 2 only after Reviewer 1 produced an accepted high finding that was repaired, tested, and reconverged. Reviewer 3 is forbidden.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
6
6
 
7
- The skill owns Reviewer launch parameters, current-checkout preference, forced-worktree changed-content fallback, one bounded infrastructure retry per required Reviewer position, and append-only progress in `review-report.md`.
7
+ The skill owns the full loop and append-only progress in `review-report.md`. Do not spawn a top-level or code-review-specific subagent. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
8
8
 
9
9
  **Gate Check — Final Review Result**:
10
10
 
@@ -16,8 +16,7 @@ Handle the marker:
16
16
 
17
17
  - `REVIEW_PASS` → proceed to next phase.
18
18
  - `REVIEW_NEEDS_FIXES` → log unresolved findings and follow the task failure policy; do not externally restart the review loop.
19
- - `REVIEW_BLOCKED` → log infrastructure evidence and stop so recovery can retry.
20
- - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect the append-only progress once, write `failure-log.md`, and stop. Do not treat an old or incidental verdict as completion and do not synthesize a passing result through Main-Agent self-review.
19
+ - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` inspect the append-only progress once, write `failure-log.md`, and stop. Do not treat an old or incidental verdict as completion and do not synthesize a passing result outside the skill.
21
20
 
22
21
  **CP-3**: Review has a valid Final Result and `review-report.md` preserves this execution's progress.
23
22
 
@@ -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 a prior `/prizmkit-test` report here; the next phase owns the formal test gate.
4
4
 
5
- Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill first runs a Main-Agent self-review loop for up to ten completed rounds, then semantic risk permits independent Reviewers at limits `low=0`, `medium=1`, `high=2`. High risk starts Reviewer 2 only after Reviewer 1 produced an accepted high finding that was repaired, tested, and reconverged. Reviewer 3 is forbidden.
5
+ Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
6
6
 
7
- The skill owns Reviewer launch parameters, current-checkout preference, forced-worktree changed-content fallback, one bounded infrastructure retry per required Reviewer position, and append-only progress in `review-report.md`.
7
+ The skill owns the full loop and append-only progress in `review-report.md`. Do not spawn a top-level or code-review-specific subagent. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
8
8
 
9
9
  **Gate Check — Final Review Result**:
10
10
 
@@ -16,8 +16,7 @@ Handle the marker:
16
16
 
17
17
  - `REVIEW_PASS` → proceed to next phase.
18
18
  - `REVIEW_NEEDS_FIXES` → log unresolved findings and follow the task failure policy; do not externally restart the review loop.
19
- - `REVIEW_BLOCKED` → log infrastructure evidence and stop so recovery can retry.
20
- - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect the append-only progress once, write `failure-log.md`, and stop. Do not treat an old or incidental verdict as completion and do not synthesize a passing result through Main-Agent self-review.
19
+ - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` inspect the append-only progress once, write `failure-log.md`, and stop. Do not treat an old or incidental verdict as completion and do not synthesize a passing result outside the skill.
21
20
 
22
21
  **CP-3**: Review has a valid Final Result and `review-report.md` preserves this execution's progress.
23
22
 
@@ -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}}/`. The skill first runs a Main-Agent self-review loop for up to ten completed rounds, then semantic risk permits independent Reviewers at limits `low=0`, `medium=1`, `high=2`. High risk starts Reviewer 2 only after Reviewer 1 produced an accepted high finding that was repaired, tested, and reconverged. Reviewer 3 is forbidden.
3
+ Run `/prizmkit-code-review` directly with `artifact_dir=.prizmkit/refactor/{{REFACTOR_ID}}/`. The skill runs a Main-Agent review loop for up to ten completed rounds. The Main Agent reviews the complete current change, rejects unsupported candidate findings, directly repairs accepted findings, verifies repairs, and repeats until `accepted = 0` with no unresolved findings.
4
4
 
5
- Do not spawn a top-level Reviewer subagent. The code-review skill owns its unchanged independent Reviewer prompt, current-checkout preference, forced-worktree changed-content fallback, one bounded infrastructure retry per required Reviewer position, and append-only report progress.
5
+ Do not spawn a top-level or code-review-specific subagent. The code-review skill owns the complete loop and append-only report progress. Missing required evidence, an unsafe repair, a failed verification, or failure to converge by round ten produces `NEEDS_FIXES`.
6
6
 
7
7
  **Gate Check — Final Review Result**:
8
8
 
@@ -12,9 +12,8 @@ Do not spawn a top-level Reviewer subagent. The code-review skill owns its uncha
12
12
 
13
13
  - `REVIEW_PASS` → proceed.
14
14
  - `REVIEW_NEEDS_FIXES` → log unresolved findings and proceed only when they do not block behavior preservation under explicit task policy.
15
- - `REVIEW_BLOCKED` → log infrastructure evidence and stop so recovery can retry.
16
- - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` → inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or replace required independent review with Main-Agent self-review.
15
+ - `REVIEW_INCOMPLETE` or `REVIEW_INVALID` inspect progress once, write `failure-log.md`, and stop. Do not accept stale verdict text or synthesize a passing result outside the skill.
17
16
 
18
17
  Verify the review explicitly checks behavior preservation, public API compatibility, imports, tests, and rollback assumptions.
19
18
 
20
- **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete the checkpoint for blocked, incomplete, or invalid reports.
19
+ **Checkpoint update**: Set step `prizmkit-code-review` to `completed` only for an accepted valid Final Result. Do not complete the checkpoint for incomplete or invalid reports.
@@ -882,9 +882,11 @@ class TestDirectOrchestratorImplementationPrompts:
882
882
  assert FORBIDDEN_TEST_CMD_PLACEHOLDER not in rendered
883
883
  assert FORBIDDEN_THREE_STRIKE not in rendered
884
884
  assert FORBIDDEN_TWENTY_STEP not in rendered
885
- assert "Main-Agent self-review loop" in rendered
886
- assert "low=0" in rendered and "medium=1" in rendered and "high=2" in rendered
887
- assert "Reviewer 3 is forbidden" in rendered
885
+ assert "Main-Agent review loop" in rendered
886
+ assert "up to ten completed rounds" in rendered
887
+ assert "code-review-specific subagent" in rendered
888
+ assert "low=0" not in rendered
889
+ assert "Reviewer 3" not in rendered
888
890
 
889
891
  def test_retained_tier3_fallback_template_uses_direct_orchestrator_implementation(self):
890
892
  rendered = Path("dev-pipeline/templates/bootstrap-tier3.md").read_text(encoding="utf-8")
@@ -1443,8 +1445,9 @@ class TestHeadlessPromptCleanupF033:
1443
1445
  refactor_prompt = _render_refactor_prompt(tmp_path / "refactor-mixed", platform="claude")
1444
1446
 
1445
1447
  assert "{{" + "REVIEWER_" + "SUBAGENT_PATH" + "}}" not in replacements
1446
- assert "Main-Agent self-review" in refactor_prompt
1447
- assert "Reviewer 3 is forbidden" in refactor_prompt
1448
+ assert "Main-Agent review loop" in refactor_prompt
1449
+ assert "code-review-specific subagent" in refactor_prompt
1450
+ assert "Reviewer 3" not in refactor_prompt
1448
1451
 
1449
1452
  def test_bugfix_refactor_explicit_codex_override(self, tmp_path, monkeypatch):
1450
1453
  from generate_bugfix_prompt import build_replacements as bugfix_build_replacements
@@ -1465,8 +1468,9 @@ class TestHeadlessPromptCleanupF033:
1465
1468
  refactor_prompt = _render_refactor_prompt(tmp_path / "refactor-codex", platform="claude", explicit_platform="codex")
1466
1469
 
1467
1470
  assert "{{" + "REVIEWER_" + "SUBAGENT_PATH" + "}}" not in replacements
1468
- assert "Main-Agent self-review" in refactor_prompt
1469
- assert "Reviewer 3 is forbidden" in refactor_prompt
1471
+ assert "Main-Agent review loop" in refactor_prompt
1472
+ assert "code-review-specific subagent" in refactor_prompt
1473
+ assert "Reviewer 3" not in refactor_prompt
1470
1474
 
1471
1475
 
1472
1476
  class TestFeatureBootstrapShellExtraction:
@@ -100,11 +100,17 @@ class TestArtifactAndTextHelpers:
100
100
  report = tmp_path / "review-report.md"
101
101
  report.write_text(
102
102
  "## Final Result\n- Verdict: PASS\n\n"
103
- "## Final Result\n- Verdict: BLOCKED\n",
103
+ "## Final Result\n- Verdict: NEEDS_FIXES\n",
104
104
  encoding="utf-8",
105
105
  )
106
- blocked = run_helper("text", "final-verdict", str(report))
107
- assert first_line(blocked) == "REVIEW_BLOCKED"
106
+ needs_fixes = run_helper("text", "final-verdict", str(report))
107
+ assert needs_fixes.returncode == 0
108
+ assert first_line(needs_fixes) == "REVIEW_NEEDS_FIXES"
109
+
110
+ report.write_text("## Final Result\n- Verdict: BLOCKED\n", encoding="utf-8")
111
+ retired = run_helper("text", "final-verdict", str(report))
112
+ assert retired.returncode != 0
113
+ assert first_line(retired) == "REVIEW_INVALID"
108
114
 
109
115
  report.write_text("## Final Result\n- Verdict: UNKNOWN\n", encoding="utf-8")
110
116
  invalid = run_helper("text", "final-verdict", str(report))
@@ -811,7 +811,7 @@ def test_session_preamble_writes_redacted_start_command_for_all_launch_profiles(
811
811
  assert str(prompt) not in "\n".join(lines[:6])
812
812
 
813
813
 
814
- def test_headless_review_guidance_uses_risk_routed_dual_layer_loop():
814
+ def test_headless_review_guidance_uses_main_agent_review_loop():
815
815
  headless_guidance_files = [
816
816
  REPO_ROOT / "dev-pipeline" / "templates" / "sections" / "phase-review-full.md",
817
817
  REPO_ROOT / "dev-pipeline" / "templates" / "bootstrap-tier3.md",
@@ -827,32 +827,27 @@ def test_headless_review_guidance_uses_risk_routed_dual_layer_loop():
827
827
 
828
828
  for path in headless_guidance_files:
829
829
  text = path.read_text(encoding="utf-8")
830
- assert "Main-Agent self-review" in text, path
831
- assert "low=0" in text and "medium=1" in text and "high=2" in text, path
832
- assert "Reviewer 3 is forbidden" in text, path
830
+ assert "Main-Agent review loop" in text, path
831
+ assert "up to ten completed rounds" in text, path
833
832
  assert "text final-verdict" in text, path
834
- assert "workspace-equivalent" not in text, path
835
- assert "workspace protocol" not in text, path
836
- assert "current-workspace / active-checkout / no-worktree" not in text, path
837
- assert ".claude/worktrees/..." not in text, path
838
- assert ".prizmkit/state/worktrees/..." not in text, path
839
- assert "USE_WORKTREE" not in text, path
833
+ assert "code-review-specific subagent" in text, path
834
+ assert "low=0" not in text and "Reviewer 3" not in text, path
835
+ assert "REVIEW_BLOCKED" not in text, path
836
+ assert "forced-worktree changed-content fallback" not in text, path
840
837
  assert "isolation:" not in text, path
841
838
 
842
839
  skill_text = skill_path.read_text(encoding="utf-8")
843
840
  assert "staged and unstaged tracked changes" in skill_text
844
841
  assert "untracked files" in skill_text
845
842
  assert "accepted = 0" in skill_text
846
- assert "low: 0" in skill_text and "medium: 1" in skill_text and "high: 2" in skill_text
847
- assert "accepted high-severity finding" in skill_text
848
- assert "Do not launch Reviewer 3" in skill_text
843
+ assert "ten completed review rounds" in skill_text
849
844
  assert "## Final Result" in skill_text
850
- assert "BLOCKED" in skill_text
851
- assert "Do not substitute Main-Agent self-review" in skill_text
845
+ assert "PASS | NEEDS_FIXES" in skill_text
846
+ assert "BLOCKED" not in skill_text
847
+ assert "Reviewer 2" not in skill_text
852
848
  assert "reviewer-workspace-protocol.md" not in skill_text
853
849
  assert "reviewer-execution-protocol.md" not in skill_text
854
850
  assert "WORKSPACE_MISMATCH" not in skill_text
855
- assert "REVIEW_INFRASTRUCTURE_BLOCKED" not in skill_text
856
851
 
857
852
 
858
853
  def test_progress_parser_adds_required_metadata(tmp_path):
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.127",
2
+ "version": "1.1.128",
3
3
  "skills": {
4
4
  "prizmkit": {
5
5
  "description": "Full-lifecycle dev toolkit. Covers spec-driven development, Prizm context docs, code quality, debugging, deployment, and knowledge management.",
@@ -30,10 +30,10 @@
30
30
  "hasScripts": false
31
31
  },
32
32
  "prizmkit-code-review": {
33
- "description": "Independent read-only review with Main-Agent finding adjudication, direct repairs, bounded convergence, and a minimal final report.",
33
+ "description": "Bounded Main-Agent code review with evidence-based finding adjudication, direct repairs, verification, and append-only progress reporting.",
34
34
  "tier": "1",
35
35
  "category": "prizmkit-skill",
36
- "hasAssets": true,
36
+ "hasAssets": false,
37
37
  "hasScripts": true
38
38
  },
39
39
  "prizmkit-committer": {