@sienklogic/plan-build-run 2.4.0 → 2.5.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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,27 @@ All notable changes to Plan-Build-Run will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.5.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.4.1...plan-build-run-v2.5.0) (2026-02-19)
9
+
10
+
11
+ ### Features
12
+
13
+ * **tools:** auto-close satisfied pending todos after quick task and build completion ([e1f8034](https://github.com/SienkLogic/plan-build-run/commit/e1f80349ca5b646ee1380014dec24dfdc0d3f800))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **tools:** add --repo flag to gh pr merge in release workflow ([4923c81](https://github.com/SienkLogic/plan-build-run/commit/4923c811244092a322c331c7f10dcb0f855a8177))
19
+ * **tools:** add milestone routing to explore skill completion ([57c3d9d](https://github.com/SienkLogic/plan-build-run/commit/57c3d9daea154b4bfb9ebe69ad1a09a8c617412d))
20
+ * **tools:** enforce quick task directory creation with CRITICAL markers and hook validation ([c7d61ba](https://github.com/SienkLogic/plan-build-run/commit/c7d61ba333423a228d930ccd6e7d63688f8cbb58))
21
+
22
+ ## [2.4.1](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.4.0...plan-build-run-v2.4.1) (2026-02-19)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * **tools:** add pull_request trigger to CI so branch protection checks pass ([6e7ada4](https://github.com/SienkLogic/plan-build-run/commit/6e7ada4cf1e24e05ddace4706d7ddee527bde81a))
28
+
8
29
  ## [2.4.0](https://github.com/SienkLogic/plan-build-run/compare/plan-build-run-v2.3.1...plan-build-run-v2.4.0) (2026-02-19)
9
30
 
10
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sienklogic/plan-build-run",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Plan it, Build it, Run it — structured development workflow for Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pbr",
3
3
  "displayName": "Plan-Build-Run",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "description": "Plan-Build-Run — Structured development workflow for GitHub Copilot CLI. Solves context rot through disciplined agent delegation, structured planning, atomic execution, and goal-backward verification.",
6
6
  "author": {
7
7
  "name": "SienkLogic",
@@ -3,9 +3,11 @@ name: build
3
3
  description: "Execute all plans in a phase. Spawns agents to build in parallel, commits atomically."
4
4
  ---
5
5
 
6
+ **STOP — DO 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.**
7
+
6
8
  # /pbr:build — Phase Execution
7
9
 
8
- You are the orchestrator for `/pbr:build`. This skill executes all plans in a phase by invoking executor agents. Plans are grouped by wave and executed in order — independent plans run in parallel, dependent plans wait. Your job is to stay lean, delegate ALL building work to agents, and keep the user's main context window clean.
10
+ You are the orchestrator for `/pbr:build`. This skill executes all plans in a phase by spawning executor agents. Plans are grouped by wave and executed in order — independent plans run in parallel, dependent plans wait. Your job is to stay lean, delegate ALL building work to Task() agents, and keep the user's main context window clean.
9
11
 
10
12
  ## Context Budget
11
13
 
@@ -68,7 +70,7 @@ Reference: `skills/shared/config-loading.md` for the tooling shortcut and config
68
70
  - Prior phase dependencies are met (check for SUMMARY.md files in dependency phases)
69
71
  6. If no phase number given, read current phase from `.planning/STATE.md`
70
72
  - `config.models.complexity_map` — adaptive model mapping (default: `{ simple: "haiku", medium: "sonnet", complex: "inherit" }`)
71
- 7. If `gates.confirm_execute` is true: use the yes-no pattern from `skills/shared/gate-prompts.md`:
73
+ 7. If `gates.confirm_execute` is true: use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
72
74
  question: "Ready to build Phase {N}? This will execute {count} plans."
73
75
  header: "Build?"
74
76
  options:
@@ -83,7 +85,7 @@ After validating prerequisites, check plan staleness:
83
85
  1. Read each PLAN.md file's `dependency_fingerprints` field (if present)
84
86
  2. For each fingerprinted dependency, check the current SUMMARY.md file (length + modification time)
85
87
  3. If any fingerprint doesn't match: the dependency phase was re-built after this plan was created
86
- 4. Use the stale-continue pattern from `skills/shared/gate-prompts.md`:
88
+ 4. Use AskUserQuestion (pattern: stale-continue from `skills/shared/gate-prompts.md`):
87
89
  question: "Plan {plan_id} may be stale — dependency phase {M} was re-built after this plan was created."
88
90
  header: "Stale"
89
91
  options:
@@ -106,7 +108,9 @@ After validating prerequisites, check plan staleness:
106
108
 
107
109
  If no plans found:
108
110
  ```
109
- ERROR
111
+ ╔══════════════════════════════════════════════════════════════╗
112
+ ║ ERROR ║
113
+ ╚══════════════════════════════════════════════════════════════╝
110
114
 
111
115
  Phase {N} has no plans.
112
116
 
@@ -115,7 +119,9 @@ Phase {N} has no plans.
115
119
 
116
120
  If dependencies incomplete:
117
121
  ```
118
- ERROR
122
+ ╔══════════════════════════════════════════════════════════════╗
123
+ ║ ERROR ║
124
+ ╚══════════════════════════════════════════════════════════════╝
119
125
 
120
126
  Phase {N} depends on Phase {M}, which is not complete.
121
127
 
@@ -166,7 +172,7 @@ Check for existing SUMMARY.md files from previous runs (crash recovery):
166
172
  3. Build the skip list of plans to exclude
167
173
 
168
174
  **If all plans already have completed SUMMARYs:**
169
- Use the yes-no pattern from `skills/shared/gate-prompts.md`:
175
+ Use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
170
176
  question: "Phase {N} has already been built. All plans have completed SUMMARYs. Re-build from scratch?"
171
177
  header: "Re-build?"
172
178
  options:
@@ -239,7 +245,7 @@ For each plan in the current wave (excluding skipped plans):
239
245
  Display to the user before spawning:
240
246
 
241
247
  ```
242
- Spawning {N} executor(s) for Wave {W}...
248
+ Spawning {N} executor(s) for Wave {W}...
243
249
  ```
244
250
 
245
251
  Then present a brief narrative for each plan to give the user context on what's about to happen:
@@ -260,13 +266,13 @@ This is a read-only presentation step — extract descriptions from plan frontma
260
266
  **State fragment rule:** Executors MUST NOT modify STATE.md directly. The build skill orchestrator is the sole STATE.md writer during execution. Executors report results via SUMMARY.md only; the orchestrator reads those summaries and updates STATE.md itself.
261
267
 
262
268
  **Model Selection (Adaptive)**:
263
- Before invoking the executor for each plan, determine the model:
269
+ Before spawning the executor for each plan, determine the model:
264
270
  1. Read the plan's task elements for `complexity` and `model` attributes
265
271
  2. If ANY task has an explicit `model` attribute, use the most capable model among them (inherit > sonnet > haiku)
266
272
  3. Otherwise, use the HIGHEST complexity among the plan's tasks to select the model:
267
273
  - Look up `config.models.complexity_map.{complexity}` (defaults: simple->haiku, medium->sonnet, complex->inherit)
268
274
  4. If `config.models.executor` is set (non-null), it overrides adaptive selection entirely — use that model for all executors
269
- 5. Pass the selected model to the agent invocation
275
+ 5. Pass the selected model to the Task() spawn
270
276
 
271
277
  Reference: `references/model-selection.md` for full details.
272
278
 
@@ -276,7 +282,7 @@ Reference: `references/model-selection.md` for full details.
276
282
  4. Read prior SUMMARY.md files from the same phase (completed plans in earlier waves)
277
283
  5. Read `.planning/config.json`
278
284
 
279
- Construct the executor prompt and invoke `@executor`:
285
+ Construct the executor prompt:
280
286
 
281
287
  ```
282
288
  You are the executor agent. Execute the following plan.
@@ -329,26 +335,35 @@ After all tasks complete:
329
335
  If you hit a checkpoint task, STOP and return the checkpoint response format immediately.
330
336
  ```
331
337
 
332
- **NOTE**: The `@executor` agent is defined in `agents/executor.md`. Do NOT inline it.
333
-
334
338
  **Spawn strategy based on config:**
335
339
 
336
340
  - If `parallelization.enabled: true` AND multiple plans in this wave:
337
- - Invoke up to `max_concurrent_agents` executors in parallel
338
- - Each invocation is independent
341
+ - Spawn up to `max_concurrent_agents` Task() calls in parallel
342
+ - Each Task() call is independent
343
+ - Use `run_in_background: true` for each executor
339
344
  - While waiting, display progress to the user:
340
345
  - After spawning: "Wave {W}: launched {N} executors in parallel: {list of plan names}"
346
+ - Periodically (~30s): check `TaskOutput` with `block: false` and report status
341
347
  - When each completes: "Plan {id} complete ({duration})"
342
348
  - When all complete: "Wave {W} finished. {passed}/{total} plans succeeded."
343
349
 
344
350
  - If `parallelization.enabled: false` OR single plan in wave:
345
- - Invoke executors sequentially, one at a time
351
+ - Spawn Task() calls sequentially, one at a time
346
352
 
347
- **Path resolution**: Before constructing the agent prompt, resolve plugin root to its absolute path. Do not pass the variable literally in prompts. Use the resolved absolute path for any pbr-tools.js or template references included in the prompt.
353
+ ```
354
+ Task({
355
+ agent_type: "pbr:executor",
356
+ prompt: <executor prompt constructed above>
357
+ })
358
+
359
+ NOTE: The pbr:executor agent type auto-loads the agent definition. Do NOT inline it.
360
+ ```
361
+
362
+ **Path resolution**: Before constructing the agent prompt, resolve `${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.
348
363
 
349
364
  #### 6b. Wait for Wave Completion
350
365
 
351
- Block until all executor agents for this wave complete.
366
+ Block until all executor Task() calls for this wave complete.
352
367
 
353
368
  #### 6c. Read Results
354
369
 
@@ -359,7 +374,7 @@ For each completed executor:
359
374
  3. Extract status: `completed` | `partial` | `checkpoint` | `failed`
360
375
  4. Display per-plan completion to the user:
361
376
  ```
362
- Plan {id} complete — {brief summary from SUMMARY.md frontmatter description or first key_file}
377
+ Plan {id} complete — {brief summary from SUMMARY.md frontmatter description or first key_file}
363
378
  ```
364
379
  Extract the brief summary from the SUMMARY.md frontmatter (use the `description` field if present, otherwise use the first entry from `key_files`).
365
380
  5. Record commit hashes, files created, deviations
@@ -406,12 +421,20 @@ When inline verification is enabled, each completed plan gets a targeted verific
406
421
  For each plan that completed successfully in this wave:
407
422
 
408
423
  1. Read the plan's SUMMARY.md to get `key_files` (the files this plan created/modified)
409
- 2. Display to the user: `Spawning inline verifier for plan {plan_id}...`
424
+ 2. Display to the user: `◐ Spawning inline verifier for plan {plan_id}...`
425
+
426
+ Spawn a lightweight verifier:
410
427
 
411
- Invoke `@verifier` with a lightweight targeted verification prompt:
428
+ <!-- NOTE: This is a targeted inline check (existence/substantiveness/wiring for specific files),
429
+ NOT the full must-have verifier. The canonical full verifier prompt lives in
430
+ agents/verifier.md and is templated via skills/review/templates/verifier-prompt.md.tmpl.
431
+ Keep this lightweight prompt distinct from the full verifier. -->
412
432
 
413
433
  ```
414
- Targeted inline verification for plan {plan_id}.
434
+ Task({
435
+ agent_type: "pbr:verifier",
436
+ model: "haiku",
437
+ prompt: "Targeted inline verification for plan {plan_id}.
415
438
 
416
439
  Verify ONLY these files: {comma-separated key_files list}
417
440
 
@@ -421,16 +444,17 @@ For each file, check three layers:
421
444
  3. Wiring — is it imported/used by at least one other file?
422
445
 
423
446
  Report PASS or FAIL with a one-line reason per file.
424
- Write nothing to disk — just return your results as text.
447
+ Write nothing to disk — just return your results as text."
448
+ })
425
449
  ```
426
450
 
427
451
  3. If verifier reports FAIL for any file:
428
452
  - Present the failure to the user: "Inline verify failed for plan {plan_id}: {details}"
429
- - Re-invoke the executor for just the failed items: include only the failing file context in the prompt
453
+ - Re-spawn the executor for just the failed items: include only the failing file context in the prompt
430
454
  - If the retry also fails: proceed but flag in the wave results table (don't block indefinitely)
431
455
  4. If verifier reports all PASS: continue to next wave
432
456
 
433
- **Note:** This adds latency (~10-20s per plan for the verifier). It's opt-in via `features.inline_verify: true` for projects where early detection outweighs speed.
457
+ **Note:** This adds latency (~10-20s per plan for the haiku verifier). It's opt-in via `features.inline_verify: true` for projects where early detection outweighs speed.
434
458
 
435
459
  ---
436
460
 
@@ -440,7 +464,7 @@ If any executor returned `failed` or `partial`:
440
464
 
441
465
  **Handoff bug check (false-failure detection):**
442
466
 
443
- Before presenting failure options, check whether the executor actually completed its work despite reporting failure:
467
+ Before presenting failure options, check whether the executor actually completed its work despite reporting failure (known Claude Code platform bug where handoff reports failure but work is done):
444
468
 
445
469
  1. Check if SUMMARY.md exists at the expected path for this plan
446
470
  2. If SUMMARY.md exists:
@@ -462,17 +486,17 @@ Plan {id} {status}:
462
486
  Last verify output: {output}
463
487
  ```
464
488
 
465
- Use the multi-option-failure pattern from `skills/shared/gate-prompts.md`:
489
+ Use AskUserQuestion (pattern: multi-option-failure from `skills/shared/gate-prompts.md`):
466
490
  question: "Plan {id} failed at task {N} ({name}). How should we proceed?"
467
491
  header: "Failed"
468
492
  options:
469
- - label: "Retry" description: "Re-invoke the executor for this plan"
493
+ - label: "Retry" description: "Re-spawn the executor for this plan"
470
494
  - label: "Skip" description: "Mark as skipped, continue to next wave"
471
495
  - label: "Rollback" description: "Undo commits from this plan, revert to last good state"
472
496
  - label: "Abort" description: "Stop the entire build"
473
497
 
474
498
  **If user selects 'Retry':**
475
- - Re-invoke executor with the same prompt
499
+ - Re-spawn executor Task() with the same prompt
476
500
  - If retry also fails: ask user again (max 2 retries total)
477
501
 
478
502
  **If user selects 'Skip':**
@@ -513,7 +537,7 @@ Checkpoint in Plan {id}, Task {N}: {checkpoint type}
513
537
  ```
514
538
 
515
539
  3. Wait for user response
516
- 4. Invoke a FRESH continuation executor:
540
+ 4. Spawn a FRESH continuation executor:
517
541
 
518
542
  Reference: `references/continuation-format.md` for the continuation protocol.
519
543
 
@@ -583,7 +607,7 @@ node ${PLUGIN_ROOT}/scripts/pbr-tools.js state update last_activity now
583
607
 
584
608
  ### Step 7: Phase Verification (delegated, conditional)
585
609
 
586
- **Event-driven auto-verify signal:** Check if `.planning/.auto-verify` exists (written by event hooks). If the signal file exists, read it and delete it (one-shot). The signal confirms that auto-verification was triggered — proceed with verification even if the build just finished.
610
+ **Event-driven auto-verify signal:** Check if `.planning/.auto-verify` exists (written by `event-handler.js` SubagentStop hook). If the signal file exists, read it and delete it (one-shot). The signal confirms that auto-verification was triggered — proceed with verification even if the build just finished.
587
611
 
588
612
  **Skip if:**
589
613
  - Build was aborted
@@ -599,13 +623,20 @@ Note for Step 8f completion summary: append "Note: Automatic verification was sk
599
623
 
600
624
  **If verification is enabled:**
601
625
 
602
- Display to the user: `Spawning verifier...`
626
+ Display to the user: `◐ Spawning verifier...`
603
627
 
604
- Invoke the `@verifier` agent with the verifier prompt.
628
+ Spawn a verifier Task():
605
629
 
606
- **NOTE**: The `@verifier` agent is defined in `agents/verifier.md`. Do NOT inline it.
630
+ ```
631
+ Task({
632
+ agent_type: "pbr:verifier",
633
+ prompt: <verifier prompt>
634
+ })
635
+
636
+ NOTE: The pbr:verifier agent type auto-loads the agent definition. Do NOT inline it.
637
+ ```
607
638
 
608
- **Path resolution**: Before constructing the agent prompt, resolve plugin root to its absolute path. Do not pass the variable literally in prompts. Use the resolved absolute path for any pbr-tools.js or template references included in the prompt.
639
+ **Path resolution**: Before constructing the agent prompt, resolve `${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.
609
640
 
610
641
  #### Verifier Prompt Template
611
642
 
@@ -613,8 +644,8 @@ Use the same verifier prompt template as defined in `/pbr:review`: read `skills/
613
644
 
614
645
  After the verifier returns, read the VERIFICATION.md frontmatter and display the results:
615
646
 
616
- - If status is `passed`: display `Verifier: {X}/{Y} must-haves verified` (where X = `must_haves_passed` and Y = `must_haves_checked`)
617
- - If status is `gaps_found`: display `Verifier found {N} gap(s) — see VERIFICATION.md` (where N = `must_haves_failed`)
647
+ - If status is `passed`: display `✓ Verifier: {X}/{Y} must-haves verified` (where X = `must_haves_passed` and Y = `must_haves_checked`)
648
+ - If status is `gaps_found`: display `⚠ Verifier found {N} gap(s) — see VERIFICATION.md` (where N = `must_haves_failed`)
618
649
 
619
650
  ---
620
651
 
@@ -648,10 +679,17 @@ Only run if ALL of these are true:
648
679
  If triggered:
649
680
  1. Record the pre-build commit SHA at the start of Step 1 (before any executors run) for comparison
650
681
  2. Run `git diff --name-only {pre_build_commit}..HEAD` to get the list of changed files
651
- 3. Display to the user: `Spawning codebase mapper (incremental update)...`
682
+ 3. Display to the user: `◐ Spawning codebase mapper (incremental update)...`
652
683
 
653
- Invoke `@codebase-mapper` with: "Incremental codebase map update. These files changed during the Phase {N} build:\n{diff file list}\n\nRead the existing .planning/codebase/ documents. Update ONLY the sections affected by these changes. Do NOT rewrite entire documents — make targeted updates. If a new dependency was added, update STACK.md. If new directories/modules were created, update STRUCTURE.md. If new patterns were introduced, update CONVENTIONS.md. Write updated files to .planning/codebase/."
654
- 4. Do NOT block on this — run in background and continue to Step 8a. Report completion in Step 8f if it finishes in time.
684
+ Spawn a lightweight mapper Task():
685
+ ```
686
+ Task({
687
+ agent_type: "pbr:codebase-mapper",
688
+ model: "haiku",
689
+ prompt: "Incremental codebase map update. These files changed during the Phase {N} build:\n{diff file list}\n\nRead the existing .planning/codebase/ documents. Update ONLY the sections affected by these changes. Do NOT rewrite entire documents — make targeted updates. If a new dependency was added, update STACK.md. If new directories/modules were created, update STRUCTURE.md. If new patterns were introduced, update CONVENTIONS.md. Write updated files to .planning/codebase/."
690
+ })
691
+ ```
692
+ 4. Do NOT block on this — use `run_in_background: true` and continue to Step 8a. Report completion in Step 8f if it finishes in time.
655
693
 
656
694
  **8a. Update ROADMAP.md Progress table** (REQUIRED — do this BEFORE updating STATE.md):
657
695
 
@@ -685,7 +723,7 @@ If `planning.commit_docs` is `true`:
685
723
  If `git.branching` is `phase`:
686
724
  - All work was done on the phase branch (created in Step 1)
687
725
  - Squash merge to main: `git checkout main && git merge --squash plan-build-run/phase-{NN}-{name}`
688
- - Use the yes-no pattern from `skills/shared/gate-prompts.md`:
726
+ - Use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
689
727
  question: "Phase {N} complete on branch `plan-build-run/phase-{NN}-{name}`. Squash merge to main?"
690
728
  header: "Merge?"
691
729
  options:
@@ -701,26 +739,43 @@ Chain to the next skill directly within this session. This eliminates manual pha
701
739
 
702
740
  | Build Result | Next Action | How |
703
741
  |-------------|-------------|-----|
704
- | Verification passed, more phases | Plan next phase | Chain to `/pbr:plan {N+1}` |
705
- | Verification skipped | Run review | Chain to `/pbr:review {N}` |
742
+ | Verification passed, more phases | Plan next phase | `Skill({ skill: "pbr:plan", args: "{N+1}" })` |
743
+ | Verification skipped | Run review | `Skill({ skill: "pbr:review", args: "{N}" })` |
706
744
  | Verification gaps found | **HARD STOP** — present gaps to user | Do NOT auto-advance past failures |
707
- | Last phase complete | **HARD STOP** — milestone boundary | Suggest `/pbr:milestone audit` |
745
+ | Last phase in current milestone | **HARD STOP** — milestone boundary | Suggest `/pbr:milestone audit`. Explain: "auto_advance pauses at milestone boundaries — your sign-off is required." |
708
746
  | Build errors occurred | **HARD STOP** — errors need human review | Do NOT auto-advance past errors |
709
747
 
710
- After invoking the chained skill, it runs within the same session. When it completes, the chained skill may itself chain further (review->plan, plan->build) if auto_advance remains true. This creates the full cycle: build->review->plan->build->...
748
+ After invoking the chained skill, it runs within the same session. When it completes, the chained skill may itself chain further (reviewplan, planbuild) if auto_advance remains true. This creates the full cycle: buildreviewplanbuild→...
711
749
 
712
750
  **Else if `features.auto_continue` is `true`:**
713
751
  Write `.planning/.auto-next` containing the next logical command (e.g., `/pbr:plan {N+1}` or `/pbr:review {N}`)
714
752
  - This file signals to the user or to wrapper scripts that the next step is ready
715
753
 
754
+ **8e-ii. Check Pending Todos:**
755
+
756
+ After completing the build, check if any pending todos are now satisfied:
757
+
758
+ 1. Check if `.planning/todos/pending/` exists and contains files
759
+ 2. If no pending todos: skip to 8f
760
+ 3. If pending todos exist:
761
+ a. Read the title and description from each pending todo's YAML frontmatter
762
+ b. Compare each todo against the phase work (plans executed, files changed, features built)
763
+ c. If a todo is **clearly satisfied**: move it to `.planning/todos/done/`, update `status: done`, add `completed: {YYYY-MM-DD}`, delete from `pending/` via Bash `rm`. Display: `✓ Auto-closed todo {NNN}: {title} (satisfied by Phase {N} build)`
764
+ d. If **partially related**: display `ℹ Related pending todo {NNN}: {title} — may be partially addressed`
765
+ e. If unrelated: skip silently
766
+
767
+ Only auto-close when the match is unambiguous. When in doubt, leave it open.
768
+
716
769
  **8f. Present completion summary:**
717
770
 
718
771
  Use the branded output templates from `references/ui-formatting.md`. Route based on status:
719
772
 
720
773
  | Status | Template |
721
774
  |--------|----------|
722
- | `passed` + more phases | "Phase Complete" template |
723
- | `passed` + last phase | "Milestone Complete" template |
775
+ | `passed` + more phases in current milestone | "Phase Complete" template |
776
+ | `passed` + last phase in current milestone | "Milestone Complete" template |
777
+
778
+ **Milestone boundary detection:** To determine "last phase in current milestone", read ROADMAP.md and find the `## Milestone:` section containing the current phase. Check its `**Phases:** start - end` range. If the current phase equals `end`, this is the last phase in the milestone. For projects with a single milestone or no explicit milestone sections, "last phase in ROADMAP" is equivalent.
724
779
  | `gaps_found` | "Gaps Found" template |
725
780
 
726
781
  Before the branded banner, include the results table:
@@ -747,66 +802,66 @@ Then present the appropriate branded banner:
747
802
  **If `passed` + more phases:**
748
803
  ```
749
804
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
750
- PLAN-BUILD-RUN ► PHASE {N} COMPLETE
805
+ PLAN-BUILD-RUN ► PHASE {N} COMPLETE
751
806
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
752
807
 
753
808
  **Phase {N}: {Name}**
754
809
 
755
810
  {X} plans executed
756
- Goal verified
811
+ Goal verified
757
812
 
758
- ---
813
+ ───────────────────────────────────────────────────────────────
759
814
 
760
- ## Next Up
815
+ ## Next Up
761
816
 
762
817
  **Phase {N+1}: {Name}** — {Goal from ROADMAP.md}
763
818
 
764
819
  `/pbr:plan {N+1}`
765
820
 
766
- `/clear` first for a fresh context window
821
+ <sub>`/clear` first fresh context window</sub>
767
822
 
768
- ---
823
+ ───────────────────────────────────────────────────────────────
769
824
 
770
825
  **Also available:**
771
826
  - `/pbr:review {N}` — manual acceptance testing before continuing
772
827
  - `/pbr:discuss {N+1}` — talk through the next phase before planning
773
828
  - `/pbr:status` — see full project status
774
829
 
775
- ---
830
+ ───────────────────────────────────────────────────────────────
776
831
  ```
777
832
 
778
833
  **If `passed` + last phase:**
779
834
  ```
780
835
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
781
- PLAN-BUILD-RUN ► MILESTONE COMPLETE
836
+ PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
782
837
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
783
838
 
784
839
  {N} phases completed
785
- All phase goals verified
840
+ All phase goals verified
786
841
 
787
- ---
842
+ ───────────────────────────────────────────────────────────────
788
843
 
789
- ## Next Up
844
+ ## Next Up
790
845
 
791
846
  **Audit milestone** — verify requirements, cross-phase integration, E2E flows
792
847
 
793
848
  `/pbr:milestone audit`
794
849
 
795
- `/clear` first for a fresh context window
850
+ <sub>`/clear` first fresh context window</sub>
796
851
 
797
- ---
852
+ ───────────────────────────────────────────────────────────────
798
853
 
799
854
  **Also available:**
800
855
  - `/pbr:review` — manual acceptance testing
801
- - `/pbr:milestone complete` — skip audit, archive directly
856
+ - `/pbr:milestone complete` — archive milestone after audit passes
802
857
 
803
- ---
858
+ ───────────────────────────────────────────────────────────────
804
859
  ```
805
860
 
806
861
  **If `gaps_found`:**
807
862
  ```
808
863
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
809
- PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND
864
+ PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND
810
865
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
811
866
 
812
867
  **Phase {N}: {Name}**
@@ -818,23 +873,23 @@ Report: .planning/phases/{phase_dir}/VERIFICATION.md
818
873
 
819
874
  {Extract gap summaries from VERIFICATION.md}
820
875
 
821
- ---
876
+ ───────────────────────────────────────────────────────────────
822
877
 
823
- ## Next Up
878
+ ## Next Up
824
879
 
825
880
  **Plan gap closure** — create additional plans to complete the phase
826
881
 
827
882
  `/pbr:plan {N} --gaps`
828
883
 
829
- `/clear` first for a fresh context window
884
+ <sub>`/clear` first fresh context window</sub>
830
885
 
831
- ---
886
+ ───────────────────────────────────────────────────────────────
832
887
 
833
888
  **Also available:**
834
889
  - `cat .planning/phases/{phase_dir}/VERIFICATION.md` — see full report
835
890
  - `/pbr:review {N}` — manual testing before planning
836
891
 
837
- ---
892
+ ───────────────────────────────────────────────────────────────
838
893
  ```
839
894
 
840
895
  **8g. Display USER-SETUP.md (conditional):**
@@ -856,9 +911,11 @@ This ensures the user sees setup requirements prominently instead of buried in S
856
911
  ## Error Handling
857
912
 
858
913
  ### Executor agent timeout
859
- If an executor agent doesn't return within a reasonable time, display:
914
+ If a Task() doesn't return within a reasonable time, display:
860
915
  ```
861
- ERROR
916
+ ╔══════════════════════════════════════════════════════════════╗
917
+ ║ ERROR ║
918
+ ╚══════════════════════════════════════════════════════════════╝
862
919
 
863
920
  Executor agent timed out for Plan {id}.
864
921
 
@@ -871,7 +928,7 @@ For commit conventions and git workflow details, see `references/git-integration
871
928
  ### Git lock conflicts
872
929
  If multiple parallel executors create git lock conflicts:
873
930
  - The executor agent handles retries internally (see executor agent definition)
874
- - If lock conflicts persist, display: "Git lock conflicts detected with parallel execution. Consider reducing max_concurrent_agents to 1."
931
+ - If lock conflicts persist, display: `⚠ Git lock conflicts detected with parallel execution. Consider reducing max_concurrent_agents to 1.`
875
932
 
876
933
  ### Executor produces unexpected files
877
934
  If SUMMARY.md shows files not listed in the plan's `files_modified`:
@@ -895,7 +952,7 @@ If `git.branching` is `phase` but we're not on the phase branch:
895
952
  | `.planning/phases/{NN}-{slug}/USER-SETUP.md` | External setup requirements | Step 6 (executor, if needed) |
896
953
  | `.planning/phases/{NN}-{slug}/VERIFICATION.md` | Phase verification report | Step 7 |
897
954
  | `.planning/codebase/*.md` | Incremental codebase map updates | Step 8-pre-c (if codebase/ exists) |
898
- | `.planning/ROADMAP.md` | Plans Complete + Status -> `built` or `partial` | Step 8a |
955
+ | `.planning/ROADMAP.md` | Plans Complete + Status `built` or `partial` | Step 8a |
899
956
  | `.planning/STATE.md` | Updated progress | Steps 6f, 8b |
900
957
  | `.planning/.auto-next` | Next command signal (if auto_continue enabled) | Step 8e |
901
958
  | Project source files | Actual code | Step 6 (executors) |
@@ -231,6 +231,7 @@ After creating artifacts (or if user chose "Skip"), display:
231
231
  - If a phase decision was captured: **Plan the phase** → `/pbr:plan {N}`
232
232
  - If a new phase was added: **Discuss the new phase** → `/pbr:discuss {N}`
233
233
  - If research questions were logged: **Plan with research** → `/pbr:plan {N}`
234
+ - If current milestone is complete (STATE.md status is "milestone-complete"): **Start next milestone** → `/pbr:milestone new`
234
235
  - Default: **See project status** → `/pbr:status`
235
236
 
236
237
  `{primary command}`
@@ -242,6 +243,7 @@ After creating artifacts (or if user chose "Skip"), display:
242
243
  **Also available:**
243
244
  - `/pbr:status` — see project status
244
245
  - `/pbr:continue` — execute next logical step
246
+ - `/pbr:milestone new` — start a new milestone with new phases
245
247
 
246
248
  ───────────────────────────────────────────────────────────────
247
249
  ```