@sienklogic/plan-build-run 2.3.1 → 2.4.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 (146) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/README.md +54 -20
  3. package/dashboard/src/services/dashboard.service.js +24 -1
  4. package/dashboard/src/services/milestone.service.js +68 -17
  5. package/package.json +1 -1
  6. package/plugins/copilot-pbr/CHANGELOG.md +19 -0
  7. package/plugins/copilot-pbr/README.md +129 -0
  8. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +109 -0
  9. package/plugins/copilot-pbr/agents/debugger.agent.md +169 -0
  10. package/plugins/copilot-pbr/agents/executor.agent.md +237 -0
  11. package/plugins/copilot-pbr/agents/general.agent.md +88 -0
  12. package/plugins/copilot-pbr/agents/integration-checker.agent.md +88 -0
  13. package/plugins/copilot-pbr/agents/plan-checker.agent.md +199 -0
  14. package/plugins/copilot-pbr/agents/planner.agent.md +181 -0
  15. package/plugins/copilot-pbr/agents/researcher.agent.md +163 -0
  16. package/plugins/copilot-pbr/agents/synthesizer.agent.md +102 -0
  17. package/plugins/copilot-pbr/agents/verifier.agent.md +194 -0
  18. package/plugins/copilot-pbr/hooks/hooks.json +144 -0
  19. package/plugins/copilot-pbr/plugin.json +30 -0
  20. package/plugins/copilot-pbr/references/agent-anti-patterns.md +25 -0
  21. package/plugins/copilot-pbr/references/agent-interactions.md +135 -0
  22. package/plugins/copilot-pbr/references/agent-teams.md +55 -0
  23. package/plugins/copilot-pbr/references/checkpoints.md +158 -0
  24. package/plugins/copilot-pbr/references/common-bug-patterns.md +14 -0
  25. package/plugins/copilot-pbr/references/config-reference.md +442 -0
  26. package/plugins/copilot-pbr/references/continuation-format.md +213 -0
  27. package/plugins/copilot-pbr/references/deviation-rules.md +113 -0
  28. package/plugins/copilot-pbr/references/git-integration.md +227 -0
  29. package/plugins/copilot-pbr/references/integration-patterns.md +118 -0
  30. package/plugins/copilot-pbr/references/model-profiles.md +100 -0
  31. package/plugins/copilot-pbr/references/model-selection.md +32 -0
  32. package/plugins/copilot-pbr/references/pbr-rules.md +194 -0
  33. package/plugins/copilot-pbr/references/plan-authoring.md +182 -0
  34. package/plugins/copilot-pbr/references/plan-format.md +288 -0
  35. package/plugins/copilot-pbr/references/planning-config.md +214 -0
  36. package/plugins/copilot-pbr/references/questioning.md +215 -0
  37. package/plugins/copilot-pbr/references/reading-verification.md +128 -0
  38. package/plugins/copilot-pbr/references/stub-patterns.md +161 -0
  39. package/plugins/copilot-pbr/references/subagent-coordination.md +120 -0
  40. package/plugins/copilot-pbr/references/ui-formatting.md +462 -0
  41. package/plugins/copilot-pbr/references/verification-patterns.md +199 -0
  42. package/plugins/copilot-pbr/references/wave-execution.md +96 -0
  43. package/plugins/copilot-pbr/rules/pbr-workflow.mdc +48 -0
  44. package/plugins/copilot-pbr/setup.ps1 +93 -0
  45. package/plugins/copilot-pbr/setup.sh +92 -0
  46. package/plugins/copilot-pbr/skills/begin/SKILL.md +566 -0
  47. package/plugins/copilot-pbr/skills/begin/templates/PROJECT.md.tmpl +34 -0
  48. package/plugins/copilot-pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +19 -0
  49. package/plugins/copilot-pbr/skills/begin/templates/STATE.md.tmpl +50 -0
  50. package/plugins/copilot-pbr/skills/begin/templates/config.json.tmpl +64 -0
  51. package/plugins/copilot-pbr/skills/begin/templates/researcher-prompt.md.tmpl +20 -0
  52. package/plugins/copilot-pbr/skills/begin/templates/roadmap-prompt.md.tmpl +31 -0
  53. package/plugins/copilot-pbr/skills/begin/templates/synthesis-prompt.md.tmpl +17 -0
  54. package/plugins/copilot-pbr/skills/build/SKILL.md +901 -0
  55. package/plugins/copilot-pbr/skills/config/SKILL.md +253 -0
  56. package/plugins/copilot-pbr/skills/continue/SKILL.md +159 -0
  57. package/plugins/copilot-pbr/skills/dashboard/SKILL.md +31 -0
  58. package/plugins/copilot-pbr/skills/debug/SKILL.md +511 -0
  59. package/plugins/copilot-pbr/skills/debug/templates/continuation-prompt.md.tmpl +17 -0
  60. package/plugins/copilot-pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +28 -0
  61. package/plugins/copilot-pbr/skills/discuss/SKILL.md +343 -0
  62. package/plugins/copilot-pbr/skills/discuss/templates/CONTEXT.md.tmpl +62 -0
  63. package/plugins/copilot-pbr/skills/discuss/templates/decision-categories.md +10 -0
  64. package/plugins/copilot-pbr/skills/do/SKILL.md +66 -0
  65. package/plugins/copilot-pbr/skills/explore/SKILL.md +374 -0
  66. package/plugins/copilot-pbr/skills/health/SKILL.md +218 -0
  67. package/plugins/copilot-pbr/skills/health/templates/check-pattern.md.tmpl +31 -0
  68. package/plugins/copilot-pbr/skills/health/templates/output-format.md.tmpl +64 -0
  69. package/plugins/copilot-pbr/skills/help/SKILL.md +152 -0
  70. package/plugins/copilot-pbr/skills/import/SKILL.md +498 -0
  71. package/plugins/copilot-pbr/skills/milestone/SKILL.md +703 -0
  72. package/plugins/copilot-pbr/skills/milestone/templates/audit-report.md.tmpl +49 -0
  73. package/plugins/copilot-pbr/skills/milestone/templates/stats-file.md.tmpl +31 -0
  74. package/plugins/copilot-pbr/skills/note/SKILL.md +227 -0
  75. package/plugins/copilot-pbr/skills/pause/SKILL.md +246 -0
  76. package/plugins/copilot-pbr/skills/pause/templates/continue-here.md.tmpl +72 -0
  77. package/plugins/copilot-pbr/skills/plan/SKILL.md +649 -0
  78. package/plugins/copilot-pbr/skills/plan/templates/checker-prompt.md.tmpl +22 -0
  79. package/plugins/copilot-pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +33 -0
  80. package/plugins/copilot-pbr/skills/plan/templates/planner-prompt.md.tmpl +39 -0
  81. package/plugins/copilot-pbr/skills/plan/templates/researcher-prompt.md.tmpl +20 -0
  82. package/plugins/copilot-pbr/skills/plan/templates/revision-prompt.md.tmpl +24 -0
  83. package/plugins/copilot-pbr/skills/quick/SKILL.md +351 -0
  84. package/plugins/copilot-pbr/skills/resume/SKILL.md +399 -0
  85. package/plugins/copilot-pbr/skills/review/SKILL.md +648 -0
  86. package/plugins/copilot-pbr/skills/review/templates/debugger-prompt.md.tmpl +61 -0
  87. package/plugins/copilot-pbr/skills/review/templates/gap-planner-prompt.md.tmpl +41 -0
  88. package/plugins/copilot-pbr/skills/review/templates/verifier-prompt.md.tmpl +116 -0
  89. package/plugins/copilot-pbr/skills/scan/SKILL.md +301 -0
  90. package/plugins/copilot-pbr/skills/scan/templates/mapper-prompt.md.tmpl +202 -0
  91. package/plugins/copilot-pbr/skills/setup/SKILL.md +250 -0
  92. package/plugins/copilot-pbr/skills/shared/commit-planning-docs.md +36 -0
  93. package/plugins/copilot-pbr/skills/shared/config-loading.md +103 -0
  94. package/plugins/copilot-pbr/skills/shared/context-budget.md +41 -0
  95. package/plugins/copilot-pbr/skills/shared/context-loader-task.md +87 -0
  96. package/plugins/copilot-pbr/skills/shared/digest-select.md +80 -0
  97. package/plugins/copilot-pbr/skills/shared/domain-probes.md +126 -0
  98. package/plugins/copilot-pbr/skills/shared/error-reporting.md +80 -0
  99. package/plugins/copilot-pbr/skills/shared/gate-prompts.md +389 -0
  100. package/plugins/copilot-pbr/skills/shared/phase-argument-parsing.md +46 -0
  101. package/plugins/copilot-pbr/skills/shared/progress-display.md +54 -0
  102. package/plugins/copilot-pbr/skills/shared/revision-loop.md +82 -0
  103. package/plugins/copilot-pbr/skills/shared/state-loading.md +63 -0
  104. package/plugins/copilot-pbr/skills/shared/state-update.md +162 -0
  105. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +34 -0
  106. package/plugins/copilot-pbr/skills/status/SKILL.md +362 -0
  107. package/plugins/copilot-pbr/skills/todo/SKILL.md +256 -0
  108. package/plugins/copilot-pbr/templates/CONTEXT.md.tmpl +53 -0
  109. package/plugins/copilot-pbr/templates/INTEGRATION-REPORT.md.tmpl +152 -0
  110. package/plugins/copilot-pbr/templates/RESEARCH-SUMMARY.md.tmpl +98 -0
  111. package/plugins/copilot-pbr/templates/ROADMAP.md.tmpl +41 -0
  112. package/plugins/copilot-pbr/templates/SUMMARY.md.tmpl +82 -0
  113. package/plugins/copilot-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  114. package/plugins/copilot-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  115. package/plugins/copilot-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  116. package/plugins/copilot-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  117. package/plugins/copilot-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  118. package/plugins/copilot-pbr/templates/codebase/STACK.md.tmpl +78 -0
  119. package/plugins/copilot-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  120. package/plugins/copilot-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  121. package/plugins/copilot-pbr/templates/continue-here.md.tmpl +74 -0
  122. package/plugins/copilot-pbr/templates/prompt-partials/phase-project-context.md.tmpl +38 -0
  123. package/plugins/copilot-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  124. package/plugins/copilot-pbr/templates/research/STACK.md.tmpl +71 -0
  125. package/plugins/copilot-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  126. package/plugins/copilot-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  127. package/plugins/copilot-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  128. package/plugins/copilot-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  129. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +13 -3
  130. package/plugins/cursor-pbr/skills/dashboard/SKILL.md +14 -4
  131. package/plugins/cursor-pbr/skills/milestone/SKILL.md +10 -7
  132. package/plugins/cursor-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  133. package/plugins/cursor-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  134. package/plugins/cursor-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  135. package/plugins/cursor-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  136. package/plugins/cursor-pbr/templates/codebase/STACK.md.tmpl +78 -0
  137. package/plugins/cursor-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  138. package/plugins/cursor-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  139. package/plugins/cursor-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  140. package/plugins/cursor-pbr/templates/research/STACK.md.tmpl +71 -0
  141. package/plugins/cursor-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  142. package/plugins/cursor-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  143. package/plugins/cursor-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  144. package/plugins/cursor-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  145. package/plugins/pbr/.claude-plugin/plugin.json +7 -2
  146. package/plugins/pbr/skills/milestone/SKILL.md +10 -7
@@ -0,0 +1,343 @@
1
+ ---
2
+ name: discuss
3
+ description: "Talk through a phase before planning. Identifies gray areas and captures your decisions."
4
+ ---
5
+
6
+ ## Step 0 — Immediate Output
7
+
8
+ **Before ANY tool calls**, display this banner:
9
+
10
+ ```
11
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ PLAN-BUILD-RUN ► DISCUSSION
13
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ```
15
+
16
+ Then proceed to Step 1.
17
+
18
+ # /pbr:discuss — Pre-Planning Discussion
19
+
20
+ You are running the **discuss** skill. Your job is to help the user think through a phase BEFORE planning begins. You identify gray areas where the user's preference matters, ask structured questions, and capture every decision in a CONTEXT.md file that the planner must honor.
21
+
22
+ This skill runs **inline** (no Task delegation).
23
+
24
+ ---
25
+
26
+ ## Core Principle
27
+
28
+ **Decisions made here are LOCKED.** The planner cannot override them, even if research suggests a different approach. The planner must implement the locked decision and may note the discrepancy, but must follow the user's choice exactly.
29
+
30
+ ---
31
+
32
+ ## Flow
33
+
34
+ ### Step 1: Parse Phase Number and Check for Existing Plans
35
+
36
+ Parse `$ARGUMENTS` to get the phase number.
37
+
38
+ **Validation:**
39
+ - Must be a valid phase number (integer or decimal like `3.1`)
40
+ - If no argument provided, read STATE.md to get the current phase
41
+ - If no current phase and no argument: "Which phase do you want to discuss? Run `/pbr:status` to see available phases."
42
+
43
+ **Phase directory resolution:**
44
+ 1. List directories in `.planning/phases/`
45
+ 2. Find directory matching pattern `{NN}-*` where NN matches the phase number
46
+ 3. If not found, check ROADMAP.md for the phase name
47
+ 4. If still not found, display:
48
+ ```
49
+ ╔══════════════════════════════════════════════════════════════╗
50
+ ║ ERROR ║
51
+ ╚══════════════════════════════════════════════════════════════╝
52
+
53
+ Phase {N} not found.
54
+
55
+ **To fix:** Run `/pbr:status` to see available phases.
56
+ ```
57
+
58
+ **Check for existing plans** (after resolving the phase directory):
59
+ 1. Check for `PLAN.md` or `PLAN-*.md` files in the phase directory
60
+ 2. If plan files exist:
61
+ - Warn: "Phase {N} already has plans. Decisions from this discussion won't retroactively change them. Consider re-planning with `/pbr:plan {N}` after."
62
+ - This is a **warning only** — do not block the discussion
63
+
64
+ ### Step 2: Load Phase Context
65
+
66
+ Read the following files to understand what this phase needs to accomplish:
67
+
68
+ 1. **ROADMAP.md** — Find the phase entry. Extract:
69
+ - Phase name and description
70
+ - Goal / objective
71
+ - Requirements to satisfy
72
+ - Success criteria
73
+ - Dependencies on prior phases
74
+
75
+ 2. **Prior SUMMARY.md files** — Scan `.planning/phases/` for phases with lower numbers that have SUMMARY.md files. Read their frontmatter to understand:
76
+ - What's already been built (`provides` field)
77
+ - What technologies are in use (`tech_stack` field)
78
+ - What patterns have been established (`patterns` field)
79
+ - What decisions were already made (`key_decisions` field)
80
+
81
+ 3. **REQUIREMENTS.md** (if exists) — Read project requirements relevant to this phase
82
+
83
+ 4. **CONTEXT.md** (if exists in the phase directory) — Check if a prior discussion already happened
84
+ - If CONTEXT.md exists, inform the user and use the **context-handling** pattern from `skills/shared/gate-prompts.md`:
85
+ question: "Phase {N} already has a CONTEXT.md from a prior discussion. How should we handle it?"
86
+
87
+ Handle responses:
88
+ - "Overwrite": Replace CONTEXT.md entirely with new decisions
89
+ - "Append": Add new decisions below existing ones, marked as "Amendment ({date})"
90
+ - "Cancel": Stop the discussion, keep existing CONTEXT.md
91
+
92
+ ### Step 2.5: Open Exploration Phase
93
+
94
+ Before jumping into specific gray areas, give the user space to share their mental model unprompted.
95
+
96
+ 1. **Present the phase goal** (from ROADMAP.md) and ask an open question:
97
+ - "Before we get into specifics — what's your mental model of how this phase should work? What excites you about it? What concerns you?"
98
+
99
+ 2. **Follow the user's response with 2-3 domain-aware follow-ups** from `skills/shared/domain-probes.md`:
100
+ - Match what the user mentioned to the relevant domain tables
101
+ - Pick the 2-3 most insightful probes based on what they said, not a generic checklist
102
+ - Ask them conversationally, not as a numbered list
103
+
104
+ 3. **Surface implications** from what the user shared:
105
+ - "You mentioned X — that usually means we'd need Y. Is that part of your vision?"
106
+ - Connect their ideas to concrete technical or design consequences
107
+ - Flag anything that would affect scope, complexity, or dependencies
108
+
109
+ 4. **Let the conversation reveal gray areas naturally.** The user's responses here often surface the real gray areas better than top-down analysis. Carry any themes, concerns, or preferences forward into Step 3.
110
+
111
+ ### Step 3: Identify Gray Areas
112
+
113
+ Analyze the phase goal, requirements, and what's already built. Identify **3-4 gray areas** where the user's preference matters. Gray areas fall into these categories:
114
+
115
+ Read `skills/discuss/templates/decision-categories.md` for the category reference table.
116
+
117
+ **How to identify gray areas:**
118
+ 1. Look at the phase requirements — where are there multiple valid approaches?
119
+ 2. Look at prior phase decisions — where might this phase need to diverge?
120
+ 3. Look at the success criteria — what's ambiguous about how to satisfy them?
121
+ 4. Consider the user's likely pain points — what would they want a say in?
122
+
123
+ **Important:** Do NOT identify gray areas that are purely implementation details (e.g., variable naming, file organization). Focus on areas that affect user experience, system behavior, or long-term maintainability.
124
+
125
+ ### Step 4: Present Gray Areas
126
+
127
+ Present each gray area to the user using the **gray-area-option** pattern from `skills/shared/gate-prompts.md`. For each gray area:
128
+
129
+ Use AskUserQuestion:
130
+ question: "Gray Area {N}: {Title} — {Why this matters}"
131
+ header: "Decision"
132
+ options: (generate 2-4 concrete options from analysis, each with pros/cons in the description)
133
+ - label: "{Option A}" description: "{Pros: ..., Cons: ...}"
134
+ - label: "{Option B}" description: "{Pros: ..., Cons: ...}"
135
+ - ...up to 4 options total, with "Let Claude decide" always as the last option
136
+ - label: "Let Claude decide" description: "Mark as Claude's Discretion"
137
+ multiSelect: false
138
+
139
+ If more than 3 concrete options exist for a gray area, present only the top 3 plus "Let Claude decide" (max 4 total). Mention the omitted option(s) in the question text.
140
+
141
+ **Rules for presenting options:**
142
+ - Each option must be concrete and implementable
143
+ - Include honest pros/cons (don't bias toward one option)
144
+ - "Let Claude decide" should always be available as a choice
145
+ - If the user gives a preference not in the options, accept it
146
+ - If the user says "I don't care", mark it as Claude's Discretion
147
+
148
+ ### Step 5: Deep-Dive Each Selected Area
149
+
150
+ For each gray area where the user made a decision (not "Let Claude decide"), ask **4 follow-up questions** to fully capture their intent.
151
+
152
+ **Follow-up question types:**
153
+
154
+ 1. **Scope boundary**: "Should {feature} also handle {edge case}?"
155
+ Use the **yes-no** pattern — this is a binary decision.
156
+
157
+ 2. **Quality level**: "How polished should this be?"
158
+ Do NOT use AskUserQuestion — this is freeform. Let the user describe their quality expectations in their own words.
159
+
160
+ 3. **Integration**: "How should this interact with {existing component}?"
161
+ Do NOT use AskUserQuestion — this is freeform. The answer depends on the specific component and context.
162
+
163
+ 4. **Future-proofing**: "Should we design this to support {potential future need}, or keep it simple?"
164
+ Use the **yes-no** pattern:
165
+ question: "Design {feature} to support {future need}, or keep it simple for now?"
166
+ options:
167
+ - label: "Future-proof" description: "Add extensibility for {future need}"
168
+ - label: "Keep simple" description: "Build only what's needed now"
169
+
170
+ **Rules for follow-ups:**
171
+ - Ask all 4 questions for each area
172
+ - Record exact answers (don't paraphrase)
173
+ - If the user gives a short answer, capture it as-is
174
+ - If the user says "you decide" on a follow-up, move that specific sub-decision to Claude's Discretion
175
+
176
+ ### Step 6: Capture Deferred Ideas
177
+
178
+ During the conversation, the user may mention ideas they want but not in this phase. Track these separately:
179
+ - Ideas explicitly deferred by the user ("let's do that later")
180
+ - Ideas that are out of scope for this phase based on ROADMAP.md
181
+ - Ideas the user considered but rejected
182
+
183
+ ### Step 7: Write CONTEXT.md
184
+
185
+ Write the CONTEXT.md file to the phase directory:
186
+
187
+ **Path:** `.planning/phases/{NN}-{phase-name}/CONTEXT.md`
188
+
189
+ **Content:**
190
+
191
+ Read `skills/discuss/templates/CONTEXT.md.tmpl` for the template structure.
192
+
193
+ **Placeholders to fill:**
194
+ - `{N}` -- the phase number
195
+ - `{ISO date}` -- today's date in ISO format
196
+ - `{Decision title}` / `{User's exact choice and reasoning}` -- from Step 4-5 decisions
197
+ - `{Idea}` / `{Why deferred}` -- from Step 6 deferred ideas
198
+ - `{Area}` / `{What Claude can choose}` -- items marked "Let Claude decide"
199
+ - `{2-3 sentences}` -- user's vision summary from the conversation
200
+ - `{Concern}` / `{Context}` -- concerns raised during discussion
201
+
202
+ **Decision Summary generation:** The `## Decision Summary` section at the top of CONTEXT.md is a compact digest (~300 tokens) of all decisions. For each locked decision, write only the title and the user's choice in one phrase (no scope/quality/integration details). List deferred and discretion items as comma-separated titles only. This summary is injected into agent prompts by the plan skill -- keep it concise.
203
+
204
+ ### Step 7.5: Update STATE.md Pointer
205
+
206
+ Update `.planning/STATE.md`'s `## Accumulated Context` section to add a reference to the new CONTEXT.md:
207
+
208
+ Add under the `### Decisions` subsection:
209
+ ```
210
+ Phase {N} discussion: .planning/phases/{NN}-{slug}/CONTEXT.md ({count} locked, {count} deferred, {count} discretion)
211
+ ```
212
+
213
+ This creates a pointer so `/pbr:resume` and `progress-tracker.js` know that phase-specific decisions exist and where to find them.
214
+
215
+ ### Step 8: Confirm and Route
216
+
217
+ After writing CONTEXT.md, display branded output:
218
+
219
+ ```
220
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
221
+ PLAN-BUILD-RUN ► DISCUSSION CAPTURED ✓
222
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
223
+
224
+ **Phase {N}: {name}**
225
+
226
+ Decisions: {count} locked, {count} deferred, {count} discretion
227
+
228
+ ───────────────────────────────────────────────────────────────
229
+
230
+ ## ▶ Next Up
231
+
232
+ **Plan this phase** — your decisions will be honored
233
+
234
+ `/pbr:plan {N}`
235
+
236
+ <sub>`/clear` first → fresh context window</sub>
237
+
238
+ ───────────────────────────────────────────────────────────────
239
+
240
+ **Also available:**
241
+ - `/pbr:status` — see project status
242
+ - `/pbr:explore` — explore ideas further
243
+
244
+ ───────────────────────────────────────────────────────────────
245
+ ```
246
+
247
+ ---
248
+
249
+ ## Decision Categories Reference
250
+
251
+ ### LOCKED Decisions
252
+
253
+ These come from:
254
+ - User selecting a specific option (not "Let Claude decide")
255
+ - User answering follow-up questions with specific preferences
256
+ - User volunteering a strong opinion during discussion
257
+
258
+ **The planner MUST:**
259
+ - Implement exactly as the user specified
260
+ - Not modify, optimize, or "improve" the decision
261
+ - Note in the plan if research suggests a different approach
262
+ - Still follow the locked decision regardless
263
+
264
+ ### DEFERRED Ideas
265
+
266
+ These come from:
267
+ - User explicitly saying "not now" or "later"
268
+ - Ideas that are out of scope per ROADMAP.md
269
+ - User rejecting an option but saying it's a good idea for later
270
+
271
+ **The planner MUST NOT:**
272
+ - Include deferred ideas in the plan
273
+ - Sneak deferred ideas in as "nice to have" tasks
274
+ - Combine deferred ideas with in-scope work
275
+
276
+ ### CLAUDE'S DISCRETION
277
+
278
+ These come from:
279
+ - User selecting "Let Claude decide"
280
+ - User saying "I don't care" or "whatever you think"
281
+ - Follow-up questions answered with "you decide"
282
+
283
+ **The planner MAY:**
284
+ - Choose any reasonable approach
285
+ - Use research results to inform the choice
286
+ - Change their mind during planning if they learn something new
287
+ - Must document their choice and rationale in the plan
288
+
289
+ ---
290
+
291
+ ## Edge Cases
292
+
293
+ ### Phase already has CONTEXT.md
294
+ - Use the **context-handling** pattern from `skills/shared/gate-prompts.md` (same as Step 2)
295
+ - If "Overwrite": replace entirely
296
+ - If "Append": add new decisions below existing ones, marking them as "Amendment"
297
+ - If "Cancel": stop the discussion, keep existing CONTEXT.md
298
+
299
+ ### Phase already has plans
300
+ - Handled by Step 1 — warn but do not block
301
+ - See Step 1 "Check for existing plans" for the exact warning message
302
+
303
+ ### User wants to discuss multiple phases
304
+ - Handle one at a time
305
+ - After completing one, suggest: "Want to discuss Phase {N+1} too? Run `/pbr:discuss {N+1}`."
306
+
307
+ ### User disagrees with all options
308
+ - Ask: "What would you prefer instead?" — this is freeform text, do NOT use AskUserQuestion.
309
+ - Accept any answer and lock it as a decision.
310
+ - The options were suggestions, not constraints
311
+
312
+ ### User wants to skip follow-ups
313
+ - If user says "that's enough" or "skip the details", respect that
314
+ - Write what you have — partial follow-ups are fine
315
+ - Mark missing follow-up areas as Claude's Discretion
316
+
317
+ ---
318
+
319
+ ## State Integration
320
+
321
+ This skill updates STATE.md's Accumulated Context section with a pointer to the phase CONTEXT.md file. It does NOT change the project position (current phase/plan). STATE.md position is updated when `/pbr:plan` runs.
322
+
323
+ ---
324
+
325
+ ## Git Integration
326
+
327
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
328
+
329
+ If `planning.commit_docs: true` in config.json:
330
+ - Commit CONTEXT.md: `docs(planning): capture phase {N} discussion decisions`
331
+
332
+ ---
333
+
334
+ ## Anti-Patterns
335
+
336
+ 1. **DO NOT** bias the user toward a particular option
337
+ 2. **DO NOT** skip the follow-up questions (unless the user asks to skip)
338
+ 3. **DO NOT** paraphrase the user's decisions — capture them verbatim
339
+ 4. **DO NOT** add your own opinions to LOCKED decisions
340
+ 5. **DO NOT** mark something as Claude's Discretion unless the user explicitly chose that
341
+ 6. **DO NOT** include implementation details in CONTEXT.md — it captures WHAT, not HOW
342
+ 7. **DO NOT** skip the deferred ideas section — this prevents scope creep later
343
+ 8. **DO NOT** present more than 4 options per gray area — decision fatigue is real
@@ -0,0 +1,62 @@
1
+ <\!-- canonical: ../../../../pbr/skills/discuss/templates/CONTEXT.md.tmpl -->
2
+ <!-- Source: discuss/SKILL.md | Purpose: Template for the CONTEXT.md file written after a phase discussion -->
3
+
4
+ # Phase {N} Context
5
+
6
+ **Created by:** /pbr:discuss {N}
7
+ **Date:** {ISO date}
8
+
9
+ ## Decision Summary
10
+
11
+ <!-- Compact digest for agent prompt injection. ~300 tokens max. -->
12
+ <!-- Agents: Read the full sections below only if you need scope/quality/integration details. -->
13
+
14
+ **Locked:**
15
+ - {Decision title}: {User's choice in one phrase}
16
+ - {Decision title}: {User's choice in one phrase}
17
+
18
+ **Deferred (excluded):** {Comma-separated list of deferred idea titles, or "None"}
19
+
20
+ **Discretion:** {Comma-separated list of discretion area titles, or "None"}
21
+
22
+ ## Decisions (LOCKED -- must implement exactly as specified)
23
+
24
+ These decisions are NON-NEGOTIABLE during planning. If research suggests a different approach,
25
+ the planner must use the locked decision and note the discrepancy in the plan.
26
+
27
+ - [ ] **{Decision title}** -- {User's exact choice and reasoning}
28
+ - Scope: {Any scope boundaries from follow-ups}
29
+ - Quality: {Quality level from follow-ups}
30
+ - Integration: {Integration notes from follow-ups}
31
+ - Notes: {Any additional context}
32
+
33
+ - [ ] **{Decision title}** -- {User's exact choice and reasoning}
34
+ ...
35
+
36
+ ## Deferred Ideas (EXCLUDED -- do not plan these)
37
+
38
+ These ideas were discussed but explicitly excluded from this phase.
39
+ They may be addressed in future phases or milestones.
40
+
41
+ - **{Idea}** -- {Why deferred}
42
+ - **{Idea}** -- {Why deferred}
43
+
44
+ ## Claude's Discretion (OPEN -- Claude decides during planning)
45
+
46
+ These areas were identified as gray areas but the user chose to let Claude decide.
47
+ The planner has freedom here but should document their choices.
48
+
49
+ - **{Area}** -- {What Claude can choose, any constraints mentioned}
50
+ - **{Area}** -- {What Claude can choose, any constraints mentioned}
51
+
52
+ ## User's Vision Summary
53
+
54
+ {2-3 sentences capturing how the user imagines this phase. This should reflect
55
+ the user's mental model, not a technical specification. Write in the user's voice
56
+ where possible, quoting key phrases they used.}
57
+
58
+ ## User's Concerns
59
+
60
+ Things the user raised during discussion that should inform planning:
61
+
62
+ - **{Concern}** -- {Context from the conversation}
@@ -0,0 +1,10 @@
1
+ <\!-- canonical: ../../../../pbr/skills/discuss/templates/decision-categories.md -->
2
+ <!-- Source: discuss/SKILL.md | Purpose: Reference table of gray area categories for phase discussions -->
3
+
4
+ | Category | Example Gray Areas |
5
+ |----------|-------------------|
6
+ | **UI/UX choices** | Layout approach, component library, responsive strategy, accessibility level |
7
+ | **Architecture decisions** | State management approach, API design style, database schema trade-offs |
8
+ | **Edge case behavior** | What happens on failure, empty states, concurrent access, rate limiting |
9
+ | **Technology selections** | Which library for X, build tool choice, testing framework preference |
10
+ | **Feature scope boundaries** | MVP vs full feature, what to include vs defer, depth of implementation |
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: do
3
+ description: "Route freeform text to the right PBR skill automatically."
4
+ ---
5
+
6
+ # /pbr:do — Freeform Task Router
7
+
8
+ You are running the **do** skill. Your job is to analyze freeform text from the user and route it to the most appropriate PBR skill. You are a dispatcher, not an executor — you never do the work yourself.
9
+
10
+ ## Step 0 — Immediate Output
11
+
12
+ **Before ANY tool calls**, display this banner:
13
+
14
+ ```
15
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
+ PLAN-BUILD-RUN ► ROUTING
17
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
18
+ ```
19
+
20
+ Then proceed to Step 1.
21
+
22
+ ## Step 1 — Validate Input
23
+
24
+ If `$ARGUMENTS` is empty, ask the user what they want to do via AskUserQuestion:
25
+ ```
26
+ What would you like to do? Describe the task, bug, or idea and I'll route it to the right skill.
27
+ ```
28
+
29
+ ## Step 2 — Analyze and Route
30
+
31
+ Evaluate `$ARGUMENTS` against these routing criteria. Apply the **first matching** rule:
32
+
33
+ | If the text describes... | Route to | Why |
34
+ |--------------------------|----------|-----|
35
+ | A bug, error, crash, failure, or something broken | `/pbr:debug` | Needs systematic investigation |
36
+ | Exploration, research, comparison, or "how does X work" | `/pbr:explore` | Open-ended investigation |
37
+ | A complex task: refactoring, migration, multi-file architecture, system redesign | `/pbr:plan add` | Needs a full phase with research/plan/build cycle |
38
+ | A review or quality concern about existing work | `/pbr:review` | Needs verification against plan |
39
+ | A note, idea, or "remember to..." | `/pbr:note` | Capture for later |
40
+ | A specific, actionable task (add feature, fix typo, update config, write test) | `/pbr:quick` | Self-contained, single executor |
41
+
42
+ **Ambiguity handling**: If the text could reasonably match multiple routes, ask the user via AskUserQuestion with the top 2-3 options. For example:
43
+
44
+ ```
45
+ "Refactor the authentication system" could be:
46
+ - /pbr:plan add — Full planning cycle (recommended for multi-file refactors)
47
+ - /pbr:quick — Quick execution (if scope is small and clear)
48
+ ```
49
+
50
+ ## Step 3 — Confirm and Dispatch
51
+
52
+ Display the routing decision:
53
+
54
+ ```
55
+ **Input:** {first 80 chars of arguments}
56
+ **Routing to:** {chosen skill}
57
+ **Reason:** {one-line explanation}
58
+ ```
59
+
60
+ Then invoke the chosen skill via the Skill tool, passing `$ARGUMENTS` as the args.
61
+
62
+ **Special case for `/pbr:plan add`**: When routing to plan, check if `.planning/ROADMAP.md` exists first (via Read). If it doesn't, suggest `/pbr:begin` instead — the user needs to set up the project before they can add phases.
63
+
64
+ ## Step 4 — No Follow-Up
65
+
66
+ After invoking the skill, your job is done. The dispatched skill handles everything from here (execution, commits, state updates). Do not add any additional output after the Skill tool call.