@sienklogic/plan-build-run 2.54.0 → 2.55.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 (127) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/plugins/codex-pbr/agents/audit.md +223 -0
  4. package/plugins/codex-pbr/agents/codebase-mapper.md +196 -0
  5. package/plugins/codex-pbr/agents/debugger.md +245 -0
  6. package/plugins/codex-pbr/agents/dev-sync.md +142 -0
  7. package/plugins/codex-pbr/agents/executor.md +429 -0
  8. package/plugins/codex-pbr/agents/general.md +131 -0
  9. package/plugins/codex-pbr/agents/integration-checker.md +178 -0
  10. package/plugins/codex-pbr/agents/plan-checker.md +253 -0
  11. package/plugins/codex-pbr/agents/planner.md +343 -0
  12. package/plugins/codex-pbr/agents/researcher.md +253 -0
  13. package/plugins/codex-pbr/agents/synthesizer.md +183 -0
  14. package/plugins/codex-pbr/agents/verifier.md +352 -0
  15. package/plugins/codex-pbr/commands/audit.md +5 -0
  16. package/plugins/codex-pbr/commands/begin.md +5 -0
  17. package/plugins/codex-pbr/commands/build.md +5 -0
  18. package/plugins/codex-pbr/commands/config.md +5 -0
  19. package/plugins/codex-pbr/commands/continue.md +5 -0
  20. package/plugins/codex-pbr/commands/dashboard.md +5 -0
  21. package/plugins/codex-pbr/commands/debug.md +5 -0
  22. package/plugins/codex-pbr/commands/discuss.md +5 -0
  23. package/plugins/codex-pbr/commands/do.md +5 -0
  24. package/plugins/codex-pbr/commands/explore.md +5 -0
  25. package/plugins/codex-pbr/commands/health.md +5 -0
  26. package/plugins/codex-pbr/commands/help.md +5 -0
  27. package/plugins/codex-pbr/commands/import.md +5 -0
  28. package/plugins/codex-pbr/commands/milestone.md +5 -0
  29. package/plugins/codex-pbr/commands/note.md +5 -0
  30. package/plugins/codex-pbr/commands/pause.md +5 -0
  31. package/plugins/codex-pbr/commands/plan.md +5 -0
  32. package/plugins/codex-pbr/commands/quick.md +5 -0
  33. package/plugins/codex-pbr/commands/resume.md +5 -0
  34. package/plugins/codex-pbr/commands/review.md +5 -0
  35. package/plugins/codex-pbr/commands/scan.md +5 -0
  36. package/plugins/codex-pbr/commands/setup.md +5 -0
  37. package/plugins/codex-pbr/commands/status.md +5 -0
  38. package/plugins/codex-pbr/commands/statusline.md +5 -0
  39. package/plugins/codex-pbr/commands/test.md +5 -0
  40. package/plugins/codex-pbr/commands/todo.md +5 -0
  41. package/plugins/codex-pbr/commands/undo.md +5 -0
  42. package/plugins/codex-pbr/references/agent-contracts.md +324 -0
  43. package/plugins/codex-pbr/references/agent-teams.md +54 -0
  44. package/plugins/codex-pbr/references/common-bug-patterns.md +13 -0
  45. package/plugins/codex-pbr/references/config-reference.md +552 -0
  46. package/plugins/codex-pbr/references/continuation-format.md +212 -0
  47. package/plugins/codex-pbr/references/deviation-rules.md +112 -0
  48. package/plugins/codex-pbr/references/git-integration.md +256 -0
  49. package/plugins/codex-pbr/references/integration-patterns.md +117 -0
  50. package/plugins/codex-pbr/references/model-profiles.md +99 -0
  51. package/plugins/codex-pbr/references/model-selection.md +31 -0
  52. package/plugins/codex-pbr/references/pbr-tools-cli.md +400 -0
  53. package/plugins/codex-pbr/references/plan-authoring.md +246 -0
  54. package/plugins/codex-pbr/references/plan-format.md +313 -0
  55. package/plugins/codex-pbr/references/questioning.md +235 -0
  56. package/plugins/codex-pbr/references/reading-verification.md +127 -0
  57. package/plugins/codex-pbr/references/signal-files.md +41 -0
  58. package/plugins/codex-pbr/references/stub-patterns.md +160 -0
  59. package/plugins/codex-pbr/references/ui-formatting.md +444 -0
  60. package/plugins/codex-pbr/references/wave-execution.md +95 -0
  61. package/plugins/codex-pbr/skills/audit/SKILL.md +346 -0
  62. package/plugins/codex-pbr/skills/begin/SKILL.md +800 -0
  63. package/plugins/codex-pbr/skills/build/SKILL.md +958 -0
  64. package/plugins/codex-pbr/skills/config/SKILL.md +267 -0
  65. package/plugins/codex-pbr/skills/continue/SKILL.md +172 -0
  66. package/plugins/codex-pbr/skills/dashboard/SKILL.md +44 -0
  67. package/plugins/codex-pbr/skills/debug/SKILL.md +530 -0
  68. package/plugins/codex-pbr/skills/discuss/SKILL.md +355 -0
  69. package/plugins/codex-pbr/skills/do/SKILL.md +68 -0
  70. package/plugins/codex-pbr/skills/explore/SKILL.md +407 -0
  71. package/plugins/codex-pbr/skills/health/SKILL.md +300 -0
  72. package/plugins/codex-pbr/skills/help/SKILL.md +229 -0
  73. package/plugins/codex-pbr/skills/import/SKILL.md +538 -0
  74. package/plugins/codex-pbr/skills/milestone/SKILL.md +620 -0
  75. package/plugins/codex-pbr/skills/note/SKILL.md +215 -0
  76. package/plugins/codex-pbr/skills/pause/SKILL.md +258 -0
  77. package/plugins/codex-pbr/skills/plan/SKILL.md +650 -0
  78. package/plugins/codex-pbr/skills/quick/SKILL.md +417 -0
  79. package/plugins/codex-pbr/skills/resume/SKILL.md +403 -0
  80. package/plugins/codex-pbr/skills/review/SKILL.md +669 -0
  81. package/plugins/codex-pbr/skills/scan/SKILL.md +325 -0
  82. package/plugins/codex-pbr/skills/setup/SKILL.md +169 -0
  83. package/plugins/codex-pbr/skills/shared/commit-planning-docs.md +35 -0
  84. package/plugins/codex-pbr/skills/shared/config-loading.md +102 -0
  85. package/plugins/codex-pbr/skills/shared/context-budget.md +77 -0
  86. package/plugins/codex-pbr/skills/shared/context-loader-task.md +86 -0
  87. package/plugins/codex-pbr/skills/shared/digest-select.md +79 -0
  88. package/plugins/codex-pbr/skills/shared/domain-probes.md +125 -0
  89. package/plugins/codex-pbr/skills/shared/error-reporting.md +59 -0
  90. package/plugins/codex-pbr/skills/shared/gate-prompts.md +388 -0
  91. package/plugins/codex-pbr/skills/shared/phase-argument-parsing.md +45 -0
  92. package/plugins/codex-pbr/skills/shared/revision-loop.md +81 -0
  93. package/plugins/codex-pbr/skills/shared/state-update.md +169 -0
  94. package/plugins/codex-pbr/skills/shared/universal-anti-patterns.md +43 -0
  95. package/plugins/codex-pbr/skills/status/SKILL.md +449 -0
  96. package/plugins/codex-pbr/skills/statusline/SKILL.md +149 -0
  97. package/plugins/codex-pbr/skills/test/SKILL.md +210 -0
  98. package/plugins/codex-pbr/skills/todo/SKILL.md +281 -0
  99. package/plugins/codex-pbr/skills/undo/SKILL.md +172 -0
  100. package/plugins/codex-pbr/templates/CONTEXT.md.tmpl +52 -0
  101. package/plugins/codex-pbr/templates/INTEGRATION-REPORT.md.tmpl +167 -0
  102. package/plugins/codex-pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
  103. package/plugins/codex-pbr/templates/ROADMAP.md.tmpl +47 -0
  104. package/plugins/codex-pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  105. package/plugins/codex-pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
  106. package/plugins/codex-pbr/templates/SUMMARY.md.tmpl +81 -0
  107. package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  108. package/plugins/codex-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  109. package/plugins/codex-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  110. package/plugins/codex-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  111. package/plugins/codex-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  112. package/plugins/codex-pbr/templates/codebase/STACK.md.tmpl +78 -0
  113. package/plugins/codex-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  114. package/plugins/codex-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  115. package/plugins/codex-pbr/templates/continue-here.md.tmpl +73 -0
  116. package/plugins/codex-pbr/templates/pr-body.md.tmpl +22 -0
  117. package/plugins/codex-pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
  118. package/plugins/codex-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  119. package/plugins/codex-pbr/templates/research/STACK.md.tmpl +71 -0
  120. package/plugins/codex-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  121. package/plugins/codex-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  122. package/plugins/codex-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  123. package/plugins/codex-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  124. package/plugins/copilot-pbr/plugin.json +1 -1
  125. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  126. package/plugins/jules-pbr/AGENTS.md +600 -0
  127. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
@@ -0,0 +1,267 @@
1
+ ---
2
+ name: config
3
+ description: "Configure settings: depth, model profiles, features, git, and gates."
4
+ ---
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
+
8
+ ## Step 0 — Immediate Output
9
+
10
+ **Before ANY tool calls**, display this banner:
11
+
12
+ ```
13
+ ╔══════════════════════════════════════════════════════════════╗
14
+ ║ PLAN-BUILD-RUN ► CONFIGURATION ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ # $pbr-config — Configure Plan-Build-Run
21
+
22
+ ## Overview
23
+
24
+ Reads and writes `.planning/config.json`. Interactive configuration with AskUserQuestion.
25
+
26
+ ## References
27
+
28
+ - `references/config-reference.md` — Full config.json schema (54 fields, 16 feature toggles, validation rules)
29
+ - `references/model-profiles.md` — Model selection guide for agent spawning
30
+
31
+ ## Flow
32
+
33
+ ### 1. Load Current Config
34
+
35
+ Read `.planning/config.json`. If it doesn't exist, display:
36
+ ```
37
+ ╔══════════════════════════════════════════════════════════════╗
38
+ ║ ERROR ║
39
+ ╚══════════════════════════════════════════════════════════════╝
40
+
41
+ No Plan-Build-Run project found.
42
+
43
+ **To fix:** Run `$pbr-begin` first.
44
+ ```
45
+
46
+ ### 2. Parse Arguments
47
+
48
+ If `$ARGUMENTS` is provided, handle direct setting:
49
+ - `depth quick|standard|comprehensive` — set depth directly
50
+ - `model <agent> <model>` — set model for specific agent (e.g., `model executor sonnet`)
51
+ - `model-profile quality|balanced|budget|adaptive` — set all models at once using a preset
52
+ - `gate <gate-name> on|off` — toggle a gate
53
+ - `feature <feature-name> on|off` — toggle a feature (e.g., `feature auto_continue on`). When the user specifies a feature name without the `features.` prefix, automatically prepend `features.` before writing to config.
54
+ - `git branching none|phase|milestone|disabled` — set branching strategy
55
+ - `git mode disabled` — disable git integration entirely
56
+ - `show` — display current config (default when no args)
57
+
58
+ ### 3. Interactive Mode (no arguments or just `show`)
59
+
60
+ Display current configuration in a readable format:
61
+
62
+ ```
63
+ Plan-Build-Run Configuration
64
+ =====================
65
+
66
+ Workflow:
67
+ Depth: standard (balanced)
68
+ Research: on Plan-check: on Verify: on
69
+ Scan mappers: 4 Debug rounds: 5 Inline verify: off
70
+ Mode: interactive
71
+ Context Strategy: aggressive
72
+
73
+ Features:
74
+ ✓ Structured planning ✓ Goal verification
75
+ ✓ Context isolation ✓ Atomic commits
76
+ ✓ Session persistence ✓ Research phase
77
+ ✓ Plan checking ✗ TDD mode
78
+ ✓ Status line ✗ Auto-continue
79
+ ✗ Auto-advance ✗ Team discussions
80
+
81
+ Models:
82
+ Researcher: sonnet Planner: inherit Executor: inherit
83
+ Verifier: sonnet Int-Checker: sonnet Debugger: inherit
84
+ Mapper: sonnet Synthesizer: haiku
85
+
86
+ Parallelization:
87
+ Enabled: true Max concurrent: 3
88
+ Plan-level: true Task-level: false
89
+ Use Teams: false
90
+
91
+ Git:
92
+ Mode: enabled Branching: none
93
+ Commit docs: true
94
+ Commit format: {type}({phase}-{plan}): {description}
95
+
96
+ Gates:
97
+ ✓ Confirm project ✓ Confirm roadmap ✓ Confirm plan
98
+ ✗ Confirm execute ✓ Confirm transition ✓ Issues review
99
+
100
+ Status Line:
101
+ Sections: [phase, plan, status, context]
102
+ Brand: PLAN-BUILD-RUN
103
+ Context bar: 20 chars, green<50%, yellow<80%
104
+
105
+ Spinner Tips: (none configured — using defaults)
106
+ ```
107
+
108
+ Then present the configuration menu using the **settings-category-select** pattern (see `skills/shared/gate-prompts.md`):
109
+
110
+ Use AskUserQuestion:
111
+ question: "What would you like to configure?"
112
+ header: "Configure"
113
+ options:
114
+ - label: "Depth" description: "quick/standard/comprehensive"
115
+ - label: "Model profile" description: "quality/balanced/budget/adaptive"
116
+ - label: "Features" description: "Toggle workflow features, gates, status line"
117
+ - label: "Git settings" description: "branching strategy, commit mode"
118
+ - label: "Save as defaults" description: "Save current config as user-level defaults for new projects"
119
+ multiSelect: false
120
+
121
+ Note: The original 7 categories are condensed to 5. "Models" (per-agent) is accessible through "Model profile" with a follow-up option. "Gates", "Parallelization", and "Status Line" are grouped under "Features". "Save as defaults" exports to ~/.claude/pbr-defaults.json.
122
+
123
+ **Follow-up based on selection:**
124
+
125
+ If user selects "Depth":
126
+ Use AskUserQuestion:
127
+ question: "Select workflow depth"
128
+ header: "Depth"
129
+ options:
130
+ - label: "Quick" description: "Budget mode: skip research/plan-check/verifier, 2 scan mappers, ~1-3 fewer spawns per phase"
131
+ - label: "Standard" description: "Balanced mode: conditional research, full plan-check and verification, 4 scan mappers (default)"
132
+ - label: "Comprehensive" description: "Thorough mode: always research, always verify, inline verification, 4 scan mappers"
133
+ multiSelect: false
134
+
135
+ After setting depth, the profile is automatically resolved. Show the user the effective settings:
136
+ "Depth set to {value}. Effective profile:"
137
+ Then display the profile summary (research, plan-check, verify, scan mappers, debug rounds, inline verify).
138
+
139
+ To resolve the profile, run: `node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth`
140
+
141
+ If the user wants to override a specific profile setting, they can set `depth_profiles.{depth}.{key}` directly.
142
+ For example: to use quick mode but keep plan-checking, the user would set depth to quick and then override:
143
+ `$pbr-config` -> Features -> Plan checking -> Enable
144
+ This writes `depth_profiles.quick.features.plan_checking: true` to config.json.
145
+
146
+ If user selects "Model profile":
147
+ Use the **model-profile-select** pattern:
148
+ Use AskUserQuestion:
149
+ question: "Select model profile"
150
+ header: "Profile"
151
+ options:
152
+ - label: "Quality" description: "opus for all agents (highest cost)"
153
+ - label: "Balanced" description: "sonnet/inherit mix (default)"
154
+ - label: "Budget" description: "haiku for all agents (lowest cost)"
155
+ - label: "Adaptive" description: "sonnet planning, haiku execution"
156
+ multiSelect: false
157
+
158
+ If user asks for per-agent model selection (typed "models" or "per-agent"), present individual agent selection as plain text: list the agents and ask which one to change, then ask for the model. This is a freeform flow because agent names are dynamic.
159
+
160
+ If user selects "Features":
161
+ List all features and gates with current status, then use the **toggle-confirm** pattern for each change.
162
+ **Feature name normalization:** When toggling a feature, if the user specifies a bare name (e.g., `inline_verify`), normalize it to `features.inline_verify` before writing to config. All feature flags live under the `features.*` namespace in config.json.
163
+ Use AskUserQuestion:
164
+ question: "Enable {feature_name}?"
165
+ header: "Toggle"
166
+ options:
167
+ - label: "Enable" description: "Turn this feature on"
168
+ - label: "Disable" description: "Turn this feature off"
169
+ multiSelect: false
170
+
171
+ Repeat for each feature the user wants to change. Show updated status after each toggle.
172
+
173
+ If user selects "Git settings":
174
+ Use AskUserQuestion:
175
+ question: "Select branching strategy"
176
+ header: "Branching"
177
+ options:
178
+ - label: "None" description: "All work on current branch"
179
+ - label: "Phase" description: "New branch per phase"
180
+ - label: "Milestone" description: "New branch per milestone"
181
+ - label: "Disabled" description: "No git integration"
182
+ multiSelect: false
183
+
184
+ If user selects "Save as defaults":
185
+ Save current project config as user-level defaults for future projects:
186
+
187
+ ```bash
188
+ node "${PLUGIN_ROOT}/scripts/pbr-tools.js" config save-defaults
189
+ ```
190
+
191
+ Display: "Saved your preferences to ~/.claude/pbr-defaults.json. New projects created with $pbr-setup will use these as starting values."
192
+
193
+ If user types something else (freeform): interpret as a direct setting command and handle via Step 2 argument parsing logic.
194
+
195
+ ### 4. Apply Changes
196
+
197
+ Update config.json with new values. Show what changed with a branded completion:
198
+ ```
199
+ ╔══════════════════════════════════════════════════════════════╗
200
+ ║ PLAN-BUILD-RUN ► CONFIG UPDATED ✓ ║
201
+ ╚══════════════════════════════════════════════════════════════╝
202
+
203
+ Updated:
204
+ depth: standard → quick
205
+ models.executor: inherit → sonnet
206
+
207
+
208
+
209
+ ╔══════════════════════════════════════════════════════════════╗
210
+ ║ ▶ NEXT UP ║
211
+ ╚══════════════════════════════════════════════════════════════╝
212
+
213
+ **Continue your workflow** — settings saved
214
+
215
+ `$pbr-status`
216
+
217
+ <sub>`/clear` first → fresh context window</sub>
218
+
219
+
220
+
221
+ **Also available:**
222
+ - `$pbr-continue` — execute next logical step
223
+ - `$pbr-config` — change more settings
224
+
225
+
226
+ ```
227
+
228
+ ## Config Schema
229
+
230
+ See `skills/begin/templates/config.json.tmpl` for the full schema with defaults.
231
+
232
+ ### Version Migration
233
+
234
+ If config `version` is older than current (2), run migration:
235
+ - v1 → v2: Add missing fields with defaults, rename `model_profile` → per-agent `models` object
236
+
237
+ ## Model Profile Presets
238
+
239
+ The `model-profile` command sets all agent models at once:
240
+
241
+ | Profile | researcher | planner | executor | verifier | int-checker | debugger | mapper | synthesizer |
242
+ |---------|-----------|---------|----------|----------|-------------|----------|--------|-------------|
243
+ | `quality` | opus | opus | opus | opus | sonnet | opus | sonnet | sonnet |
244
+ | `balanced` | sonnet | inherit | inherit | sonnet | sonnet | inherit | sonnet | haiku |
245
+ | `budget` | haiku | haiku | haiku | haiku | haiku | haiku | haiku | haiku |
246
+ | `adaptive` | sonnet | sonnet | inherit | sonnet | haiku | inherit | haiku | haiku |
247
+
248
+ `balanced` is the default and matches the initial config template. `adaptive` front-loads intelligence in research/planning and uses lighter models for mechanical work.
249
+
250
+ ## Feature Reference
251
+
252
+ | Feature | Key | Default | Description |
253
+ |---------|-----|---------|-------------|
254
+ | Auto-continue | `features.auto_continue` | `false` | Automatically spawn continuation agents without user prompt |
255
+ | Auto-advance | `features.auto_advance` | `false` | Chain build→review→plan automatically in autonomous mode |
256
+ | Team discussions | `features.team_discussions` | `false` | Enable team-based discussion workflows |
257
+
258
+ **Team boundaries**: Teams are NEVER used for execution, planning, or verification. Teams are only for discussion and brainstorming workflows. All execution, planning, and verification use single-agent Task() spawns with proper subagent types.
259
+
260
+ ## Validation
261
+
262
+ - `depth` must be one of: quick, standard, comprehensive
263
+ - `models.*` must be one of: sonnet, inherit, haiku, opus
264
+ - `context_strategy` must be one of: aggressive, balanced, minimal
265
+ - `git.branching` must be one of: none, phase, milestone, disabled
266
+ - `git.mode` must be one of: enabled, disabled. When `disabled`, no git commands are run (no commits, no branching). Useful for prototyping or non-git projects.
267
+ - Boolean fields must be true/false
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: continue
3
+ description: "Execute the next logical step automatically. No prompts, no decisions — just do it."
4
+ ---
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
+
8
+ # $pbr-continue — Action-Oriented Resumption
9
+
10
+ You are running the **continue** skill. Unlike `$pbr-status` which shows the dashboard and suggests the next action, `$pbr-continue` determines and EXECUTES the next logical step automatically. Stops safely at milestones, checkpoints, errors, and verification gaps.
11
+
12
+ This skill runs **inline** and may delegate to other skills via Task().
13
+
14
+ ---
15
+
16
+ ## Step 0 — Immediate Output
17
+
18
+ **Before ANY tool calls**, display this banner:
19
+
20
+ ```
21
+ ╔══════════════════════════════════════════════════════════════╗
22
+ ║ PLAN-BUILD-RUN ► NEXT STEP ║
23
+ ╚══════════════════════════════════════════════════════════════╝
24
+ ```
25
+
26
+ Then proceed to Step 1.
27
+
28
+ ## Context Budget
29
+
30
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
31
+
32
+ Additionally for this skill:
33
+ - **Minimize** state reads — read only STATE.md lines 1-20 to determine next action
34
+ - **Delegate** execution to the appropriate skill via Skill() or Task()
35
+
36
+ ---
37
+
38
+ ## Core Principle
39
+
40
+ **Do, don't ask.** Read STATE.md, determine the next action, and execute it. The user wants hands-off forward progress.
41
+
42
+ ---
43
+
44
+ ## Flow
45
+
46
+ ### Step 1: Read State
47
+
48
+ Read `.planning/STATE.md` and determine current position:
49
+ - Current phase number and name
50
+ - Current plan progress
51
+ - Phase status (planning, building, reviewing, complete)
52
+
53
+ Then read `.planning/ROADMAP.md` to identify the current milestone boundary:
54
+ - Find which `## Milestone:` section contains the current phase
55
+ - Determine if the current phase is the **last phase** in that milestone section
56
+ - If this is the last phase and it is verified/complete, warn: "This is the final phase of milestone {name}. After verification, run `$pbr-milestone` to complete it."
57
+ - If the current phase's `Depends on` references a phase from the **previous** milestone that is not yet complete, warn: "Cross-milestone dependency: Phase {N} depends on Phase {M} from milestone {prev}, which is not yet complete."
58
+
59
+ If STATE.md doesn't exist, display:
60
+ ```
61
+ ╔══════════════════════════════════════════════════════════════╗
62
+ ║ ERROR ║
63
+ ╚══════════════════════════════════════════════════════════════╝
64
+
65
+ No project state found.
66
+
67
+ **To fix:** Run `$pbr-begin` first.
68
+ ```
69
+
70
+ #### Context Budget Guard
71
+
72
+ Before proceeding to priority evaluation, check for runaway continue chains:
73
+
74
+ 1. Read `last_command` from STATE.md. **If `last_command` is missing, empty, or the field does not exist, skip directly to the fallback detection** — do NOT error or warn.
75
+ 2. If `last_command` is present and equals `$pbr-continue`, this is a chained continue. Check session context for consecutive `$pbr-continue` invocations.
76
+ 3. **Fallback detection** — if `last_command` is not available or not present in STATE.md:
77
+ - Check `.planning/.active-skill` file — if it contains `continue`, treat as a chained continue
78
+ - Check STATE.md `last_action` field — if it contains `continue`, treat as a chained continue
79
+ - If neither source is available, assume this is the first invocation (do not warn)
80
+ 4. **If this is the 6th consecutive `$pbr-continue` in a row**, display:
81
+
82
+ ```
83
+ WARNING: Context budget warning: 6 consecutive auto-continues detected.
84
+ Recommend running $pbr-pause then resuming in a fresh session.
85
+ ```
86
+
87
+ Then present the user with a choice:
88
+ - **"Continue"** — proceed with the next action
89
+ - **"Pause"** — run `$pbr-pause` logic to save state and stop
90
+
91
+ This prevents runaway chains that fill the context window without a human checkpoint.
92
+
93
+ ### Step 2: Scan for Priority Items
94
+
95
+ Check the resumption priority hierarchy (same as $pbr-resume):
96
+
97
+ 1. **UAT Blockers**: VERIFICATION.md with `status: gaps_found` → Execute `$pbr-plan {N} --gaps`
98
+ 2. **Checkpoint pending**: `.checkpoint-manifest.json` with pending items → Resume the build
99
+ 3. **Continue-here file**: `.continue-here.md` exists → Follow its next step
100
+ 4. **Incomplete build**: PLAN.md files without SUMMARY.md → Execute `$pbr-build {N}`
101
+ 5. **Unverified phase**: All plans complete, no VERIFICATION.md → Execute `$pbr-review {N}`
102
+ 6. **Phase complete, more phases exist**: Verification passed → Execute `$pbr-plan {N+1}`
103
+ 7. **Last phase in current milestone complete**: Verification passed on the last phase of the current milestone's phase range → Stop. Display: "Milestone complete! Run `$pbr-milestone audit` to verify cross-phase integration, then `$pbr-milestone complete` to archive."
104
+ 8. **Between milestones**: Current milestone is marked complete in STATE.md, but more milestones exist or user needs to create the next one → Stop. Display: "Current milestone is complete. Run `$pbr-milestone new` to start the next milestone, or `$pbr-milestone audit` if not yet audited."
105
+
106
+ ### Step 3: Execute
107
+
108
+ Based on the determined action, display the delegation indicator to the user:
109
+ ```
110
+ ◐ Delegating to $pbr-{skill} {args}...
111
+ ```
112
+
113
+ Then invoke the appropriate skill via the Skill tool. **NEVER read SKILL.md files into your context** — this wastes the main context budget with 500+ lines of instructions. Instead, use the Skill tool which runs the skill in a clean invocation:
114
+
115
+ | Situation | Action | How |
116
+ |-----------|--------|-----|
117
+ | Gaps need closure | Plan gap closure | `Skill({ skill: "pbr:plan", args: "{N} --gaps" })` |
118
+ | Build incomplete | Continue build | `Skill({ skill: "pbr:build", args: "{N}" })` |
119
+ | Review needed | Run review | `Skill({ skill: "pbr:review", args: "{N}" })` |
120
+ | Next phase needed | Plan next phase | `Skill({ skill: "pbr:plan", args: "{N+1}" })` |
121
+ | Project not started | Plan phase 1 | `Skill({ skill: "pbr:plan", args: "1" })` |
122
+
123
+ Where `{N}` is the current phase number determined from STATE.md in Step 1.
124
+
125
+ ### Step 4: Report and Chain
126
+
127
+ After execution completes, display a branded completion:
128
+ ```
129
+ ╔══════════════════════════════════════════════════════════════╗
130
+ ║ PLAN-BUILD-RUN ► STEP COMPLETE ✓ ║
131
+ ╚══════════════════════════════════════════════════════════════╝
132
+
133
+ ✓ Completed: {what was done}
134
+
135
+
136
+
137
+ ╔══════════════════════════════════════════════════════════════╗
138
+ ║ ▶ NEXT UP ║
139
+ ╚══════════════════════════════════════════════════════════════╝
140
+
141
+ **{Next action description}**
142
+
143
+ `$pbr-continue` or `{specific command}`
144
+
145
+
146
+ ```
147
+
148
+ **If `features.auto_advance` is `true` AND `mode` is `autonomous`:**
149
+ After the delegated skill completes, immediately re-run Step 1-3 to determine and execute the NEXT action. Continue chaining until a hard stop is reached. This enables hands-free phase cycling: build→review→plan→build→...
150
+
151
+ ---
152
+
153
+ ## Hard Stops
154
+
155
+ Do NOT auto-continue when:
156
+ - `config.mode` is NOT `autonomous` and a gate confirmation is needed
157
+ - A checkpoint requires human input (decision, verify, action)
158
+ - An error occurred during execution
159
+ - The milestone is complete
160
+ - Verification found gaps (need user review before advancing)
161
+
162
+ In these cases, explain why auto-continue stopped and what the user needs to do.
163
+
164
+ ---
165
+
166
+ ## Anti-Patterns
167
+
168
+ 1. **DO NOT** ask the user what to do — determine it from state
169
+ 2. **DO NOT** skip error handling — if something fails, stop and report
170
+ 3. **DO NOT** continue past checkpoints that need human input
171
+ 4. **DO NOT** auto-continue into a new milestone — that needs user initiation
172
+ 5. **DO NOT** modify STATE.md directly — let the delegated skill handle it
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: dashboard
3
+ description: "Launch the PBR web dashboard for the current project."
4
+ ---
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. Begin executing immediately.**
7
+
8
+ ## Step 0 — Immediate Output
9
+
10
+ **Before ANY tool calls**, display this banner:
11
+
12
+ ```
13
+ ╔══════════════════════════════════════════════════════════════╗
14
+ ║ PLAN-BUILD-RUN ► DASHBOARD ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ ## Behavior
21
+
22
+ 1. **Parse arguments**: Extract `--port N` from the user's input. Default to `3000`.
23
+
24
+ 2. **Check dependencies**: Check if `../../dashboard/node_modules/` exists. If not, run:
25
+ ```
26
+ npm install --prefix ../../dashboard
27
+ ```
28
+
29
+ 3. **Launch dashboard**: Run in background via Bash:
30
+ ```
31
+ node ../../dashboard/bin/cli.js --dir <cwd> --port <port> &
32
+ ```
33
+ Use `&` to background the process so it doesn't block the session.
34
+
35
+ 4. **Output to user**:
36
+ ```
37
+ Dashboard running at http://localhost:<port>
38
+ Open this URL in your browser to view your project's planning state.
39
+ ```
40
+
41
+ ## Notes
42
+
43
+ - If the port is already in use, the dashboard will fail to start — suggest the user try a different port with `--port`.
44
+ - The dashboard watches `.planning/` for live updates via SSE.