@sienklogic/plan-build-run 2.34.0 → 2.38.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 (160) hide show
  1. package/CHANGELOG.md +683 -0
  2. package/dashboard/public/css/command-center.css +152 -65
  3. package/dashboard/public/css/explorer.css +22 -41
  4. package/dashboard/public/css/layout.css +119 -1
  5. package/dashboard/public/css/tokens.css +13 -0
  6. package/dashboard/src/components/Layout.tsx +32 -6
  7. package/dashboard/src/components/explorer/tabs/PhasesTab.tsx +11 -1
  8. package/dashboard/src/components/explorer/tabs/TodosTab.tsx +18 -2
  9. package/dashboard/src/components/partials/AttentionPanel.tsx +7 -1
  10. package/dashboard/src/components/partials/CurrentPhaseCard.tsx +26 -24
  11. package/dashboard/src/components/partials/QuickActions.tsx +21 -11
  12. package/dashboard/src/components/partials/StatCardGrid.tsx +67 -0
  13. package/dashboard/src/components/partials/StatusHeader.tsx +1 -0
  14. package/dashboard/src/routes/command-center.routes.tsx +8 -7
  15. package/dashboard/src/routes/index.routes.tsx +32 -29
  16. package/package.json +2 -2
  17. package/plugins/copilot-pbr/agents/audit.agent.md +129 -16
  18. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +49 -1
  19. package/plugins/copilot-pbr/agents/debugger.agent.md +50 -1
  20. package/plugins/copilot-pbr/agents/dev-sync.agent.md +23 -0
  21. package/plugins/copilot-pbr/agents/executor.agent.md +153 -8
  22. package/plugins/copilot-pbr/agents/general.agent.md +46 -1
  23. package/plugins/copilot-pbr/agents/integration-checker.agent.md +55 -2
  24. package/plugins/copilot-pbr/agents/plan-checker.agent.md +50 -2
  25. package/plugins/copilot-pbr/agents/planner.agent.md +80 -1
  26. package/plugins/copilot-pbr/agents/researcher.agent.md +50 -2
  27. package/plugins/copilot-pbr/agents/synthesizer.agent.md +49 -1
  28. package/plugins/copilot-pbr/agents/verifier.agent.md +114 -13
  29. package/plugins/copilot-pbr/commands/test.md +5 -0
  30. package/plugins/copilot-pbr/hooks/hooks.json +11 -0
  31. package/plugins/copilot-pbr/plugin.json +1 -1
  32. package/plugins/copilot-pbr/references/agent-contracts.md +27 -0
  33. package/plugins/copilot-pbr/references/checkpoints.md +32 -1
  34. package/plugins/copilot-pbr/references/context-quality-tiers.md +45 -0
  35. package/plugins/copilot-pbr/references/pbr-tools-cli.md +115 -0
  36. package/plugins/copilot-pbr/references/questioning.md +21 -1
  37. package/plugins/copilot-pbr/references/verification-patterns.md +96 -18
  38. package/plugins/copilot-pbr/skills/audit/SKILL.md +19 -3
  39. package/plugins/copilot-pbr/skills/begin/SKILL.md +57 -4
  40. package/plugins/copilot-pbr/skills/build/SKILL.md +39 -2
  41. package/plugins/copilot-pbr/skills/config/SKILL.md +12 -2
  42. package/plugins/copilot-pbr/skills/debug/SKILL.md +12 -1
  43. package/plugins/copilot-pbr/skills/explore/SKILL.md +13 -2
  44. package/plugins/copilot-pbr/skills/health/SKILL.md +13 -5
  45. package/plugins/copilot-pbr/skills/import/SKILL.md +26 -1
  46. package/plugins/copilot-pbr/skills/milestone/SKILL.md +15 -3
  47. package/plugins/copilot-pbr/skills/plan/SKILL.md +50 -0
  48. package/plugins/copilot-pbr/skills/quick/SKILL.md +21 -0
  49. package/plugins/copilot-pbr/skills/review/SKILL.md +45 -0
  50. package/plugins/copilot-pbr/skills/scan/SKILL.md +20 -0
  51. package/plugins/copilot-pbr/skills/setup/SKILL.md +9 -1
  52. package/plugins/copilot-pbr/skills/shared/context-budget.md +10 -0
  53. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +6 -0
  54. package/plugins/copilot-pbr/skills/test/SKILL.md +210 -0
  55. package/plugins/copilot-pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  56. package/plugins/copilot-pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
  57. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  58. package/plugins/cursor-pbr/agents/audit.md +52 -5
  59. package/plugins/cursor-pbr/agents/codebase-mapper.md +49 -1
  60. package/plugins/cursor-pbr/agents/debugger.md +50 -1
  61. package/plugins/cursor-pbr/agents/dev-sync.md +23 -0
  62. package/plugins/cursor-pbr/agents/executor.md +153 -8
  63. package/plugins/cursor-pbr/agents/general.md +46 -1
  64. package/plugins/cursor-pbr/agents/integration-checker.md +54 -1
  65. package/plugins/cursor-pbr/agents/plan-checker.md +49 -1
  66. package/plugins/cursor-pbr/agents/planner.md +80 -1
  67. package/plugins/cursor-pbr/agents/researcher.md +49 -1
  68. package/plugins/cursor-pbr/agents/synthesizer.md +49 -1
  69. package/plugins/cursor-pbr/agents/verifier.md +113 -12
  70. package/plugins/cursor-pbr/commands/test.md +5 -0
  71. package/plugins/cursor-pbr/hooks/hooks.json +9 -0
  72. package/plugins/cursor-pbr/references/agent-contracts.md +27 -0
  73. package/plugins/cursor-pbr/references/checkpoints.md +32 -1
  74. package/plugins/cursor-pbr/references/context-quality-tiers.md +45 -0
  75. package/plugins/cursor-pbr/references/pbr-tools-cli.md +115 -0
  76. package/plugins/cursor-pbr/references/questioning.md +21 -1
  77. package/plugins/cursor-pbr/references/verification-patterns.md +96 -18
  78. package/plugins/cursor-pbr/skills/audit/SKILL.md +19 -3
  79. package/plugins/cursor-pbr/skills/begin/SKILL.md +57 -4
  80. package/plugins/cursor-pbr/skills/build/SKILL.md +37 -2
  81. package/plugins/cursor-pbr/skills/config/SKILL.md +12 -2
  82. package/plugins/cursor-pbr/skills/debug/SKILL.md +12 -1
  83. package/plugins/cursor-pbr/skills/explore/SKILL.md +13 -2
  84. package/plugins/cursor-pbr/skills/health/SKILL.md +14 -5
  85. package/plugins/cursor-pbr/skills/import/SKILL.md +26 -1
  86. package/plugins/cursor-pbr/skills/milestone/SKILL.md +15 -3
  87. package/plugins/cursor-pbr/skills/plan/SKILL.md +50 -0
  88. package/plugins/cursor-pbr/skills/quick/SKILL.md +21 -0
  89. package/plugins/cursor-pbr/skills/review/SKILL.md +45 -0
  90. package/plugins/cursor-pbr/skills/scan/SKILL.md +20 -0
  91. package/plugins/cursor-pbr/skills/setup/SKILL.md +9 -1
  92. package/plugins/cursor-pbr/skills/shared/context-budget.md +10 -0
  93. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +6 -0
  94. package/plugins/cursor-pbr/skills/test/SKILL.md +211 -0
  95. package/plugins/cursor-pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  96. package/plugins/cursor-pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
  97. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  98. package/plugins/pbr/agents/audit.md +45 -0
  99. package/plugins/pbr/agents/codebase-mapper.md +48 -0
  100. package/plugins/pbr/agents/debugger.md +49 -0
  101. package/plugins/pbr/agents/dev-sync.md +23 -0
  102. package/plugins/pbr/agents/executor.md +151 -6
  103. package/plugins/pbr/agents/general.md +45 -0
  104. package/plugins/pbr/agents/integration-checker.md +53 -0
  105. package/plugins/pbr/agents/plan-checker.md +48 -0
  106. package/plugins/pbr/agents/planner.md +78 -1
  107. package/plugins/pbr/agents/researcher.md +48 -0
  108. package/plugins/pbr/agents/synthesizer.md +48 -0
  109. package/plugins/pbr/agents/verifier.md +112 -11
  110. package/plugins/pbr/commands/test.md +5 -0
  111. package/plugins/pbr/hooks/hooks.json +9 -0
  112. package/plugins/pbr/references/agent-contracts.md +27 -0
  113. package/plugins/pbr/references/checkpoints.md +32 -0
  114. package/plugins/pbr/references/context-quality-tiers.md +45 -0
  115. package/plugins/pbr/references/pbr-tools-cli.md +115 -0
  116. package/plugins/pbr/references/questioning.md +21 -0
  117. package/plugins/pbr/references/verification-patterns.md +96 -17
  118. package/plugins/pbr/scripts/check-plan-format.js +13 -1
  119. package/plugins/pbr/scripts/check-state-sync.js +26 -7
  120. package/plugins/pbr/scripts/check-subagent-output.js +30 -2
  121. package/plugins/pbr/scripts/config-schema.json +11 -1
  122. package/plugins/pbr/scripts/context-bridge.js +265 -0
  123. package/plugins/pbr/scripts/lib/config.js +271 -0
  124. package/plugins/pbr/scripts/lib/core.js +587 -0
  125. package/plugins/pbr/scripts/lib/history.js +73 -0
  126. package/plugins/pbr/scripts/lib/init.js +166 -0
  127. package/plugins/pbr/scripts/lib/migrate.js +169 -0
  128. package/plugins/pbr/scripts/lib/phase.js +364 -0
  129. package/plugins/pbr/scripts/lib/roadmap.js +175 -0
  130. package/plugins/pbr/scripts/lib/state.js +397 -0
  131. package/plugins/pbr/scripts/lib/todo.js +300 -0
  132. package/plugins/pbr/scripts/pbr-tools.js +425 -1310
  133. package/plugins/pbr/scripts/post-write-dispatch.js +5 -4
  134. package/plugins/pbr/scripts/pre-write-dispatch.js +1 -1
  135. package/plugins/pbr/scripts/progress-tracker.js +1 -1
  136. package/plugins/pbr/scripts/suggest-compact.js +1 -1
  137. package/plugins/pbr/scripts/track-context-budget.js +53 -2
  138. package/plugins/pbr/scripts/validate-task.js +20 -28
  139. package/plugins/pbr/skills/audit/SKILL.md +19 -3
  140. package/plugins/pbr/skills/begin/SKILL.md +48 -2
  141. package/plugins/pbr/skills/build/SKILL.md +39 -2
  142. package/plugins/pbr/skills/config/SKILL.md +12 -2
  143. package/plugins/pbr/skills/debug/SKILL.md +12 -1
  144. package/plugins/pbr/skills/debug/templates/continuation-prompt.md.tmpl +12 -1
  145. package/plugins/pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +12 -5
  146. package/plugins/pbr/skills/explore/SKILL.md +13 -2
  147. package/plugins/pbr/skills/health/SKILL.md +14 -3
  148. package/plugins/pbr/skills/help/SKILL.md +2 -0
  149. package/plugins/pbr/skills/import/SKILL.md +26 -1
  150. package/plugins/pbr/skills/milestone/SKILL.md +15 -3
  151. package/plugins/pbr/skills/plan/SKILL.md +52 -2
  152. package/plugins/pbr/skills/quick/SKILL.md +21 -0
  153. package/plugins/pbr/skills/review/SKILL.md +46 -0
  154. package/plugins/pbr/skills/scan/SKILL.md +20 -0
  155. package/plugins/pbr/skills/setup/SKILL.md +9 -1
  156. package/plugins/pbr/skills/shared/context-budget.md +10 -0
  157. package/plugins/pbr/skills/shared/universal-anti-patterns.md +6 -0
  158. package/plugins/pbr/skills/test/SKILL.md +212 -0
  159. package/plugins/pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  160. package/plugins/pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
@@ -5,6 +5,14 @@ model: sonnet
5
5
  readonly: true
6
6
  ---
7
7
 
8
+ <files_to_read>
9
+ CRITICAL: If your spawn prompt contains a files_to_read block,
10
+ you MUST Read every listed file BEFORE any other action.
11
+ Skipping this causes hallucinated context and broken output.
12
+ </files_to_read>
13
+
14
+ > Default files: all PLAN files (must-haves), SUMMARY files, prior VERIFICATION.md
15
+
8
16
  # Plan-Build-Run Verifier
9
17
 
10
18
  You are **verifier**, the phase verification agent for the Plan-Build-Run development system. You verify that executed plans actually achieved their stated goals by inspecting the real codebase. You are the quality gate between execution and phase completion.
@@ -13,6 +21,8 @@ You are **verifier**, the phase verification agent for the Plan-Build-Run develo
13
21
 
14
22
  **Task completion does NOT equal goal achievement.** You verify the GOAL, not the tasks. You check the CODEBASE, not the SUMMARY.md claims. Trust nothing — verify everything.
15
23
 
24
+ <critical_rules>
25
+
16
26
  ## Critical Constraints
17
27
 
18
28
  ### Read-Only Agent
@@ -29,6 +39,8 @@ Every claim must be backed by evidence. "I checked and it exists" is not evidenc
29
39
 
30
40
  When validating SUMMARY.md and VERIFICATION.md outputs, read `references/agent-contracts.md` to confirm output schemas match their contract definitions. Check required fields, format constraints, and status enums.
31
41
 
42
+ </critical_rules>
43
+
32
44
  ## The 10-Step Verification Process
33
45
 
34
46
  ### Step 1: Check Previous Verification (Always)
@@ -85,16 +97,30 @@ Check for stub indicators: TODO/FIXME comments, empty function bodies, trivial r
85
97
  #### Level 3: Wired (Connected to the System)
86
98
  Verify the artifact is imported AND used by other parts of the system (functions called, components rendered, middleware applied, routes registered). Result: `WIRED`, `IMPORTED-UNUSED`, or `ORPHANED`.
87
99
 
100
+ #### Level 4: Functional (Actually Works)
101
+ Run the artifact and verify it produces correct results. This goes beyond structural checks (L1-L3) to behavioral verification. Result: `FUNCTIONAL`, `RUNTIME_ERROR`, or `LOGIC_ERROR`.
102
+
103
+ **When to apply L4:** Only for must-haves that have automated verification commands (test suites, build scripts, API endpoints). Skip L4 for items that require manual/visual testing — those go to the Human Verification section instead.
104
+
105
+ **L4 checks:**
106
+ - Tests pass: `npm test`, `pytest`, or the project's test command
107
+ - Build succeeds: `npm run build`, `tsc --noEmit`, or equivalent
108
+ - API responds correctly: endpoint returns expected shape and status codes
109
+ - CLI produces expected output: command-line tools return correct exit codes and output
110
+
88
111
  #### Artifact Outcome Decision Table
89
112
 
90
- | Exists | Substantive | Wired | Status |
91
- |--------|-------------|-------|--------|
92
- | No | -- | -- | MISSING |
93
- | Yes | No | -- | STUB |
94
- | Yes | Yes | No | UNWIRED |
95
- | Yes | Yes | Yes | PASSED |
113
+ | Exists | Substantive | Wired | Functional | Status |
114
+ |--------|-------------|-------|------------|--------|
115
+ | No | -- | -- | -- | MISSING |
116
+ | Yes | No | -- | -- | STUB |
117
+ | Yes | Yes | No | -- | UNWIRED |
118
+ | Yes | Yes | Yes | No | BROKEN |
119
+ | Yes | Yes | Yes | Yes | PASSED |
96
120
 
97
121
  > **Note:** WIRED status (Level 3) requires correct arguments, not just correct function names. A call that passes `undefined` for a parameter available in scope is `ARGS_WRONG`, not `WIRED`.
122
+ >
123
+ > **Note:** FUNCTIONAL status (Level 4) is optional — only applied when automated verification is available. Artifacts that pass L1-L3 but have no automated test are reported as `PASSED (L3 only)` with a note in Human Verification.
98
124
 
99
125
  ### Step 6: Verify Key Links (Always)
100
126
 
@@ -122,13 +148,15 @@ Beyond verifying that calls exist, spot-check that **arguments passed to cross-b
122
148
  Cross-reference all must-haves against verification results in a table:
123
149
 
124
150
  ```markdown
125
- | # | Must-Have | Type | L1 (Exists) | L2 (Substantive) | L3 (Wired) | Status |
126
- |---|----------|------|-------------|-------------------|------------|--------|
127
- | 1 | {description} | truth | - | - | - | VERIFIED/FAILED |
128
- | 2 | {description} | artifact | YES/NO | YES/STUB/PARTIAL | WIRED/ORPHANED/ARGS_WRONG | PASS/FAIL |
129
- | 3 | {description} | key_link | - | - | YES/NO/ARGS_WRONG | PASS/FAIL |
151
+ | # | Must-Have | Type | L1 (Exists) | L2 (Substantive) | L3 (Wired) | L4 (Functional) | Status |
152
+ |---|----------|------|-------------|-------------------|------------|-----------------|--------|
153
+ | 1 | {description} | truth | - | - | - | - | VERIFIED/FAILED |
154
+ | 2 | {description} | artifact | YES/NO | YES/STUB/PARTIAL | WIRED/ORPHANED | FUNCTIONAL/BROKEN/- | PASS/FAIL |
155
+ | 3 | {description} | key_link | - | - | YES/NO/ARGS_WRONG | - | PASS/FAIL |
130
156
  ```
131
157
 
158
+ L4 column shows `-` when no automated verification is available. Only artifacts with test commands or build verification get L4 checks.
159
+
132
160
  ### Step 8: Scan for Anti-Patterns (Full Verification Only)
133
161
 
134
162
  Scan for: dead code/unused imports, console.log in production code, hardcoded secrets, TODO/FIXME comments (should be in deferred), disabled/skipped tests, empty catch blocks, committed .env files. Report blockers only.
@@ -206,6 +234,62 @@ Output includes `is_re_verification: true` in frontmatter and a regressions sect
206
234
 
207
235
  Read `references/stub-patterns.md` for stub detection patterns by technology. Read the project's stack from `.planning/codebase/STACK.md` or `.planning/research/STACK.md` to determine which patterns to apply. If no stack file exists, use universal patterns only.
208
236
 
237
+ <stub_detection_patterns>
238
+ ## Stub Detection Patterns
239
+
240
+ When checking if code is "substantive" (not a stub/placeholder), scan for these patterns:
241
+
242
+ **Universal stubs:**
243
+ - `return null`, `return undefined`, `return {}`, `return []`
244
+ - `TODO`, `FIXME`, `HACK`, `XXX` comments
245
+ - Empty function bodies: `function foo() {}`
246
+ - `throw new Error('Not implemented')`
247
+ - `console.log('placeholder')`
248
+
249
+ **React/JSX stubs:**
250
+ - `<div>ComponentName</div>` (render-only placeholder)
251
+ - `onClick={() => {}}` (empty event handler)
252
+ - `useState()` value never referenced in JSX
253
+ - Component returns only static text with no props usage
254
+
255
+ **API stubs:**
256
+ - `res.json({ message: 'Not implemented' })`
257
+ - `res.status(501)` or `res.status(200).json({})`
258
+ - Empty middleware: `(req, res, next) => next()`
259
+ - Route handler with no database/service calls
260
+
261
+ **Data flow stubs:**
262
+ - `fetch()` with no `await` or `.then()` — result discarded
263
+ - `useState()` setter never called
264
+ - Props received but never used in render
265
+ - Event handler that only calls `preventDefault()`
266
+
267
+ Mark any file containing 2+ stub patterns as "STUB — not substantive".
268
+ </stub_detection_patterns>
269
+
270
+ ---
271
+
272
+ <success_criteria>
273
+ - [ ] Previous VERIFICATION.md checked
274
+ - [ ] Must-haves established from plan frontmatter
275
+ - [ ] All truths verified with status and evidence
276
+ - [ ] All artifacts checked at 3-4 levels (exists, substantive, wired, functional when testable)
277
+ - [ ] All key links verified including argument values
278
+ - [ ] Anti-patterns scanned and categorized
279
+ - [ ] Overall status determined
280
+ - [ ] VERIFICATION.md created with complete report
281
+ </success_criteria>
282
+
283
+ ---
284
+
285
+ ## Completion Protocol
286
+
287
+ CRITICAL: Your final output MUST end with exactly one completion marker.
288
+ Orchestrators pattern-match on these markers to route results. Omitting causes silent failures.
289
+
290
+ - `## VERIFICATION COMPLETE` - VERIFICATION.md written (status in frontmatter)
291
+ - `## VERIFICATION FAILED` - could not complete verification (missing phase dir, no must-haves to check)
292
+
209
293
  ---
210
294
 
211
295
  ## Budget Management
@@ -216,6 +300,19 @@ Read `references/stub-patterns.md` for stub detection patterns by technology. Re
216
300
 
217
301
  ---
218
302
 
303
+ ### Context Quality Tiers
304
+
305
+ | Budget Used | Tier | Behavior |
306
+ |------------|------|----------|
307
+ | 0-30% | PEAK | Explore freely, read broadly |
308
+ | 30-50% | GOOD | Be selective with reads |
309
+ | 50-70% | DEGRADING | Write incrementally, skip non-essential |
310
+ | 70%+ | POOR | Finish current task and return immediately |
311
+
312
+ ---
313
+
314
+ <anti_patterns>
315
+
219
316
  ## Anti-Patterns
220
317
 
221
318
  ### Universal Anti-Patterns
@@ -230,7 +327,7 @@ Read `references/stub-patterns.md` for stub detection patterns by technology. Re
230
327
  9. DO NOT contradict locked decisions in CONTEXT.md
231
328
  10. DO NOT implement deferred ideas from CONTEXT.md
232
329
  11. DO NOT consume more than 50% context before producing output — write incrementally
233
- 12. DO NOT read agent .md files from agents/ — they're auto-loaded via subagent_type
330
+ 12. DO NOT read agent .md files from agents/ — they're auto-loaded via agent:
234
331
 
235
332
  ### Verifier-Specific Anti-Patterns
236
333
  1. DO NOT trust SUMMARY.md claims without verifying the actual codebase
@@ -245,3 +342,7 @@ Read `references/stub-patterns.md` for stub detection patterns by technology. Re
245
342
  10. DO NOT count deferred items as gaps — they are intentionally not implemented
246
343
  11. DO NOT be lenient — your job is to find problems, not to be encouraging
247
344
  12. DO NOT mark a call as WIRED if it passes hardcoded `undefined`/`null` for parameters that have a known source in scope — check arguments, not just function names
345
+
346
+ </anti_patterns>
347
+
348
+ ---
@@ -0,0 +1,5 @@
1
+ ---
2
+ description: "Generate tests for completed phase code. Detects test framework and targets key files."
3
+ ---
4
+
5
+ This command is provided by the `pbr:test` skill.
@@ -63,6 +63,15 @@
63
63
  "statusMessage": "Tracking context budget..."
64
64
  }
65
65
  ]
66
+ },
67
+ {
68
+ "hooks": [
69
+ {
70
+ "type": "command",
71
+ "command": "node -e \"var r=process.env.CLAUDE_PLUGIN_ROOT||'',m=r.match(/^\\/([a-zA-Z])\\/(.*)/);if(m)r=m[1]+String.fromCharCode(58)+String.fromCharCode(92)+m[2];require(require('path').resolve(r,'..','pbr','scripts','run-hook.js'))\" context-bridge.js",
72
+ "statusMessage": "Updating context monitor..."
73
+ }
74
+ ]
66
75
  }
67
76
  ],
68
77
  "PostToolUseFailure": [
@@ -295,3 +295,30 @@ No YAML frontmatter required — these are reference documents with markdown tab
295
295
  - Codebase-Mapper does NOT commit — the orchestrator handles commits
296
296
  - Researcher treats these as S0 (highest confidence) local prior research
297
297
  - One focus area per invocation
298
+
299
+ ---
300
+
301
+ ## Completion Markers
302
+
303
+ Every agent MUST end its output with exactly one completion marker. Orchestrating skills pattern-match on these markers to route results. Omitting a marker causes silent routing failures.
304
+
305
+ | Agent | Markers |
306
+ |-------|---------|
307
+ | executor | `## PLAN COMPLETE` / `## PLAN FAILED` / `## CHECKPOINT: {TYPE}` |
308
+ | planner | `## PLANNING COMPLETE` / `## PLANNING FAILED` / `## PLANNING INCONCLUSIVE` |
309
+ | verifier | `## VERIFICATION COMPLETE` (status in VERIFICATION.md frontmatter) |
310
+ | researcher | `## RESEARCH COMPLETE` / `## RESEARCH BLOCKED` |
311
+ | synthesizer | `## SYNTHESIS COMPLETE` / `## SYNTHESIS BLOCKED` |
312
+ | plan-checker | `## CHECK PASSED` / `## ISSUES FOUND` |
313
+ | debugger | `## DEBUG COMPLETE` / `## ROOT CAUSE FOUND` / `## DEBUG SESSION PAUSED` |
314
+ | codebase-mapper | `## MAPPING COMPLETE` |
315
+ | integration-checker | `## INTEGRATION CHECK COMPLETE` |
316
+ | general | `## TASK COMPLETE` / `## TASK FAILED` |
317
+ | audit | `## AUDIT COMPLETE` |
318
+
319
+ ### Rules
320
+
321
+ - Exactly ONE marker per agent invocation — never zero, never multiple
322
+ - Marker must be the LAST heading in output (content may follow on same line)
323
+ - Skills check for markers with regex: `/^## (PLAN COMPLETE|PLAN FAILED|CHECKPOINT)/m`
324
+ - If an agent cannot determine outcome, use the FAILED/BLOCKED variant with explanation
@@ -1,4 +1,3 @@
1
- <!-- canonical: ../../pbr/references/checkpoints.md -->
2
1
  # Checkpoints Reference
3
2
 
4
3
  How Plan-Build-Run uses checkpoint tasks to pause execution and involve the human.
@@ -156,3 +155,35 @@ When creating plans that include checkpoints:
156
155
  4. **Provide clear instructions** — the `<action>` and `<verify>` elements should give the human everything they need
157
156
  5. **Consider autonomous alternatives** — if a task CAN be verified automatically, prefer `type="auto"` with a robust `<verify>` command
158
157
  6. **Set `autonomous: false`** in the plan frontmatter when any task is a checkpoint
158
+
159
+ ---
160
+
161
+ ## Automation-First Philosophy
162
+
163
+ ### 5 Golden Rules
164
+ 1. If Claude CAN run it, Claude MUST run it
165
+ 2. If Claude CAN verify it, Claude MUST verify it
166
+ 3. Only checkpoint for things requiring human senses or credentials
167
+ 4. Group manual actions to minimize checkpoint count
168
+ 5. Never ask the user to do something automatable
169
+
170
+ ### Automatable Quick Reference
171
+
172
+ | Action | Automatable? | Notes |
173
+ |--------|-------------|-------|
174
+ | Run tests | YES | `npm test`, `pytest`, etc. |
175
+ | Start dev server | YES | `npm run dev` (check port) |
176
+ | Check environment variables | YES | `env \| grep KEY` |
177
+ | Build project | YES | `npm run build` |
178
+ | Run linting | YES | `npm run lint` |
179
+ | Database migrations | YES | CLI commands |
180
+ | Click email verification link | NO | Requires browser + inbox |
181
+ | 3DS payment verification | NO | Requires card + phone |
182
+ | OAuth consent screen | NO | Requires browser interaction |
183
+ | Hardware token/YubiKey | NO | Physical device |
184
+
185
+ ### Anti-Patterns
186
+ - Asking user to "start the dev server" — just run it
187
+ - Asking user to "check if tests pass" — run `npm test`
188
+ - Saying "please verify the output" without running verification commands first
189
+ - Creating a checkpoint for `mkdir` or `npm install`
@@ -0,0 +1,45 @@
1
+ # Context Quality Tiers
2
+
3
+ Behavioral guidance for agents based on context window utilization.
4
+
5
+ ## Tier Definitions
6
+
7
+ | Tier | Context Used | Quality | Guidance |
8
+ |------|-------------|---------|----------|
9
+ | PEAK | 0-30% | Full capacity | Explore freely, read broadly, take time to understand |
10
+ | GOOD | 30-50% | High capacity | Be selective with reads, skip non-essential exploration |
11
+ | DEGRADING | 50-70% | Declining capacity | Write incrementally, finish current task, skip nice-to-haves |
12
+ | POOR | 70%+ | Critical | Finish current task IMMEDIATELY and return. No new reads. |
13
+
14
+ ## Behavioral Rules Per Tier
15
+
16
+ ### PEAK (0-30%)
17
+ - Read all relevant files before making changes
18
+ - Explore adjacent code for patterns and conventions
19
+ - Write comprehensive commit messages
20
+ - Full self-check protocols
21
+
22
+ ### GOOD (30-50%)
23
+ - Read only files directly relevant to current task
24
+ - Skip exploratory reads of "nice to have" context
25
+ - Standard commit messages
26
+ - Standard self-check
27
+
28
+ ### DEGRADING (50-70%)
29
+ - Write changes incrementally (don't accumulate large diffs)
30
+ - Skip optional verification steps
31
+ - Brief commit messages
32
+ - Abbreviated self-check (key_files only)
33
+
34
+ ### POOR (70%+)
35
+ - STOP exploring. Finish the current task only.
36
+ - Write SUMMARY.md immediately if executor
37
+ - Return completion marker immediately
38
+ - Do NOT start new tasks or reads
39
+
40
+ ## Agent-Specific Overrides
41
+
42
+ - **Researcher**: At DEGRADING, write findings immediately rather than accumulating
43
+ - **Executor**: At DEGRADING, complete current task then return CHECKPOINT
44
+ - **Verifier**: At DEGRADING, check existence only (skip substantiveness/wiring layers)
45
+ - **Planner**: At GOOD, reduce task detail level; at DEGRADING, finish current plan file only
@@ -283,3 +283,118 @@ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js event error hook-failure '{"scri
283
283
  **Output:** `{ "logged": true, "category": "build", "event": "plan-complete" }`
284
284
 
285
285
  If the JSON-details argument is not valid JSON, it's stored as `{ "raw": "<the string>" }`.
286
+
287
+ ---
288
+
289
+ ## Compound Init Commands
290
+
291
+ Compound commands that compose multiple data sources into a single JSON response.
292
+ Replace multi-step context loading in skills with a single CLI call.
293
+
294
+ ### `init execute-phase <phase>`
295
+
296
+ Everything an executor needs to start building a phase.
297
+
298
+ ```bash
299
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init execute-phase 3
300
+ ```
301
+
302
+ **Output:**
303
+ ```json
304
+ {
305
+ "executor_model": "sonnet",
306
+ "verifier_model": "sonnet",
307
+ "config": { "depth": "standard", "mode": "interactive", "parallelization": {}, "planning": {}, "gates": {}, "features": {} },
308
+ "phase": { "num": "3", "dir": "03-auth", "name": "auth", "goal": "...", "has_context": false, "status": "planned", "plan_count": 2, "completed": 0 },
309
+ "plans": [{ "file": "PLAN-01.md", "plan_id": "01", "wave": 1, "autonomous": true, "has_summary": false, "must_haves_count": 4, "depends_on": [] }],
310
+ "waves": { "wave_1": ["01", "02"] },
311
+ "branch_name": "main",
312
+ "git_clean": true
313
+ }
314
+ ```
315
+
316
+ ### `init plan-phase <phase>`
317
+
318
+ Everything a planner needs to start phase planning.
319
+
320
+ ```bash
321
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init plan-phase 3
322
+ ```
323
+
324
+ **Output:** `researcher_model`, `planner_model`, `checker_model`, `config` (depth profile, features, planning settings), `phase` (num, dir, goal, depends_on), `existing_artifacts`, `workflow` flags.
325
+
326
+ ### `init quick <description>`
327
+
328
+ Everything the quick skill needs: next task number, slug, directory path.
329
+
330
+ ```bash
331
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init quick "add search feature"
332
+ ```
333
+
334
+ **Output:** `next_task_number`, `slug`, `dir`, `dir_name`, `timestamp`, `config` subset.
335
+
336
+ ### `init verify-work <phase>`
337
+
338
+ Everything a verifier needs to start verification.
339
+
340
+ ```bash
341
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init verify-work 3
342
+ ```
343
+
344
+ **Output:** `verifier_model`, `phase` info, `has_verification`, `prior_attempts`, `prior_status`, `summaries`.
345
+
346
+ ### `init resume`
347
+
348
+ Detect interrupted state and suggest continuation.
349
+
350
+ ```bash
351
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init resume
352
+ ```
353
+
354
+ **Output:** `state`, `auto_next`, `continue_here`, `active_skill`, `current_phase`, `progress`.
355
+
356
+ ### `init progress`
357
+
358
+ All phases with status and completion data.
359
+
360
+ ```bash
361
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init progress
362
+ ```
363
+
364
+ **Output:** `current_phase`, `total_phases`, `status`, `phases` array, `total_plans`, `completed_plans`, `percentage`.
365
+
366
+ ---
367
+
368
+ ## State Mutation Extensions
369
+
370
+ ### `state patch <JSON>`
371
+
372
+ Multi-field atomic STATE.md update. Updates all fields in a single pass.
373
+
374
+ ```bash
375
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state patch '{"status":"executing","last_activity":"now"}'
376
+ ```
377
+
378
+ **Valid fields:** `current_phase`, `status`, `plans_complete`, `last_activity`, `progress_percent`, `phase_slug`, `total_phases`, `last_command`, `blockers`
379
+
380
+ **Output:** `{ "success": true, "updated": ["status", "last_activity"] }`
381
+
382
+ ### `state advance-plan`
383
+
384
+ Increment current plan number in STATE.md and update progress percentage.
385
+
386
+ ```bash
387
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state advance-plan
388
+ ```
389
+
390
+ **Output:** `{ "success": true, "previous_plan": 1, "current_plan": 2, "total_plans": 5, "progress_percent": 40 }`
391
+
392
+ ### `state record-metric [--duration Nm] [--plans-completed N]`
393
+
394
+ Record session/execution metrics. Appends to HISTORY.md and updates last_activity.
395
+
396
+ ```bash
397
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state record-metric --duration 15m --plans-completed 3
398
+ ```
399
+
400
+ **Output:** `{ "success": true, "duration_minutes": 15, "plans_completed": 3 }`
@@ -1,4 +1,3 @@
1
- <!-- canonical: ../../pbr/references/questioning.md -->
2
1
  # Deep Questioning Guide
3
2
 
4
3
  Techniques for understanding a user's project vision during `/pbr:begin`. The goal is to build a complete mental model of what needs to be built, not just a feature list.
@@ -213,3 +212,24 @@ See **[skills/shared/domain-probes.md](../shared/domain-probes.md)** for technol
213
212
  9. **DO NOT** lead the user toward a particular solution
214
213
  10. **DO NOT** forget to summarize and confirm understanding
215
214
  11. **DO NOT** ask what you already know — track what the user has stated and never re-ask it. If they said "I'm using React", do not later ask "Are you using a frontend framework?" If they said "PostgreSQL", do not ask "What database are you using?" Redundant questions waste exchanges and erode trust. Instead, build on what you know: "You mentioned React — are you using Next.js or plain CRA?"
215
+
216
+ ---
217
+
218
+ ## Dream Extraction Philosophy
219
+
220
+ The goal of questioning is not to gather requirements — it's to extract the user's dream and make it buildable.
221
+
222
+ ### 4-Item Context Checklist
223
+ Before planning can begin, you must know:
224
+ 1. **What** are we building? (concrete deliverable, not abstract concept)
225
+ 2. **Why** does it exist? (the problem it solves, not the tech it uses)
226
+ 3. **Who** is it for? (specific users, not "everyone")
227
+ 4. **What does done look like?** (observable outcomes, not technical milestones)
228
+
229
+ ### Conversation Rules
230
+ - **Start open**: "Tell me about what you want to build"
231
+ - **Follow energy**: When they light up about something, dig deeper there
232
+ - **Challenge vagueness**: "You said 'user-friendly' — what does that mean specifically?"
233
+ - **Know when to stop**: When you have the 4 items above, move to planning
234
+ - **NEVER ask about technical experience**: It's irrelevant and condescending
235
+ - **NEVER present a menu of options**: Open questions reveal more than multiple choice
@@ -1,13 +1,12 @@
1
- <!-- canonical: ../../pbr/references/verification-patterns.md -->
2
1
  # Goal-Backward Verification Patterns
3
2
 
4
3
  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
4
 
6
5
  ---
7
6
 
8
- ## The Three-Layer Check
7
+ ## The Four-Layer Check
9
8
 
10
- Every must-have is verified through three layers, checked in order:
9
+ Every must-have is verified through up to four layers, checked in order:
11
10
 
12
11
  ### Layer 1: Existence
13
12
 
@@ -63,6 +62,28 @@ grep -q "prisma" src/app.ts
63
62
  grep -q "DISCORD_CLIENT_ID" src/auth/discord.ts
64
63
  ```
65
64
 
65
+ ### Layer 4: Functional
66
+
67
+ Does the artifact actually work when executed?
68
+
69
+ ```bash
70
+ # Tests pass
71
+ npm test -- --testPathPattern auth
72
+ pytest tests/test_auth.py -v
73
+
74
+ # Build succeeds
75
+ npm run build
76
+ npx tsc --noEmit
77
+
78
+ # API returns correct data
79
+ curl -s http://localhost:3000/api/auth/login -X POST -d '{"code":"test"}' | jq '.token'
80
+
81
+ # CLI produces expected output
82
+ node src/cli.js --help | grep -q "Usage:"
83
+ ```
84
+
85
+ **When to apply L4:** Only when automated verification commands exist (test suites, build scripts, API endpoints with test data). Skip for items requiring manual/visual testing. L4 is optional — artifacts passing L1-L3 without available automated tests are reported as `PASSED (L3 only)`.
86
+
66
87
  ---
67
88
 
68
89
  ## Verification by Feature Type
@@ -70,41 +91,46 @@ grep -q "DISCORD_CLIENT_ID" src/auth/discord.ts
70
91
  ### API Endpoint
71
92
 
72
93
  ```
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
94
+ Existence: curl returns non-404 status
95
+ Substance: curl returns expected response shape (correct fields)
96
+ Wiring: endpoint calls the right service, middleware is applied
97
+ Functional: POST/GET with test data returns correct response, error cases handled
76
98
  ```
77
99
 
78
100
  ### Database Schema
79
101
 
80
102
  ```
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
103
+ Existence: table/collection exists, can query without error
104
+ Substance: columns/fields match specification, constraints are applied
105
+ Wiring: application code references the schema, migrations run cleanly
106
+ Functional: CRUD operations work end-to-end, constraints reject invalid data
84
107
  ```
85
108
 
86
109
  ### Authentication
87
110
 
88
111
  ```
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
112
+ Existence: auth routes exist, auth module exports functions
113
+ Substance: login flow returns token, invalid creds return error
114
+ Wiring: protected routes use auth middleware, tokens are validated
115
+ Functional: auth tests pass (valid token, expired token, missing token, malformed token)
92
116
  ```
93
117
 
94
118
  ### UI Component
95
119
 
96
120
  ```
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
121
+ Existence: component file exists, exports default component
122
+ Substance: component renders expected elements (test or visual check)
123
+ Wiring: component is imported in parent, receives correct props, routes to it
124
+ Functional: component tests pass, build succeeds with component included
100
125
  ```
101
126
 
102
127
  ### Configuration
103
128
 
104
129
  ```
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
130
+ Existence: config file exists, environment variables documented
131
+ Substance: config values are used (not dead code), defaults are sensible
132
+ Wiring: application reads config at startup, config changes take effect
133
+ Functional: app starts with config, missing config produces clear error message
108
134
  ```
109
135
 
110
136
  ---
@@ -197,3 +223,55 @@ Bad: "Tests pass"
197
223
  Good: "All 5 auth middleware tests pass: valid token, expired token,
198
224
  missing token, malformed token, and correct user extraction"
199
225
  ```
226
+
227
+ ---
228
+
229
+ ## Wiring Verification Patterns
230
+
231
+ 4 concrete patterns for verifying components are actually connected, not just present.
232
+
233
+ ### Pattern 1: Component to API
234
+ 1. Find the fetch/axios call in the component
235
+ 2. Verify the call is NOT commented out
236
+ 3. Verify the response is assigned to state (not discarded)
237
+ 4. Verify error handling exists (try/catch or .catch)
238
+
239
+ ### Pattern 2: API to Database
240
+ 1. Find the database query in the route handler
241
+ 2. Verify `await` is present (not fire-and-forget)
242
+ 3. Verify the result is returned in the response (not discarded)
243
+ 4. Verify error cases return appropriate HTTP status codes
244
+
245
+ ### Pattern 3: Form to Handler
246
+ 1. Find the form's onSubmit handler
247
+ 2. Verify it calls an API function (not just preventDefault)
248
+ 3. Verify form validation runs before the API call
249
+ 4. Verify success/error feedback is shown to the user
250
+
251
+ ### Pattern 4: State to Render
252
+ 1. Find state variables (useState, store, etc.)
253
+ 2. Verify they appear in JSX/template via .map(), interpolation, or conditional rendering
254
+ 3. Verify loading/error states are rendered (not just success state)
255
+ 4. Verify empty state is handled (not just "no data" crash)
256
+
257
+ ### Quick Verification Checklists
258
+
259
+ **Component Checklist (8 items):**
260
+ - [ ] Component file exists and exports correctly
261
+ - [ ] Props/types are defined (not `any`)
262
+ - [ ] API calls use actual endpoints (not hardcoded data)
263
+ - [ ] Loading state renders something meaningful
264
+ - [ ] Error state renders something meaningful
265
+ - [ ] Empty state renders something meaningful
266
+ - [ ] User interactions trigger actual handlers
267
+ - [ ] Component is imported and rendered in parent
268
+
269
+ **API Route Checklist (8 items):**
270
+ - [ ] Route file exists and exports handler
271
+ - [ ] Route is registered in router/app
272
+ - [ ] Request validation exists (body, params, query)
273
+ - [ ] Database query uses parameterized inputs
274
+ - [ ] Success response includes expected data shape
275
+ - [ ] Error response includes status code and message
276
+ - [ ] Authentication/authorization check exists if needed
277
+ - [ ] Response matches what the frontend expects