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.
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/claude/command-adapter.js +2 -75
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +14 -11
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_helper.py +0 -1
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +3 -3
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +3 -3
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +4 -4
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -4
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -4
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -4
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +4 -5
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +11 -7
- package/bundled/dev-pipeline/tests/test_runtime_helper.py +9 -3
- package/bundled/dev-pipeline/tests/test_unified_cli.py +11 -16
- package/bundled/skills/_metadata.json +3 -3
- package/bundled/skills/prizmkit-code-review/SKILL.md +54 -122
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +9 -36
- package/bundled/skills/prizmkit-code-review/scripts/render_review_report.py +21 -111
- package/package.json +1 -1
- package/src/scaffold.js +5 -16
- package/bundled/skills/prizmkit-code-review/assets/reviewer-role.json +0 -19
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +0 -120
package/bundled/VERSION.json
CHANGED
|
@@ -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
|
|
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`
|
|
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,
|
|
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
|
-
+--
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
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 |
|
|
@@ -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
|
|
101
|
-
3.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
184
|
-
-
|
|
185
|
-
- The skill
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
- `
|
|
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
|
|
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
|
|
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
|
-
- `
|
|
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
|
|
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
|
|
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
|
-
- `
|
|
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
|
|
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
|
|
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
|
-
- `
|
|
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
|
|
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
|
|
886
|
-
assert "
|
|
887
|
-
assert "
|
|
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
|
|
1447
|
-
assert "
|
|
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
|
|
1469
|
-
assert "
|
|
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:
|
|
103
|
+
"## Final Result\n- Verdict: NEEDS_FIXES\n",
|
|
104
104
|
encoding="utf-8",
|
|
105
105
|
)
|
|
106
|
-
|
|
107
|
-
assert
|
|
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
|
|
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
|
|
831
|
-
assert "
|
|
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 "
|
|
835
|
-
assert "
|
|
836
|
-
assert "
|
|
837
|
-
assert "
|
|
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 "
|
|
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 "
|
|
851
|
-
assert "
|
|
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.
|
|
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": "
|
|
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":
|
|
36
|
+
"hasAssets": false,
|
|
37
37
|
"hasScripts": true
|
|
38
38
|
},
|
|
39
39
|
"prizmkit-committer": {
|