@sienklogic/plan-build-run 2.0.2 → 2.2.0

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 (166) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +25 -6
  3. package/dashboard/src/routes/pages.routes.js +11 -4
  4. package/dashboard/src/services/dashboard.service.js +81 -17
  5. package/dashboard/src/services/phase.service.js +30 -24
  6. package/dashboard/src/services/roadmap.service.js +3 -3
  7. package/dashboard/src/views/partials/phase-content.ejs +5 -4
  8. package/package.json +1 -1
  9. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  10. package/plugins/cursor-pbr/CHANGELOG.md +15 -0
  11. package/plugins/cursor-pbr/README.md +118 -0
  12. package/plugins/cursor-pbr/agents/codebase-mapper.md +108 -0
  13. package/plugins/cursor-pbr/agents/debugger.md +168 -0
  14. package/plugins/cursor-pbr/agents/executor.md +236 -0
  15. package/plugins/cursor-pbr/agents/general.md +87 -0
  16. package/plugins/cursor-pbr/agents/integration-checker.md +87 -0
  17. package/plugins/cursor-pbr/agents/plan-checker.md +198 -0
  18. package/plugins/cursor-pbr/agents/planner.md +180 -0
  19. package/plugins/cursor-pbr/agents/researcher.md +162 -0
  20. package/plugins/cursor-pbr/agents/synthesizer.md +101 -0
  21. package/plugins/cursor-pbr/agents/verifier.md +193 -0
  22. package/plugins/cursor-pbr/assets/logo.svg +21 -0
  23. package/plugins/cursor-pbr/hooks/hooks.json +189 -7
  24. package/plugins/cursor-pbr/references/agent-anti-patterns.md +25 -0
  25. package/plugins/cursor-pbr/references/agent-interactions.md +135 -0
  26. package/plugins/cursor-pbr/references/agent-teams.md +55 -0
  27. package/plugins/cursor-pbr/references/checkpoints.md +158 -0
  28. package/plugins/cursor-pbr/references/common-bug-patterns.md +14 -0
  29. package/plugins/cursor-pbr/references/config-reference.md +442 -0
  30. package/plugins/cursor-pbr/references/continuation-format.md +213 -0
  31. package/plugins/cursor-pbr/references/deviation-rules.md +113 -0
  32. package/plugins/cursor-pbr/references/git-integration.md +227 -0
  33. package/plugins/cursor-pbr/references/integration-patterns.md +118 -0
  34. package/plugins/cursor-pbr/references/model-profiles.md +100 -0
  35. package/plugins/cursor-pbr/references/model-selection.md +32 -0
  36. package/plugins/cursor-pbr/references/pbr-rules.md +194 -0
  37. package/plugins/cursor-pbr/references/plan-authoring.md +182 -0
  38. package/plugins/cursor-pbr/references/plan-format.md +288 -0
  39. package/plugins/cursor-pbr/references/planning-config.md +214 -0
  40. package/plugins/cursor-pbr/references/questioning.md +215 -0
  41. package/plugins/cursor-pbr/references/reading-verification.md +128 -0
  42. package/plugins/cursor-pbr/references/stub-patterns.md +161 -0
  43. package/plugins/cursor-pbr/references/subagent-coordination.md +120 -0
  44. package/plugins/cursor-pbr/references/ui-formatting.md +462 -0
  45. package/plugins/cursor-pbr/references/verification-patterns.md +199 -0
  46. package/plugins/cursor-pbr/references/wave-execution.md +96 -0
  47. package/plugins/cursor-pbr/rules/pbr-workflow.mdc +48 -0
  48. package/plugins/cursor-pbr/setup.ps1 +78 -0
  49. package/plugins/cursor-pbr/setup.sh +83 -0
  50. package/plugins/cursor-pbr/skills/begin/SKILL.md +566 -0
  51. package/plugins/cursor-pbr/skills/begin/templates/PROJECT.md.tmpl +34 -0
  52. package/plugins/cursor-pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +19 -0
  53. package/plugins/cursor-pbr/skills/begin/templates/STATE.md.tmpl +50 -0
  54. package/plugins/cursor-pbr/skills/begin/templates/config.json.tmpl +64 -0
  55. package/plugins/cursor-pbr/skills/begin/templates/researcher-prompt.md.tmpl +20 -0
  56. package/plugins/cursor-pbr/skills/begin/templates/roadmap-prompt.md.tmpl +31 -0
  57. package/plugins/cursor-pbr/skills/begin/templates/synthesis-prompt.md.tmpl +17 -0
  58. package/plugins/cursor-pbr/skills/build/SKILL.md +902 -0
  59. package/plugins/cursor-pbr/skills/config/SKILL.md +253 -0
  60. package/plugins/cursor-pbr/skills/continue/SKILL.md +159 -0
  61. package/plugins/cursor-pbr/skills/debug/SKILL.md +512 -0
  62. package/plugins/cursor-pbr/skills/debug/templates/continuation-prompt.md.tmpl +17 -0
  63. package/plugins/cursor-pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +28 -0
  64. package/plugins/cursor-pbr/skills/discuss/SKILL.md +344 -0
  65. package/plugins/cursor-pbr/skills/discuss/templates/CONTEXT.md.tmpl +62 -0
  66. package/plugins/cursor-pbr/skills/discuss/templates/decision-categories.md +10 -0
  67. package/plugins/cursor-pbr/skills/explore/SKILL.md +375 -0
  68. package/plugins/cursor-pbr/skills/health/SKILL.md +218 -0
  69. package/plugins/cursor-pbr/skills/health/templates/check-pattern.md.tmpl +31 -0
  70. package/plugins/cursor-pbr/skills/health/templates/output-format.md.tmpl +64 -0
  71. package/plugins/cursor-pbr/skills/help/SKILL.md +152 -0
  72. package/plugins/cursor-pbr/skills/import/SKILL.md +499 -0
  73. package/plugins/cursor-pbr/skills/milestone/SKILL.md +701 -0
  74. package/plugins/cursor-pbr/skills/milestone/templates/audit-report.md.tmpl +49 -0
  75. package/plugins/cursor-pbr/skills/milestone/templates/stats-file.md.tmpl +31 -0
  76. package/plugins/cursor-pbr/skills/note/SKILL.md +228 -0
  77. package/plugins/cursor-pbr/skills/pause/SKILL.md +246 -0
  78. package/plugins/cursor-pbr/skills/pause/templates/continue-here.md.tmpl +72 -0
  79. package/plugins/cursor-pbr/skills/plan/SKILL.md +648 -0
  80. package/plugins/cursor-pbr/skills/plan/templates/checker-prompt.md.tmpl +22 -0
  81. package/plugins/cursor-pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +33 -0
  82. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +39 -0
  83. package/plugins/cursor-pbr/skills/plan/templates/researcher-prompt.md.tmpl +20 -0
  84. package/plugins/cursor-pbr/skills/plan/templates/revision-prompt.md.tmpl +24 -0
  85. package/plugins/cursor-pbr/skills/quick/SKILL.md +351 -0
  86. package/plugins/cursor-pbr/skills/resume/SKILL.md +399 -0
  87. package/plugins/cursor-pbr/skills/review/SKILL.md +649 -0
  88. package/plugins/cursor-pbr/skills/review/templates/debugger-prompt.md.tmpl +61 -0
  89. package/plugins/cursor-pbr/skills/review/templates/gap-planner-prompt.md.tmpl +41 -0
  90. package/plugins/cursor-pbr/skills/review/templates/verifier-prompt.md.tmpl +116 -0
  91. package/plugins/cursor-pbr/skills/scan/SKILL.md +301 -0
  92. package/plugins/cursor-pbr/skills/scan/templates/mapper-prompt.md.tmpl +202 -0
  93. package/plugins/cursor-pbr/skills/setup/SKILL.md +250 -0
  94. package/plugins/cursor-pbr/skills/shared/commit-planning-docs.md +36 -0
  95. package/plugins/cursor-pbr/skills/shared/config-loading.md +103 -0
  96. package/plugins/cursor-pbr/skills/shared/context-budget.md +41 -0
  97. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +87 -0
  98. package/plugins/cursor-pbr/skills/shared/digest-select.md +80 -0
  99. package/plugins/cursor-pbr/skills/shared/domain-probes.md +126 -0
  100. package/plugins/cursor-pbr/skills/shared/error-reporting.md +80 -0
  101. package/plugins/cursor-pbr/skills/shared/gate-prompts.md +389 -0
  102. package/plugins/cursor-pbr/skills/shared/phase-argument-parsing.md +46 -0
  103. package/plugins/cursor-pbr/skills/shared/progress-display.md +54 -0
  104. package/plugins/cursor-pbr/skills/shared/revision-loop.md +82 -0
  105. package/plugins/cursor-pbr/skills/shared/state-loading.md +63 -0
  106. package/plugins/cursor-pbr/skills/shared/state-update.md +162 -0
  107. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +34 -0
  108. package/plugins/cursor-pbr/skills/status/SKILL.md +362 -0
  109. package/plugins/cursor-pbr/skills/todo/SKILL.md +195 -0
  110. package/plugins/cursor-pbr/templates/CONTEXT.md.tmpl +53 -0
  111. package/plugins/cursor-pbr/templates/INTEGRATION-REPORT.md.tmpl +152 -0
  112. package/plugins/cursor-pbr/templates/RESEARCH-SUMMARY.md.tmpl +98 -0
  113. package/plugins/cursor-pbr/templates/ROADMAP.md.tmpl +41 -0
  114. package/plugins/cursor-pbr/templates/SUMMARY.md.tmpl +82 -0
  115. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  116. package/plugins/cursor-pbr/templates/continue-here.md.tmpl +74 -0
  117. package/plugins/cursor-pbr/templates/prompt-partials/phase-project-context.md.tmpl +38 -0
  118. package/plugins/pbr/agents/codebase-mapper.md +41 -206
  119. package/plugins/pbr/agents/debugger.md +65 -171
  120. package/plugins/pbr/agents/executor.md +90 -275
  121. package/plugins/pbr/agents/general.md +27 -97
  122. package/plugins/pbr/agents/integration-checker.md +35 -112
  123. package/plugins/pbr/agents/plan-checker.md +71 -164
  124. package/plugins/pbr/agents/planner.md +76 -245
  125. package/plugins/pbr/agents/researcher.md +63 -255
  126. package/plugins/pbr/agents/synthesizer.md +49 -174
  127. package/plugins/pbr/agents/verifier.md +75 -366
  128. package/plugins/pbr/hooks/hooks.json +14 -10
  129. package/plugins/pbr/references/ui-formatting.md +1 -1
  130. package/plugins/pbr/scripts/auto-continue.js +20 -4
  131. package/plugins/pbr/scripts/check-dangerous-commands.js +1 -1
  132. package/plugins/pbr/scripts/check-phase-boundary.js +1 -1
  133. package/plugins/pbr/scripts/check-plan-format.js +3 -3
  134. package/plugins/pbr/scripts/check-roadmap-sync.js +3 -3
  135. package/plugins/pbr/scripts/check-skill-workflow.js +1 -1
  136. package/plugins/pbr/scripts/check-state-sync.js +2 -2
  137. package/plugins/pbr/scripts/check-subagent-output.js +1 -1
  138. package/plugins/pbr/scripts/check-summary-gate.js +198 -0
  139. package/plugins/pbr/scripts/context-budget-check.js +1 -1
  140. package/plugins/pbr/scripts/event-handler.js +2 -2
  141. package/plugins/pbr/scripts/event-logger.js +1 -1
  142. package/plugins/pbr/scripts/log-subagent.js +1 -1
  143. package/plugins/pbr/scripts/pbr-tools.js +1 -1
  144. package/plugins/pbr/scripts/post-write-dispatch.js +1 -1
  145. package/plugins/pbr/scripts/post-write-quality.js +1 -1
  146. package/plugins/pbr/scripts/pre-bash-dispatch.js +1 -1
  147. package/plugins/pbr/scripts/pre-write-dispatch.js +16 -3
  148. package/plugins/pbr/scripts/session-cleanup.js +1 -1
  149. package/plugins/pbr/scripts/status-line.js +1 -1
  150. package/plugins/pbr/scripts/suggest-compact.js +1 -1
  151. package/plugins/pbr/scripts/task-completed.js +1 -1
  152. package/plugins/pbr/scripts/track-context-budget.js +11 -6
  153. package/plugins/pbr/scripts/validate-commit.js +1 -1
  154. package/plugins/pbr/scripts/validate-task.js +1 -1
  155. package/plugins/pbr/skills/begin/SKILL.md +4 -2
  156. package/plugins/pbr/skills/begin/templates/roadmap-prompt.md.tmpl +2 -0
  157. package/plugins/pbr/skills/build/SKILL.md +6 -4
  158. package/plugins/pbr/skills/continue/SKILL.md +2 -1
  159. package/plugins/pbr/skills/review/SKILL.md +4 -3
  160. package/plugins/pbr/skills/status/SKILL.md +5 -2
  161. package/plugins/pbr/templates/ROADMAP.md.tmpl +6 -1
  162. package/plugins/cursor-pbr/agents/.gitkeep +0 -0
  163. package/plugins/cursor-pbr/references/.gitkeep +0 -0
  164. package/plugins/cursor-pbr/rules/.gitkeep +0 -0
  165. package/plugins/cursor-pbr/skills/.gitkeep +0 -0
  166. package/plugins/cursor-pbr/templates/.gitkeep +0 -0
@@ -0,0 +1,462 @@
1
+ <!-- canonical: ../../pbr/references/ui-formatting.md -->
2
+ # Plan-Build-Run UI Brand & Formatting Reference
3
+
4
+ Consistent output formatting for all Plan-Build-Run skills. Every skill that produces user-facing output should follow these patterns.
5
+
6
+ ## Stage Banners
7
+
8
+ Use for major workflow transitions. Always use `PLAN-BUILD-RUN` prefix.
9
+
10
+ ```
11
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ PLAN-BUILD-RUN ► {STAGE NAME}
13
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ```
15
+
16
+ **Stage names (uppercase):**
17
+ - `QUESTIONING`
18
+ - `RESEARCHING`
19
+ - `DEFINING REQUIREMENTS`
20
+ - `CREATING ROADMAP`
21
+ - `PLANNING PHASE {N}`
22
+ - `EXECUTING WAVE {N}`
23
+ - `VERIFYING`
24
+ - `PHASE {N} COMPLETE ✓`
25
+ - `MILESTONE COMPLETE 🎉`
26
+ - `SCANNING CODEBASE`
27
+ - `DEBUGGING`
28
+
29
+ ---
30
+
31
+ ## Invocation Banners
32
+
33
+ **Every skill MUST display a branded banner as its very first output, BEFORE any file reads, state loading, or processing.** This is the user's immediate confirmation that their command was received.
34
+
35
+ Format:
36
+ ```
37
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
38
+ PLAN-BUILD-RUN ► {SKILL NAME}
39
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
40
+ ```
41
+
42
+ **Skill names (uppercase):**
43
+ - `STARTING PROJECT` (begin)
44
+ - `PLANNING PHASE {N}` (plan)
45
+ - `BUILDING PHASE {N}` (build)
46
+ - `REVIEWING PHASE {N}` (review)
47
+ - `QUICK TASK` (quick)
48
+ - `NEXT STEP` (continue)
49
+ - `PROJECT STATUS` (status)
50
+ - `RESUMING SESSION` (resume)
51
+ - `PAUSING SESSION` (pause)
52
+ - `HEALTH CHECK` (health)
53
+ - `SETUP` (setup)
54
+ - `CONFIGURATION` (config)
55
+ - `COMMAND REFERENCE` (help)
56
+ - `DISCUSSION` (discuss)
57
+ - `EXPLORING` (explore)
58
+ - `NOTE` (note)
59
+ - `TODO` (todo)
60
+ - `DEBUGGING` (debug)
61
+ - `SCANNING CODEBASE` (scan)
62
+ - `MILESTONE` (milestone)
63
+ - `IMPORTING PLAN` (import)
64
+
65
+ **Rules:**
66
+ 1. The banner MUST be output BEFORE any tool calls (Read, Glob, Bash, Task)
67
+ 2. The banner MUST be the first text the user sees
68
+ 3. After the banner, optionally show a 1-line context summary (e.g., "Phase 3 of 7 — API Layer")
69
+ 4. Then proceed to Step 1 (state loading, argument parsing, etc.)
70
+
71
+ ---
72
+
73
+ ## Headers
74
+
75
+ Use these patterns for consistent visual hierarchy within sections:
76
+
77
+ ```
78
+ ## Phase 3: Authentication <- Phase-level header
79
+ ### Plan 01: Database Schema <- Plan-level header
80
+ #### Task 1: Create User Table <- Task-level header
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Status Indicators
86
+
87
+ | Status | Indicator | Usage |
88
+ |--------|-----------|-------|
89
+ | Complete | `✓` | Completed items, passed checks |
90
+ | Failed | `✗` | Failed verification, missing items |
91
+ | Pending | `○` | Not yet started |
92
+ | In Progress | `◐` | Currently executing |
93
+ | Needs Human | `?` | Requires human verification |
94
+ | Warning | `⚠` | Warnings, non-blocking issues |
95
+ | Blocked | `⊘` | Blocked by dependency |
96
+ | Auto-approved | `⚡` | Automatically approved (gates) |
97
+
98
+ ---
99
+
100
+ ## Progress Display
101
+
102
+ **Phase/milestone level:**
103
+ ```
104
+ Progress: ████████░░ 80%
105
+ ```
106
+
107
+ **Phase progress (detailed):**
108
+ ```
109
+ Phase 3 of 5: Authentication
110
+ Progress: [████████░░░░░░░░░░░░] 40%
111
+ Plans: 2/5 complete
112
+ ```
113
+
114
+ **Build progress (wave tracking):**
115
+ ```
116
+ Wave 1: ✓ Plan 01, ✓ Plan 02
117
+ Wave 2: ◐ Plan 03 (executing)
118
+ Wave 3: ○ Plan 04
119
+ ```
120
+
121
+ **Task level:**
122
+ ```
123
+ Tasks: 2/4 complete
124
+ ```
125
+
126
+ ---
127
+
128
+ ## Spawning Indicators
129
+
130
+ Show when agents are being launched:
131
+
132
+ ```
133
+ ◐ Spawning executor...
134
+
135
+ ◐ Spawning 4 executors in parallel...
136
+ → Plan 01: Database Schema
137
+ → Plan 02: Auth Service
138
+ → Plan 03: API Routes
139
+ → Plan 04: Test Suite
140
+
141
+ ✓ Plan 01 complete (2m 14s)
142
+ ```
143
+
144
+ For research agents:
145
+ ```
146
+ ◐ Spawning 4 researchers in parallel...
147
+ → Stack research
148
+ → Features research
149
+ → Architecture research
150
+ → Pitfalls research
151
+
152
+ ✓ Researcher complete: STACK.md written
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Checkpoint Boxes
158
+
159
+ User action required. Use double-line box drawing, 62-character width.
160
+
161
+ ```
162
+ ╔══════════════════════════════════════════════════════════════╗
163
+ ║ CHECKPOINT: {Type} ║
164
+ ╚══════════════════════════════════════════════════════════════╝
165
+
166
+ {Content}
167
+
168
+ ──────────────────────────────────────────────────────────────
169
+ → {ACTION PROMPT}
170
+ ──────────────────────────────────────────────────────────────
171
+ ```
172
+
173
+ **Types:**
174
+ - `CHECKPOINT: Verification Required` → `→ Type "approved" or describe issues`
175
+ - `CHECKPOINT: Decision Required` → `→ Select: option-a / option-b`
176
+ - `CHECKPOINT: Action Required` → `→ Type "done" when complete`
177
+
178
+ ---
179
+
180
+ ## AskUserQuestion Patterns
181
+
182
+ Structured prompts for user decision points. All gate checks use AskUserQuestion instead of
183
+ plain-text "Type approved" prompts. See `skills/shared/gate-prompts.md` for the full
184
+ pattern catalog (21 named AskUserQuestion patterns).
185
+
186
+ ### Structure
187
+
188
+ ```
189
+ AskUserQuestion:
190
+ question: "{contextual question}"
191
+ header: "{max 12 chars}"
192
+ options:
193
+ - label: "{Option 1}" description: "{What happens}"
194
+ - label: "{Option 2}" description: "{What happens}"
195
+ multiSelect: false
196
+ ```
197
+
198
+ ### Rules
199
+
200
+ - **Max 4 options** per call. Split into 2-step flow if more are needed.
201
+ - **Header max 12 characters.** Single word preferred (e.g., "Approve?", "Confirm", "Scope").
202
+ - **multiSelect: false** always. Plan-Build-Run gates require single selection.
203
+ - **Handle "Other"**: Users may type freeform text instead of selecting. Skills must handle this gracefully.
204
+ - **Orchestrator only**: AskUserQuestion cannot be called from subagents.
205
+
206
+ ### Common Patterns
207
+
208
+ **Approval gate** (approve-revise-abort):
209
+ ```
210
+ question: "Approve these plans?"
211
+ header: "Approve?"
212
+ options:
213
+ - label: "Approve" description: "Proceed with execution"
214
+ - label: "Request changes" description: "Discuss adjustments before proceeding"
215
+ - label: "Abort" description: "Cancel this operation"
216
+ ```
217
+
218
+ **Simple confirmation** (yes-no):
219
+ ```
220
+ question: "Re-plan this phase with gap context?"
221
+ header: "Confirm"
222
+ options:
223
+ - label: "Yes" description: "Create gap-closure plans"
224
+ - label: "No" description: "Skip re-planning"
225
+ ```
226
+
227
+ **Category selection** (settings-category-select):
228
+ ```
229
+ question: "What would you like to configure?"
230
+ header: "Configure"
231
+ options:
232
+ - label: "Depth" description: "quick/standard/comprehensive"
233
+ - label: "Model profile" description: "quality/balanced/budget/adaptive"
234
+ - label: "Features" description: "Toggle workflow features and gates"
235
+ - label: "Git settings" description: "branching strategy, commit mode"
236
+ ```
237
+
238
+ **Dynamic routing** (action-routing):
239
+ ```
240
+ question: "What would you like to do next?"
241
+ header: "Next Step"
242
+ options:
243
+ - label: "/pbr:build 3" description: "Execute phase 3 plans"
244
+ - label: "/pbr:review 2" description: "Verify phase 2 results"
245
+ - label: "Something else" description: "Enter a different command"
246
+ ```
247
+
248
+ ### When NOT to Use
249
+
250
+ Do not use AskUserQuestion for:
251
+ - Freeform text input (symptom descriptions, task descriptions, open questions)
252
+ - Socratic discussion (explore, discuss follow-ups)
253
+ - Situations with unbounded response space
254
+
255
+ Use plain conversational prompts for these cases instead.
256
+
257
+ ---
258
+
259
+ ## Next Up Block
260
+
261
+ Always present at end of major completions (phase complete, milestone complete, project init).
262
+
263
+ ```
264
+ ───────────────────────────────────────────────────────────────
265
+
266
+ ## ▶ Next Up
267
+
268
+ **{Identifier}: {Name}** — {one-line description}
269
+
270
+ `{copy-paste command}`
271
+
272
+ <sub>`/clear` first → fresh context window</sub>
273
+
274
+ ───────────────────────────────────────────────────────────────
275
+
276
+ **Also available:**
277
+ - `/pbr:alternative-1` — description
278
+ - `/pbr:alternative-2` — description
279
+
280
+ ───────────────────────────────────────────────────────────────
281
+ ```
282
+
283
+ **Shorter routing (for minor completions):**
284
+ ```
285
+ What's next?
286
+ → /pbr:plan 4 — plan the next phase
287
+ → /pbr:review 3 — review what was just built
288
+ → /pbr:status — see full project status
289
+ ```
290
+
291
+ ---
292
+
293
+ ## Error Box
294
+
295
+ ```
296
+ ╔══════════════════════════════════════════════════════════════╗
297
+ ║ ERROR ║
298
+ ╚══════════════════════════════════════════════════════════════╝
299
+
300
+ {Error description}
301
+
302
+ **To fix:** {Resolution steps}
303
+ ```
304
+
305
+ ---
306
+
307
+ ## Tables
308
+
309
+ Use tables for structured data:
310
+
311
+ ```markdown
312
+ | Phase | Status | Plans | Progress |
313
+ |-------|--------|-------|----------|
314
+ | 1. Foundation | ✓ Complete | 3/3 | 100% |
315
+ | 2. Database | ✓ Complete | 2/2 | 100% |
316
+ | 3. Auth | ◐ Building | 1/3 | 33% |
317
+ | 4. Frontend | ○ Pending | 0/4 | 0% |
318
+ ```
319
+
320
+ ---
321
+
322
+ ## Cost/Token Warnings
323
+
324
+ ```
325
+ ⚠ Budget check: This operation will spawn 4 agents (~400k tokens)
326
+ Estimated: ~20% of 5-hour window
327
+ Continue? [/pbr:config to adjust depth first]
328
+ ```
329
+
330
+ ---
331
+
332
+ ## Completion Summary Templates
333
+
334
+ ### Phase Complete
335
+
336
+ ```
337
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
338
+ PLAN-BUILD-RUN ► PHASE {N} COMPLETE ✓
339
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
340
+
341
+ **Phase {N}: {Name}**
342
+
343
+ {X} plans executed
344
+ Goal verified ✓
345
+
346
+ ───────────────────────────────────────────────────────────────
347
+
348
+ ## ▶ Next Up
349
+
350
+ **Phase {N+1}: {Name}** — {Goal from ROADMAP.md}
351
+
352
+ /pbr:discuss {N+1} — gather context and clarify approach
353
+
354
+ <sub>/clear first → fresh context window</sub>
355
+
356
+ ───────────────────────────────────────────────────────────────
357
+
358
+ **Also available:**
359
+ - /pbr:plan {N+1} — skip discussion, plan directly
360
+ - /pbr:review {N} — manual acceptance testing before continuing
361
+
362
+ ───────────────────────────────────────────────────────────────
363
+ ```
364
+
365
+ ### Milestone Complete
366
+
367
+ ```
368
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
369
+ PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
370
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
371
+
372
+ **{version}**
373
+
374
+ {N} phases completed
375
+ All phase goals verified ✓
376
+
377
+ ───────────────────────────────────────────────────────────────
378
+
379
+ ## ▶ Next Up
380
+
381
+ **Audit milestone** — verify requirements, cross-phase integration, E2E flows
382
+
383
+ /pbr:milestone audit
384
+
385
+ <sub>/clear first → fresh context window</sub>
386
+
387
+ ───────────────────────────────────────────────────────────────
388
+
389
+ **Also available:**
390
+ - /pbr:review — manual acceptance testing
391
+ - /pbr:milestone complete — skip audit, archive directly
392
+
393
+ ───────────────────────────────────────────────────────────────
394
+ ```
395
+
396
+ ### Gaps Found
397
+
398
+ ```
399
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
400
+ PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND ⚠
401
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
402
+
403
+ **Phase {N}: {Name}**
404
+
405
+ Score: {X}/{Y} must-haves verified
406
+ Report: .planning/phases/{phase_dir}/VERIFICATION.md
407
+
408
+ ### What's Missing
409
+
410
+ {Extract gap summaries from VERIFICATION.md}
411
+
412
+ ───────────────────────────────────────────────────────────────
413
+
414
+ ## ▶ Next Up
415
+
416
+ **Plan gap closure** — create additional plans to complete the phase
417
+
418
+ /pbr:plan {N} --gaps
419
+
420
+ <sub>/clear first → fresh context window</sub>
421
+
422
+ ───────────────────────────────────────────────────────────────
423
+
424
+ **Also available:**
425
+ - cat .planning/phases/{phase_dir}/VERIFICATION.md — see full report
426
+ - /pbr:review {N} — manual testing before planning
427
+
428
+ ───────────────────────────────────────────────────────────────
429
+ ```
430
+
431
+ ---
432
+
433
+ ## Session Banners
434
+
435
+ Use for session lifecycle transitions (pause/resume):
436
+
437
+ ```
438
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
439
+ PLAN-BUILD-RUN ► SESSION RESTORED ✓
440
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
441
+
442
+ Position: Phase {N} — {phase name}, Plan {M}
443
+ Paused: {ISO datetime}
444
+ Duration: {time since pause}
445
+
446
+ {Summary of where work left off}
447
+ ```
448
+
449
+ Other session banners: `SESSION SAVED ✓` (pause), `RESUMING SESSION` (resume start).
450
+
451
+ ---
452
+
453
+ ## Anti-Patterns
454
+
455
+ Do NOT:
456
+ - Use varying box/banner widths
457
+ - Mix banner styles (`===`, `---`, `***`) with `━━━` banners
458
+ - Skip `PLAN-BUILD-RUN ►` prefix in stage banners
459
+ - Use random emoji (only `🎉` for milestone complete, `✓` for phase complete)
460
+ - Skip the "Next Up" block after major completions
461
+ - Reference non-Plan-Build-Run commands (always use `/pbr:*` commands)
462
+ - Use non-Plan-Build-Run branding in banners
@@ -0,0 +1,199 @@
1
+ <!-- canonical: ../../pbr/references/verification-patterns.md -->
2
+ # Goal-Backward Verification Patterns
3
+
4
+ Reference patterns for deriving verification criteria from goals. Used by the planner to create `<verify>` and `<done>` elements, and by the verifier to check phase completion.
5
+
6
+ ---
7
+
8
+ ## The Three-Layer Check
9
+
10
+ Every must-have is verified through three layers, checked in order:
11
+
12
+ ### Layer 1: Existence
13
+
14
+ Does the artifact exist?
15
+
16
+ ```bash
17
+ # File existence
18
+ ls -la src/auth/discord.ts
19
+
20
+ # Module export existence
21
+ grep -q "export.*authenticateWithDiscord" src/auth/discord.ts
22
+
23
+ # Database table existence
24
+ npx prisma db execute --stdin <<< "SELECT 1 FROM users LIMIT 1"
25
+
26
+ # Route existence
27
+ curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/api/auth/login
28
+ ```
29
+
30
+ ### Layer 2: Substantiveness
31
+
32
+ Is the artifact more than a stub?
33
+
34
+ ```bash
35
+ # File has real content (not just exports)
36
+ wc -l src/auth/discord.ts # Should be > 10 lines for a real implementation
37
+
38
+ # Function has a body (not just a signature)
39
+ grep -A5 "authenticateWithDiscord" src/auth/discord.ts | grep -q "return"
40
+
41
+ # Test file has actual test cases
42
+ grep -c "it(" tests/auth.test.ts # Should be > 0
43
+
44
+ # API returns real data (not just 200 OK)
45
+ curl -s http://localhost:3000/api/health | jq '.status' | grep -q "ok"
46
+ ```
47
+
48
+ ### Layer 3: Wiring
49
+
50
+ Are components connected to each other?
51
+
52
+ ```bash
53
+ # Module is imported where needed
54
+ grep -q "from.*auth/discord" src/routes/auth.ts
55
+
56
+ # Middleware is applied to routes
57
+ grep -q "requireAuth" src/routes/protected.ts
58
+
59
+ # Database is configured in app init
60
+ grep -q "prisma" src/app.ts
61
+
62
+ # Environment variables are referenced
63
+ grep -q "DISCORD_CLIENT_ID" src/auth/discord.ts
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Verification by Feature Type
69
+
70
+ ### API Endpoint
71
+
72
+ ```
73
+ Existence: curl returns non-404 status
74
+ Substance: curl returns expected response shape (correct fields)
75
+ Wiring: endpoint calls the right service, middleware is applied
76
+ ```
77
+
78
+ ### Database Schema
79
+
80
+ ```
81
+ Existence: table/collection exists, can query without error
82
+ Substance: columns/fields match specification, constraints are applied
83
+ Wiring: application code references the schema, migrations run cleanly
84
+ ```
85
+
86
+ ### Authentication
87
+
88
+ ```
89
+ Existence: auth routes exist, auth module exports functions
90
+ Substance: login flow returns token, invalid creds return error
91
+ Wiring: protected routes use auth middleware, tokens are validated
92
+ ```
93
+
94
+ ### UI Component
95
+
96
+ ```
97
+ Existence: component file exists, exports default component
98
+ Substance: component renders expected elements (test or visual check)
99
+ Wiring: component is imported in parent, receives correct props, routes to it
100
+ ```
101
+
102
+ ### Configuration
103
+
104
+ ```
105
+ Existence: config file exists, environment variables documented
106
+ Substance: config values are used (not dead code), defaults are sensible
107
+ Wiring: application reads config at startup, config changes take effect
108
+ ```
109
+
110
+ ---
111
+
112
+ ## Verify Command Patterns
113
+
114
+ ### TypeScript/JavaScript
115
+
116
+ ```bash
117
+ # Type checking
118
+ npx tsc --noEmit
119
+
120
+ # Unit tests
121
+ npm test
122
+ npm test -- --grep "pattern"
123
+ npx jest path/to/test
124
+
125
+ # Linting
126
+ npx eslint src/auth/
127
+
128
+ # Build check
129
+ npm run build
130
+ ```
131
+
132
+ ### Python
133
+
134
+ ```bash
135
+ # Type checking
136
+ mypy src/
137
+
138
+ # Unit tests
139
+ pytest tests/
140
+ pytest tests/test_auth.py -v
141
+ pytest -k "test_login"
142
+
143
+ # Linting
144
+ flake8 src/
145
+ pylint src/auth/
146
+ ```
147
+
148
+ ### General
149
+
150
+ ```bash
151
+ # File existence
152
+ ls -la path/to/file
153
+
154
+ # Content check
155
+ grep -q "pattern" path/to/file
156
+
157
+ # HTTP endpoint
158
+ curl -s -o /dev/null -w "%{http_code}" http://localhost:PORT/path
159
+
160
+ # Process running
161
+ pgrep -f "process-name"
162
+
163
+ # Port listening
164
+ netstat -an | grep LISTEN | grep PORT
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Done Condition Patterns
170
+
171
+ ### Good Done Conditions (Observable, Falsifiable)
172
+
173
+ - "User can log in with Discord and see their dashboard"
174
+ - "API returns paginated list of items with correct total count"
175
+ - "Database migration creates users table with all required columns"
176
+ - "Protected routes return 401 without valid JWT"
177
+ - "Build completes without TypeScript errors"
178
+
179
+ ### Bad Done Conditions (Vague, Not Falsifiable)
180
+
181
+ - "Authentication is implemented" (how do you test this?)
182
+ - "Code is clean" (subjective)
183
+ - "Database is set up" (what does "set up" mean?)
184
+ - "Tests pass" (which tests? what do they test?)
185
+ - "File was created" (created with what content?)
186
+
187
+ ### Transformation Rule
188
+
189
+ ```
190
+ Bad: "Authentication is implemented"
191
+ Good: "User can complete Discord OAuth flow and receive a valid JWT"
192
+
193
+ Bad: "Database is set up"
194
+ Good: "Users table exists with id, email, name columns and can accept INSERT"
195
+
196
+ Bad: "Tests pass"
197
+ Good: "All 5 auth middleware tests pass: valid token, expired token,
198
+ missing token, malformed token, and correct user extraction"
199
+ ```