@sienklogic/plan-build-run 2.58.0 → 2.60.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 (128) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/package.json +1 -1
  3. package/plugins/codex-pbr/agents/executor.md +8 -0
  4. package/plugins/codex-pbr/agents/plan-checker.md +5 -3
  5. package/plugins/codex-pbr/agents/planner.md +13 -7
  6. package/plugins/codex-pbr/agents/verifier.md +10 -1
  7. package/plugins/codex-pbr/commands/profile.md +7 -0
  8. package/plugins/codex-pbr/references/model-profiles.md +29 -3
  9. package/plugins/codex-pbr/references/plan-format.md +46 -8
  10. package/plugins/codex-pbr/skills/begin/SKILL.md +18 -34
  11. package/plugins/codex-pbr/skills/build/SKILL.md +8 -4
  12. package/plugins/codex-pbr/skills/debug/SKILL.md +2 -2
  13. package/plugins/codex-pbr/skills/discuss/SKILL.md +54 -4
  14. package/plugins/codex-pbr/skills/health/SKILL.md +15 -2
  15. package/plugins/codex-pbr/skills/milestone/SKILL.md +8 -8
  16. package/plugins/codex-pbr/skills/pause/SKILL.md +1 -1
  17. package/plugins/codex-pbr/skills/plan/SKILL.md +20 -8
  18. package/plugins/codex-pbr/skills/profile/SKILL.md +171 -0
  19. package/plugins/codex-pbr/skills/review/SKILL.md +5 -3
  20. package/plugins/codex-pbr/skills/scan/SKILL.md +2 -2
  21. package/plugins/codex-pbr/skills/setup/SKILL.md +66 -2
  22. package/plugins/codex-pbr/skills/shared/context-loader-task.md +2 -0
  23. package/plugins/codex-pbr/skills/status/SKILL.md +17 -0
  24. package/plugins/codex-pbr/templates/PROJECT.md.tmpl +41 -0
  25. package/plugins/codex-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  26. package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  27. package/plugins/codex-pbr/templates/project-CONTEXT.md.tmpl +43 -0
  28. package/plugins/copilot-pbr/agents/executor.agent.md +8 -0
  29. package/plugins/copilot-pbr/agents/plan-checker.agent.md +5 -3
  30. package/plugins/copilot-pbr/agents/planner.agent.md +13 -7
  31. package/plugins/copilot-pbr/agents/verifier.agent.md +10 -1
  32. package/plugins/copilot-pbr/commands/profile.md +7 -0
  33. package/plugins/copilot-pbr/hooks/hooks.json +27 -0
  34. package/plugins/copilot-pbr/plugin.json +1 -1
  35. package/plugins/copilot-pbr/references/model-profiles.md +29 -3
  36. package/plugins/copilot-pbr/references/plan-format.md +46 -8
  37. package/plugins/copilot-pbr/skills/begin/SKILL.md +18 -34
  38. package/plugins/copilot-pbr/skills/build/SKILL.md +8 -4
  39. package/plugins/copilot-pbr/skills/debug/SKILL.md +2 -2
  40. package/plugins/copilot-pbr/skills/discuss/SKILL.md +54 -4
  41. package/plugins/copilot-pbr/skills/health/SKILL.md +15 -2
  42. package/plugins/copilot-pbr/skills/milestone/SKILL.md +8 -8
  43. package/plugins/copilot-pbr/skills/pause/SKILL.md +1 -1
  44. package/plugins/copilot-pbr/skills/plan/SKILL.md +20 -8
  45. package/plugins/copilot-pbr/skills/profile/SKILL.md +171 -0
  46. package/plugins/copilot-pbr/skills/review/SKILL.md +5 -3
  47. package/plugins/copilot-pbr/skills/scan/SKILL.md +2 -2
  48. package/plugins/copilot-pbr/skills/setup/SKILL.md +66 -2
  49. package/plugins/copilot-pbr/skills/shared/context-loader-task.md +2 -0
  50. package/plugins/copilot-pbr/skills/status/SKILL.md +17 -0
  51. package/plugins/copilot-pbr/templates/PROJECT.md.tmpl +41 -0
  52. package/plugins/copilot-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  53. package/plugins/copilot-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  54. package/plugins/copilot-pbr/templates/project-CONTEXT.md.tmpl +43 -0
  55. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  56. package/plugins/cursor-pbr/agents/executor.md +8 -0
  57. package/plugins/cursor-pbr/agents/plan-checker.md +5 -3
  58. package/plugins/cursor-pbr/agents/planner.md +13 -7
  59. package/plugins/cursor-pbr/agents/verifier.md +10 -1
  60. package/plugins/cursor-pbr/commands/profile.md +7 -0
  61. package/plugins/cursor-pbr/hooks/hooks.json +23 -0
  62. package/plugins/cursor-pbr/references/model-profiles.md +29 -3
  63. package/plugins/cursor-pbr/references/plan-format.md +46 -8
  64. package/plugins/cursor-pbr/skills/begin/SKILL.md +18 -34
  65. package/plugins/cursor-pbr/skills/build/SKILL.md +9 -5
  66. package/plugins/cursor-pbr/skills/debug/SKILL.md +2 -2
  67. package/plugins/cursor-pbr/skills/discuss/SKILL.md +55 -5
  68. package/plugins/cursor-pbr/skills/health/SKILL.md +15 -2
  69. package/plugins/cursor-pbr/skills/milestone/SKILL.md +8 -8
  70. package/plugins/cursor-pbr/skills/pause/SKILL.md +1 -1
  71. package/plugins/cursor-pbr/skills/plan/SKILL.md +21 -9
  72. package/plugins/cursor-pbr/skills/profile/SKILL.md +172 -0
  73. package/plugins/cursor-pbr/skills/review/SKILL.md +6 -4
  74. package/plugins/cursor-pbr/skills/scan/SKILL.md +2 -2
  75. package/plugins/cursor-pbr/skills/setup/SKILL.md +66 -2
  76. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +2 -0
  77. package/plugins/cursor-pbr/skills/status/SKILL.md +17 -0
  78. package/plugins/cursor-pbr/templates/PROJECT.md.tmpl +41 -0
  79. package/plugins/cursor-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  80. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  81. package/plugins/cursor-pbr/templates/project-CONTEXT.md.tmpl +43 -0
  82. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  83. package/plugins/pbr/agents/audit.md +0 -1
  84. package/plugins/pbr/agents/codebase-mapper.md +0 -1
  85. package/plugins/pbr/agents/debugger.md +0 -1
  86. package/plugins/pbr/agents/dev-sync.md +0 -1
  87. package/plugins/pbr/agents/executor.md +8 -1
  88. package/plugins/pbr/agents/general.md +0 -1
  89. package/plugins/pbr/agents/integration-checker.md +0 -1
  90. package/plugins/pbr/agents/plan-checker.md +5 -4
  91. package/plugins/pbr/agents/planner.md +13 -8
  92. package/plugins/pbr/agents/researcher.md +0 -1
  93. package/plugins/pbr/agents/synthesizer.md +0 -1
  94. package/plugins/pbr/agents/verifier.md +10 -2
  95. package/plugins/pbr/commands/profile.md +7 -0
  96. package/plugins/pbr/hooks/hooks.json +23 -0
  97. package/plugins/pbr/references/model-profiles.md +29 -3
  98. package/plugins/pbr/references/plan-format.md +46 -8
  99. package/plugins/pbr/scripts/check-plan-format.js +29 -0
  100. package/plugins/pbr/scripts/config-schema.json +20 -1
  101. package/plugins/pbr/scripts/context-bridge.js +1 -1
  102. package/plugins/pbr/scripts/hooks-schema.json +3 -1
  103. package/plugins/pbr/scripts/lib/gates/doc-existence.js +46 -0
  104. package/plugins/pbr/scripts/lib/init.js +10 -7
  105. package/plugins/pbr/scripts/pbr-tools.js +6 -6
  106. package/plugins/pbr/scripts/post-write-dispatch.js +22 -2
  107. package/plugins/pbr/scripts/sync-context-to-claude.js +100 -0
  108. package/plugins/pbr/scripts/validate-task.js +14 -1
  109. package/plugins/pbr/scripts/worktree-create.js +93 -0
  110. package/plugins/pbr/scripts/worktree-remove.js +83 -0
  111. package/plugins/pbr/skills/begin/SKILL.md +18 -34
  112. package/plugins/pbr/skills/build/SKILL.md +9 -5
  113. package/plugins/pbr/skills/debug/SKILL.md +2 -2
  114. package/plugins/pbr/skills/discuss/SKILL.md +55 -5
  115. package/plugins/pbr/skills/health/SKILL.md +15 -2
  116. package/plugins/pbr/skills/milestone/SKILL.md +8 -8
  117. package/plugins/pbr/skills/pause/SKILL.md +1 -1
  118. package/plugins/pbr/skills/plan/SKILL.md +21 -9
  119. package/plugins/pbr/skills/profile/SKILL.md +173 -0
  120. package/plugins/pbr/skills/review/SKILL.md +6 -4
  121. package/plugins/pbr/skills/scan/SKILL.md +2 -2
  122. package/plugins/pbr/skills/setup/SKILL.md +66 -2
  123. package/plugins/pbr/skills/shared/context-loader-task.md +2 -0
  124. package/plugins/pbr/skills/status/SKILL.md +17 -0
  125. package/plugins/pbr/templates/PROJECT.md.tmpl +41 -0
  126. package/plugins/pbr/templates/REQUIREMENTS.md.tmpl +52 -0
  127. package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
  128. package/plugins/pbr/templates/project-CONTEXT.md.tmpl +43 -0
@@ -162,7 +162,7 @@ Start a new milestone cycle with new phases.
162
162
  docs(planning): start milestone "{name}" (phases {start}-{end})
163
163
  ```
164
164
 
165
- 10. **Confirm** with branded output — read `skills/milestone/templates/new-output.md.tmpl` and fill in `{name}` (milestone name), `{count}` (phase count), `{N}` (first phase number).
165
+ 10. **Confirm** with branded output — read `${CLAUDE_SKILL_DIR}/templates/new-output.md.tmpl` and fill in `{name}` (milestone name), `{count}` (phase count), `{N}` (first phase number).
166
166
 
167
167
  ---
168
168
 
@@ -333,7 +333,7 @@ Archive a completed milestone and prepare for the next one.
333
333
 
334
334
  **Stats file content:**
335
335
 
336
- Read `skills/milestone/templates/stats-file.md.tmpl` for the stats file format. Fill in all `{variable}` placeholders with actual data gathered in Steps 3-4.
336
+ Read `${CLAUDE_SKILL_DIR}/templates/stats-file.md.tmpl` for the stats file format. Fill in all `{variable}` placeholders with actual data gathered in Steps 3-4.
337
337
 
338
338
  6. **Update PROJECT.md:**
339
339
  - Move milestone from "Active" to "Completed"
@@ -450,7 +450,7 @@ If `config.deployment.smoke_test_command` is set and non-empty:
450
450
 
451
451
  This is advisory only — the milestone is already archived. Surface it as a potential issue for the user to investigate.
452
452
 
453
- 10. **Confirm** with branded output — read `skills/milestone/templates/complete-output.md.tmpl` and fill in `{version}`, `{count}` (phases, plans, commits), `{lines}`, `{duration}`.
453
+ 10. **Confirm** with branded output — read `${CLAUDE_SKILL_DIR}/templates/complete-output.md.tmpl` and fill in `{version}`, `{count}` (phases, plans, commits), `{lines}`, `{duration}`.
454
454
 
455
455
  ---
456
456
 
@@ -473,7 +473,7 @@ Verify milestone completion with cross-phase integration checks.
473
473
 
474
474
  Display to the user: `◐ Spawning integration checker...`
475
475
 
476
- Spawn `Task(subagent_type: "pbr:integration-checker")`. Read `skills/milestone/templates/integration-checker-prompt.md.tmpl`, fill in `{version or "current"}`, `{list of phase directories}`, and `{phase SUMMARY.md paths}`, then use the filled template as the Task() prompt.
476
+ Spawn `Task(subagent_type: "pbr:integration-checker")`. Read `${CLAUDE_SKILL_DIR}/templates/integration-checker-prompt.md.tmpl`, fill in `{version or "current"}`, `{list of phase directories}`, and `{phase SUMMARY.md paths}`, then use the filled template as the Task() prompt.
477
477
 
478
478
  4. **Check integration-checker completion:**
479
479
 
@@ -490,11 +490,11 @@ Verify milestone completion with cross-phase integration checks.
490
490
 
491
491
  Create `.planning/{version}-MILESTONE-AUDIT.md` using the template:
492
492
 
493
- Read `skills/milestone/templates/audit-report.md.tmpl` for the audit report format. Fill in all `{variable}` placeholders with actual data from the audit.
493
+ Read `${CLAUDE_SKILL_DIR}/templates/audit-report.md.tmpl` for the audit report format. Fill in all `{variable}` placeholders with actual data from the audit.
494
494
 
495
495
  **Spot-check:** After writing, verify `.planning/{version}-MILESTONE-AUDIT.md` exists on disk using Glob. If missing, re-attempt the write. If still missing, display an error and include findings inline.
496
496
 
497
- 7. **Report to user** using branded banners — read `skills/milestone/templates/audit-output.md.tmpl`. The template contains all 3 variants (PASSED, GAPS FOUND, TECH DEBT). Select the appropriate section based on audit result. Fill in `{version}`, `{count}`, `{gap 1}`, `{gap 2}` as applicable.
497
+ 7. **Report to user** using branded banners — read `${CLAUDE_SKILL_DIR}/templates/audit-output.md.tmpl`. The template contains all 3 variants (PASSED, GAPS FOUND, TECH DEBT). Select the appropriate section based on audit result. Fill in `{version}`, `{count}`, `{gap 1}`, `{gap 2}` as applicable.
498
498
 
499
499
  ---
500
500
 
@@ -574,7 +574,7 @@ Create phases to close gaps found during an audit.
574
574
  docs(planning): add gap-closure phases from milestone audit
575
575
  ```
576
576
 
577
- 9. **Confirm** with branded output — read `skills/milestone/templates/gaps-output.md.tmpl` and fill in `{count}` (gap-closure phases created), `{N}` (first gap phase number), `{name}` (phase name).
577
+ 9. **Confirm** with branded output — read `${CLAUDE_SKILL_DIR}/templates/gaps-output.md.tmpl` and fill in `{count}` (gap-closure phases created), `{N}` (first gap phase number), `{name}` (phase name).
578
578
 
579
579
  ---
580
580
 
@@ -605,7 +605,7 @@ Tags (complete only):
605
605
 
606
606
  ## Edge Cases
607
607
 
608
- For all edge case handling, see `skills/milestone/templates/edge-cases.md`.
608
+ For all edge case handling, see `${CLAUDE_SKILL_DIR}/templates/edge-cases.md`.
609
609
  Key scenarios: no ROADMAP.md, no phases, no gaps found, version collision, partially verified, large milestone (8+ phases).
610
610
 
611
611
  ---
@@ -129,7 +129,7 @@ Write the handoff file to the current phase directory:
129
129
 
130
130
  **Content:**
131
131
 
132
- Read `skills/pause/templates/continue-here.md.tmpl` for the handoff file format. Fill in all `{variable}` placeholders with actual session data gathered in Steps 1-3.
132
+ Read `${CLAUDE_SKILL_DIR}/templates/continue-here.md.tmpl` for the handoff file format. Fill in all `{variable}` placeholders with actual session data gathered in Steps 1-3.
133
133
 
134
134
  ### Step 5: Update STATE.md
135
135
 
@@ -2,7 +2,7 @@
2
2
  name: plan
3
3
  description: "Create a detailed plan for a phase. Research, plan, and verify before building."
4
4
  allowed-tools: Read, Write, Bash, Glob, Grep, WebFetch, WebSearch, Task, AskUserQuestion, Skill
5
- argument-hint: "<phase-number> [--skip-research] [--assumptions] [--gaps] | add | insert <N> | remove <N>"
5
+ argument-hint: "<phase-number> [--skip-research] [--assumptions] [--gaps] [--model <model>] | add | insert <N> | remove <N>"
6
6
  ---
7
7
 
8
8
  **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.**
@@ -56,6 +56,7 @@ Parse the phase number and optional flags:
56
56
  | `3 --assumptions` | Surface assumptions before planning phase 3 |
57
57
  | `3 --gaps` | Create gap-closure plans for phase 3 (from VERIFICATION.md) |
58
58
  | `3 --teams` | Plan phase 3 using specialist agent teams |
59
+ | `3 --model opus` | Use opus for all researcher, planner, and checker spawns in phase 3 |
59
60
  | (no number) | Use current phase from STATE.md |
60
61
  | `3 --preview` | Preview what planning would produce for phase 3 without spawning agents |
61
62
 
@@ -116,6 +117,7 @@ Execute these steps in order for standard `/pbr:plan <N>` invocations.
116
117
  Reference: `skills/shared/config-loading.md` for the tooling shortcut (`state load`, `plan-index`, `phase-info`) and config field reference.
117
118
 
118
119
  1. Parse `$ARGUMENTS` for phase number and flags
120
+ - If `--model <value>` is present in `$ARGUMENTS`, extract the value (sonnet, opus, haiku, inherit). Store as `override_model`. When spawning researcher, planner, and plan-checker Task() agents, use `override_model` instead of the config-derived model values. If an invalid value is provided, display an error and list valid values.
119
121
  2. Read `.planning/config.json` for settings (see config-loading.md for field reference)
120
122
  **CRITICAL (hook-enforced): Write .active-skill NOW.** Write the text "plan" to `.planning/.active-skill` using the Write tool.
121
123
  3. Resolve depth profile: run `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
@@ -229,7 +231,7 @@ NOTE: The pbr:researcher subagent type auto-loads the agent definition. Do NOT i
229
231
 
230
232
  #### Phase Research Prompt Template
231
233
 
232
- Read `skills/plan/templates/researcher-prompt.md.tmpl` and use it as the prompt template for spawning the researcher agent. Fill in the placeholders with phase-specific context:
234
+ Read `${CLAUDE_SKILL_DIR}/templates/researcher-prompt.md.tmpl` and use it as the prompt template for spawning the researcher agent. Fill in the placeholders with phase-specific context:
233
235
  - `{NN}` - phase number (zero-padded)
234
236
  - `{phase name}` - phase name from roadmap
235
237
  - `{goal from roadmap}` - phase goal statement
@@ -354,7 +356,7 @@ After planner completes, check for completion markers: `## PLANNING COMPLETE`, `
354
356
 
355
357
  #### Planning Prompt Template
356
358
 
357
- Read `skills/plan/templates/planner-prompt.md.tmpl` and use it as the prompt template for spawning the planner agent. Fill in all placeholder blocks with phase-specific context:
359
+ Read `${CLAUDE_SKILL_DIR}/templates/planner-prompt.md.tmpl` and use it as the prompt template for spawning the planner agent. Fill in all placeholder blocks with phase-specific context:
358
360
 
359
361
  - `<phase_context>` - phase number, directory, goal, requirements, dependencies, success criteria
360
362
  - `<project_context>` - locked decisions, user constraints, deferred ideas, phase-specific decisions
@@ -426,7 +428,7 @@ NOTE: The pbr:plan-checker subagent type auto-loads the agent definition. Do NOT
426
428
 
427
429
  #### Checker Prompt Template
428
430
 
429
- Read `skills/plan/templates/checker-prompt.md.tmpl` and use it as the prompt template for spawning the plan checker agent. Fill in the placeholders:
431
+ Read `${CLAUDE_SKILL_DIR}/templates/checker-prompt.md.tmpl` and use it as the prompt template for spawning the plan checker agent. Fill in the placeholders:
430
432
  - `<plans_to_check>` - manifest table of PLAN.md file paths (checker reads each via Read tool)
431
433
  - `<phase_context>` - phase goal and requirement IDs
432
434
  - `<context>` - file paths to project-level and phase-level CONTEXT.md files (checker reads via Read tool)
@@ -454,7 +456,7 @@ After the plan checker returns, display its result:
454
456
  Reference: `skills/shared/revision-loop.md` for the full Check-Revise-Escalate pattern.
455
457
 
456
458
  Follow the revision loop pattern with:
457
- - **Producer**: planner (re-spawned with `skills/plan/templates/revision-prompt.md.tmpl`)
459
+ - **Producer**: planner (re-spawned with `${CLAUDE_SKILL_DIR}/templates/revision-prompt.md.tmpl`)
458
460
  - **Checker**: plan-checker (back to Step 6)
459
461
  - **Escalation**: present issues to user, offer "Proceed anyway" or "Adjust approach" (re-enter Step 5)
460
462
 
@@ -484,7 +486,17 @@ Use AskUserQuestion (pattern: approve-revise-abort from `skills/shared/gate-prom
484
486
  - Or make small inline edits to plan files directly
485
487
 
486
488
  **If user selects 'Approve':**
487
- - **CONTEXT.md compliance reporting**: If `.planning/CONTEXT.md` exists, compare all locked decisions against the generated plans. Print: "CONTEXT.md compliance: {M}/{N} locked decisions mapped to tasks" where M = locked decisions that are reflected in at least one task, N = total locked decisions. If any locked decisions are unmapped, list them as warnings.
489
+ - **CONTEXT.md compliance reporting**: Check locked decisions from BOTH sources:
490
+ a. Project-level: `.planning/CONTEXT.md` (if exists) — cross-cutting decisions for all phases
491
+ b. Phase-level: `.planning/phases/{NN}-{slug}/CONTEXT.md` (if exists) — phase-specific decisions
492
+ Phase-level decisions override project-level for the same decision area.
493
+
494
+ Collect ALL locked decisions from both files (deduplicate identical decision text).
495
+ Compare against the generated plan tasks. Print:
496
+ `CONTEXT.md compliance: {M}/{N} locked decisions mapped to tasks`
497
+ where M = locked decisions reflected in at least one task action, N = total unique locked decisions.
498
+ If any locked decisions are unmapped, list them as warnings.
499
+ If neither CONTEXT.md exists: skip this check silently.
488
500
  - **Dependency fingerprinting**: For each dependency phase (phases that this phase depends on, per ROADMAP.md):
489
501
  1. Find all SUMMARY.md files in the dependency phase directory
490
502
  2. Compute a fingerprint string for each: `"len:{bytes}-mod:{mtime}"` and add as a `dependency_fingerprints` map in each plan's YAML frontmatter — this allows the build skill to detect stale plans if dependencies were rebuilt.
@@ -531,7 +543,7 @@ Use AskUserQuestion (pattern: approve-revise-abort from `skills/shared/gate-prom
531
543
 
532
544
  ### Subcommand: `insert <N>`
533
545
 
534
- Reference: `skills/plan/decimal-phase-calc.md` for decimal numbering rules.
546
+ Reference: `${CLAUDE_SKILL_DIR}/decimal-phase-calc.md` for decimal numbering rules.
535
547
 
536
548
  **CRITICAL (hook-enforced): Write .active-skill NOW.** Write the text "plan" to `.planning/.active-skill` using the Write tool.
537
549
 
@@ -575,7 +587,7 @@ When invoked with `--gaps`:
575
587
  2. Extract all gaps from the verification report
576
588
  3. Spawn planner Task() in Gap Closure mode:
577
589
 
578
- Read `skills/plan/templates/gap-closure-prompt.md.tmpl` and use it as the prompt template for the gap closure planner. Fill in the placeholders:
590
+ Read `${CLAUDE_SKILL_DIR}/templates/gap-closure-prompt.md.tmpl` and use it as the prompt template for the gap closure planner. Fill in the placeholders:
579
591
  - `<verification_report>` - inline the FULL VERIFICATION.md content
580
592
  - `<existing_plans>` - inline all existing PLAN.md files for the phase
581
593
  - `<gap_closure_instructions>` - specify output path and gap_closure frontmatter flag
@@ -648,5 +660,5 @@ Delete `.planning/.active-skill` if it exists. This must happen on all paths (su
648
660
 
649
661
  After planning completes, present:
650
662
 
651
- Use the branded stage banner and next-up block from `skills/plan/templates/completion-output.md.tmpl`.
663
+ Use the branded stage banner and next-up block from `${CLAUDE_SKILL_DIR}/templates/completion-output.md.tmpl`.
652
664
  Fill in: `{N}` (phase number), `{phase-name}`, `{plan_count}`, `{plan_list_lines}` (one line per plan with wave and task count), `{wave_table_lines}` (one line per wave).
@@ -0,0 +1,173 @@
1
+ ---
2
+ name: profile
3
+ description: "Switch the active model profile. Presets: quality, balanced, budget, adaptive. Supports custom profiles from config.json model_profiles."
4
+ allowed-tools: Read, Write, Bash, AskUserQuestion
5
+ argument-hint: "[quality|balanced|budget|adaptive|<custom>]"
6
+ ---
7
+
8
+ **STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Begin executing Step 0 immediately.**
9
+
10
+ # /pbr:profile — Model Profile Manager
11
+
12
+ You are running the **profile** skill. Your job is to show the current model profile or switch to a new one by writing model assignments to `.planning/config.json`.
13
+
14
+ ## Step 0 — Immediate Output
15
+
16
+ **Before ANY tool calls**, display this banner:
17
+
18
+ ```
19
+ ╔══════════════════════════════════════════════════════════════╗
20
+ ║ PLAN-BUILD-RUN ► MODEL PROFILE ║
21
+ ╚══════════════════════════════════════════════════════════════╝
22
+ ```
23
+
24
+ Then proceed to Step 1.
25
+
26
+ ## Step 1 — Load Config
27
+
28
+ Read `.planning/config.json`.
29
+
30
+ If the file does not exist, output:
31
+
32
+ ```
33
+ Error: .planning/config.json not found. Run /pbr:begin first.
34
+ ```
35
+
36
+ Stop immediately.
37
+
38
+ ## Step 2 — Parse Arguments
39
+
40
+ Extract the first word from `$ARGUMENTS` as the profile name. Trim whitespace.
41
+
42
+ - If `$ARGUMENTS` is empty or blank → **show-mode** (go to Step 3).
43
+ - If a profile name is present → **switch-mode** (go to Step 4).
44
+
45
+ ## Step 3 — Show Mode (no argument)
46
+
47
+ Display the current profile status and available options.
48
+
49
+ 1. Read `config.json` key `model_profile`. If absent, treat as `"balanced"`.
50
+ 2. Read `config.json` key `models` (object). If absent, use empty object.
51
+ 3. Read `config.json` key `model_profiles` (object, optional custom profiles). If absent, use empty object.
52
+
53
+ Output the following (fill in actual values):
54
+
55
+ ```
56
+ Active profile: <model_profile value>
57
+
58
+ Current model assignments:
59
+ researcher : <models.researcher or "not set">
60
+ planner : <models.planner or "not set">
61
+ executor : <models.executor or "not set">
62
+ verifier : <models.verifier or "not set">
63
+ integration_checker : <models.integration_checker or "not set">
64
+ debugger : <models.debugger or "not set">
65
+ mapper : <models.mapper or "not set">
66
+ synthesizer : <models.synthesizer or "not set">
67
+
68
+ Available presets:
69
+ quality — all agents use opus (maximum capability)
70
+ balanced — mix of sonnet/inherit/haiku (default)
71
+ budget — all agents use haiku (minimum cost)
72
+ adaptive — sonnet for planning/verification, inherit/haiku for execution
73
+ ```
74
+
75
+ If `model_profiles` has any keys, also display:
76
+
77
+ ```
78
+ Custom profiles:
79
+ <profile-name> — <key count> model overrides
80
+ ```
81
+
82
+ Output: "Run `/pbr:profile <name>` to switch profiles."
83
+
84
+ Stop. Do not write anything.
85
+
86
+ ## Step 4 — Switch Mode (argument provided)
87
+
88
+ ### Step 4a — Validate Profile Name
89
+
90
+ Built-in preset names: `quality`, `balanced`, `budget`, `adaptive`.
91
+
92
+ Custom profile names: keys in `config.json model_profiles` (if any).
93
+
94
+ If the provided name does not match any of the above:
95
+
96
+ ```
97
+ Error: Unknown profile "<name>".
98
+
99
+ Valid presets: quality, balanced, budget, adaptive
100
+ <list any custom profile names from config.json model_profiles, if any>
101
+
102
+ Run `/pbr:profile` to see the current status.
103
+ ```
104
+
105
+ Stop immediately.
106
+
107
+ ### Step 4b — Resolve Model Values
108
+
109
+ Use the preset table to resolve model values:
110
+
111
+ | Agent | quality | balanced | budget | adaptive |
112
+ |---------------------|---------|----------|--------|----------|
113
+ | researcher | opus | sonnet | haiku | sonnet |
114
+ | planner | opus | inherit | haiku | sonnet |
115
+ | executor | opus | inherit | haiku | inherit |
116
+ | verifier | opus | sonnet | haiku | sonnet |
117
+ | integration_checker | sonnet | sonnet | haiku | haiku |
118
+ | debugger | opus | inherit | haiku | inherit |
119
+ | mapper | sonnet | sonnet | haiku | haiku |
120
+ | synthesizer | sonnet | haiku | haiku | haiku |
121
+
122
+ For a **custom profile** (name found in `config.json model_profiles`):
123
+ - Start with the `balanced` defaults from the table above.
124
+ - Overlay any keys present in `config.json model_profiles[<name>]`.
125
+ - Any agents not specified in the custom profile use the balanced default.
126
+
127
+ ### Step 4c — Write to config.json
128
+
129
+ Update `config.json` using the Bash tool with `node -e` inline script:
130
+
131
+ ```bash
132
+ node -e "
133
+ const fs = require('fs');
134
+ const cfg = JSON.parse(fs.readFileSync('.planning/config.json', 'utf8'));
135
+ cfg.model_profile = '<name>';
136
+ cfg.models = cfg.models || {};
137
+ cfg.models.researcher = '<value>';
138
+ cfg.models.planner = '<value>';
139
+ cfg.models.executor = '<value>';
140
+ cfg.models.verifier = '<value>';
141
+ cfg.models.integration_checker = '<value>';
142
+ cfg.models.debugger = '<value>';
143
+ cfg.models.mapper = '<value>';
144
+ cfg.models.synthesizer = '<value>';
145
+ fs.writeFileSync('.planning/config.json', JSON.stringify(cfg, null, 2));
146
+ console.log('OK');
147
+ "
148
+ ```
149
+
150
+ Replace each `<value>` with the resolved model string for that agent. Replace `<name>` with the profile name.
151
+
152
+ ### Step 4d — Confirm
153
+
154
+ Output:
155
+
156
+ ```
157
+ Active profile set to: <name>
158
+
159
+ Model assignments updated:
160
+ researcher : <value>
161
+ planner : <value>
162
+ executor : <value>
163
+ verifier : <value>
164
+ integration_checker : <value>
165
+ debugger : <value>
166
+ mapper : <value>
167
+ synthesizer : <value>
168
+
169
+ Config written to .planning/config.json.
170
+ Run /pbr:profile to verify.
171
+ ```
172
+
173
+ Stop. Done.
@@ -2,7 +2,7 @@
2
2
  name: review
3
3
  description: "Verify the build matched the plan. Automated checks + walkthrough with you."
4
4
  allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion, Skill
5
- argument-hint: "<phase-number> [--auto-fix] [--teams]"
5
+ argument-hint: "<phase-number> [--auto-fix] [--teams] [--model <model>]"
6
6
  ---
7
7
 
8
8
  **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.**
@@ -52,6 +52,7 @@ Parse `$ARGUMENTS` according to `skills/shared/phase-argument-parsing.md`.
52
52
  | `3` | Review phase 3 |
53
53
  | `3 --auto-fix` | Review phase 3, automatically diagnose and create gap-closure plans for failures |
54
54
  | `3 --teams` | Review phase 3 with parallel specialist verifiers (functional + security + performance) |
55
+ | `3 --model opus` | Use opus for all verifier spawns in phase 3 (overrides config verifier_model) |
55
56
  | (no number) | Use current phase from STATE.md |
56
57
 
57
58
  ---
@@ -67,6 +68,7 @@ Execute these steps in order.
67
68
  **Init-first pattern**: When spawning agents, pass the output of `node plugins/pbr/scripts/pbr-tools.js init verify-work {N}` as context rather than having the agent read multiple files separately. This reduces file reads and prevents context-loading failures.
68
69
 
69
70
  1. Parse `$ARGUMENTS` for phase number and `--auto-fix` flag
71
+ - If `--model <value>` is present in `$ARGUMENTS`, extract the value (sonnet, opus, haiku, inherit). Store as `override_model`. When spawning verifier Task() agents, use `override_model` instead of the config-derived verifier_model. If an invalid value is provided, display an error and list valid values.
70
72
  2. Read `.planning/config.json`
71
73
  **CRITICAL (hook-enforced): Write .active-skill NOW.** Write the text "review" to `.planning/.active-skill` using the Write tool.
72
74
  3. Resolve depth profile: run `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
@@ -186,7 +188,7 @@ Task({
186
188
 
187
189
  #### Verifier Prompt Template
188
190
 
189
- Read `skills/review/templates/verifier-prompt.md.tmpl` and use its content as the verifier prompt.
191
+ Read `${CLAUDE_SKILL_DIR}/templates/verifier-prompt.md.tmpl` and use its content as the verifier prompt.
190
192
 
191
193
  **Prepend this block to the verifier prompt before sending:**
192
194
  ```
@@ -428,7 +430,7 @@ Task({
428
430
 
429
431
  ##### Debugger Prompt Template
430
432
 
431
- Read `skills/review/templates/debugger-prompt.md.tmpl` and use its content as the debugger prompt.
433
+ Read `${CLAUDE_SKILL_DIR}/templates/debugger-prompt.md.tmpl` and use its content as the debugger prompt.
432
434
 
433
435
  **Prepend this block to the debugger prompt before sending:**
434
436
  ```
@@ -460,7 +462,7 @@ Task({
460
462
 
461
463
  ##### Gap Planner Prompt Template
462
464
 
463
- Read `skills/review/templates/gap-planner-prompt.md.tmpl` and use its content as the gap planner prompt.
465
+ Read `${CLAUDE_SKILL_DIR}/templates/gap-planner-prompt.md.tmpl` and use its content as the gap planner prompt.
464
466
 
465
467
  **Prepend this block to the gap planner prompt before sending:**
466
468
  ```
@@ -90,7 +90,7 @@ Before spawning agents, do a quick scan to identify what we're working with. Thi
90
90
  4. **Read existing docs** — README.md, architecture docs, .env.example
91
91
  5. **Write `.planning/codebase/RECON.md`** with project type, scale, key directories, entry points, and quick stats
92
92
 
93
- Refer to the "Reconnaissance Detection Reference" section of `skills/scan/templates/mapper-prompt.md.tmpl` for the full detection checklists.
93
+ Refer to the "Reconnaissance Detection Reference" section of `${CLAUDE_SKILL_DIR}/templates/mapper-prompt.md.tmpl` for the full detection checklists.
94
94
 
95
95
  ### Step 3: Spawn Analysis Agents
96
96
 
@@ -119,7 +119,7 @@ Display to the user:
119
119
 
120
120
  Spawn `{mapper_count}` parallel `Task(subagent_type: "pbr:codebase-mapper")` agents, one for each area in `scan.mapper_areas`. All should be spawned in a single response for maximum parallelism.
121
121
 
122
- For each agent, read `skills/scan/templates/mapper-prompt.md.tmpl` and fill in the placeholders:
122
+ For each agent, read `${CLAUDE_SKILL_DIR}/templates/mapper-prompt.md.tmpl` and fill in the placeholders:
123
123
  - `{focus_area}`: one of `tech`, `arch`, `quality`, `concerns`
124
124
  - `{project_path}`: the working directory
125
125
  - `{recon_data}`: contents of RECON.md
@@ -136,7 +136,69 @@ This project uses [Plan-Build-Run](https://github.com/SienkLogic/plan-build-run)
136
136
 
137
137
  ---
138
138
 
139
- ## Step 5: Write Updated Config
139
+ ## Step 5: Platform Settings
140
+
141
+ Manage Claude Code platform settings that PBR recommends for optimal token usage.
142
+
143
+ **Read `.planning/config.json`** (already loaded in Step 1). Check for a `platform_settings` block:
144
+ - If absent, treat it as `{}` (no managed settings).
145
+
146
+ **Check for existing `.claude/settings.json`**:
147
+ - If it exists, read its contents. Parse as JSON (or `{}` if empty/missing).
148
+ - If it does not exist, start from `{}`.
149
+
150
+ **Compute the merge**:
151
+ - Start with the existing `.claude/settings.json` content.
152
+ - Apply each key from `platform_settings` in config.json on top.
153
+ - If `platform_settings` is absent or empty, skip the write entirely.
154
+
155
+ **Report drift** (compare before/after):
156
+ - List keys being ADDED (were absent in .claude/settings.json)
157
+ - List keys being CHANGED (differ from existing .claude/settings.json value)
158
+ - List keys that MATCH (already correct — no change needed)
159
+
160
+ Display the report:
161
+
162
+ ```
163
+ Platform Settings:
164
+ Keys added: includeGitInstructions → false
165
+ Keys matched: (none)
166
+ Keys changed: (none)
167
+
168
+ Writing .claude/settings.json...
169
+ ```
170
+
171
+ If all keys already match, display:
172
+
173
+ ```
174
+ Platform Settings: .claude/settings.json is already in sync — no changes needed.
175
+ ```
176
+
177
+ **Conflict detection**: If an existing `.claude/settings.json` has a key from `platform_settings` set to the OPPOSITE value (e.g., `"includeGitInstructions": true` when PBR wants `false`), display a WARNING before overwriting:
178
+
179
+ ```
180
+ WARNING: .claude/settings.json has includeGitInstructions: true
181
+ PBR recommends false (removes redundant built-in git instructions).
182
+ Overwriting with PBR recommended value.
183
+ ```
184
+
185
+ **Write the merged settings.json**:
186
+ - Write to `.claude/settings.json` in the project root (alongside `.planning/`).
187
+ - Ensure the directory `.claude/` exists (create it if needed with Bash `mkdir -p .claude`).
188
+ - Write with 2-space indentation. Include a `$schema` key at the top:
189
+ ```json
190
+ {
191
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
192
+ "includeGitInstructions": false
193
+ }
194
+ ```
195
+ (Merge in any pre-existing keys from .claude/settings.json that are NOT managed by PBR — pass them through unchanged at the bottom of the object.)
196
+
197
+ **Drift detection note**: On subsequent /pbr:setup runs, if `.claude/settings.json` has drifted from `platform_settings` (e.g., user manually changed it), this step will detect and re-apply the PBR values with a drift warning. This is by design — platform_settings in config.json is the source of truth.
198
+
199
+ ---
200
+
201
+ ## Step 6: Write Updated Config
140
202
 
141
203
  **CRITICAL: Write `.planning/config.json` NOW with all changes from Steps 2-3. Do NOT skip this step.**
142
204
 
@@ -144,13 +206,14 @@ Write the updated config.json to disk with all applied changes.
144
206
 
145
207
  ---
146
208
 
147
- ## Step 6: Verification
209
+ ## Step 7: Verification
148
210
 
149
211
  Run a quick check:
150
212
  1. Verify `.planning/config.json` is valid JSON (read it back)
151
213
  2. Display updated settings summary
152
214
 
153
215
  Display:
216
+
154
217
  ```
155
218
  ╔══════════════════════════════════════════════════════════════╗
156
219
  ║ PLAN-BUILD-RUN ► RECONFIGURE COMPLETE ✓ ║
@@ -160,6 +223,7 @@ Updated:
160
223
  - Model profile: {new profile}
161
224
  - Features changed: {list or "none"}
162
225
  - CLAUDE.md: {updated/skipped}
226
+ - Platform settings: {".claude/settings.json updated" or "already in sync" or "no managed settings"}
163
227
 
164
228
  Run /pbr:status to see current project state.
165
229
  ```
@@ -28,6 +28,7 @@ Task({
28
28
  - .planning/STATE.md
29
29
  - .planning/ROADMAP.md
30
30
  - .planning/REQUIREMENTS.md
31
+ - .planning/PROJECT.md (if exists — project vision and scope)
31
32
  - .planning/CONTEXT.md
32
33
  - Any .planning/phases/*/CONTEXT.md files
33
34
  - .planning/research/SUMMARY.md (if exists)
@@ -65,6 +66,7 @@ Task({
65
66
  - .planning/STATE.md
66
67
  - .planning/ROADMAP.md
67
68
  - .planning/REQUIREMENTS.md
69
+ - .planning/PROJECT.md (if exists — project vision and scope)
68
70
  - .planning/CONTEXT.md
69
71
  - Any .planning/phases/*/CONTEXT.md files
70
72
  - .planning/HISTORY.md (if exists — scan for decisions relevant to '{topic}' only, do NOT summarize all history)
@@ -112,6 +112,16 @@ Parse the JSON response. Capture:
112
112
 
113
113
  Store these for use in Step 4 display and Step 5 routing.
114
114
 
115
+ 6. **`.planning/CONTEXT.md`** (project-level, if exists)
116
+ - Note: project-level locked decisions file
117
+
118
+ ### Step 1d: Check Project Documents
119
+
120
+ Check existence of the three project-level documents and record their status for Step 4 display:
121
+ - `.planning/PROJECT.md` — exists or not
122
+ - `.planning/REQUIREMENTS.md` — exists or not
123
+ - `.planning/CONTEXT.md` — exists or not
124
+
115
125
  ### Step 2: Scan Phase Directories
116
126
 
117
127
  For each phase listed in ROADMAP.md:
@@ -222,6 +232,13 @@ Phase Status:
222
232
  | 2. {name} | {status indicator} {status text} | {completed}/{total} | {percentage}% |
223
233
  | ...
224
234
 
235
+ **Project documents:**
236
+ | File | Status |
237
+ |------|--------|
238
+ | PROJECT.md | {exists / not found — run /pbr:begin} |
239
+ | REQUIREMENTS.md | {exists / not found — run /pbr:begin} |
240
+ | CONTEXT.md | {exists / not found — run /pbr:discuss --project} |
241
+
225
242
  {If context tier is DEGRADING, POOR, or CRITICAL:}
226
243
  ⚠ Context: {percentage}% used ({tier}) — {recommendation_text}
227
244
  Run `/compact` to reclaim context before spawning more agents.
@@ -0,0 +1,41 @@
1
+ # {project_name}
2
+
3
+ > {ONE sentence core value statement}
4
+
5
+ ## Vision
6
+
7
+ {2-3 sentences describing the product and problem it solves. Who is it for? What does it replace or improve?}
8
+
9
+ ## Scope
10
+
11
+ ### In Scope (v1)
12
+
13
+ {Bulleted list of features and capabilities committed for this project.}
14
+
15
+ - {Feature area}: {brief description}
16
+
17
+ ### Out of Scope
18
+
19
+ {Features explicitly excluded from this project.}
20
+
21
+ - {Feature}: {brief reason why excluded}
22
+
23
+ ## Success Criteria
24
+
25
+ {Observable conditions that define project success. Each must be testable.}
26
+
27
+ - {Criterion 1 — specific and measurable}
28
+ - {Criterion 2 — specific and measurable}
29
+ - {Criterion 3 — specific and measurable}
30
+
31
+ ## Stakeholders
32
+
33
+ {Who cares about this project and why.}
34
+
35
+ - **Primary user**: {description}
36
+ - **Team**: {description}
37
+
38
+ ## Milestones
39
+
40
+ {project_name} planned in {phase_count} phases across {milestone_count} milestone(s).
41
+ See `.planning/ROADMAP.md` for phase details.
@@ -0,0 +1,52 @@
1
+ # Requirements
2
+
3
+ > Living document. Generated by `/pbr:begin`, updated via `/pbr:discuss`.
4
+ > All requirements flow from here into plans via `implements:[]` in PLAN.md frontmatter.
5
+
6
+ ## Functional Requirements
7
+
8
+ Capabilities the system must provide from the user's perspective.
9
+
10
+ ### {Category} (e.g., Authentication, API, UI)
11
+
12
+ | ID | Requirement | Priority | Status |
13
+ |----|-------------|----------|--------|
14
+ | REQ-F-001 | {User-centric, testable statement of capability} | Must | Open |
15
+ | REQ-F-002 | {User-centric, testable statement of capability} | Should | Open |
16
+
17
+ ### {Category 2}
18
+
19
+ | ID | Requirement | Priority | Status |
20
+ |----|-------------|----------|--------|
21
+ | REQ-F-010 | {User-centric, testable statement of capability} | Must | Open |
22
+
23
+ ## Non-Functional Requirements
24
+
25
+ Quality attributes and constraints the system must satisfy.
26
+
27
+ | ID | Requirement | Category | Priority |
28
+ |----|-------------|----------|----------|
29
+ | REQ-NF-001 | {Observable quality statement — e.g., "Page loads in <2s on 4G"} | Performance | Must |
30
+ | REQ-NF-002 | {Observable quality statement} | Security | Must |
31
+ | REQ-NF-003 | {Observable quality statement} | Reliability | Should |
32
+
33
+ ## Deferred Requirements (v2+)
34
+
35
+ Requirements explicitly out of scope for v1.
36
+
37
+ | ID | Requirement | Deferred Reason |
38
+ |----|-------------|----------------|
39
+ | REQ-F-099 | {requirement} | {reason — e.g., "Phase 2 priority"} |
40
+
41
+ ## Out of Scope
42
+
43
+ Features explicitly excluded. These must NOT appear in any plan.
44
+
45
+ - {Feature}: {brief rationale}
46
+
47
+ ## Traceability
48
+
49
+ | REQ-ID | Implemented In | Verified In |
50
+ |--------|---------------|------------|
51
+ | REQ-F-001 | Phase 01 PLAN-01 | Phase 01 VERIFICATION.md |
52
+ | REQ-F-002 | — | — |