@sienklogic/plan-build-run 2.0.0 → 2.0.1

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 (225) hide show
  1. package/CHANGELOG.md +56 -56
  2. package/CLAUDE.md +149 -149
  3. package/LICENSE +21 -21
  4. package/README.md +247 -247
  5. package/dashboard/bin/cli.js +25 -25
  6. package/dashboard/package.json +34 -34
  7. package/dashboard/public/css/layout.css +406 -406
  8. package/dashboard/public/css/status-colors.css +98 -98
  9. package/dashboard/public/js/htmx-title.js +5 -5
  10. package/dashboard/public/js/sidebar-toggle.js +20 -20
  11. package/dashboard/src/app.js +78 -78
  12. package/dashboard/src/middleware/errorHandler.js +52 -52
  13. package/dashboard/src/middleware/notFoundHandler.js +9 -9
  14. package/dashboard/src/repositories/planning.repository.js +128 -128
  15. package/dashboard/src/routes/events.routes.js +40 -40
  16. package/dashboard/src/routes/index.routes.js +31 -31
  17. package/dashboard/src/routes/pages.routes.js +245 -195
  18. package/dashboard/src/server.js +42 -42
  19. package/dashboard/src/services/dashboard.service.js +222 -222
  20. package/dashboard/src/services/phase.service.js +220 -167
  21. package/dashboard/src/services/project.service.js +57 -57
  22. package/dashboard/src/services/roadmap.service.js +171 -171
  23. package/dashboard/src/services/sse.service.js +58 -58
  24. package/dashboard/src/services/todo.service.js +254 -254
  25. package/dashboard/src/services/watcher.service.js +48 -48
  26. package/dashboard/src/views/coming-soon.ejs +11 -11
  27. package/dashboard/src/views/error.ejs +13 -13
  28. package/dashboard/src/views/index.ejs +5 -5
  29. package/dashboard/src/views/layout.ejs +1 -1
  30. package/dashboard/src/views/partials/dashboard-content.ejs +77 -77
  31. package/dashboard/src/views/partials/footer.ejs +3 -3
  32. package/dashboard/src/views/partials/head.ejs +21 -21
  33. package/dashboard/src/views/partials/header.ejs +12 -12
  34. package/dashboard/src/views/partials/layout-bottom.ejs +15 -15
  35. package/dashboard/src/views/partials/layout-top.ejs +8 -8
  36. package/dashboard/src/views/partials/phase-content.ejs +188 -181
  37. package/dashboard/src/views/partials/phase-doc-content.ejs +38 -0
  38. package/dashboard/src/views/partials/phases-content.ejs +117 -117
  39. package/dashboard/src/views/partials/roadmap-content.ejs +142 -142
  40. package/dashboard/src/views/partials/sidebar.ejs +38 -38
  41. package/dashboard/src/views/partials/todo-create-content.ejs +53 -53
  42. package/dashboard/src/views/partials/todo-detail-content.ejs +38 -38
  43. package/dashboard/src/views/partials/todos-content.ejs +53 -53
  44. package/dashboard/src/views/phase-detail.ejs +5 -5
  45. package/dashboard/src/views/phase-doc.ejs +5 -0
  46. package/dashboard/src/views/phases.ejs +5 -5
  47. package/dashboard/src/views/roadmap.ejs +5 -5
  48. package/dashboard/src/views/todo-create.ejs +5 -5
  49. package/dashboard/src/views/todo-detail.ejs +5 -5
  50. package/dashboard/src/views/todos.ejs +5 -5
  51. package/package.json +57 -57
  52. package/plugins/pbr/.claude-plugin/plugin.json +13 -13
  53. package/plugins/pbr/UI-CONSISTENCY-GAPS.md +61 -61
  54. package/plugins/pbr/agents/codebase-mapper.md +279 -271
  55. package/plugins/pbr/agents/debugger.md +281 -281
  56. package/plugins/pbr/agents/executor.md +428 -407
  57. package/plugins/pbr/agents/general.md +164 -164
  58. package/plugins/pbr/agents/integration-checker.md +169 -141
  59. package/plugins/pbr/agents/plan-checker.md +296 -280
  60. package/plugins/pbr/agents/planner.md +358 -358
  61. package/plugins/pbr/agents/researcher.md +363 -363
  62. package/plugins/pbr/agents/synthesizer.md +230 -230
  63. package/plugins/pbr/agents/verifier.md +489 -454
  64. package/plugins/pbr/commands/begin.md +5 -5
  65. package/plugins/pbr/commands/build.md +5 -5
  66. package/plugins/pbr/commands/config.md +5 -5
  67. package/plugins/pbr/commands/continue.md +5 -5
  68. package/plugins/pbr/commands/debug.md +5 -5
  69. package/plugins/pbr/commands/discuss.md +5 -5
  70. package/plugins/pbr/commands/explore.md +5 -5
  71. package/plugins/pbr/commands/health.md +5 -5
  72. package/plugins/pbr/commands/help.md +5 -5
  73. package/plugins/pbr/commands/import.md +5 -5
  74. package/plugins/pbr/commands/milestone.md +5 -5
  75. package/plugins/pbr/commands/note.md +5 -5
  76. package/plugins/pbr/commands/pause.md +5 -5
  77. package/plugins/pbr/commands/plan.md +5 -5
  78. package/plugins/pbr/commands/quick.md +5 -5
  79. package/plugins/pbr/commands/resume.md +5 -5
  80. package/plugins/pbr/commands/review.md +5 -5
  81. package/plugins/pbr/commands/scan.md +5 -5
  82. package/plugins/pbr/commands/setup.md +5 -5
  83. package/plugins/pbr/commands/status.md +5 -5
  84. package/plugins/pbr/commands/todo.md +5 -5
  85. package/plugins/pbr/contexts/dev.md +27 -27
  86. package/plugins/pbr/contexts/research.md +28 -28
  87. package/plugins/pbr/contexts/review.md +36 -36
  88. package/plugins/pbr/hooks/hooks.json +183 -183
  89. package/plugins/pbr/references/agent-anti-patterns.md +24 -24
  90. package/plugins/pbr/references/agent-interactions.md +134 -134
  91. package/plugins/pbr/references/agent-teams.md +54 -54
  92. package/plugins/pbr/references/checkpoints.md +157 -157
  93. package/plugins/pbr/references/common-bug-patterns.md +13 -13
  94. package/plugins/pbr/references/config-reference.md +441 -0
  95. package/plugins/pbr/references/continuation-format.md +212 -212
  96. package/plugins/pbr/references/deviation-rules.md +112 -112
  97. package/plugins/pbr/references/git-integration.md +226 -226
  98. package/plugins/pbr/references/integration-patterns.md +117 -117
  99. package/plugins/pbr/references/model-profiles.md +99 -99
  100. package/plugins/pbr/references/model-selection.md +31 -31
  101. package/plugins/pbr/references/pbr-rules.md +193 -193
  102. package/plugins/pbr/references/plan-authoring.md +181 -181
  103. package/plugins/pbr/references/plan-format.md +287 -283
  104. package/plugins/pbr/references/planning-config.md +213 -213
  105. package/plugins/pbr/references/questioning.md +214 -214
  106. package/plugins/pbr/references/reading-verification.md +127 -127
  107. package/plugins/pbr/references/stub-patterns.md +160 -160
  108. package/plugins/pbr/references/subagent-coordination.md +119 -119
  109. package/plugins/pbr/references/ui-formatting.md +461 -399
  110. package/plugins/pbr/references/verification-patterns.md +198 -198
  111. package/plugins/pbr/references/wave-execution.md +95 -95
  112. package/plugins/pbr/scripts/auto-continue.js +80 -80
  113. package/plugins/pbr/scripts/check-dangerous-commands.js +136 -136
  114. package/plugins/pbr/scripts/check-doc-sprawl.js +102 -102
  115. package/plugins/pbr/scripts/check-phase-boundary.js +196 -196
  116. package/plugins/pbr/scripts/check-plan-format.js +270 -270
  117. package/plugins/pbr/scripts/check-roadmap-sync.js +322 -252
  118. package/plugins/pbr/scripts/check-skill-workflow.js +262 -262
  119. package/plugins/pbr/scripts/check-state-sync.js +476 -476
  120. package/plugins/pbr/scripts/check-subagent-output.js +144 -144
  121. package/plugins/pbr/scripts/config-schema.json +251 -251
  122. package/plugins/pbr/scripts/context-budget-check.js +287 -287
  123. package/plugins/pbr/scripts/event-handler.js +151 -151
  124. package/plugins/pbr/scripts/event-logger.js +92 -92
  125. package/plugins/pbr/scripts/hook-logger.js +80 -76
  126. package/plugins/pbr/scripts/hooks-schema.json +79 -79
  127. package/plugins/pbr/scripts/log-subagent.js +164 -152
  128. package/plugins/pbr/scripts/log-tool-failure.js +88 -88
  129. package/plugins/pbr/scripts/pbr-tools.js +1378 -1301
  130. package/plugins/pbr/scripts/post-write-dispatch.js +66 -66
  131. package/plugins/pbr/scripts/post-write-quality.js +207 -207
  132. package/plugins/pbr/scripts/pre-bash-dispatch.js +86 -56
  133. package/plugins/pbr/scripts/pre-write-dispatch.js +97 -62
  134. package/plugins/pbr/scripts/progress-tracker.js +281 -228
  135. package/plugins/pbr/scripts/run-hook.js +92 -0
  136. package/plugins/pbr/scripts/session-cleanup.js +254 -254
  137. package/plugins/pbr/scripts/status-line.js +288 -285
  138. package/plugins/pbr/scripts/suggest-compact.js +119 -119
  139. package/plugins/pbr/scripts/task-completed.js +45 -45
  140. package/plugins/pbr/scripts/track-context-budget.js +149 -119
  141. package/plugins/pbr/scripts/validate-commit.js +200 -200
  142. package/plugins/pbr/scripts/validate-plugin-structure.js +183 -172
  143. package/plugins/pbr/scripts/validate-task.js +106 -0
  144. package/plugins/pbr/skills/begin/SKILL.md +594 -545
  145. package/plugins/pbr/skills/begin/templates/PROJECT.md.tmpl +33 -33
  146. package/plugins/pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +18 -18
  147. package/plugins/pbr/skills/begin/templates/STATE.md.tmpl +49 -49
  148. package/plugins/pbr/skills/begin/templates/config.json.tmpl +64 -63
  149. package/plugins/pbr/skills/begin/templates/researcher-prompt.md.tmpl +19 -19
  150. package/plugins/pbr/skills/begin/templates/roadmap-prompt.md.tmpl +30 -30
  151. package/plugins/pbr/skills/begin/templates/synthesis-prompt.md.tmpl +16 -16
  152. package/plugins/pbr/skills/build/SKILL.md +943 -962
  153. package/plugins/pbr/skills/config/SKILL.md +256 -241
  154. package/plugins/pbr/skills/continue/SKILL.md +164 -127
  155. package/plugins/pbr/skills/debug/SKILL.md +515 -489
  156. package/plugins/pbr/skills/debug/templates/continuation-prompt.md.tmpl +16 -16
  157. package/plugins/pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +27 -27
  158. package/plugins/pbr/skills/discuss/SKILL.md +347 -338
  159. package/plugins/pbr/skills/discuss/templates/CONTEXT.md.tmpl +61 -61
  160. package/plugins/pbr/skills/discuss/templates/decision-categories.md +9 -9
  161. package/plugins/pbr/skills/explore/SKILL.md +378 -362
  162. package/plugins/pbr/skills/health/SKILL.md +221 -186
  163. package/plugins/pbr/skills/health/templates/check-pattern.md.tmpl +30 -30
  164. package/plugins/pbr/skills/health/templates/output-format.md.tmpl +63 -63
  165. package/plugins/pbr/skills/help/SKILL.md +155 -140
  166. package/plugins/pbr/skills/import/SKILL.md +504 -490
  167. package/plugins/pbr/skills/milestone/SKILL.md +704 -673
  168. package/plugins/pbr/skills/milestone/templates/audit-report.md.tmpl +48 -48
  169. package/plugins/pbr/skills/milestone/templates/stats-file.md.tmpl +30 -30
  170. package/plugins/pbr/skills/note/SKILL.md +231 -212
  171. package/plugins/pbr/skills/pause/SKILL.md +249 -235
  172. package/plugins/pbr/skills/pause/templates/continue-here.md.tmpl +71 -71
  173. package/plugins/pbr/skills/plan/SKILL.md +685 -628
  174. package/plugins/pbr/skills/plan/decimal-phase-calc.md +98 -98
  175. package/plugins/pbr/skills/plan/templates/checker-prompt.md.tmpl +21 -21
  176. package/plugins/pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +32 -32
  177. package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +38 -38
  178. package/plugins/pbr/skills/plan/templates/researcher-prompt.md.tmpl +19 -19
  179. package/plugins/pbr/skills/plan/templates/revision-prompt.md.tmpl +23 -23
  180. package/plugins/pbr/skills/quick/SKILL.md +354 -335
  181. package/plugins/pbr/skills/resume/SKILL.md +402 -388
  182. package/plugins/pbr/skills/review/SKILL.md +686 -652
  183. package/plugins/pbr/skills/review/templates/debugger-prompt.md.tmpl +60 -60
  184. package/plugins/pbr/skills/review/templates/gap-planner-prompt.md.tmpl +40 -40
  185. package/plugins/pbr/skills/review/templates/verifier-prompt.md.tmpl +115 -115
  186. package/plugins/pbr/skills/scan/SKILL.md +304 -269
  187. package/plugins/pbr/skills/scan/templates/mapper-prompt.md.tmpl +201 -201
  188. package/plugins/pbr/skills/setup/SKILL.md +253 -227
  189. package/plugins/pbr/skills/shared/commit-planning-docs.md +35 -35
  190. package/plugins/pbr/skills/shared/config-loading.md +102 -102
  191. package/plugins/pbr/skills/shared/context-budget.md +40 -40
  192. package/plugins/pbr/skills/shared/context-loader-task.md +86 -86
  193. package/plugins/pbr/skills/shared/digest-select.md +79 -79
  194. package/plugins/pbr/skills/shared/domain-probes.md +125 -125
  195. package/plugins/pbr/skills/shared/error-reporting.md +79 -79
  196. package/plugins/pbr/skills/shared/gate-prompts.md +388 -388
  197. package/plugins/pbr/skills/shared/phase-argument-parsing.md +45 -45
  198. package/plugins/pbr/skills/shared/progress-display.md +53 -53
  199. package/plugins/pbr/skills/shared/revision-loop.md +81 -81
  200. package/plugins/pbr/skills/shared/state-loading.md +62 -62
  201. package/plugins/pbr/skills/shared/state-update.md +161 -161
  202. package/plugins/pbr/skills/shared/universal-anti-patterns.md +33 -33
  203. package/plugins/pbr/skills/status/SKILL.md +367 -353
  204. package/plugins/pbr/skills/todo/SKILL.md +198 -181
  205. package/plugins/pbr/templates/CONTEXT.md.tmpl +52 -52
  206. package/plugins/pbr/templates/INTEGRATION-REPORT.md.tmpl +151 -151
  207. package/plugins/pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -97
  208. package/plugins/pbr/templates/ROADMAP.md.tmpl +40 -40
  209. package/plugins/pbr/templates/SUMMARY.md.tmpl +81 -81
  210. package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +116 -116
  211. package/plugins/pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -98
  212. package/plugins/pbr/templates/codebase/CONCERNS.md.tmpl +93 -93
  213. package/plugins/pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -104
  214. package/plugins/pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -78
  215. package/plugins/pbr/templates/codebase/STACK.md.tmpl +78 -78
  216. package/plugins/pbr/templates/codebase/STRUCTURE.md.tmpl +80 -80
  217. package/plugins/pbr/templates/codebase/TESTING.md.tmpl +107 -107
  218. package/plugins/pbr/templates/continue-here.md.tmpl +73 -73
  219. package/plugins/pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -37
  220. package/plugins/pbr/templates/research/ARCHITECTURE.md.tmpl +124 -124
  221. package/plugins/pbr/templates/research/STACK.md.tmpl +71 -71
  222. package/plugins/pbr/templates/research/SUMMARY.md.tmpl +112 -112
  223. package/plugins/pbr/templates/research-outputs/phase-research.md.tmpl +81 -81
  224. package/plugins/pbr/templates/research-outputs/project-research.md.tmpl +99 -99
  225. package/plugins/pbr/templates/research-outputs/synthesis.md.tmpl +36 -36
@@ -1,652 +1,686 @@
1
- ---
2
- name: review
3
- description: "Verify the build matched the plan. Automated checks + walkthrough with you."
4
- allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion
5
- argument-hint: "<phase-number> [--auto-fix] [--teams]"
6
- ---
7
-
8
- # /pbr:review Phase Review and Verification
9
-
10
- You are the orchestrator for `/pbr:review`. This skill verifies that what was built matches what was planned. It runs automated three-layer checks against must-haves, then walks the user through a conversational UAT (user acceptance testing) for each deliverable. Your job is to present findings clearly and help the user decide what's good enough versus what needs fixes.
11
-
12
- ## Context Budget
13
-
14
- Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
15
-
16
- Additionally for this skill:
17
- - **Minimize** reading subagent output — read only VERIFICATION.md frontmatter for summaries
18
-
19
- ## Prerequisites
20
-
21
- - `.planning/config.json` exists
22
- - Phase has been built: SUMMARY.md files exist in `.planning/phases/{NN}-{slug}/`
23
-
24
- ### Event-Driven Auto-Verification
25
-
26
- When `features.goal_verification` is enabled and depth is "standard" or "comprehensive", the `event-handler.js` hook automatically queues verification after executor completion. The hook writes `.planning/.auto-verify` as a signal file. The build skill's orchestrator detects this signal and spawns the verifier agent.
27
-
28
- **This is additive**: `/pbr:review` can always be invoked manually regardless of auto-verification settings. If auto-verification already ran, `/pbr:review` re-runs verification (useful for re-checking after fixes).
29
-
30
- ---
31
-
32
- ## Argument Parsing
33
-
34
- Parse `$ARGUMENTS` according to `skills/shared/phase-argument-parsing.md`.
35
-
36
- | Argument | Meaning |
37
- |----------|---------|
38
- | `3` | Review phase 3 |
39
- | `3 --auto-fix` | Review phase 3, automatically diagnose and create gap-closure plans for failures |
40
- | `3 --teams` | Review phase 3 with parallel specialist verifiers (functional + security + performance) |
41
- | (no number) | Use current phase from STATE.md |
42
-
43
- ---
44
-
45
- ## Orchestration Flow
46
-
47
- Execute these steps in order.
48
-
49
- ---
50
-
51
- ### Step 1: Parse and Validate (inline)
52
-
53
- 1. Parse `$ARGUMENTS` for phase number and `--auto-fix` flag
54
- 2. Read `.planning/config.json`
55
- 3. Resolve depth profile: run `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
56
- 4. Validate:
57
- - Phase directory exists at `.planning/phases/{NN}-{slug}/`
58
- - SUMMARY.md files exist (phase has been built)
59
- - PLAN.md files exist (needed for must-have extraction)
60
- 4. If no phase number given, read current phase from `.planning/STATE.md`
61
- 5. If `.planning/.auto-verify` signal file exists, read it and note the auto-verification was already queued. Delete the signal file after reading (one-shot, same pattern as auto-continue.js).
62
-
63
- **Validation errors — use branded error boxes:**
64
-
65
- If no SUMMARY.md files:
66
- ```
67
- ╔══════════════════════════════════════════════════════════════╗
68
- ║ ERROR ║
69
- ╚══════════════════════════════════════════════════════════════╝
70
-
71
- Phase {N} hasn't been built yet.
72
-
73
- **To fix:** Run `/pbr:build {N}` first.
74
- ```
75
-
76
- If no PLAN.md files:
77
- ```
78
- ╔══════════════════════════════════════════════════════════════╗
79
- ║ ERROR ║
80
- ╚══════════════════════════════════════════════════════════════╝
81
-
82
- Phase {N} has no plans.
83
-
84
- **To fix:** Run `/pbr:plan {N}` first.
85
- ```
86
-
87
- ---
88
-
89
- ### Step 2: Check Existing Verification (inline)
90
-
91
- Reference: `skills/shared/config-loading.md` for the tooling shortcut (`phase-info`) and config field reference.
92
-
93
- Check if a VERIFICATION.md already exists from `/pbr:build`'s auto-verification step:
94
-
95
- 1. Look for `.planning/phases/{NN}-{slug}/VERIFICATION.md`
96
- 2. If it exists:
97
- - Read it and check the status
98
- - If `status: passed` and no `--auto-fix` flag: skip to Step 4 (conversational UAT)
99
- - If `status: gaps_found`: present gaps and proceed to Step 4
100
- - If `status: human_needed`: proceed to Step 4
101
-
102
- 3. If it does NOT exist: proceed to Step 3 (automated verification)
103
-
104
- ---
105
-
106
- ### Step 3: Automated Verification (delegated)
107
-
108
- **Depth profile gate:** Before spawning the verifier, resolve the depth profile. If `features.goal_verification` is false in the profile, skip automated verification and proceed directly to Step 5 (Conversational UAT). Note to user: "Automated verification skipped (depth: {depth}). Proceeding to manual review."
109
-
110
- #### Team Review Mode
111
-
112
- If `--teams` flag is present OR `config.parallelization.use_teams` is true:
113
-
114
- 1. Create team output directory: `.planning/phases/{NN}-{slug}/team/` (if not exists)
115
- 2. Display to the user: `◐ Spawning 3 verifiers in parallel (functional, security, performance)...`
116
-
117
- Spawn THREE verifier agents in parallel using Task():
118
-
119
- **Agent 1 -- Functional Reviewer**:
120
- - subagent_type: "pbr:verifier"
121
- - Prompt includes: "You are the FUNCTIONAL REVIEWER in a review team. Focus on: must-haves met, code correctness, completeness, integration points. Write output to `.planning/phases/{NN}-{slug}/team/functional-VERIFY.md`."
122
-
123
- **Agent 2 -- Security Auditor**:
124
- - subagent_type: "pbr:verifier"
125
- - Prompt includes: "You are the SECURITY AUDITOR in a review team. Focus on: vulnerabilities, auth bypass paths, injection risks, secrets exposure, permission escalation. Write output to `.planning/phases/{NN}-{slug}/team/security-VERIFY.md`."
126
-
127
- **Agent 3 -- Performance Analyst**:
128
- - subagent_type: "pbr:verifier"
129
- - Prompt includes: "You are the PERFORMANCE ANALYST in a review team. Focus on: N+1 queries, memory leaks, unnecessary allocations, bundle size impact, blocking operations. Write output to `.planning/phases/{NN}-{slug}/team/performance-VERIFY.md`."
130
-
131
- 3. Wait for all three to complete
132
- 4. Display to the user: `◐ Spawning synthesizer...`
133
-
134
- Spawn synthesizer:
135
- - subagent_type: "pbr:synthesizer"
136
- - Prompt: "Read all *-VERIFY.md files in `.planning/phases/{NN}-{slug}/team/`. Synthesize into a unified VERIFICATION.md. Merge pass/fail verdicts -- a must-have fails if ANY reviewer flags it. Combine gap lists. Security and performance findings go into dedicated sections."
137
- 5. Proceed to UAT walkthrough with the unified VERIFICATION.md
138
-
139
- If teams not enabled, proceed with existing single-verifier flow.
140
-
141
- Reference: `references/agent-teams.md`
142
-
143
- #### Single-Verifier Flow (default)
144
-
145
- Display to the user: `◐ Spawning verifier...`
146
-
147
- Spawn a verifier Task() to run three-layer checks:
148
-
149
- ```
150
- Task({
151
- subagent_type: "pbr:verifier",
152
- prompt: <verifier prompt>
153
- })
154
- ```
155
-
156
- #### Verifier Prompt Template
157
-
158
- Read `skills/review/templates/verifier-prompt.md.tmpl` and use its content as the verifier prompt.
159
-
160
- **Placeholders to fill before sending:**
161
- - `{For each PLAN.md file in the phase directory:}` — inline each plan's must_haves frontmatter block
162
- - `{For each SUMMARY.md file in the phase directory:}` — provide manifest table with file paths and status from frontmatter. The verifier reads full content from disk via Read tool.
163
- - `{NN}-{slug}` — the phase directory name
164
- - `{N}` — the phase number
165
- - `{date}`, `{count}`, `{phase name}` — fill from context
166
-
167
- Wait for the verifier to complete.
168
-
169
- ---
170
-
171
- ### Step 4: Present Verification Results (inline)
172
-
173
- Read the VERIFICATION.md frontmatter. Check the `attempt` counter.
174
-
175
- **If `attempt >= 3` AND `status: gaps_found`:** This phase has failed verification multiple times. Present escalation options instead of the normal flow:
176
-
177
- Present the escalation context:
178
- ```
179
- Phase {N}: {name} — Verification Failed ({attempt} attempts)
180
- The same gaps have persisted across {attempt} verification attempts.
181
- Remaining gaps: {count}
182
- ```
183
-
184
- Use AskUserQuestion (pattern: multi-option-escalation from `skills/shared/gate-prompts.md`):
185
- question: "Phase {N} has failed verification {attempt} times with {count} persistent gaps. How should we proceed?"
186
- header: "Escalate"
187
- options:
188
- - label: "Accept gaps" description: "Mark as complete-with-gaps and move on"
189
- - label: "Re-plan" description: "Go back to /pbr:plan {N} with gap context"
190
- - label: "Debug" description: "Spawn /pbr:debug to investigate root causes"
191
- - label: "Retry" description: "Try one more verification cycle"
192
-
193
- - **If user selects "Accept gaps":** Follow up with a second AskUserQuestion:
194
- question: "Accept all gaps or pick specific ones to override?"
195
- header: "Override?"
196
- options:
197
- - label: "Accept all" description: "Mark phase as complete-with-gaps, accept everything"
198
- - label: "Pick specific" description: "Choose which gaps to mark as false positives"
199
- - If "Accept all": Update STATE.md status to `complete-with-gaps`, update ROADMAP.md to `verified*`, add a note in VERIFICATION.md about accepted gaps. Proceed to next phase.
200
- - If "Pick specific": Use the override flow from Step 6 "Gaps Found" section (present each gap for selection).
201
- - **If user selects "Re-plan":** Suggest `/pbr:plan {N} --gaps` to create targeted fix plans.
202
- - **If user selects "Debug":** Suggest `/pbr:debug` with the gap details as starting context.
203
- - **If user selects "Retry":** Continue with normal Step 5 flow.
204
-
205
- **Otherwise**, present results normally:
206
-
207
- ```
208
- Phase {N}: {name} Verification Results
209
-
210
- Status: {PASSED | GAPS FOUND | HUMAN NEEDED}
211
- Attempt: {attempt}
212
-
213
- Must-have truths: {passed}/{total}
214
- Must-have artifacts: {passed}/{total}
215
- Must-have key links: {passed}/{total}
216
-
217
- {If all passed:}
218
- All automated checks passed.
219
-
220
- {If gaps found:}
221
- Gaps found:
222
- 1. {gap description} {failed layer}
223
- 2. {gap description} {failed layer}
224
-
225
- {If human needed:}
226
- Items requiring your verification:
227
- 1. {item} {why automated check couldn't verify}
228
- ```
229
-
230
- ---
231
-
232
- ### Step 5: Conversational UAT (inline)
233
-
234
- Walk the user through each deliverable one by one. This is an interactive conversation, not an automated check.
235
-
236
- **For each plan in the phase:**
237
-
238
- 1. Read the plan's must-haves and SUMMARY.md
239
- 2. Present what was built:
240
-
241
- ```
242
- Plan {plan_id}: {plan name}
243
-
244
- What was built:
245
- {Brief description from SUMMARY.md}
246
-
247
- Key deliverables:
248
- 1. {artifact/truth 1}
249
- 2. {artifact/truth 2}
250
- 3. {artifact/truth 3}
251
- ```
252
-
253
- 3. For each must-have truth, walk the user through verification:
254
-
255
- ```
256
- Checking: "{truth statement}"
257
-
258
- How to verify:
259
- {Specific steps the user can take to check this}
260
- {e.g., "Open http://localhost:3000 and click Login"}
261
- {e.g., "Run `npm test` and check that auth tests pass"}
262
-
263
- Does this work as expected? [pass / fail / skip]
264
- ```
265
-
266
- 4. Record the user's assessment for each item
267
-
268
- **Keep the conversation flowing:**
269
- - If user says "pass": move to the next item
270
- - If user says "fail": ask what's wrong, record the issue
271
- - If user says "skip": note it and move on
272
- - If user has questions: answer them using the SUMMARY.md and plan context
273
-
274
- ---
275
-
276
- ### Step 6: Handle Results (inline)
277
-
278
- Compile the UAT results and determine next steps.
279
-
280
- #### All Items Pass
281
-
282
- If all automated checks and UAT items passed:
283
-
284
- 1. **Update `.planning/ROADMAP.md` Progress table** (REQUIRED — do this BEFORE updating STATE.md):
285
-
286
- **Tooling shortcut**: Use the CLI for atomic ROADMAP.md and STATE.md updates:
287
- ```bash
288
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js roadmap update-status {phase} verified
289
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update status verified
290
- node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update last_activity now
291
- ```
292
-
293
- 1. Open `.planning/ROADMAP.md`
294
- 2. Find the `## Progress` table
295
- 3. Locate the row matching this phase number
296
- 4. Update the `Status` column to `verified`
297
- 5. Update the `Completed` column to the current date (YYYY-MM-DD)
298
- 6. Save the file — do NOT skip this step
299
- 2. Update `.planning/STATE.md`:
300
- - Phase status: "verified"
301
- - Progress updated
302
- - Last activity timestamp
303
- - **STATE.md size limit:** Follow size limit enforcement rules in `skills/shared/state-update.md` (150 lines max).
304
- 3. Update VERIFICATION.md with UAT results (append UAT section)
305
- 3. Present completion:
306
-
307
- Use the branded output from `references/ui-formatting.md`:
308
- - If more phases remain: use the "Phase Complete" banner template
309
- - If this was the last phase: use the "Milestone Complete" banner template
310
- - Always include the "Next Up" routing block
311
-
312
- 4. If `gates.confirm_transition` is true in config AND `features.auto_advance` is NOT true:
313
- - Use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
314
- question: "Phase {N} verified. Ready to move to Phase {N+1}?"
315
- header: "Continue?"
316
- options:
317
- - label: "Yes" description: "Proceed to plan Phase {N+1}"
318
- - label: "No" description: "Stay on Phase {N} for now"
319
- - If "Yes": suggest `/pbr:plan {N+1}`
320
- - If "No" or "Other": stop
321
-
322
- 5. **If `features.auto_advance` is `true` AND `mode` is `autonomous` AND more phases remain:**
323
- - Chain directly to plan: `Skill({ skill: "dev:plan", args: "{N+1}" })`
324
- - This continues the build→review→plan cycle automatically
325
- - **If this is the last phase:** HARD STOP — do NOT auto-advance past milestone boundaries
326
-
327
- #### Gaps Found WITH `--auto-fix`
328
-
329
- If gaps were found and `--auto-fix` was specified:
330
-
331
- **Step 6a: Diagnose**
332
-
333
- Display to the user: `◐ Spawning debugger...`
334
-
335
- Spawn a debugger Task() to analyze each failure:
336
-
337
- ```
338
- Task({
339
- subagent_type: "pbr:debugger",
340
- prompt: <debugger prompt>
341
- })
342
- ```
343
-
344
- ##### Debugger Prompt Template
345
-
346
- Read `skills/review/templates/debugger-prompt.md.tmpl` and use its content as the debugger prompt.
347
-
348
- **Placeholders to fill before sending:**
349
- - `[Inline the VERIFICATION.md content]` — provide file path; debugger reads via Read tool
350
- - `[Inline all SUMMARY.md files for the phase]` — provide manifest table of file paths
351
- - `[Inline all PLAN.md files for the phase]` — provide manifest table of file paths
352
-
353
- **Step 6b: Create Gap-Closure Plans**
354
-
355
- After receiving the root cause analysis, display to the user: `◐ Spawning planner (gap closure)...`
356
-
357
- Spawn the planner in gap-closure mode:
358
-
359
- ```
360
- Task({
361
- subagent_type: "pbr:planner",
362
- prompt: <gap planner prompt>
363
- })
364
- ```
365
-
366
- ##### Gap Planner Prompt Template
367
-
368
- Read `skills/review/templates/gap-planner-prompt.md.tmpl` and use its content as the gap planner prompt.
369
-
370
- **Placeholders to fill before sending:**
371
- - `[Inline VERIFICATION.md]` — provide file path; planner reads via Read tool
372
- - `[Inline the debugger's root cause analysis]` — keep inline (already in conversation context)
373
- - `[Inline all existing PLAN.md files for this phase]` — provide manifest table of file paths
374
- - `[Inline CONTEXT.md if it exists]` — provide file path; planner reads via Read tool
375
- - `{NN}-{slug}` — the phase directory name
376
-
377
- **Step 6c: Validate gap-closure plans (conditional)**
378
-
379
- If `features.plan_checking` is true in config:
380
- - Display to the user: `◐ Spawning plan checker...`
381
- - Spawn plan checker Task() on the new gap-closure plans
382
- - Same process as `/pbr:plan` Step 6
383
-
384
- **Step 6d: Present gap-closure plans to user**
385
-
386
- ```
387
- Auto-fix analysis complete.
388
-
389
- Gaps found: {count}
390
- Root causes identified: {count}
391
- Gap-closure plans created: {count}
392
-
393
- Plans:
394
- {plan_id}: {name} — fixes: {gap description} ({difficulty})
395
- {plan_id}: {name} — fixes: {gap description} ({difficulty})
396
-
397
- Use AskUserQuestion (pattern: approve-revise-abort from `skills/shared/gate-prompts.md`):
398
- question: "Approve these {count} gap-closure plans?"
399
- header: "Approve?"
400
- options:
401
- - label: "Approve" description: "Proceed — I'll suggest the build command"
402
- - label: "Review first" description: "Let me review the plans before approving"
403
- - label: "Fix manually" description: "I'll fix these gaps myself"
404
-
405
- - If "Approve": suggest `/pbr:build {N} --gaps-only`
406
- - If "Review first" or "Other": present the full plan files for inspection
407
- - If "Fix manually": suggest relevant files to inspect based on gap details
408
-
409
- #### Gaps Found WITHOUT `--auto-fix`
410
-
411
- If gaps were found and `--auto-fix` was NOT specified:
412
-
413
- 1. List all gaps clearly
414
- 2. **Default to auto-fix** — offer it as the recommended action, not a hidden flag
415
-
416
- ```
417
- Phase {N}: {name} — Gaps Found
418
-
419
- {count} verification gaps need attention:
420
-
421
- 1. {gap description}
422
- Layer failed: {existence | substantiveness | wiring}
423
- Details: {what's wrong}
424
-
425
- 2. {gap description}
426
- ...
427
-
428
- Use AskUserQuestion (pattern: multi-option-gaps from `skills/shared/gate-prompts.md`):
429
- question: "{count} verification gaps need attention. How should we proceed?"
430
- header: "Gaps"
431
- options:
432
- - label: "Auto-fix" description: "Diagnose root causes and create fix plans (recommended)"
433
- - label: "Override" description: "Accept specific gaps as false positives"
434
- - label: "Manual" description: "I'll fix these myself"
435
- - label: "Skip" description: "Save results for later"
436
-
437
- **If user selects "Auto-fix":** proceed with the same Steps 6a-6d as the `--auto-fix` flow above (diagnose, create gap-closure plans, validate, present). This is the default path.
438
-
439
- **If user selects "Override":** present each gap and ask which ones to accept. For each accepted gap, collect a reason. Add to VERIFICATION.md frontmatter `overrides` list:
440
- ```yaml
441
- overrides:
442
- - must_have: "{text}"
443
- reason: "{user's reason}"
444
- accepted_by: "user"
445
- accepted_at: "{ISO date}"
446
- ```
447
- After adding overrides, re-evaluate: if all remaining gaps are now overridden, mark status as `passed`. Otherwise, offer auto-fix for the remaining non-overridden gaps.
448
-
449
- **If user selects "Manual":** suggest relevant files to inspect based on the gap details.
450
-
451
- **If user selects "Skip":** save results and exit.
452
-
453
- ---
454
-
455
- ## UAT Result Recording
456
-
457
- After conversational UAT, append UAT results to VERIFICATION.md:
458
-
459
- ```markdown
460
- ## User Acceptance Testing
461
-
462
- | # | Item | Automated | UAT | Final Status |
463
- |---|------|-----------|-----|-------------|
464
- | 1 | {must-have} | PASS | PASS | VERIFIED |
465
- | 2 | {must-have} | PASS | FAIL | GAP |
466
- | 3 | {must-have} | GAP | | GAP |
467
- | 4 | {must-have} | PASS | SKIP | UNVERIFIED |
468
-
469
- UAT conducted: {date}
470
- Items verified: {count}
471
- Items passed: {count}
472
- Items failed: {count}
473
- Items skipped: {count}
474
- ```
475
-
476
- ---
477
-
478
- ## Integration Verification (optional)
479
-
480
- If `features.integration_verification: true` AND this phase depends on prior phases:
481
-
482
- After Step 3, also check cross-phase integration:
483
- - Read SUMMARY.md `provides` and `requires` from this phase and dependent phases
484
- - Verify that exports from prior phases are used in this phase's code
485
- - Verify that this phase's outputs are compatible with future phase expectations
486
- - Include integration findings in Step 4 presentation
487
-
488
- ---
489
-
490
- ## Error Handling
491
-
492
- ### Verifier agent fails
493
- If the verifier Task() fails, display:
494
- ```
495
- ╔══════════════════════════════════════════════════════════════╗
496
- ║ ERROR ║
497
- ╚══════════════════════════════════════════════════════════════╝
498
-
499
- Automated verification failed.
500
-
501
- **To fix:** We'll do a manual walkthrough instead.
502
- ```
503
- Fall back to manual UAT only (skip automated checks).
504
-
505
- ### No must-haves to check
506
- If plans have empty must_haves:
507
- - Warn user: `⚠ Plans don't have defined must-haves. UAT will be based on plan descriptions only.`
508
- - Use SUMMARY.md content as the basis for UAT
509
-
510
- ### User can't verify something
511
- If user can't verify an item (e.g., needs server running, needs credentials):
512
- - Mark as SKIP
513
- - Record what's needed
514
- - Suggest how to verify later
515
-
516
- ### Debugger fails during auto-fix
517
- If the debugger Task() fails, display:
518
- ```
519
- ╔══════════════════════════════════════════════════════════════╗
520
- ║ ERROR ║
521
- ╚══════════════════════════════════════════════════════════════╝
522
-
523
- Auto-diagnosis failed.
524
-
525
- **To fix:** Create gap-closure plans based on the verification report alone.
526
- ```
527
- Ask user: "Would you like to proceed with gap-closure plans without root cause analysis?"
528
-
529
- ---
530
-
531
- ## Files Created/Modified by /pbr:review
532
-
533
- | File | Purpose | When |
534
- |------|---------|------|
535
- | `.planning/phases/{NN}-{slug}/VERIFICATION.md` | Verification report | Step 3 (created or updated with UAT) |
536
- | `.planning/phases/{NN}-{slug}/*-PLAN.md` | Gap-closure plans | Step 6b (--auto-fix only) |
537
- | `.planning/ROADMAP.md` | Status `verified` + Completed date | Step 6 |
538
- | `.planning/STATE.md` | Updated with review status | Step 6 |
539
-
540
- ---
541
-
542
- ## Completion
543
-
544
- After review completes, always present a clear next action:
545
-
546
- **If verified (not final phase):**
547
-
548
- Display the "Phase Complete" banner inline:
549
- ```
550
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
551
- PLAN-BUILD-RUN PHASE {N} COMPLETE ✓
552
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
553
-
554
- **Phase {N}: {Name}**
555
-
556
- {X} plans executed
557
- Goal verified ✓
558
- ```
559
-
560
- Then the branded "Next Up" block:
561
- ```
562
- ───────────────────────────────────────────────────────────────
563
-
564
- ## ▶ Next Up
565
-
566
- **Phase {N+1}: {Name}** — {Goal from ROADMAP.md}
567
-
568
- `/pbr:plan {N+1}`
569
-
570
- <sub>`/clear` first fresh context window</sub>
571
-
572
- ───────────────────────────────────────────────────────────────
573
-
574
- **Also available:**
575
- - `/pbr:discuss {N+1}` — talk through details before planning
576
- - `/pbr:status` — see full project status
577
-
578
- ───────────────────────────────────────────────────────────────
579
- ```
580
-
581
- **If gaps remain:**
582
- ```
583
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
584
- PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND ⚠
585
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
586
-
587
- **Phase {N}: {name}** — {count} gaps remaining
588
-
589
- ───────────────────────────────────────────────────────────────
590
-
591
- ## Next Up
592
-
593
- **Fix gaps** — diagnose and create fix plans
594
-
595
- `/pbr:review {N} --auto-fix`
596
-
597
- <sub>`/clear` first → fresh context window</sub>
598
-
599
- ───────────────────────────────────────────────────────────────
600
-
601
- **Also available:**
602
- - `/pbr:plan {N} --gaps` — create fix plans manually
603
- - Fix manually, then `/pbr:review {N}`
604
-
605
- ───────────────────────────────────────────────────────────────
606
- ```
607
-
608
- **If final phase:**
609
-
610
- Display the "Milestone Complete" banner inline:
611
- ```
612
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
613
- PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
614
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
615
-
616
- {N} phases completed
617
- All phase goals verified ✓
618
- ```
619
-
620
- Then:
621
- ```
622
- ───────────────────────────────────────────────────────────────
623
-
624
- ## ▶ Next Up
625
-
626
- **Audit milestone** — verify cross-phase integration
627
-
628
- `/pbr:milestone audit`
629
-
630
- <sub>`/clear` first → fresh context window</sub>
631
-
632
- ───────────────────────────────────────────────────────────────
633
-
634
- **Also available:**
635
- - `/pbr:milestone complete` — archive this milestone and tag it
636
- - `/pbr:milestone new` — start planning next features
637
- - `/pbr:status` — see final project status
638
-
639
- ───────────────────────────────────────────────────────────────
640
- ```
641
-
642
- ---
643
-
644
- ## Notes
645
-
646
- For user-friendly interpretation of verification results, see `references/reading-verification.md`.
647
-
648
- - The verifier agent has NO Write/Edit tools for project source code — it can only read, check, and write VERIFICATION.md
649
- - Re-running `/pbr:review` after gap closure triggers fresh verification
650
- - UAT results are conversational — user responses are captured inline
651
- - VERIFICATION.md is persistent and serves as the ground truth for gap closure
652
- - The three-layer check (existence -> substantiveness -> wiring) catches progressively deeper issues
1
+ ---
2
+ name: review
3
+ description: "Verify the build matched the plan. Automated checks + walkthrough with you."
4
+ allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion
5
+ argument-hint: "<phase-number> [--auto-fix] [--teams]"
6
+ ---
7
+
8
+ **STOPDO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
9
+
10
+ # /pbr:review Phase Review and Verification
11
+
12
+ You are the orchestrator for `/pbr:review`. This skill verifies that what was built matches what was planned. It runs automated three-layer checks against must-haves, then walks the user through a conversational UAT (user acceptance testing) for each deliverable. Your job is to present findings clearly and help the user decide what's good enough versus what needs fixes.
13
+
14
+ ## Context Budget
15
+
16
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
17
+
18
+ Additionally for this skill:
19
+ - **Minimize** reading subagent output — read only VERIFICATION.md frontmatter for summaries
20
+
21
+ ## Step 0 — Immediate Output
22
+
23
+ **Before ANY tool calls**, display this banner:
24
+
25
+ ```
26
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
+ PLAN-BUILD-RUN ► REVIEWING PHASE {N}
28
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
29
+ ```
30
+
31
+ Where `{N}` is the phase number from `$ARGUMENTS`. Then proceed to Step 1.
32
+
33
+ ## Prerequisites
34
+
35
+ - `.planning/config.json` exists
36
+ - Phase has been built: SUMMARY.md files exist in `.planning/phases/{NN}-{slug}/`
37
+
38
+ ### Event-Driven Auto-Verification
39
+
40
+ When `features.goal_verification` is enabled and depth is "standard" or "comprehensive", the `event-handler.js` hook automatically queues verification after executor completion. The hook writes `.planning/.auto-verify` as a signal file. The build skill's orchestrator detects this signal and spawns the verifier agent.
41
+
42
+ **This is additive**: `/pbr:review` can always be invoked manually regardless of auto-verification settings. If auto-verification already ran, `/pbr:review` re-runs verification (useful for re-checking after fixes).
43
+
44
+ ---
45
+
46
+ ## Argument Parsing
47
+
48
+ Parse `$ARGUMENTS` according to `skills/shared/phase-argument-parsing.md`.
49
+
50
+ | Argument | Meaning |
51
+ |----------|---------|
52
+ | `3` | Review phase 3 |
53
+ | `3 --auto-fix` | Review phase 3, automatically diagnose and create gap-closure plans for failures |
54
+ | `3 --teams` | Review phase 3 with parallel specialist verifiers (functional + security + performance) |
55
+ | (no number) | Use current phase from STATE.md |
56
+
57
+ ---
58
+
59
+ ## Orchestration Flow
60
+
61
+ Execute these steps in order.
62
+
63
+ ---
64
+
65
+ ### Step 1: Parse and Validate (inline)
66
+
67
+ 1. Parse `$ARGUMENTS` for phase number and `--auto-fix` flag
68
+ 2. Read `.planning/config.json`
69
+ 3. Resolve depth profile: run `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
70
+ 4. Validate:
71
+ - Phase directory exists at `.planning/phases/{NN}-{slug}/`
72
+ - SUMMARY.md files exist (phase has been built)
73
+ - PLAN.md files exist (needed for must-have extraction)
74
+ 5. If no phase number given, read current phase from `.planning/STATE.md`
75
+ 6. If `.planning/.auto-verify` signal file exists, read it and note the auto-verification was already queued. Delete the signal file after reading (one-shot, same pattern as auto-continue.js).
76
+
77
+ **Validation errors — use branded error boxes:**
78
+
79
+ If no SUMMARY.md files:
80
+ ```
81
+ ╔══════════════════════════════════════════════════════════════╗
82
+ ║ ERROR ║
83
+ ╚══════════════════════════════════════════════════════════════╝
84
+
85
+ Phase {N} hasn't been built yet.
86
+
87
+ **To fix:** Run `/pbr:build {N}` first.
88
+ ```
89
+
90
+ If no PLAN.md files:
91
+ ```
92
+ ╔══════════════════════════════════════════════════════════════╗
93
+ ║ ERROR ║
94
+ ╚══════════════════════════════════════════════════════════════╝
95
+
96
+ Phase {N} has no plans.
97
+
98
+ **To fix:** Run `/pbr:plan {N}` first.
99
+ ```
100
+
101
+ ---
102
+
103
+ ### Step 2: Check Existing Verification (inline)
104
+
105
+ Reference: `skills/shared/config-loading.md` for the tooling shortcut (`phase-info`) and config field reference.
106
+
107
+ Check if a VERIFICATION.md already exists from `/pbr:build`'s auto-verification step:
108
+
109
+ 1. Look for `.planning/phases/{NN}-{slug}/VERIFICATION.md`
110
+ 2. If it exists:
111
+ - Read it and check the status
112
+ - If `status: passed` and no `--auto-fix` flag: skip to Step 4 (conversational UAT)
113
+ - If `status: gaps_found`: present gaps and proceed to Step 4
114
+ - If `status: human_needed`: proceed to Step 4
115
+
116
+ 3. If it does NOT exist: proceed to Step 3 (automated verification)
117
+
118
+ ---
119
+
120
+ ### Step 3: Automated Verification (delegated)
121
+
122
+ **Depth profile gate:** Before spawning the verifier, resolve the depth profile. If `features.goal_verification` is false in the profile, skip automated verification and proceed directly to Step 5 (Conversational UAT). Note to user: "Automated verification skipped (depth: {depth}). Proceeding to manual review."
123
+
124
+ #### Team Review Mode
125
+
126
+ If `--teams` flag is present OR `config.parallelization.use_teams` is true:
127
+
128
+ 1. Create team output directory: `.planning/phases/{NN}-{slug}/team/` (if not exists)
129
+ 2. Display to the user: `◐ Spawning 3 verifiers in parallel (functional, security, performance)...`
130
+
131
+ Spawn THREE verifier agents in parallel using Task():
132
+
133
+ **Agent 1 -- Functional Reviewer**:
134
+ - subagent_type: "pbr:verifier"
135
+ - Prompt includes: "You are the FUNCTIONAL REVIEWER in a review team. Focus on: must-haves met, code correctness, completeness, integration points. Write output to `.planning/phases/{NN}-{slug}/team/functional-VERIFY.md`."
136
+
137
+ **Agent 2 -- Security Auditor**:
138
+ - subagent_type: "pbr:verifier"
139
+ - Prompt includes: "You are the SECURITY AUDITOR in a review team. Focus on: vulnerabilities, auth bypass paths, injection risks, secrets exposure, permission escalation. Write output to `.planning/phases/{NN}-{slug}/team/security-VERIFY.md`."
140
+
141
+ **Agent 3 -- Performance Analyst**:
142
+ - subagent_type: "pbr:verifier"
143
+ - Prompt includes: "You are the PERFORMANCE ANALYST in a review team. Focus on: N+1 queries, memory leaks, unnecessary allocations, bundle size impact, blocking operations. Write output to `.planning/phases/{NN}-{slug}/team/performance-VERIFY.md`."
144
+
145
+ 3. Wait for all three to complete
146
+ 4. Display to the user: `◐ Spawning synthesizer...`
147
+
148
+ Spawn synthesizer:
149
+ - subagent_type: "pbr:synthesizer"
150
+ - Prompt: "Read all *-VERIFY.md files in `.planning/phases/{NN}-{slug}/team/`. Synthesize into a unified VERIFICATION.md. Merge pass/fail verdicts -- a must-have fails if ANY reviewer flags it. Combine gap lists. Security and performance findings go into dedicated sections."
151
+ 5. Proceed to UAT walkthrough with the unified VERIFICATION.md
152
+
153
+ If teams not enabled, proceed with existing single-verifier flow.
154
+
155
+ Reference: `references/agent-teams.md`
156
+
157
+ #### Single-Verifier Flow (default)
158
+
159
+ Display to the user: `◐ Spawning verifier...`
160
+
161
+ Spawn a verifier Task() to run three-layer checks:
162
+
163
+ ```
164
+ Task({
165
+ subagent_type: "pbr:verifier",
166
+ prompt: <verifier prompt>
167
+ })
168
+ ```
169
+
170
+ **Path resolution**: Before constructing any agent prompt, resolve `${CLAUDE_PLUGIN_ROOT}` to its absolute path. Do not pass the variable literally in prompts — Task() contexts may not expand it. Use the resolved absolute path for any pbr-tools.js or template references included in the prompt.
171
+
172
+ #### Verifier Prompt Template
173
+
174
+ Read `skills/review/templates/verifier-prompt.md.tmpl` and use its content as the verifier prompt.
175
+
176
+ **Placeholders to fill before sending:**
177
+ - `{For each PLAN.md file in the phase directory:}` — inline each plan's must_haves frontmatter block
178
+ - `{For each SUMMARY.md file in the phase directory:}` — provide manifest table with file paths and status from frontmatter. The verifier reads full content from disk via Read tool.
179
+ - `{NN}-{slug}`the phase directory name
180
+ - `{N}` the phase number
181
+ - `{date}`, `{count}`, `{phase name}` — fill from context
182
+
183
+ Wait for the verifier to complete.
184
+
185
+ **After the verifier completes**, read VERIFICATION.md frontmatter and display a quick summary before the full results:
186
+
187
+ ```
188
+ Verifier: {passed}/{total} must-haves verified
189
+ ```
190
+
191
+ Then show a brief table of must-haves with pass/fail status:
192
+
193
+ ```
194
+ | Must-Have | Status |
195
+ |-----------|--------|
196
+ | {name} | ✓ |
197
+ | {name} | ✗ |
198
+ ```
199
+
200
+ Then display the overall verdict (`PASSED`, `GAPS FOUND`, or `HUMAN NEEDED`) before proceeding to the full results presentation.
201
+
202
+ ---
203
+
204
+ ### Step 4: Present Verification Results (inline)
205
+
206
+ Read the VERIFICATION.md frontmatter. Check the `attempt` counter.
207
+
208
+ **If `attempt >= 3` AND `status: gaps_found`:** This phase has failed verification multiple times. Present escalation options instead of the normal flow:
209
+
210
+ Present the escalation context:
211
+ ```
212
+ Phase {N}: {name} — Verification Failed ({attempt} attempts)
213
+ The same gaps have persisted across {attempt} verification attempts.
214
+ Remaining gaps: {count}
215
+ ```
216
+
217
+ Use AskUserQuestion (pattern: multi-option-escalation from `skills/shared/gate-prompts.md`):
218
+ question: "Phase {N} has failed verification {attempt} times with {count} persistent gaps. How should we proceed?"
219
+ header: "Escalate"
220
+ options:
221
+ - label: "Accept gaps" description: "Mark as complete-with-gaps and move on"
222
+ - label: "Re-plan" description: "Go back to /pbr:plan {N} with gap context"
223
+ - label: "Debug" description: "Spawn /pbr:debug to investigate root causes"
224
+ - label: "Retry" description: "Try one more verification cycle"
225
+
226
+ - **If user selects "Accept gaps":** Follow up with a second AskUserQuestion:
227
+ question: "Accept all gaps or pick specific ones to override?"
228
+ header: "Override?"
229
+ options:
230
+ - label: "Accept all" description: "Mark phase as complete-with-gaps, accept everything"
231
+ - label: "Pick specific" description: "Choose which gaps to mark as false positives"
232
+ - If "Accept all": Update STATE.md status to `complete-with-gaps`, update ROADMAP.md to `verified*`, add a note in VERIFICATION.md about accepted gaps. Proceed to next phase.
233
+ - If "Pick specific": Use the override flow from Step 6 "Gaps Found" section (present each gap for selection).
234
+ - **If user selects "Re-plan":** Suggest `/pbr:plan {N} --gaps` to create targeted fix plans.
235
+ - **If user selects "Debug":** Suggest `/pbr:debug` with the gap details as starting context.
236
+ - **If user selects "Retry":** Continue with normal Step 5 flow.
237
+
238
+ **Otherwise**, present results normally:
239
+
240
+ ```
241
+ Phase {N}: {name} — Verification Results
242
+
243
+ Status: {PASSED | GAPS FOUND | HUMAN NEEDED}
244
+ Attempt: {attempt}
245
+
246
+ Must-have truths: {passed}/{total}
247
+ Must-have artifacts: {passed}/{total}
248
+ Must-have key links: {passed}/{total}
249
+
250
+ {If all passed:}
251
+ All automated checks passed.
252
+
253
+ {If gaps found:}
254
+ Gaps found:
255
+ 1. {gap description} — {failed layer}
256
+ 2. {gap description} — {failed layer}
257
+
258
+ {If human needed:}
259
+ Items requiring your verification:
260
+ 1. {item} {why automated check couldn't verify}
261
+ ```
262
+
263
+ ---
264
+
265
+ ### Step 5: Conversational UAT (inline)
266
+
267
+ Walk the user through each deliverable one by one. This is an interactive conversation, not an automated check.
268
+
269
+ **For each plan in the phase:**
270
+
271
+ 0. **Filter out ineligible plans**: Read each plan's SUMMARY.md `status` field. Skip plans with `status: failed`, `status: incomplete`, or `status: partial` that have zero committed tasks (check `commits` frontmatter field). Only walk through plans that completed successfully (`status: complete`) or partially with at least one committed task. For each skipped plan, note it to the user: "Skipping plan {plan_id} ({status}) — not eligible for UAT." If ALL plans in the phase are skipped, display: "No plans eligible for UAT walkthrough. All plans in Phase {N} are incomplete or failed. Run `/pbr:build {N}` to retry." and stop.
272
+ 1. Read the plan's must-haves and SUMMARY.md
273
+ 2. Present what was built:
274
+
275
+ ```
276
+ Plan {plan_id}: {plan name}
277
+
278
+ What was built:
279
+ {Brief description from SUMMARY.md}
280
+
281
+ Key deliverables:
282
+ 1. {artifact/truth 1}
283
+ 2. {artifact/truth 2}
284
+ 3. {artifact/truth 3}
285
+ ```
286
+
287
+ 3. For each must-have truth, walk the user through verification:
288
+
289
+ ```
290
+ Checking: "{truth statement}"
291
+
292
+ How to verify:
293
+ {Specific steps the user can take to check this}
294
+ {e.g., "Open http://localhost:3000 and click Login"}
295
+ {e.g., "Run `npm test` and check that auth tests pass"}
296
+
297
+ Does this work as expected? [pass / fail / skip]
298
+ ```
299
+
300
+ 4. Record the user's assessment for each item
301
+
302
+ **Keep the conversation flowing:**
303
+ - If user says "pass": move to the next item
304
+ - If user says "fail": ask what's wrong, record the issue
305
+ - If user says "skip": note it and move on
306
+ - If user has questions: answer them using the SUMMARY.md and plan context
307
+
308
+ ---
309
+
310
+ ### Step 6: Handle Results (inline)
311
+
312
+ Compile the UAT results and determine next steps.
313
+
314
+ #### All Items Pass
315
+
316
+ If all automated checks and UAT items passed:
317
+
318
+ 1. **Update `.planning/ROADMAP.md` Progress table** (REQUIRED do this BEFORE updating STATE.md):
319
+
320
+ **Tooling shortcut**: Use the CLI for atomic ROADMAP.md and STATE.md updates:
321
+ ```bash
322
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js roadmap update-status {phase} verified
323
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update status verified
324
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update last_activity now
325
+ ```
326
+
327
+ 1. Open `.planning/ROADMAP.md`
328
+ 2. Find the `## Progress` table
329
+ 3. Locate the row matching this phase number
330
+ 4. Update the `Status` column to `verified`
331
+ 5. Update the `Completed` column to the current date (YYYY-MM-DD)
332
+ 6. Save the file — do NOT skip this step
333
+ 2. Update `.planning/STATE.md`:
334
+ - Phase status: "verified"
335
+ - Progress updated
336
+ - Last activity timestamp
337
+ - **STATE.md size limit:** Follow size limit enforcement rules in `skills/shared/state-update.md` (150 lines max).
338
+ 3. Update VERIFICATION.md with UAT results (append UAT section)
339
+ 3. Present completion:
340
+
341
+ Use the branded output from `references/ui-formatting.md`:
342
+ - If more phases remain: use the "Phase Complete" banner template
343
+ - If this was the last phase: use the "Milestone Complete" banner template
344
+ - Always include the "Next Up" routing block
345
+
346
+ 4. If `gates.confirm_transition` is true in config AND `features.auto_advance` is NOT true:
347
+ - Use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
348
+ question: "Phase {N} verified. Ready to move to Phase {N+1}?"
349
+ header: "Continue?"
350
+ options:
351
+ - label: "Yes" description: "Proceed to plan Phase {N+1}"
352
+ - label: "No" description: "Stay on Phase {N} for now"
353
+ - If "Yes": suggest `/pbr:plan {N+1}`
354
+ - If "No" or "Other": stop
355
+
356
+ 5. **If `features.auto_advance` is `true` AND `mode` is `autonomous` AND more phases remain:**
357
+ - Chain directly to plan: `Skill({ skill: "pbr:plan", args: "{N+1}" })`
358
+ - This continues the build→review→plan cycle automatically
359
+ - **If this is the last phase:** HARD STOP — do NOT auto-advance past milestone boundaries
360
+
361
+ #### Gaps Found WITH `--auto-fix`
362
+
363
+ If gaps were found and `--auto-fix` was specified:
364
+
365
+ **Step 6a: Diagnose**
366
+
367
+ Display to the user: `◐ Spawning debugger...`
368
+
369
+ Spawn a debugger Task() to analyze each failure:
370
+
371
+ ```
372
+ Task({
373
+ subagent_type: "pbr:debugger",
374
+ prompt: <debugger prompt>
375
+ })
376
+ ```
377
+
378
+ ##### Debugger Prompt Template
379
+
380
+ Read `skills/review/templates/debugger-prompt.md.tmpl` and use its content as the debugger prompt.
381
+
382
+ **Placeholders to fill before sending:**
383
+ - `[Inline the VERIFICATION.md content]` — provide file path; debugger reads via Read tool
384
+ - `[Inline all SUMMARY.md files for the phase]` — provide manifest table of file paths
385
+ - `[Inline all PLAN.md files for the phase]` — provide manifest table of file paths
386
+
387
+ **Step 6b: Create Gap-Closure Plans**
388
+
389
+ After receiving the root cause analysis, display to the user: `◐ Spawning planner (gap closure)...`
390
+
391
+ Spawn the planner in gap-closure mode:
392
+
393
+ ```
394
+ Task({
395
+ subagent_type: "pbr:planner",
396
+ prompt: <gap planner prompt>
397
+ })
398
+ ```
399
+
400
+ ##### Gap Planner Prompt Template
401
+
402
+ Read `skills/review/templates/gap-planner-prompt.md.tmpl` and use its content as the gap planner prompt.
403
+
404
+ **Placeholders to fill before sending:**
405
+ - `[Inline VERIFICATION.md]` provide file path; planner reads via Read tool
406
+ - `[Inline the debugger's root cause analysis]` keep inline (already in conversation context)
407
+ - `[Inline all existing PLAN.md files for this phase]` provide manifest table of file paths
408
+ - `[Inline CONTEXT.md if it exists]` — provide file path; planner reads via Read tool
409
+ - `{NN}-{slug}` the phase directory name
410
+
411
+ **Step 6c: Validate gap-closure plans (conditional)**
412
+
413
+ If `features.plan_checking` is true in config:
414
+ - Display to the user: `◐ Spawning plan checker...`
415
+ - Spawn plan checker Task() on the new gap-closure plans
416
+ - Same process as `/pbr:plan` Step 6
417
+
418
+ **Step 6d: Present gap-closure plans to user**
419
+
420
+ ```
421
+ Auto-fix analysis complete.
422
+
423
+ Gaps found: {count}
424
+ Root causes identified: {count}
425
+ Gap-closure plans created: {count}
426
+
427
+ Plans:
428
+ {plan_id}: {name} — fixes: {gap description} ({difficulty})
429
+ {plan_id}: {name} fixes: {gap description} ({difficulty})
430
+
431
+ Use AskUserQuestion (pattern: approve-revise-abort from `skills/shared/gate-prompts.md`):
432
+ question: "Approve these {count} gap-closure plans?"
433
+ header: "Approve?"
434
+ options:
435
+ - label: "Approve" description: "Proceed I'll suggest the build command"
436
+ - label: "Review first" description: "Let me review the plans before approving"
437
+ - label: "Fix manually" description: "I'll fix these gaps myself"
438
+
439
+ - If "Approve": suggest `/pbr:build {N} --gaps-only`
440
+ - If "Review first" or "Other": present the full plan files for inspection
441
+ - If "Fix manually": suggest relevant files to inspect based on gap details
442
+
443
+ #### Gaps Found WITHOUT `--auto-fix`
444
+
445
+ If gaps were found and `--auto-fix` was NOT specified:
446
+
447
+ 1. List all gaps clearly
448
+ 2. **Default to auto-fix** — offer it as the recommended action, not a hidden flag
449
+
450
+ ```
451
+ Phase {N}: {name} Gaps Found
452
+
453
+ {count} verification gaps need attention:
454
+
455
+ 1. {gap description}
456
+ Layer failed: {existence | substantiveness | wiring}
457
+ Details: {what's wrong}
458
+
459
+ 2. {gap description}
460
+ ...
461
+
462
+ Use AskUserQuestion (pattern: multi-option-gaps from `skills/shared/gate-prompts.md`):
463
+ question: "{count} verification gaps need attention. How should we proceed?"
464
+ header: "Gaps"
465
+ options:
466
+ - label: "Auto-fix" description: "Diagnose root causes and create fix plans (recommended)"
467
+ - label: "Override" description: "Accept specific gaps as false positives"
468
+ - label: "Manual" description: "I'll fix these myself"
469
+ - label: "Skip" description: "Save results for later"
470
+
471
+ **If user selects "Auto-fix":** proceed with the same Steps 6a-6d as the `--auto-fix` flow above (diagnose, create gap-closure plans, validate, present). This is the default path.
472
+
473
+ **If user selects "Override":** present each gap and ask which ones to accept. For each accepted gap, collect a reason. Add to VERIFICATION.md frontmatter `overrides` list:
474
+ ```yaml
475
+ overrides:
476
+ - must_have: "{text}"
477
+ reason: "{user's reason}"
478
+ accepted_by: "user"
479
+ accepted_at: "{ISO date}"
480
+ ```
481
+ After adding overrides, re-evaluate: if all remaining gaps are now overridden, mark status as `passed`. Otherwise, offer auto-fix for the remaining non-overridden gaps.
482
+
483
+ **If user selects "Manual":** suggest relevant files to inspect based on the gap details.
484
+
485
+ **If user selects "Skip":** save results and exit.
486
+
487
+ ---
488
+
489
+ ## UAT Result Recording
490
+
491
+ After conversational UAT, append UAT results to VERIFICATION.md:
492
+
493
+ ```markdown
494
+ ## User Acceptance Testing
495
+
496
+ | # | Item | Automated | UAT | Final Status |
497
+ |---|------|-----------|-----|-------------|
498
+ | 1 | {must-have} | PASS | PASS | VERIFIED |
499
+ | 2 | {must-have} | PASS | FAIL | GAP |
500
+ | 3 | {must-have} | GAP | — | GAP |
501
+ | 4 | {must-have} | PASS | SKIP | UNVERIFIED |
502
+
503
+ UAT conducted: {date}
504
+ Items verified: {count}
505
+ Items passed: {count}
506
+ Items failed: {count}
507
+ Items skipped: {count}
508
+ ```
509
+
510
+ ---
511
+
512
+ ## Integration Verification (optional)
513
+
514
+ If `features.integration_verification: true` AND this phase depends on prior phases:
515
+
516
+ After Step 3, also check cross-phase integration:
517
+ - Read SUMMARY.md `provides` and `requires` from this phase and dependent phases
518
+ - Verify that exports from prior phases are used in this phase's code
519
+ - Verify that this phase's outputs are compatible with future phase expectations
520
+ - Include integration findings in Step 4 presentation
521
+
522
+ ---
523
+
524
+ ## Error Handling
525
+
526
+ ### Verifier agent fails
527
+ If the verifier Task() fails, display:
528
+ ```
529
+ ╔══════════════════════════════════════════════════════════════╗
530
+ ║ ERROR ║
531
+ ╚══════════════════════════════════════════════════════════════╝
532
+
533
+ Automated verification failed.
534
+
535
+ **To fix:** We'll do a manual walkthrough instead.
536
+ ```
537
+ Fall back to manual UAT only (skip automated checks).
538
+
539
+ ### No must-haves to check
540
+ If plans have empty must_haves:
541
+ - Warn user: `⚠ Plans don't have defined must-haves. UAT will be based on plan descriptions only.`
542
+ - Use SUMMARY.md content as the basis for UAT
543
+
544
+ ### User can't verify something
545
+ If user can't verify an item (e.g., needs server running, needs credentials):
546
+ - Mark as SKIP
547
+ - Record what's needed
548
+ - Suggest how to verify later
549
+
550
+ ### Debugger fails during auto-fix
551
+ If the debugger Task() fails, display:
552
+ ```
553
+ ╔══════════════════════════════════════════════════════════════╗
554
+ ║ ERROR ║
555
+ ╚══════════════════════════════════════════════════════════════╝
556
+
557
+ Auto-diagnosis failed.
558
+
559
+ **To fix:** Create gap-closure plans based on the verification report alone.
560
+ ```
561
+ Ask user: "Would you like to proceed with gap-closure plans without root cause analysis?"
562
+
563
+ ---
564
+
565
+ ## Files Created/Modified by /pbr:review
566
+
567
+ | File | Purpose | When |
568
+ |------|---------|------|
569
+ | `.planning/phases/{NN}-{slug}/VERIFICATION.md` | Verification report | Step 3 (created or updated with UAT) |
570
+ | `.planning/phases/{NN}-{slug}/*-PLAN.md` | Gap-closure plans | Step 6b (--auto-fix only) |
571
+ | `.planning/ROADMAP.md` | Status → `verified` + Completed date | Step 6 |
572
+ | `.planning/STATE.md` | Updated with review status | Step 6 |
573
+
574
+ ---
575
+
576
+ ## Completion
577
+
578
+ After review completes, always present a clear next action:
579
+
580
+ **If verified (not final phase):**
581
+
582
+ Display the "Phase Complete" banner inline:
583
+ ```
584
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
585
+ PLAN-BUILD-RUN ► PHASE {N} COMPLETE ✓
586
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
587
+
588
+ **Phase {N}: {Name}**
589
+
590
+ {X} plans executed
591
+ Goal verified
592
+ ```
593
+
594
+ Then the branded "Next Up" block:
595
+ ```
596
+ ───────────────────────────────────────────────────────────────
597
+
598
+ ## ▶ Next Up
599
+
600
+ **Phase {N+1}: {Name}** — {Goal from ROADMAP.md}
601
+
602
+ `/pbr:plan {N+1}`
603
+
604
+ <sub>`/clear` first → fresh context window</sub>
605
+
606
+ ───────────────────────────────────────────────────────────────
607
+
608
+ **Also available:**
609
+ - `/pbr:discuss {N+1}` — talk through details before planning
610
+ - `/pbr:status` see full project status
611
+
612
+ ───────────────────────────────────────────────────────────────
613
+ ```
614
+
615
+ **If gaps remain:**
616
+ ```
617
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
618
+ PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND ⚠
619
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
620
+
621
+ **Phase {N}: {name}** — {count} gaps remaining
622
+
623
+ ───────────────────────────────────────────────────────────────
624
+
625
+ ## ▶ Next Up
626
+
627
+ **Fix gaps** — diagnose and create fix plans
628
+
629
+ `/pbr:review {N} --auto-fix`
630
+
631
+ <sub>`/clear` first → fresh context window</sub>
632
+
633
+ ───────────────────────────────────────────────────────────────
634
+
635
+ **Also available:**
636
+ - `/pbr:plan {N} --gaps` — create fix plans manually
637
+ - Fix manually, then `/pbr:review {N}`
638
+
639
+ ───────────────────────────────────────────────────────────────
640
+ ```
641
+
642
+ **If final phase:**
643
+
644
+ Display the "Milestone Complete" banner inline:
645
+ ```
646
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
647
+ PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
648
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
649
+
650
+ {N} phases completed
651
+ All phase goals verified
652
+ ```
653
+
654
+ Then:
655
+ ```
656
+ ───────────────────────────────────────────────────────────────
657
+
658
+ ## ▶ Next Up
659
+
660
+ **Audit milestone** — verify cross-phase integration
661
+
662
+ `/pbr:milestone audit`
663
+
664
+ <sub>`/clear` first → fresh context window</sub>
665
+
666
+ ───────────────────────────────────────────────────────────────
667
+
668
+ **Also available:**
669
+ - `/pbr:milestone complete` — archive this milestone and tag it
670
+ - `/pbr:milestone new` — start planning next features
671
+ - `/pbr:status` — see final project status
672
+
673
+ ───────────────────────────────────────────────────────────────
674
+ ```
675
+
676
+ ---
677
+
678
+ ## Notes
679
+
680
+ For user-friendly interpretation of verification results, see `references/reading-verification.md`.
681
+
682
+ - The verifier agent has NO Write/Edit tools for project source code — it can only read, check, and write VERIFICATION.md
683
+ - Re-running `/pbr:review` after gap closure triggers fresh verification
684
+ - UAT results are conversational — user responses are captured inline
685
+ - VERIFICATION.md is persistent and serves as the ground truth for gap closure
686
+ - The three-layer check (existence -> substantiveness -> wiring) catches progressively deeper issues