prizmkit 1.0.122 → 1.0.124

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.
@@ -84,10 +84,16 @@ def parse_args():
84
84
  )
85
85
  parser.add_argument(
86
86
  "--mode",
87
- choices=["lite", "standard", "full", "self-evolve"],
87
+ choices=["lite", "standard", "full"],
88
88
  default=None,
89
89
  help="Override pipeline mode (default: auto-detect from complexity)",
90
90
  )
91
+ parser.add_argument(
92
+ "--critic",
93
+ choices=["true", "false"],
94
+ default=None,
95
+ help="Override critic enablement (default: read from feature field)",
96
+ )
91
97
  return parser.parse_args()
92
98
 
93
99
 
@@ -279,39 +285,20 @@ def process_conditional_blocks(content, resume_phase):
279
285
  return content
280
286
 
281
287
 
282
- def process_mode_blocks(content, pipeline_mode, init_done):
283
- """Process pipeline mode and init conditional blocks.
288
+ def process_mode_blocks(content, pipeline_mode, init_done, critic_enabled=False):
289
+ """Process pipeline mode, init, and critic conditional blocks.
284
290
 
285
291
  Keeps the block matching the current mode, removes the others.
286
- For self-evolve mode: keeps SELF_EVOLVE blocks AND FULL blocks
287
- (since self-evolve is full + framework guardrails).
292
+ Handles {{IF_CRITIC_ENABLED}} / {{END_IF_CRITIC_ENABLED}} blocks.
288
293
  """
289
- is_self_evolve = pipeline_mode == "self-evolve"
290
-
291
- # Step 1: Handle SELF_EVOLVE conditional blocks first
292
- se_open = "{{IF_MODE_SELF_EVOLVE}}"
293
- se_close = "{{END_IF_MODE_SELF_EVOLVE}}"
294
- if is_self_evolve:
295
- # Keep content, remove tags
296
- content = content.replace(se_open + "\n", "")
297
- content = content.replace(se_open, "")
298
- content = content.replace(se_close + "\n", "")
299
- content = content.replace(se_close, "")
300
- else:
301
- # Remove entire SELF_EVOLVE blocks
302
- pattern = re.escape(se_open) + r".*?" + re.escape(se_close) + r"\n?"
303
- content = re.sub(pattern, "", content, flags=re.DOTALL)
304
-
305
- # Step 2: Handle lite/standard/full blocks
306
- # self-evolve inherits full mode for the standard tier blocks
307
- effective_mode = "full" if is_self_evolve else pipeline_mode
294
+ # Handle lite/standard/full blocks
308
295
  modes = ["lite", "standard", "full"]
309
296
 
310
297
  for mode in modes:
311
298
  tag_open = "{{{{IF_MODE_{}}}}}".format(mode.upper())
312
299
  tag_close = "{{{{END_IF_MODE_{}}}}}".format(mode.upper())
313
300
 
314
- if mode == effective_mode:
301
+ if mode == pipeline_mode:
315
302
  # Keep content, remove tags
316
303
  content = content.replace(tag_open + "\n", "")
317
304
  content = content.replace(tag_open, "")
@@ -338,6 +325,20 @@ def process_mode_blocks(content, pipeline_mode, init_done):
338
325
  "", content, flags=re.DOTALL,
339
326
  )
340
327
 
328
+ # Critic blocks
329
+ critic_open = "{{IF_CRITIC_ENABLED}}"
330
+ critic_close = "{{END_IF_CRITIC_ENABLED}}"
331
+ if critic_enabled:
332
+ # Keep content, remove tags
333
+ content = content.replace(critic_open + "\n", "")
334
+ content = content.replace(critic_open, "")
335
+ content = content.replace(critic_close + "\n", "")
336
+ content = content.replace(critic_close, "")
337
+ else:
338
+ # Remove entire CRITIC blocks
339
+ pattern = re.escape(critic_open) + r".*?" + re.escape(critic_close) + r"\n?"
340
+ content = re.sub(pattern, "", content, flags=re.DOTALL)
341
+
341
342
  return content
342
343
 
343
344
 
@@ -430,6 +431,9 @@ def build_replacements(args, feature, features, global_context, script_dir):
430
431
  reviewer_subagent = os.path.join(
431
432
  agents_dir, "prizm-dev-team-reviewer.md",
432
433
  )
434
+ critic_subagent = os.path.join(
435
+ agents_dir, "prizm-dev-team-critic.md",
436
+ )
433
437
 
434
438
  # Verify agent files actually exist — missing files cause confusing
435
439
  # errors when the AI session tries to read them later.
@@ -472,14 +476,47 @@ def build_replacements(args, feature, features, global_context, script_dir):
472
476
  else:
473
477
  pipeline_mode = determine_pipeline_mode(complexity)
474
478
 
475
- is_self_evolve = pipeline_mode == "self-evolve"
476
-
477
479
  # Auto-detect resume: if all planning artifacts exist and resume_phase
478
480
  # is "null" (fresh start), skip to Phase 6
479
481
  effective_resume = args.resume_phase
480
482
  if effective_resume == "null" and artifacts["all_complete"]:
481
483
  effective_resume = "6"
482
484
 
485
+ # Determine critic enablement (priority: CLI > env > feature field > default)
486
+ critic_env = os.environ.get("ENABLE_CRITIC", "").lower()
487
+ if args.critic is not None:
488
+ critic_enabled = args.critic == "true"
489
+ elif critic_env in ("true", "1"):
490
+ critic_enabled = True
491
+ elif critic_env in ("false", "0"):
492
+ critic_enabled = False
493
+ else:
494
+ critic_enabled = bool(feature.get("critic", False))
495
+
496
+ # Determine critic count (from feature field, default 1)
497
+ # Multi-critic voting (3) must be explicitly set by the user in feature-list.json
498
+ critic_count = feature.get("critic_count", 1)
499
+
500
+ # Guard: if critic enabled but agent file missing, force disable and warn
501
+ if critic_enabled and not os.path.isfile(critic_subagent):
502
+ LOGGER.warning(
503
+ "Critic enabled but agent file not found: %s. "
504
+ "Critic phases will be SKIPPED. "
505
+ "Run `npx prizmkit install` to install agent definitions.",
506
+ critic_subagent,
507
+ )
508
+ critic_enabled = False
509
+
510
+ # Guard: if critic enabled but tier doesn't support it (lite), warn and disable
511
+ if critic_enabled and pipeline_mode == "lite":
512
+ LOGGER.warning(
513
+ "Critic enabled for feature %s but pipeline_mode='lite' (tier1) "
514
+ "does not support critic phases. Critic will be SKIPPED. "
515
+ "Use estimated_complexity='high' or pass --mode standard/full.",
516
+ args.feature_id,
517
+ )
518
+ critic_enabled = False
519
+
483
520
  replacements = {
484
521
  "{{RUN_ID}}": args.run_id,
485
522
  "{{SESSION_ID}}": args.session_id,
@@ -501,6 +538,7 @@ def build_replacements(args, feature, features, global_context, script_dir):
501
538
  "{{TEAM_CONFIG_PATH}}": team_config_path,
502
539
  "{{DEV_SUBAGENT_PATH}}": dev_subagent,
503
540
  "{{REVIEWER_SUBAGENT_PATH}}": reviewer_subagent,
541
+ "{{CRITIC_SUBAGENT_PATH}}": critic_subagent,
504
542
  "{{VALIDATOR_SCRIPTS_DIR}}": validator_scripts_dir,
505
543
  "{{INIT_SCRIPT_PATH}}": init_script_path,
506
544
  "{{SESSION_STATUS_PATH}}": session_status_abs,
@@ -508,11 +546,12 @@ def build_replacements(args, feature, features, global_context, script_dir):
508
546
  "{{FEATURE_SLUG}}": feature_slug,
509
547
  "{{PIPELINE_MODE}}": pipeline_mode,
510
548
  "{{COMPLEXITY}}": complexity,
549
+ "{{CRITIC_ENABLED}}": "true" if critic_enabled else "false",
550
+ "{{CRITIC_COUNT}}": str(critic_count),
511
551
  "{{INIT_DONE}}": "true" if init_done else "false",
512
552
  "{{HAS_SPEC}}": "true" if artifacts["has_spec"] else "false",
513
553
  "{{HAS_PLAN}}": "true" if artifacts["has_plan"] else "false",
514
554
  "{{ARTIFACTS_COMPLETE}}": "true" if artifacts["all_complete"] else "false",
515
- "{{IS_SELF_EVOLVE}}": "true" if is_self_evolve else "false",
516
555
  }
517
556
 
518
557
  return replacements, effective_resume
@@ -523,10 +562,11 @@ def render_template(template_content, replacements, resume_phase):
523
562
  # Step 1: Process fresh_start/resume conditional blocks
524
563
  content = process_conditional_blocks(template_content, resume_phase)
525
564
 
526
- # Step 2: Process mode and init conditional blocks
565
+ # Step 2: Process mode, init, and critic conditional blocks
527
566
  pipeline_mode = replacements.get("{{PIPELINE_MODE}}", "standard")
528
567
  init_done = replacements.get("{{INIT_DONE}}", "false") == "true"
529
- content = process_mode_blocks(content, pipeline_mode, init_done)
568
+ critic_enabled = replacements.get("{{CRITIC_ENABLED}}", "false") == "true"
569
+ content = process_mode_blocks(content, pipeline_mode, init_done, critic_enabled)
530
570
 
531
571
  # Step 3: Replace all {{PLACEHOLDER}} variables
532
572
  for placeholder, value in replacements.items():
@@ -584,7 +624,6 @@ def main():
584
624
  "lite": "bootstrap-tier1.md",
585
625
  "standard": "bootstrap-tier2.md",
586
626
  "full": "bootstrap-tier3.md",
587
- "self-evolve": "bootstrap-tier3.md",
588
627
  }
589
628
  _tier_file = _tier_file_map.get(_mode, "bootstrap-tier2.md")
590
629
  _tier_path = os.path.join(script_dir, "..", "templates", _tier_file)
@@ -88,8 +88,13 @@ ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXI
88
88
 
89
89
  If MISSING — build it now:
90
90
  1. Read `.prizm-docs/root.prizm` and relevant L1 prizm docs
91
- 2. Scan `src/` for files related to this feature; read each one
92
- 3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
91
+ 2. Detect source code directories: read KEY_FILES and STRUCTURE sections from `root.prizm` to identify where source code lives (e.g. `src/`, `app/`, `lib/`, `cmd/`, `packages/`, or project root). If `root.prizm` is missing, scan the project tree:
92
+ ```bash
93
+ find . -maxdepth 2 -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.java" -o -name "*.rb" -o -name "*.rs" \) -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/vendor/*' | head -30
94
+ ```
95
+ Identify the top-level source directories from the results.
96
+ 3. Scan the detected source directories for files related to this feature; read each one
97
+ 4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
93
98
  - **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
94
99
  - **Section 2 — Project Structure**: run the following to get a visual directory tree, then paste output:
95
100
  ```bash
@@ -108,6 +113,12 @@ ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
108
113
  If plan.md missing, write it directly:
109
114
  - `plan.md`: key components, data flow, files to create/modify, and a Tasks section with `[ ]` checkboxes (each task = one implementable unit). Keep under 80 lines.
110
115
 
116
+ **Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
117
+ Before proceeding past CP-1:
118
+ 1. Scan for existing schema files (`*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*`) and read them
119
+ 2. Ensure new tables/fields follow existing naming conventions and constraint patterns
120
+ 3. Resolve all uncertain DB design decisions before writing Tasks — document choices in plan.md
121
+
111
122
  **CP-1**: plan.md exists with Tasks section.
112
123
 
113
124
  ### Phase 3: Implement + Test
@@ -38,9 +38,9 @@ You are running in headless mode with a FINITE context window. Exceeding it will
38
38
  1. **context-snapshot.md is your single source of truth** — After Phase 1 builds it, ALWAYS read context-snapshot.md instead of re-reading individual source files
39
39
  2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
40
40
  3. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
41
- 4. **One task at a time** — In Phase 3 (implement), complete and test one task before starting the next.
41
+ 4. **One task at a time** — In Phase 4 (implement), complete and test one task before starting the next.
42
42
  5. **Minimize tool output** — When running commands, use `| head -20` or `| tail -20` to limit output. Never dump entire test suites or logs.
43
- 6. **No intermediate commits** — Do NOT run `git add`/`git commit` during Phase 1-4. All changes are committed once at the end in Phase 5 via `/prizmkit-committer`.
43
+ 6. **No intermediate commits** — Do NOT run `git add`/`git commit` during Phase 1-5. All changes are committed once at the end in Phase 6 via `/prizmkit-committer`.
44
44
  7. **Capture test output once** — When running the test suite, always use `$TEST_CMD 2>&1 | tee /tmp/test-out.txt | tail -20`. Then grep `/tmp/test-out.txt` for details. Never re-run the suite just to apply a different filter.
45
45
 
46
46
  ---
@@ -90,7 +90,7 @@ cat .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md 2>/dev/null || echo "NO_PREV
90
90
  ```
91
91
  If failure-log.md exists:
92
92
  - Read ROOT_CAUSE and SUGGESTION — adjust your approach accordingly
93
- - Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 5 retrospective
93
+ - Read DISCOVERED_TRAPS — if any are genuine, inject into .prizm-docs/ during Phase 6 retrospective
94
94
  - Do NOT delete failure-log.md until this session completes all phases and commits successfully
95
95
 
96
96
  ```bash
@@ -99,8 +99,13 @@ ls .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md 2>/dev/null && echo "EXI
99
99
 
100
100
  If MISSING — build it now:
101
101
  1. Read `.prizm-docs/root.prizm` and relevant L1/L2 prizm docs
102
- 2. Scan `src/` for files related to this feature; read each one
103
- 3. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
102
+ 2. Detect source code directories: read KEY_FILES and STRUCTURE sections from `root.prizm` to identify where source code lives (e.g. `src/`, `app/`, `lib/`, `cmd/`, `packages/`, or project root). If `root.prizm` is missing, scan the project tree:
103
+ ```bash
104
+ find . -maxdepth 2 -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.java" -o -name "*.rb" -o -name "*.rs" \) -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/vendor/*' | head -30
105
+ ```
106
+ Identify the top-level source directories from the results.
107
+ 3. Scan the detected source directories for files related to this feature; read each one
108
+ 4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
104
109
  - **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
105
110
  - **Section 2 — Project Structure**: run the following to get a visual directory tree, then paste output:
106
111
  ```bash
@@ -111,12 +116,12 @@ If MISSING — build it now:
111
116
  ### Files to Modify
112
117
  | File | Why Needed | Key Interfaces |
113
118
  |------|-----------|----------------|
114
- | `src/config.js` | Add runtime config layer | `config` (Zod object), `configSchema` |
119
+ | `<source-dir>/config.js` | Add runtime config layer | `config` (Zod object), `configSchema` |
115
120
 
116
121
  ### Files for Reference
117
122
  | File | Why Needed | Key Interfaces |
118
123
  |------|-----------|----------------|
119
- | `src/security/permission-guard.js` | Permission check integration | `checkCommandPermission(userId, cmd)` |
124
+ | `<source-dir>/security/permission-guard.js` | Permission check integration | `checkCommandPermission(userId, cmd)` |
120
125
 
121
126
  ### Known TRAPS (from .prizm-docs/)
122
127
  - <trap entries extracted from L1/L2 docs>
@@ -139,7 +144,50 @@ Before proceeding past CP-1, verify:
139
144
 
140
145
  **CP-1**: plan.md exists with Tasks section.
141
146
 
142
- ### Phase 3: ImplementDev Subagent
147
+ ### Phase 3: AnalyzeReviewer Subagent
148
+
149
+ Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
150
+
151
+ Prompt:
152
+ > "Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
153
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
154
+ > 2. Run prizmkit-analyze: cross-check `plan.md` (including Tasks section) against feature description and acceptance criteria for consistency.
155
+ > 3. Before flagging CRITICAL or HIGH issues, read the relevant source files listed in the File Manifest to verify.
156
+ > Report: CRITICAL, HIGH, MEDIUM issues found (or 'No issues found')."
157
+
158
+ Wait for Reviewer to return.
159
+ - If CRITICAL issues found: fix them yourself — read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full project context. Fix ONLY the listed CRITICAL issues in plan.md. Then re-run analyze (max 1 round).
160
+
161
+ **CP-2**: No CRITICAL issues.
162
+
163
+ {{IF_CRITIC_ENABLED}}
164
+ ### Phase 3.5: Plan Challenge — Critic Agent
165
+
166
+ **Guard**: Verify critic agent file exists before spawning:
167
+ ```bash
168
+ ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
169
+ ```
170
+ If CRITIC:MISSING — skip Phase 3.5 entirely and proceed to Phase 4. Log: "Critic agent not installed — skipping Plan Challenge."
171
+
172
+ Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
173
+
174
+ Prompt:
175
+ > "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
176
+ > **MODE: Plan Challenge**
177
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has project context, Section 4 has file manifest.
178
+ > 2. Read `.prizm-docs/root.prizm` and relevant L1/L2 docs for affected modules.
179
+ > 3. Read existing source files in the modules this plan touches.
180
+ > 4. Challenge plan.md against the project's existing architecture, patterns, and style.
181
+ > Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` with findings (or 'No significant challenges')."
182
+
183
+ Wait for Critic to return.
184
+ - Read challenge-report.md. For items marked CRITICAL/HIGH: decide whether to adjust plan.md or document why the plan stands.
185
+ - Max 1 plan revision round.
186
+
187
+ **CP-2.5**: Plan challenges reviewed and resolved.
188
+ {{END_IF_CRITIC_ENABLED}}
189
+
190
+ ### Phase 4: Implement — Dev Subagent
143
191
 
144
192
  **Build artifacts rule** (passed to Dev): After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary or build directory is in `.gitignore`. Never commit compiled binaries, build output, or generated artifacts.
145
193
 
@@ -171,7 +219,34 @@ grep -q "## Implementation Log" .prizmkit/specs/{{FEATURE_SLUG}}/context-snapsho
171
219
  ```
172
220
  If GATE:MISSING — send message to Dev (re-spawn if needed): "Write the '## Implementation Log' section to context-snapshot.md before I can proceed to review. Include: files changed/created, key decisions, deviations from plan, notable discoveries."
173
221
 
174
- ### Phase 4: Review + Test — Reviewer Subagent
222
+ {{IF_CRITIC_ENABLED}}
223
+ ### Phase 4.5: Code Challenge — Critic Agent
224
+
225
+ **Guard**: Verify critic agent file exists before spawning:
226
+ ```bash
227
+ ls {{CRITIC_SUBAGENT_PATH}} 2>/dev/null && echo "CRITIC:READY" || echo "CRITIC:MISSING"
228
+ ```
229
+ If CRITIC:MISSING — skip Phase 4.5 entirely and proceed to Phase 5. Log: "Critic agent not installed — skipping Code Challenge."
230
+
231
+ Spawn Critic agent (Agent tool, subagent_type="prizm-dev-team-critic", run_in_background=false).
232
+
233
+ Prompt:
234
+ > "Read {{CRITIC_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
235
+ > **MODE: Code Challenge**
236
+ > 1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Implementation Log section shows what Dev changed.
237
+ > 2. Read `.prizm-docs/root.prizm` and relevant module docs for RULES/PATTERNS.
238
+ > 3. Read the actual source files changed (from Implementation Log).
239
+ > 4. Read comparable existing source files in the same module for style comparison.
240
+ > 5. Challenge code integration quality: style fit, robustness, existing code cohesion, hidden impact.
241
+ > Write `.prizmkit/specs/{{FEATURE_SLUG}}/challenge-report.md` (overwrite) with findings (or 'No significant challenges')."
242
+
243
+ Wait for Critic to return.
244
+ - Read challenge-report.md. For items marked CRITICAL/HIGH: spawn Dev to fix, then proceed to Review.
245
+
246
+ **CP-3.5**: Code challenges reviewed and resolved.
247
+ {{END_IF_CRITIC_ENABLED}}
248
+
249
+ ### Phase 5: Review + Test — Reviewer Subagent
175
250
 
176
251
  Spawn Reviewer subagent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false).
177
252
 
@@ -198,29 +273,29 @@ If GATE:MISSING — send message to Reviewer (re-spawn if needed): "Write the '#
198
273
 
199
274
  - If NEEDS_FIXES: spawn Dev to fix (Dev reads Fix Instructions in snapshot), re-run Review (max 3 rounds)
200
275
 
201
- **CP-2**: Tests pass, verdict is not NEEDS_FIXES.
276
+ **CP-3**: Tests pass, verdict is not NEEDS_FIXES.
202
277
 
203
- ### Phase 5: Architecture Sync & Commit (SINGLE COMMIT)
278
+ ### Phase 6: Architecture Sync & Commit (SINGLE COMMIT)
204
279
 
205
- **5a.** Run `/prizmkit-retrospective` — maintains `.prizm-docs/` (architecture index):
280
+ **6a.** Run `/prizmkit-retrospective` — maintains `.prizm-docs/` (architecture index):
206
281
  1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizm-docs/` files
207
282
  2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizm-docs/`
208
283
  3. Stage doc changes: `git add .prizm-docs/`
209
284
  ⚠️ Do NOT commit here. Only stage.
210
285
 
211
- **5b.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
286
+ **6b.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
212
287
  ```bash
213
288
  git add <specific-files-created-or-modified>
214
289
  git add .prizm-docs/
215
290
  ```
216
291
 
217
- **5c.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
292
+ **6c.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
218
293
  `feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
219
294
  This single commit includes: feature code + tests + .prizm-docs/ updates. Do NOT push.
220
295
  - MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
221
296
  - Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
222
297
 
223
- **5d.** Final verification:
298
+ **6d.** Final verification:
224
299
  ```bash
225
300
  git status --short
226
301
  ```
@@ -234,6 +309,9 @@ Working tree MUST be clean after this step. If any feature-related files remain,
234
309
  | Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
235
310
  | Dev Agent Def | {{DEV_SUBAGENT_PATH}} |
236
311
  | Reviewer Agent Def | {{REVIEWER_SUBAGENT_PATH}} |
312
+ {{IF_CRITIC_ENABLED}}
313
+ | Critic Agent Def | {{CRITIC_SUBAGENT_PATH}} |
314
+ {{END_IF_CRITIC_ENABLED}}
237
315
  | Project Root | {{PROJECT_ROOT}} |
238
316
 
239
317
  ## Failure Capture Protocol
@@ -260,13 +338,13 @@ rm -f .prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md
260
338
 
261
339
  ## Reminders
262
340
 
263
- - Tier 2: orchestrator builds context+plan, Dev implements, Reviewer reviews+tests — use direct Agent spawn for agents
341
+ - Tier 2: orchestrator builds context+plan, Analyzer checks consistency, Dev implements, Reviewer reviews+tests — use direct Agent spawn for agents
264
342
  - Build context-snapshot.md FIRST; all subagents read it instead of re-reading source files
265
343
  - context-snapshot.md is append-only: orchestrator writes Sections 1-4, Dev appends Implementation Log, Reviewer appends Review Notes
266
344
  - Gate checks enforce Implementation Log and Review Notes are written before proceeding
267
345
  - Do NOT use `run_in_background=true` when spawning subagents
268
346
  - `/prizmkit-committer` is mandatory, and must not be replaced with manual git commit commands
269
- - Do NOT run `git add`/`git commit` during Phase 1-4 — all changes are committed once in Phase 5
347
+ - Do NOT run `git add`/`git commit` during Phase 1-5 — all changes are committed once in Phase 6
270
348
  - If any files remain after the commit, amend the existing commit — do NOT create a follow-up commit
271
349
  - When staging files, always use explicit file names — NEVER use `git add -A` or `git add .`
272
350
  - On timeout: check snapshot + git diff HEAD → model:lite → remaining steps only → max 2 retries per phase → orchestrator fallback