prizmkit 1.1.111 → 1.1.113
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/codex/skill-adapter.js +4 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +10 -10
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +20 -73
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +290 -421
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
- package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
- package/bundled/dev-pipeline/scripts/utils.py +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +7 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +17 -19
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +21 -26
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +8 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +7 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +7 -1
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +104 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +14 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +239 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
- package/bundled/dev-pipeline/tests/test_utils.py +66 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
- package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
- package/bundled/skills/bug-planner/SKILL.md +6 -5
- package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
- package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +70 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -21
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +25 -26
- package/bundled/skills/feature-planner/SKILL.md +9 -11
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
- package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
- package/bundled/skills/feature-workflow/SKILL.md +170 -298
- package/bundled/skills/prizmkit/SKILL.md +103 -57
- package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +14 -3
- package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
- package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +12 -3
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
- package/bundled/skills/prizmkit-init/SKILL.md +4 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +11 -13
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
- package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
- package/bundled/skills/prizmkit-test/SKILL.md +138 -141
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +1 -1
- package/bundled/skills/prizmkit-test/references/examples.md +11 -9
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
- package/bundled/skills/recovery-workflow/SKILL.md +195 -256
- package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
- package/bundled/skills/recovery-workflow/references/detection.md +48 -39
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +32 -13
- package/bundled/skills/refactor-planner/SKILL.md +2 -2
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
- package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
- package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +174 -307
- package/package.json +1 -1
- package/src/scaffold.js +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
- 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
|
|
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
|
|
16
|
-
- Mid-implementation — use the specific skill needed (
|
|
17
|
-
- User wants to execute immediately without orientation —
|
|
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
|
|
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
|
-
|
|
24
|
-
```
|
|
25
|
-
read docs → plan → implement → code-review → retrospective → committer
|
|
26
|
-
```
|
|
24
|
+
Per-task context normally comes from:
|
|
27
25
|
|
|
28
|
-
|
|
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
|
-
**
|
|
31
|
-
-
|
|
32
|
-
- `.prizmkit/
|
|
33
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
38
|
+
Choose the lightest path that still protects correctness. Explain the chosen path briefly before proceeding.
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
+
### Full path
|
|
49
69
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
+
## Risk-Triggered Testing
|
|
59
85
|
|
|
60
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
71
|
-
| `/prizmkit-
|
|
72
|
-
| `/prizmkit-
|
|
73
|
-
| `/prizmkit-
|
|
74
|
-
| `/prizmkit-
|
|
75
|
-
| `/prizmkit-
|
|
76
|
-
| `/prizmkit-
|
|
77
|
-
| `/prizmkit-
|
|
78
|
-
| `/prizmkit-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
11
|
-
-
|
|
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
|
-
|
|
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`
|
|
17
|
-
-
|
|
18
|
-
-
|
|
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
|
-
-
|
|
22
|
-
- No spec.md or plan.md exists
|
|
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
|
|
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.
|
|
33
|
-
2.
|
|
34
|
-
3.
|
|
35
|
-
- If `{artifact_dir}/test-report-path.txt` exists, read the
|
|
36
|
-
- Extract
|
|
37
|
-
- If `
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
59
|
-
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
76
|
+
Always spawn `prizm-dev-team-reviewer` using the dedicated subagent contract:
|
|
81
77
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
89
|
+
### Step 2: Run Review
|
|
109
90
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
|
99
|
+
### Step 3: Loop Exit Gate
|
|
122
100
|
|
|
123
|
-
|
|
101
|
+
Call the gate only in these cases:
|
|
124
102
|
|
|
125
|
-
|
|
103
|
+
1. Review returned `PASS`.
|
|
104
|
+
2. Main Agent has filtered `NEEDS_FIXES` findings.
|
|
126
105
|
|
|
127
|
-
|
|
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
|
-
|
|
108
|
+
Script mode invocation:
|
|
135
109
|
|
|
136
|
-
|
|
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
|
-
|
|
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
|
-
|
|
116
|
+
### Text Fallback Constraints
|
|
141
117
|
|
|
142
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
129
|
+
For each finding, decide whether it is reasonable:
|
|
153
130
|
|
|
154
|
-
|
|
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
|
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
142
|
+
### Step 5: Main Agent Applies Accepted Fixes
|
|
166
143
|
|
|
167
|
-
|
|
144
|
+
The Main Agent applies accepted findings directly in the active checkout. Do not spawn a separate Dev Agent for fixes.
|
|
168
145
|
|
|
169
|
-
|
|
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
|
|
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
|
-
|
|
178
|
-
- `
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
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
|
|
|
@@ -12,10 +12,21 @@ You are the dedicated PrizmKit Reviewer agent (`prizm-dev-team-reviewer`). Revie
|
|
|
12
12
|
{architecture decisions and task list from plan.md}
|
|
13
13
|
|
|
14
14
|
## Scoped Test Report
|
|
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
|
|
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 change 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."}
|
|
@@ -38,7 +49,7 @@ Evaluate the changes across these dimensions (focus on what's relevant):
|
|
|
38
49
|
3. **Completeness**: Files that should have been changed but weren't? Missing tests, types, imports, exports?
|
|
39
50
|
4. **Consistency**: Do changes follow the project's existing patterns, naming conventions, and code style?
|
|
40
51
|
5. **Security**: Hardcoded secrets, injection vulnerabilities, unsafe operations.
|
|
41
|
-
6. **Test quality**: If a scoped `/prizmkit-test` report is present, verify the report scope is `this-change`, the artifact dir matches the
|
|
52
|
+
6. **Test quality**: If a scoped `/prizmkit-test` report is present, verify the report scope is `this-change`, the artifact dir matches the reviewed change, generated/updated tests assert real behavior rather than mock success or empty assertions, in-scope failures are not mislabeled as baseline failures, baseline failures are genuinely unrelated or pre-existing, out-of-scope gaps were not turned into unrelated test changes, and the report verdict is compatible with proceeding.
|
|
42
53
|
7. **Rules compliance**: (Skip this dimension if no dev rules were provided.) Do changes follow the per-layer dev rules? Flag violations of framework conventions, naming patterns, state management, or other rules defined for that layer.
|
|
43
54
|
|
|
44
55
|
## Output Format
|