prizmkit 1.1.79 → 1.1.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/scripts/init-pipeline.py +2 -0
  3. package/bundled/dev-pipeline-windows/scripts/init-pipeline.py +2 -0
  4. package/bundled/skills/_metadata.json +1 -1
  5. package/bundled/skills/app-planner/SKILL.md +12 -356
  6. package/bundled/skills/app-planner/references/infrastructure-convention-discovery.md +108 -0
  7. package/bundled/skills/app-planner/references/project-conventions-discovery.md +59 -0
  8. package/bundled/skills/app-planner/references/project-state-detection.md +88 -0
  9. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +10 -0
  10. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +9 -0
  11. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +10 -0
  12. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +17 -0
  13. package/bundled/skills/app-planner/references/rules/frontend/template.md +19 -0
  14. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +10 -0
  15. package/bundled/skills/app-planner/references/rules-configuration.md +46 -0
  16. package/bundled/skills/bug-fix-workflow/SKILL.md +18 -54
  17. package/bundled/skills/bug-fix-workflow/references/bug-diagnosis.md +41 -0
  18. package/bundled/skills/bug-planner/SKILL.md +20 -12
  19. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +9 -108
  20. package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +98 -0
  21. package/bundled/skills/feature-pipeline-launcher/SKILL.md +20 -103
  22. package/bundled/skills/feature-pipeline-launcher/references/configuration.md +81 -0
  23. package/bundled/skills/feature-planner/SKILL.md +5 -9
  24. package/bundled/skills/feature-workflow/SKILL.md +27 -184
  25. package/bundled/skills/feature-workflow/references/brainstorm-guide.md +137 -0
  26. package/bundled/skills/prizm-kit/SKILL.md +14 -2
  27. package/bundled/skills/prizmkit-code-review/SKILL.md +67 -136
  28. package/bundled/skills/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
  29. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +31 -0
  30. package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
  31. package/bundled/skills/prizmkit-code-review/scripts/check_loop.py +186 -0
  32. package/bundled/skills/prizmkit-committer/SKILL.md +8 -0
  33. package/bundled/skills/prizmkit-deploy/SKILL.md +49 -73
  34. package/bundled/skills/prizmkit-deploy/references/data-safety-examples.md +120 -0
  35. package/bundled/skills/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
  36. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
  37. package/bundled/skills/prizmkit-deploy/references/ssh-takeover.md +20 -0
  38. package/bundled/skills/prizmkit-implement/SKILL.md +7 -1
  39. package/bundled/skills/prizmkit-plan/SKILL.md +1 -83
  40. package/bundled/skills/prizmkit-plan/references/examples.md +85 -0
  41. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +14 -0
  42. package/bundled/skills/prizmkit-retrospective/SKILL.md +1 -1
  43. package/bundled/skills/prizmkit-test/SKILL.md +3 -151
  44. package/bundled/skills/prizmkit-test/references/examples.md +70 -0
  45. package/bundled/skills/prizmkit-test/references/test-generation-steps.md +49 -0
  46. package/bundled/skills/prizmkit-test/references/test-report-template.md +42 -0
  47. package/bundled/skills/recovery-workflow/SKILL.md +24 -103
  48. package/bundled/skills/recovery-workflow/references/detection.md +58 -0
  49. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +9 -96
  50. package/bundled/skills/refactor-pipeline-launcher/references/configuration.md +88 -0
  51. package/bundled/skills/refactor-planner/SKILL.md +15 -157
  52. package/bundled/skills/refactor-planner/references/fast-path.md +59 -0
  53. package/bundled/skills/refactor-planner/references/planning-phases.md +135 -0
  54. package/bundled/skills/refactor-workflow/SKILL.md +18 -178
  55. package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +116 -0
  56. package/bundled/skills-windows/app-planner/SKILL.md +12 -358
  57. package/bundled/skills-windows/app-planner/references/infrastructure-convention-discovery.md +108 -0
  58. package/bundled/skills-windows/app-planner/references/project-conventions-discovery.md +59 -0
  59. package/bundled/skills-windows/app-planner/references/project-state-detection.md +90 -0
  60. package/bundled/skills-windows/app-planner/references/rules/backend/derivation-rules.md +10 -0
  61. package/bundled/skills-windows/app-planner/references/rules/database/derivation-rules.md +9 -0
  62. package/bundled/skills-windows/app-planner/references/rules/frontend/derivation-rules.md +10 -0
  63. package/bundled/skills-windows/app-planner/references/rules/frontend/question-bank.md +17 -0
  64. package/bundled/skills-windows/app-planner/references/rules/frontend/template.md +19 -0
  65. package/bundled/skills-windows/app-planner/references/rules/mobile/derivation-rules.md +10 -0
  66. package/bundled/skills-windows/app-planner/references/rules-configuration.md +46 -0
  67. package/bundled/skills-windows/bug-fix-workflow/SKILL.md +18 -54
  68. package/bundled/skills-windows/bug-fix-workflow/references/bug-diagnosis.md +41 -0
  69. package/bundled/skills-windows/bug-planner/SKILL.md +20 -12
  70. package/bundled/skills-windows/bugfix-pipeline-launcher/SKILL.md +6 -91
  71. package/bundled/skills-windows/bugfix-pipeline-launcher/references/configuration.md +94 -0
  72. package/bundled/skills-windows/feature-pipeline-launcher/SKILL.md +19 -88
  73. package/bundled/skills-windows/feature-pipeline-launcher/references/configuration.md +77 -0
  74. package/bundled/skills-windows/feature-planner/SKILL.md +5 -9
  75. package/bundled/skills-windows/feature-workflow/SKILL.md +27 -184
  76. package/bundled/skills-windows/feature-workflow/references/brainstorm-guide.md +137 -0
  77. package/bundled/skills-windows/prizm-kit/SKILL.md +14 -2
  78. package/bundled/skills-windows/prizmkit-code-review/SKILL.md +67 -136
  79. package/bundled/skills-windows/prizmkit-code-review/references/dev-agent-prompt.md +30 -0
  80. package/bundled/skills-windows/prizmkit-code-review/references/review-report-template.md +31 -0
  81. package/bundled/skills-windows/prizmkit-code-review/references/reviewer-agent-prompt.md +62 -0
  82. package/bundled/skills-windows/prizmkit-code-review/scripts/check_loop.py +186 -0
  83. package/bundled/skills-windows/prizmkit-committer/SKILL.md +8 -0
  84. package/bundled/skills-windows/prizmkit-deploy/SKILL.md +50 -74
  85. package/bundled/skills-windows/prizmkit-deploy/references/data-safety-examples.md +120 -0
  86. package/bundled/skills-windows/prizmkit-deploy/references/direct-upload.md +3 -3
  87. package/bundled/skills-windows/prizmkit-deploy/references/ssh-bootstrap-flow.md +49 -0
  88. package/bundled/skills-windows/prizmkit-deploy/references/ssh-execution-flow.md +41 -0
  89. package/bundled/skills-windows/prizmkit-deploy/references/ssh-takeover.md +20 -0
  90. package/bundled/skills-windows/prizmkit-deploy/references/ssl-setup.md +2 -2
  91. package/bundled/skills-windows/prizmkit-implement/SKILL.md +7 -1
  92. package/bundled/skills-windows/prizmkit-plan/SKILL.md +1 -83
  93. package/bundled/skills-windows/prizmkit-plan/references/examples.md +85 -0
  94. package/bundled/skills-windows/prizmkit-prizm-docs/SKILL.md +14 -0
  95. package/bundled/skills-windows/prizmkit-retrospective/SKILL.md +1 -1
  96. package/bundled/skills-windows/prizmkit-retrospective/references/structural-sync-steps.md +1 -1
  97. package/bundled/skills-windows/prizmkit-test/SKILL.md +3 -151
  98. package/bundled/skills-windows/prizmkit-test/references/examples.md +70 -0
  99. package/bundled/skills-windows/prizmkit-test/references/test-generation-steps.md +49 -0
  100. package/bundled/skills-windows/prizmkit-test/references/test-report-template.md +42 -0
  101. package/bundled/skills-windows/recovery-workflow/SKILL.md +24 -125
  102. package/bundled/skills-windows/recovery-workflow/references/detection.md +58 -0
  103. package/bundled/skills-windows/refactor-pipeline-launcher/SKILL.md +8 -77
  104. package/bundled/skills-windows/refactor-pipeline-launcher/references/configuration.md +82 -0
  105. package/bundled/skills-windows/refactor-planner/SKILL.md +15 -157
  106. package/bundled/skills-windows/refactor-planner/references/fast-path.md +59 -0
  107. package/bundled/skills-windows/refactor-planner/references/planning-phases.md +135 -0
  108. package/bundled/skills-windows/refactor-workflow/SKILL.md +18 -178
  109. package/bundled/skills-windows/refactor-workflow/references/brainstorm-guide.md +116 -0
  110. package/package.json +1 -1
@@ -26,114 +26,104 @@ The loop repeats until the Reviewer finds no issues or the max round limit is re
26
26
 
27
27
  | Parameter | Required | Description |
28
28
  |-----------|----------|-------------|
29
- | `artifact_dir` | No | Directory containing spec.md + plan.md. If omitted, scan `.prizmkit/` subdirectories for the most recently modified directory with a `plan.md` whose tasks are all completed. |
29
+ | `artifact_dir` | No | Directory containing spec.md + plan.md. If omitted, scan `.prizmkit/` subdirectories for the most recently modified directory with a `plan.md` whose tasks are all completed. When invoked as a handoff step, reuse the caller's `artifact_dir` rather than re-detecting. |
30
30
 
31
31
  ## Phase 0: Context Loading
32
32
 
33
33
  1. **Read spec.md** from the artifact directory — extract goals and acceptance criteria.
34
34
  2. **Read plan.md** from the artifact directory — extract architecture decisions and completed tasks.
35
- 3. **Read dev rules** (if configured): Read `.prizmkit/prizm-docs/root.prizm` and check for a `RULES:` line. If present, read all referenced `.prizmkit/rules/<layer>-rules.md` files. If a referenced file does not exist, skip it silently and continue. These define per-layer conventions that the code should follow.
35
+ 3. **Read dev rules** (if configured): If `.prizmkit/prizm-docs/root.prizm` exists, read it and check for a `RULES:` line. If present, read all referenced `.prizmkit/rules/<layer>-rules.md` files. If `root.prizm` or a referenced rules file does not exist, continue with "No custom dev rules configured use general best practices."
36
36
  4. **Capture workspace diff**: run `git diff` (unstaged) + `git diff --cached` (staged) + `git status` to understand the full scope of changes. For new files in git status, note their paths for the Reviewer to read.
37
- - If no changes are detected, output PASS and stop.
37
+ - 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.
38
38
 
39
39
  ## Phase 1: Review-Fix Loop
40
40
 
41
- ```
42
- ┌─── Loop (max 3 rounds) ──────────────────────────────┐
43
- │ │
44
- │ Step 1: Spawn Reviewer Agent (read-only) │
45
- │ → Input: git diff + spec goals + plan decisions + dev rules│
46
- │ → Output: structured findings or PASS │
47
- │ │
48
- │ Step 2: Check result │
49
- │ → If PASS (no findings): exit loop │
50
- │ │
51
- │ Step 3: Main Agent filters findings │
52
- │ → For each finding: accept (reasonable) or reject │
53
- │ → If all rejected: exit loop │
54
- │ │
55
- │ Step 4: Spawn Dev Agent (read-write) │
56
- │ → Input: accepted findings + spec/plan context │
57
- │ → Output: fix report │
58
- │ │
59
- │ Step 5: Back to Step 1 │
60
- │ │
61
- │ Hard limit: exit after 3 rounds regardless │
62
- │ → On max-round exhaustion: output a summary of all │
63
- │ unresolved findings to the conversation, then write │
64
- │ review-report.md with NEEDS_FIXES verdict. │
65
- └────────────────────────────────────────────────────────┘
41
+ ### Gate Mode Detection
42
+
43
+ The loop exit conditions are enforced by a gatekeeper. Check Python availability first:
44
+
45
+ ```bash
46
+ python3 --version 2>/dev/null && echo "SCRIPT_MODE" || echo "TEXT_MODE"
66
47
  ```
67
48
 
68
- ### Step 1: Spawn Reviewer Agent
49
+ - **Script mode** (Python available): Use `${SKILL_DIR}/scripts/check_loop.py` to enforce exit conditions with round tracking, max-rounds enforcement, and divergence detection. The script prevents accidentally exceeding the 3-round limit.
50
+ - **Text mode** (no Python): Follow §Text Fallback Constraints — identical behavior enforced manually.
51
+
52
+ ### Step 0: Initialize Loop State
53
+
54
+ The script is stateless — no `--reset` or runtime files. Initialize these values before starting:
69
55
 
70
- Include the dev rules read in Phase 0 step 3 in the `## Dev Rules` section of the prompt below. Spawn a **read-only** agent (subagent_type: `Explore`) with the following prompt:
56
+ **Script mode** `findings_history = []`, `max_rounds = 3`, `round = 1`.
57
+ **Text mode** — track manually: `round = 1`, `findings_history = []`.
71
58
 
59
+ ### Loop Flow
60
+
61
+ ```
62
+ 1. Spawn Reviewer Agent (read-only) → findings or PASS
63
+ 2. Parse result:
64
+ - PASS → Call Loop Exit Gate → Phase 2
65
+ - NEEDS_FIXES → count findings → Step 3 (do not call gate yet)
66
+ 3. Main Agent filters findings → Call Loop Exit Gate → if endLoop: Phase 2
67
+ 4. Spawn Dev Agent (read-write) → apply fixes
68
+ 5. Increment round and return to Step 1
72
69
  ```
73
- You are a code reviewer. Review workspace changes against the spec goals, plan decisions, and per-layer dev rules.
74
70
 
75
- ## Spec Goals
76
- {goals and acceptance criteria from spec.md}
71
+ ### Loop Exit Gate
72
+
73
+ Call the gate only in these cases:
77
74
 
78
- ## Plan Decisions
79
- {architecture decisions and task list from plan.md}
75
+ 1. Reviewer returned `PASS`.
76
+ 2. Main Agent has finished filtering `NEEDS_FIXES` findings.
80
77
 
81
- ## Dev Rules (per-layer conventions)
82
- {rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}
78
+ 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.
83
79
 
84
- ## Review Round
85
- Round {N}. {round_context}
80
+ **Script mode invocation:**
81
+ ```bash
82
+ 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
83
+ ```
86
84
 
87
- ## What to Review
88
- Run these commands to see the current workspace changes:
89
- - `git diff` (unstaged changes)
90
- - `git diff --cached` (staged changes)
91
- - `git status` (new/deleted files)
85
+ | Input field | Type | Description |
86
+ |-------------|------|-------------|
87
+ | `reviewer_result` | `"PASS"` or `"NEEDS_FIXES"` | Reviewer's verdict |
88
+ | `accepted_count` | int | Findings accepted by Main Agent. Use `0` for Reviewer PASS or when all findings were rejected after filtering. |
89
+ | `findings_count` | int | Total findings returned by Reviewer this round |
90
+ | `round` | int | Current round number (1-based, model-supplied — the script does not auto-increment) |
91
+ | `findings_history` | `[int, ...]` | Findings count per round, used for divergence detection. Initialize as `[]`. Pass back the value from the previous gate call's output. |
92
+ | `max_rounds` | int | Maximum review rounds before forced exit. Default `3`. |
93
+ | `filtering_done` | bool | `true` only after Main Agent has filtered `NEEDS_FIXES` findings. For Reviewer PASS, this may be omitted. |
92
94
 
93
- For new files shown in git status, read their full content.
94
- For modified files, read enough surrounding context to understand the change.
95
+ Output: `{"endLoop": bool, "reason": str, "verdict": "PASS"|"NEEDS_FIXES"|null, "round": int, "maxRounds": int, "divergenceWarning": bool, "findings_history": [int, ...]}`
95
96
 
96
- ## Review Dimensions
97
- Evaluate the changes across these dimensions (focus on what's relevant):
97
+ 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.
98
98
 
99
- 1. **Goal alignment**: Do the changes accomplish all goals from spec.md? Anything missing or off-target?
100
- 2. **Defects**: Logic bugs, missing error handling, boundary condition issues, incorrect behavior.
101
- 3. **Completeness**: Files that should have been changed but weren't? Missing tests, types, imports, exports?
102
- 4. **Consistency**: Do changes follow the project's existing patterns, naming conventions, and code style?
103
- 5. **Security**: Hardcoded secrets, injection vulnerabilities, unsafe operations.
104
- 6. **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.
99
+ **Text mode** enforce §Text Fallback Constraints manually with identical logic.
105
100
 
106
- ## Output Format
107
- Respond with EXACTLY this format:
101
+ ### Text Fallback Constraints
108
102
 
109
- ### Result: PASS | NEEDS_FIXES
103
+ When Python is unavailable, apply these rules exactly — they match the script's logic:
110
104
 
111
- ### Findings
112
- (If PASS, write "No issues found.")
105
+ 1. **PASS exit**: Reviewer returns `PASS` → exit loop, verdict PASS.
106
+ 2. **Pre-filter NEEDS_FIXES**: Count findings and continue to filtering. Do not apply all-rejected or max-round exits before filtering.
107
+ 3. **All-rejected exit**: After filtering, if all findings were rejected → exit loop, verdict PASS.
108
+ 4. **Max rounds**: After filtering, if `round >= 3` and accepted findings remain → exit loop, verdict NEEDS_FIXES. Write `review-report.md` with unresolved findings.
109
+ 5. **Divergence**: If findings count strictly increases for 3 consecutive recorded rounds, warn user the loop may not converge.
110
+ 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.
113
111
 
114
- #### Finding N
115
- - **Severity**: high | medium | low
116
- - **Dimension**: goal-alignment | defect | completeness | consistency | security | rules-compliance
117
- - **Location**: filepath:line (or "project-level")
118
- - **Problem**: What is wrong and why it matters
119
- - **Suggestion**: Recommended fix approach
120
- - **Verification**: How to confirm the fix is correct
112
+ ### Step 1: Spawn Reviewer Agent
121
113
 
122
- ### Summary
123
- One to two sentences about the overall state of the changes.
124
- ```
114
+ Include the dev rules read in Phase 0 step 3 in the `## Dev Rules` section of the prompt. Spawn a platform-supported **read-only** reviewer agent; use `subagent_type: Explore` only on platforms that support it. If no read-only agent is available, perform the review in the Main Agent without editing files. Read `${SKILL_DIR}/references/reviewer-agent-prompt.md` for the full prompt template — fill `{goals}`, `{plan decisions}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning.
125
115
 
126
- **Round context** varies by round:
116
+ Round context varies by round:
127
117
  - Round 1: "This is the first review. Examine all changes comprehensively."
128
118
  - 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."
129
119
 
130
- ### Step 2: Check Result
120
+ ### Step 2: Check Result + Gate
131
121
 
132
122
  Parse the Reviewer Agent's output:
133
- - If `Result: PASS` → exit loop, proceed to Phase 2.
134
- - If `Result: NEEDS_FIXES` → extract findings and continue to Step 3.
123
+ - 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.
124
+ - If `Result: NEEDS_FIXES` → count findings, do not call the gate yet, then continue to Step 3.
135
125
 
136
- ### Step 3: Main Agent Filters Findings
126
+ ### Step 3: Main Agent Filters Findings + Gate
137
127
 
138
128
  Review each finding and decide whether it's reasonable. This prevents unnecessary or harmful changes.
139
129
 
@@ -146,76 +136,17 @@ Review each finding and decide whether it's reasonable. This prevents unnecessar
146
136
  - **Accepted**: The finding is reasonable — include it in the Dev Agent's task.
147
137
  - **Rejected** (with reason): Brief explanation (e.g., "Out of scope", "Style preference, not a defect").
148
138
 
149
- If all findings are rejected exit loop, proceed to Phase 2.
139
+ After filtering: call the **Loop Exit Gate** with `{"reviewer_result": "NEEDS_FIXES", "accepted_count": <N>, "findings_count": <total findings this round>, "round": <current_round>, "findings_history": <current_history>, "max_rounds": 3, "filtering_done": true}`. If `endLoop=true`, proceed to Phase 2.
150
140
 
151
141
  ### Step 4: Spawn Dev Agent
152
142
 
153
- Spawn a **general-purpose** agent (read-write) with the following prompt:
154
-
155
- ```
156
- You are a developer fixing code review findings. Apply each fix carefully without breaking existing functionality.
157
-
158
- ## Spec Context
159
- {goals from spec.md for reference}
160
-
161
- ## Findings to Fix
162
- {accepted findings list — each with Severity, Location, Problem, Suggestion, Verification}
163
-
164
- ## Instructions
165
- 1. Read each finding carefully.
166
- 2. For each finding:
167
- a. Read the relevant code and understand the context.
168
- b. Implement the fix based on the suggestion.
169
- c. If a suggestion is not feasible (would break other functionality, technically impossible), explain why.
170
- 3. After all fixes, report what you did.
171
-
172
- ## Output Format
173
- For each finding, report:
174
- - **Finding N**: [fixed | unable-to-fix]
175
- - **What was done**: Brief description
176
- - **Files modified**: List of changed files
177
- (If unable-to-fix, explain why)
178
- ```
143
+ Spawn a platform-supported **read-write** developer agent. If no write-capable agent is available, the Main Agent applies accepted fixes directly. Read `${SKILL_DIR}/references/dev-agent-prompt.md` for the full prompt template — fill `{spec context}` and `{accepted findings}` before spawning.
179
144
 
180
145
  After the Dev Agent returns, record results and return to Step 1 for the next round.
181
146
 
182
147
  ## Phase 2: Output
183
148
 
184
- Write `review-report.md` to the artifact directory:
185
-
186
- ```markdown
187
- # Review Report
188
-
189
- ## Verdict: PASS
190
- ## Rounds: 2
191
- ## Total findings: 3 → Fixed: 2, Rejected: 1
192
-
193
- ## Round 1
194
- Findings: 3 | Accepted: 2, Rejected: 1
195
-
196
- ### Finding 1: Missing null check in parseConfig
197
- - Severity: high
198
- - Dimension: defect
199
- - Location: src/config.ts:42
200
- - Problem: parseConfig crashes when input is undefined
201
- - Status: fixed (round 1)
202
-
203
- ### Finding 2: Export missing from index.ts
204
- - Severity: medium
205
- - Dimension: completeness
206
- - Location: src/index.ts
207
- - Problem: New parseConfig function not exported
208
- - Status: fixed (round 1)
209
-
210
- ### Finding 3: Consider renaming variable
211
- - Severity: low
212
- - Dimension: consistency
213
- - Location: src/config.ts:15
214
- - Problem: Variable `d` should be more descriptive
215
- - Status: rejected — Style preference; existing code uses short names in this module
216
-
217
- ## Round 2: PASS — no new findings
218
- ```
149
+ 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.
219
150
 
220
151
  - `PASS`: Reviewer returned no findings (or all remaining findings were rejected as unreasonable)
221
152
  - `NEEDS_FIXES`: 3 rounds completed but unresolved findings remain
@@ -0,0 +1,30 @@
1
+ # Dev Agent Prompt Template
2
+
3
+ Used in Phase 1 Step 4 of `/prizmkit-code-review`. The orchestrator fills `{spec context}` and `{accepted findings}` before spawning the Dev Agent.
4
+
5
+ ```
6
+ You are a developer fixing code review findings. Apply each fix carefully without breaking existing functionality.
7
+
8
+ ## Spec Context
9
+ {goals from spec.md for reference}
10
+
11
+ ## Findings to Fix
12
+ {accepted findings list — each with Severity, Location, Problem, Suggestion, Verification}
13
+
14
+ ## Instructions
15
+ 1. Read each finding carefully.
16
+ 2. For each finding:
17
+ a. Read the relevant code and understand the context.
18
+ b. Implement the fix based on the suggestion.
19
+ c. If a suggestion is not feasible (would break other functionality, technically impossible), explain why.
20
+ 3. After all fixes, report what you did.
21
+
22
+ ## Output Format
23
+ For each finding, report:
24
+ - **Finding N**: [fixed | unable-to-fix]
25
+ - **What was done**: Brief description
26
+ - **Files modified**: List of changed files
27
+ (If unable-to-fix, explain why)
28
+ ```
29
+
30
+ After the Dev Agent returns, record results and return to Step 1 for the next round.
@@ -0,0 +1,31 @@
1
+ # Review Report Output Template
2
+
3
+ Used in Phase 2 of `/prizmkit-code-review`. Always write `review-report.md` to the artifact directory using this format.
4
+
5
+ ```markdown
6
+ # Review Report
7
+
8
+ ## Verdict: <PASS|NEEDS_FIXES>
9
+ ## Rounds: <number of review rounds completed; use 0 for no-change PASS>
10
+ ## Total findings: <total> → Fixed: <fixed>, Rejected: <rejected>, Unresolved: <unresolved>
11
+
12
+ ## Round <N>
13
+ Findings: <count> | Accepted: <count>, Rejected: <count>
14
+
15
+ ### Finding <N>: <short title>
16
+ - Severity: <high|medium|low>
17
+ - Dimension: <goal-alignment|defect|completeness|consistency|security|rules-compliance>
18
+ - Location: <filepath:line or project-level>
19
+ - Problem: <what was wrong and why it mattered>
20
+ - Status: <fixed (round N)|rejected — reason|unresolved — reason>
21
+
22
+ ## Final Summary
23
+ <One to three sentences summarizing the review outcome, including no-change PASS when applicable.>
24
+ ```
25
+
26
+ For `PASS` with no findings, write `Total findings: 0 → Fixed: 0, Rejected: 0, Unresolved: 0` and `## Round 0: PASS — no workspace changes to review` or `## Round N: PASS — no issues found`.
27
+
28
+ ## Verdict Rules
29
+
30
+ - `PASS`: Reviewer returned no findings, no workspace changes existed, or all remaining findings were rejected as unreasonable.
31
+ - `NEEDS_FIXES`: Max rounds completed but accepted findings remain unresolved.
@@ -0,0 +1,62 @@
1
+ # Reviewer Agent Prompt Template
2
+
3
+ Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills `{goals}`, `{plan decisions}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning the Reviewer Agent.
4
+
5
+ ```
6
+ You are a code reviewer. Review workspace changes against the spec goals, plan decisions, and per-layer dev rules.
7
+
8
+ ## Spec Goals
9
+ {goals and acceptance criteria from spec.md}
10
+
11
+ ## Plan Decisions
12
+ {architecture decisions and task list from plan.md}
13
+
14
+ ## Dev Rules (per-layer conventions)
15
+ {rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}
16
+
17
+ ## Review Round
18
+ Round {N}. {round_context}
19
+
20
+ ## What to Review
21
+ Run these commands to see the current workspace changes:
22
+ - `git diff` (unstaged changes)
23
+ - `git diff --cached` (staged changes)
24
+ - `git status` (new/deleted files)
25
+
26
+ For new files shown in git status, read their full content.
27
+ For modified files, read enough surrounding context to understand the change.
28
+
29
+ ## Review Dimensions
30
+ Evaluate the changes across these dimensions (focus on what's relevant):
31
+
32
+ 1. **Goal alignment**: Do the changes accomplish all goals from spec.md? Anything missing or off-target?
33
+ 2. **Defects**: Logic bugs, missing error handling, boundary condition issues, incorrect behavior.
34
+ 3. **Completeness**: Files that should have been changed but weren't? Missing tests, types, imports, exports?
35
+ 4. **Consistency**: Do changes follow the project's existing patterns, naming conventions, and code style?
36
+ 5. **Security**: Hardcoded secrets, injection vulnerabilities, unsafe operations.
37
+ 6. **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.
38
+
39
+ ## Output Format
40
+ Respond with EXACTLY this format:
41
+
42
+ ### Result: PASS | NEEDS_FIXES
43
+
44
+ ### Findings
45
+ (If PASS, write "No issues found.")
46
+
47
+ #### Finding N
48
+ - **Severity**: high | medium | low
49
+ - **Dimension**: goal-alignment | defect | completeness | consistency | security | rules-compliance
50
+ - **Location**: filepath:line (or "project-level")
51
+ - **Problem**: What is wrong and why it matters
52
+ - **Suggestion**: Recommended fix approach
53
+ - **Verification**: How to confirm the fix is correct
54
+
55
+ ### Summary
56
+ One to two sentences about the overall state of the changes.
57
+ ```
58
+
59
+ ## Round Context
60
+
61
+ - Round 1: "This is the first review. Examine all changes comprehensively."
62
+ - 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."
@@ -0,0 +1,186 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Loop Exit Gatekeeper for prizmkit-code-review skill.
4
+
5
+ Stateless design: all loop state is passed via stdin and returned via stdout.
6
+ The caller (AI model) tracks `findings_history` and `max_rounds` between calls.
7
+ No runtime files are created — the script is a pure function over JSON.
8
+
9
+ The model supplies the current round in each call — the script does not auto-increment
10
+ rounds, because the gate is called twice per loop iteration (after Reviewer returns
11
+ and after Main Agent filters), and only the model knows when a full cycle completes.
12
+
13
+ Usage:
14
+ echo '{"reviewer_result":"NEEDS_FIXES","accepted_count":2,"findings_count":5,"round":1,"findings_history":[],"max_rounds":3,"filtering_done":true}' | python3 check_loop.py
15
+
16
+ Input JSON schema:
17
+ {
18
+ "reviewer_result": "PASS" | "NEEDS_FIXES",
19
+ "accepted_count": int,
20
+ "findings_count": int,
21
+ "round": int,
22
+ "findings_history": [int, ...],
23
+ "max_rounds": int,
24
+ "filtering_done": bool
25
+ }
26
+
27
+ Output JSON schema:
28
+ {
29
+ "endLoop": bool,
30
+ "reason": str,
31
+ "verdict": "PASS" | "NEEDS_FIXES" | null,
32
+ "round": int,
33
+ "maxRounds": int,
34
+ "divergenceWarning": bool,
35
+ "findings_history": [int, ...]
36
+ }
37
+
38
+ Exit conditions (checked in order):
39
+ 1. Reviewer returned PASS → endLoop=true, verdict=PASS
40
+ 2. NEEDS_FIXES before filtering → endLoop=false, wait for filtering
41
+ 3. Filtered findings all rejected → endLoop=true, verdict=PASS
42
+ 4. Max rounds reached after filtering → endLoop=true, verdict=NEEDS_FIXES
43
+ 5. Otherwise → endLoop=false
44
+
45
+ Divergence detection:
46
+ If findings_count strictly increases for 3 consecutive rounds, set divergenceWarning=true.
47
+ This is a warning only — it does not force loop exit.
48
+ """
49
+
50
+ import json
51
+ import sys
52
+
53
+ DEFAULT_MAX_ROUNDS = 3
54
+
55
+
56
+ def check_divergence(findings_history):
57
+ """Return True if the last 3 entries in findings_history are strictly increasing."""
58
+ if len(findings_history) < 3:
59
+ return False
60
+ last_three = findings_history[-3:]
61
+ return last_three[0] < last_three[1] < last_three[2]
62
+
63
+
64
+ def record_findings_count(findings_history, current_round, findings_count):
65
+ """Record findings_count once per round index, updating duplicate calls for the same round."""
66
+ if current_round <= 0:
67
+ return findings_history
68
+
69
+ target_index = current_round - 1
70
+ while len(findings_history) < target_index:
71
+ findings_history.append(0)
72
+
73
+ if len(findings_history) == target_index:
74
+ findings_history.append(findings_count)
75
+ else:
76
+ findings_history[target_index] = findings_count
77
+
78
+ return findings_history
79
+
80
+
81
+ def check_exit_condition(data):
82
+ """Determine whether the loop should exit. Pure function — no side effects.
83
+
84
+ Round is model-supplied — the script does not auto-increment it because
85
+ the gate is called twice per loop iteration (after Step 2 and Step 3).
86
+ """
87
+ reviewer_result = data.get("reviewer_result")
88
+ accepted_count = data.get("accepted_count", 0)
89
+ findings_count = data.get("findings_count", 0)
90
+ current_round = data.get("round", 0)
91
+ findings_history = list(data.get("findings_history", []))
92
+ max_rounds = data.get("max_rounds", DEFAULT_MAX_ROUNDS)
93
+ filtering_done = data.get("filtering_done", reviewer_result == "PASS")
94
+
95
+ findings_history = record_findings_count(
96
+ findings_history, current_round, findings_count
97
+ )
98
+ divergence_warning = check_divergence(findings_history)
99
+
100
+ # Condition 1: Reviewer returned PASS
101
+ if reviewer_result == "PASS":
102
+ return {
103
+ "endLoop": True,
104
+ "reason": f"Round {current_round}: Reviewer returned PASS",
105
+ "verdict": "PASS",
106
+ "round": current_round,
107
+ "maxRounds": max_rounds,
108
+ "divergenceWarning": False,
109
+ "findings_history": findings_history,
110
+ }
111
+
112
+ # Condition 2: Reviewer returned findings, but filtering has not happened yet
113
+ if reviewer_result == "NEEDS_FIXES" and not filtering_done:
114
+ return {
115
+ "endLoop": False,
116
+ "reason": f"Round {current_round}: reviewer returned findings; filter before applying exit conditions",
117
+ "verdict": None,
118
+ "round": current_round,
119
+ "maxRounds": max_rounds,
120
+ "divergenceWarning": divergence_warning,
121
+ "findings_history": findings_history,
122
+ }
123
+
124
+ # Condition 3: All findings rejected after filtering
125
+ if reviewer_result == "NEEDS_FIXES" and accepted_count == 0:
126
+ return {
127
+ "endLoop": True,
128
+ "reason": f"Round {current_round}: all findings rejected by main agent",
129
+ "verdict": "PASS",
130
+ "round": current_round,
131
+ "maxRounds": max_rounds,
132
+ "divergenceWarning": False,
133
+ "findings_history": findings_history,
134
+ }
135
+
136
+ # Condition 4: Max rounds reached
137
+ if current_round >= max_rounds:
138
+ return {
139
+ "endLoop": True,
140
+ "reason": f"Hard limit: max {max_rounds} rounds reached",
141
+ "verdict": "NEEDS_FIXES",
142
+ "round": current_round,
143
+ "maxRounds": max_rounds,
144
+ "divergenceWarning": divergence_warning,
145
+ "findings_history": findings_history,
146
+ }
147
+
148
+ # Condition 5: Continue loop
149
+ next_round = current_round + 1
150
+ return {
151
+ "endLoop": False,
152
+ "reason": f"Round {current_round}: {accepted_count} findings accepted, continuing to round {next_round}",
153
+ "verdict": None,
154
+ "round": current_round,
155
+ "maxRounds": max_rounds,
156
+ "divergenceWarning": divergence_warning,
157
+ "findings_history": findings_history,
158
+ }
159
+
160
+
161
+ def main():
162
+ # Read input from stdin
163
+ try:
164
+ data = json.load(sys.stdin)
165
+ except json.JSONDecodeError as e:
166
+ print(
167
+ json.dumps(
168
+ {
169
+ "endLoop": False,
170
+ "reason": f"Invalid JSON input: {e}",
171
+ "verdict": None,
172
+ "round": 0,
173
+ "maxRounds": DEFAULT_MAX_ROUNDS,
174
+ "divergenceWarning": False,
175
+ "findings_history": [],
176
+ }
177
+ )
178
+ )
179
+ sys.exit(1)
180
+
181
+ result = check_exit_condition(data)
182
+ print(json.dumps(result))
183
+
184
+
185
+ if __name__ == "__main__":
186
+ main()
@@ -10,6 +10,12 @@ description: "Pure git commit workflow with safety checks. Stages files, generat
10
10
  - After `/prizmkit-retrospective` has finished architecture sync
11
11
  - The UserPromptSubmit hook will remind to use this skill when commit intent is detected
12
12
 
13
+ ### When NOT to Use
14
+ - No uncommitted changes exist — nothing to commit
15
+ - .prizmkit/prizm-docs/ not synced — run /prizmkit-retrospective first (full lifecycle only; the `plan → implement → committer` fast path skips this by design)
16
+ - Code review not passed in pipeline mode — run /prizmkit-code-review first
17
+ - Mid-merge conflict resolution — handle manually with git
18
+
13
19
  **PRECONDITION:**
14
20
 
15
21
  | Required State | Check | If Missing |
@@ -18,6 +24,8 @@ description: "Pure git commit workflow with safety checks. Stages files, generat
18
24
  | `.prizmkit/prizm-docs/` synced (feature/refactor) | `/prizmkit-retrospective` has run | Run `/prizmkit-retrospective` first |
19
25
  | Code review passed (pipeline mode) | `review-report.md` in artifact directory has `## Verdict: PASS` | Run `/prizmkit-code-review` first |
20
26
 
27
+ > **Fast-path exemption**: the prizm-docs-synced and review-passed rows above gate the **full lifecycle**. Small, well-scoped changes using the `plan → implement → committer` fast path may commit without them — there is no retrospective or review-report artifact to check, so treat those rows as "satisfied when not applicable."
28
+
21
29
  ### Workflow
22
30
 
23
31
  Follow these steps in order — skipping or reordering can stage sensitive files or commit without proper verification: