@sienklogic/plan-build-run 2.0.2 → 2.1.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 (156) hide show
  1. package/dashboard/src/routes/pages.routes.js +11 -4
  2. package/dashboard/src/services/dashboard.service.js +81 -17
  3. package/dashboard/src/services/phase.service.js +30 -24
  4. package/dashboard/src/services/roadmap.service.js +3 -3
  5. package/dashboard/src/views/partials/phase-content.ejs +5 -4
  6. package/package.json +1 -1
  7. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  8. package/plugins/cursor-pbr/CHANGELOG.md +15 -0
  9. package/plugins/cursor-pbr/README.md +118 -0
  10. package/plugins/cursor-pbr/agents/codebase-mapper.md +108 -0
  11. package/plugins/cursor-pbr/agents/debugger.md +168 -0
  12. package/plugins/cursor-pbr/agents/executor.md +236 -0
  13. package/plugins/cursor-pbr/agents/general.md +87 -0
  14. package/plugins/cursor-pbr/agents/integration-checker.md +87 -0
  15. package/plugins/cursor-pbr/agents/plan-checker.md +198 -0
  16. package/plugins/cursor-pbr/agents/planner.md +180 -0
  17. package/plugins/cursor-pbr/agents/researcher.md +162 -0
  18. package/plugins/cursor-pbr/agents/synthesizer.md +101 -0
  19. package/plugins/cursor-pbr/agents/verifier.md +193 -0
  20. package/plugins/cursor-pbr/assets/logo.svg +21 -0
  21. package/plugins/cursor-pbr/hooks/hooks.json +189 -7
  22. package/plugins/cursor-pbr/references/agent-anti-patterns.md +25 -0
  23. package/plugins/cursor-pbr/references/agent-interactions.md +135 -0
  24. package/plugins/cursor-pbr/references/agent-teams.md +55 -0
  25. package/plugins/cursor-pbr/references/checkpoints.md +158 -0
  26. package/plugins/cursor-pbr/references/common-bug-patterns.md +14 -0
  27. package/plugins/cursor-pbr/references/config-reference.md +442 -0
  28. package/plugins/cursor-pbr/references/continuation-format.md +213 -0
  29. package/plugins/cursor-pbr/references/deviation-rules.md +113 -0
  30. package/plugins/cursor-pbr/references/git-integration.md +227 -0
  31. package/plugins/cursor-pbr/references/integration-patterns.md +118 -0
  32. package/plugins/cursor-pbr/references/model-profiles.md +100 -0
  33. package/plugins/cursor-pbr/references/model-selection.md +32 -0
  34. package/plugins/cursor-pbr/references/pbr-rules.md +194 -0
  35. package/plugins/cursor-pbr/references/plan-authoring.md +182 -0
  36. package/plugins/cursor-pbr/references/plan-format.md +288 -0
  37. package/plugins/cursor-pbr/references/planning-config.md +214 -0
  38. package/plugins/cursor-pbr/references/questioning.md +215 -0
  39. package/plugins/cursor-pbr/references/reading-verification.md +128 -0
  40. package/plugins/cursor-pbr/references/stub-patterns.md +161 -0
  41. package/plugins/cursor-pbr/references/subagent-coordination.md +120 -0
  42. package/plugins/cursor-pbr/references/ui-formatting.md +462 -0
  43. package/plugins/cursor-pbr/references/verification-patterns.md +199 -0
  44. package/plugins/cursor-pbr/references/wave-execution.md +96 -0
  45. package/plugins/cursor-pbr/rules/pbr-workflow.mdc +48 -0
  46. package/plugins/cursor-pbr/setup.ps1 +78 -0
  47. package/plugins/cursor-pbr/setup.sh +83 -0
  48. package/plugins/cursor-pbr/skills/begin/SKILL.md +566 -0
  49. package/plugins/cursor-pbr/skills/begin/templates/PROJECT.md.tmpl +34 -0
  50. package/plugins/cursor-pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +19 -0
  51. package/plugins/cursor-pbr/skills/begin/templates/STATE.md.tmpl +50 -0
  52. package/plugins/cursor-pbr/skills/begin/templates/config.json.tmpl +64 -0
  53. package/plugins/cursor-pbr/skills/begin/templates/researcher-prompt.md.tmpl +20 -0
  54. package/plugins/cursor-pbr/skills/begin/templates/roadmap-prompt.md.tmpl +31 -0
  55. package/plugins/cursor-pbr/skills/begin/templates/synthesis-prompt.md.tmpl +17 -0
  56. package/plugins/cursor-pbr/skills/build/SKILL.md +902 -0
  57. package/plugins/cursor-pbr/skills/config/SKILL.md +253 -0
  58. package/plugins/cursor-pbr/skills/continue/SKILL.md +159 -0
  59. package/plugins/cursor-pbr/skills/debug/SKILL.md +512 -0
  60. package/plugins/cursor-pbr/skills/debug/templates/continuation-prompt.md.tmpl +17 -0
  61. package/plugins/cursor-pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +28 -0
  62. package/plugins/cursor-pbr/skills/discuss/SKILL.md +344 -0
  63. package/plugins/cursor-pbr/skills/discuss/templates/CONTEXT.md.tmpl +62 -0
  64. package/plugins/cursor-pbr/skills/discuss/templates/decision-categories.md +10 -0
  65. package/plugins/cursor-pbr/skills/explore/SKILL.md +375 -0
  66. package/plugins/cursor-pbr/skills/health/SKILL.md +218 -0
  67. package/plugins/cursor-pbr/skills/health/templates/check-pattern.md.tmpl +31 -0
  68. package/plugins/cursor-pbr/skills/health/templates/output-format.md.tmpl +64 -0
  69. package/plugins/cursor-pbr/skills/help/SKILL.md +152 -0
  70. package/plugins/cursor-pbr/skills/import/SKILL.md +499 -0
  71. package/plugins/cursor-pbr/skills/milestone/SKILL.md +701 -0
  72. package/plugins/cursor-pbr/skills/milestone/templates/audit-report.md.tmpl +49 -0
  73. package/plugins/cursor-pbr/skills/milestone/templates/stats-file.md.tmpl +31 -0
  74. package/plugins/cursor-pbr/skills/note/SKILL.md +228 -0
  75. package/plugins/cursor-pbr/skills/pause/SKILL.md +246 -0
  76. package/plugins/cursor-pbr/skills/pause/templates/continue-here.md.tmpl +72 -0
  77. package/plugins/cursor-pbr/skills/plan/SKILL.md +648 -0
  78. package/plugins/cursor-pbr/skills/plan/templates/checker-prompt.md.tmpl +22 -0
  79. package/plugins/cursor-pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +33 -0
  80. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +39 -0
  81. package/plugins/cursor-pbr/skills/plan/templates/researcher-prompt.md.tmpl +20 -0
  82. package/plugins/cursor-pbr/skills/plan/templates/revision-prompt.md.tmpl +24 -0
  83. package/plugins/cursor-pbr/skills/quick/SKILL.md +351 -0
  84. package/plugins/cursor-pbr/skills/resume/SKILL.md +399 -0
  85. package/plugins/cursor-pbr/skills/review/SKILL.md +649 -0
  86. package/plugins/cursor-pbr/skills/review/templates/debugger-prompt.md.tmpl +61 -0
  87. package/plugins/cursor-pbr/skills/review/templates/gap-planner-prompt.md.tmpl +41 -0
  88. package/plugins/cursor-pbr/skills/review/templates/verifier-prompt.md.tmpl +116 -0
  89. package/plugins/cursor-pbr/skills/scan/SKILL.md +301 -0
  90. package/plugins/cursor-pbr/skills/scan/templates/mapper-prompt.md.tmpl +202 -0
  91. package/plugins/cursor-pbr/skills/setup/SKILL.md +250 -0
  92. package/plugins/cursor-pbr/skills/shared/commit-planning-docs.md +36 -0
  93. package/plugins/cursor-pbr/skills/shared/config-loading.md +103 -0
  94. package/plugins/cursor-pbr/skills/shared/context-budget.md +41 -0
  95. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +87 -0
  96. package/plugins/cursor-pbr/skills/shared/digest-select.md +80 -0
  97. package/plugins/cursor-pbr/skills/shared/domain-probes.md +126 -0
  98. package/plugins/cursor-pbr/skills/shared/error-reporting.md +80 -0
  99. package/plugins/cursor-pbr/skills/shared/gate-prompts.md +389 -0
  100. package/plugins/cursor-pbr/skills/shared/phase-argument-parsing.md +46 -0
  101. package/plugins/cursor-pbr/skills/shared/progress-display.md +54 -0
  102. package/plugins/cursor-pbr/skills/shared/revision-loop.md +82 -0
  103. package/plugins/cursor-pbr/skills/shared/state-loading.md +63 -0
  104. package/plugins/cursor-pbr/skills/shared/state-update.md +162 -0
  105. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +34 -0
  106. package/plugins/cursor-pbr/skills/status/SKILL.md +362 -0
  107. package/plugins/cursor-pbr/skills/todo/SKILL.md +195 -0
  108. package/plugins/cursor-pbr/templates/CONTEXT.md.tmpl +53 -0
  109. package/plugins/cursor-pbr/templates/INTEGRATION-REPORT.md.tmpl +152 -0
  110. package/plugins/cursor-pbr/templates/RESEARCH-SUMMARY.md.tmpl +98 -0
  111. package/plugins/cursor-pbr/templates/ROADMAP.md.tmpl +41 -0
  112. package/plugins/cursor-pbr/templates/SUMMARY.md.tmpl +82 -0
  113. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  114. package/plugins/cursor-pbr/templates/continue-here.md.tmpl +74 -0
  115. package/plugins/cursor-pbr/templates/prompt-partials/phase-project-context.md.tmpl +38 -0
  116. package/plugins/pbr/agents/codebase-mapper.md +41 -206
  117. package/plugins/pbr/agents/debugger.md +65 -171
  118. package/plugins/pbr/agents/executor.md +90 -275
  119. package/plugins/pbr/agents/general.md +27 -97
  120. package/plugins/pbr/agents/integration-checker.md +35 -112
  121. package/plugins/pbr/agents/plan-checker.md +71 -164
  122. package/plugins/pbr/agents/planner.md +75 -246
  123. package/plugins/pbr/agents/researcher.md +63 -255
  124. package/plugins/pbr/agents/synthesizer.md +49 -174
  125. package/plugins/pbr/agents/verifier.md +75 -366
  126. package/plugins/pbr/hooks/hooks.json +14 -10
  127. package/plugins/pbr/scripts/auto-continue.js +20 -4
  128. package/plugins/pbr/scripts/check-dangerous-commands.js +1 -1
  129. package/plugins/pbr/scripts/check-phase-boundary.js +1 -1
  130. package/plugins/pbr/scripts/check-plan-format.js +3 -3
  131. package/plugins/pbr/scripts/check-roadmap-sync.js +3 -3
  132. package/plugins/pbr/scripts/check-skill-workflow.js +1 -1
  133. package/plugins/pbr/scripts/check-state-sync.js +2 -2
  134. package/plugins/pbr/scripts/check-subagent-output.js +1 -1
  135. package/plugins/pbr/scripts/check-summary-gate.js +198 -0
  136. package/plugins/pbr/scripts/context-budget-check.js +1 -1
  137. package/plugins/pbr/scripts/event-handler.js +2 -2
  138. package/plugins/pbr/scripts/event-logger.js +1 -1
  139. package/plugins/pbr/scripts/log-subagent.js +1 -1
  140. package/plugins/pbr/scripts/pbr-tools.js +1 -1
  141. package/plugins/pbr/scripts/post-write-dispatch.js +1 -1
  142. package/plugins/pbr/scripts/post-write-quality.js +1 -1
  143. package/plugins/pbr/scripts/pre-bash-dispatch.js +1 -1
  144. package/plugins/pbr/scripts/pre-write-dispatch.js +16 -3
  145. package/plugins/pbr/scripts/session-cleanup.js +1 -1
  146. package/plugins/pbr/scripts/status-line.js +1 -1
  147. package/plugins/pbr/scripts/suggest-compact.js +1 -1
  148. package/plugins/pbr/scripts/task-completed.js +1 -1
  149. package/plugins/pbr/scripts/track-context-budget.js +11 -6
  150. package/plugins/pbr/scripts/validate-commit.js +1 -1
  151. package/plugins/pbr/scripts/validate-task.js +1 -1
  152. package/plugins/cursor-pbr/agents/.gitkeep +0 -0
  153. package/plugins/cursor-pbr/references/.gitkeep +0 -0
  154. package/plugins/cursor-pbr/rules/.gitkeep +0 -0
  155. package/plugins/cursor-pbr/skills/.gitkeep +0 -0
  156. package/plugins/cursor-pbr/templates/.gitkeep +0 -0
@@ -0,0 +1,344 @@
1
+ ---
2
+ name: discuss
3
+ description: "Talk through a phase before planning. Identifies gray areas and captures your decisions."
4
+ argument-hint: "<phase-number>"
5
+ ---
6
+
7
+ ## Step 0 — Immediate Output
8
+
9
+ **Before ANY tool calls**, display this banner:
10
+
11
+ ```
12
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
+ PLAN-BUILD-RUN ► DISCUSSION
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ```
16
+
17
+ Then proceed to Step 1.
18
+
19
+ # /pbr:discuss — Pre-Planning Discussion
20
+
21
+ 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.
22
+
23
+ This skill runs **inline** (no Task delegation).
24
+
25
+ ---
26
+
27
+ ## Core Principle
28
+
29
+ **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.
30
+
31
+ ---
32
+
33
+ ## Flow
34
+
35
+ ### Step 1: Parse Phase Number and Check for Existing Plans
36
+
37
+ Parse `$ARGUMENTS` to get the phase number.
38
+
39
+ **Validation:**
40
+ - Must be a valid phase number (integer or decimal like `3.1`)
41
+ - If no argument provided, read STATE.md to get the current phase
42
+ - If no current phase and no argument: "Which phase do you want to discuss? Run `/pbr:status` to see available phases."
43
+
44
+ **Phase directory resolution:**
45
+ 1. List directories in `.planning/phases/`
46
+ 2. Find directory matching pattern `{NN}-*` where NN matches the phase number
47
+ 3. If not found, check ROADMAP.md for the phase name
48
+ 4. If still not found, display:
49
+ ```
50
+ ╔══════════════════════════════════════════════════════════════╗
51
+ ║ ERROR ║
52
+ ╚══════════════════════════════════════════════════════════════╝
53
+
54
+ Phase {N} not found.
55
+
56
+ **To fix:** Run `/pbr:status` to see available phases.
57
+ ```
58
+
59
+ **Check for existing plans** (after resolving the phase directory):
60
+ 1. Check for `PLAN.md` or `PLAN-*.md` files in the phase directory
61
+ 2. If plan files exist:
62
+ - Warn: "Phase {N} already has plans. Decisions from this discussion won't retroactively change them. Consider re-planning with `/pbr:plan {N}` after."
63
+ - This is a **warning only** — do not block the discussion
64
+
65
+ ### Step 2: Load Phase Context
66
+
67
+ Read the following files to understand what this phase needs to accomplish:
68
+
69
+ 1. **ROADMAP.md** — Find the phase entry. Extract:
70
+ - Phase name and description
71
+ - Goal / objective
72
+ - Requirements to satisfy
73
+ - Success criteria
74
+ - Dependencies on prior phases
75
+
76
+ 2. **Prior SUMMARY.md files** — Scan `.planning/phases/` for phases with lower numbers that have SUMMARY.md files. Read their frontmatter to understand:
77
+ - What's already been built (`provides` field)
78
+ - What technologies are in use (`tech_stack` field)
79
+ - What patterns have been established (`patterns` field)
80
+ - What decisions were already made (`key_decisions` field)
81
+
82
+ 3. **REQUIREMENTS.md** (if exists) — Read project requirements relevant to this phase
83
+
84
+ 4. **CONTEXT.md** (if exists in the phase directory) — Check if a prior discussion already happened
85
+ - If CONTEXT.md exists, inform the user and use the **context-handling** pattern from `skills/shared/gate-prompts.md`:
86
+ question: "Phase {N} already has a CONTEXT.md from a prior discussion. How should we handle it?"
87
+
88
+ Handle responses:
89
+ - "Overwrite": Replace CONTEXT.md entirely with new decisions
90
+ - "Append": Add new decisions below existing ones, marked as "Amendment ({date})"
91
+ - "Cancel": Stop the discussion, keep existing CONTEXT.md
92
+
93
+ ### Step 2.5: Open Exploration Phase
94
+
95
+ Before jumping into specific gray areas, give the user space to share their mental model unprompted.
96
+
97
+ 1. **Present the phase goal** (from ROADMAP.md) and ask an open question:
98
+ - "Before we get into specifics — what's your mental model of how this phase should work? What excites you about it? What concerns you?"
99
+
100
+ 2. **Follow the user's response with 2-3 domain-aware follow-ups** from `skills/shared/domain-probes.md`:
101
+ - Match what the user mentioned to the relevant domain tables
102
+ - Pick the 2-3 most insightful probes based on what they said, not a generic checklist
103
+ - Ask them conversationally, not as a numbered list
104
+
105
+ 3. **Surface implications** from what the user shared:
106
+ - "You mentioned X — that usually means we'd need Y. Is that part of your vision?"
107
+ - Connect their ideas to concrete technical or design consequences
108
+ - Flag anything that would affect scope, complexity, or dependencies
109
+
110
+ 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.
111
+
112
+ ### Step 3: Identify Gray Areas
113
+
114
+ 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:
115
+
116
+ Read `skills/discuss/templates/decision-categories.md` for the category reference table.
117
+
118
+ **How to identify gray areas:**
119
+ 1. Look at the phase requirements — where are there multiple valid approaches?
120
+ 2. Look at prior phase decisions — where might this phase need to diverge?
121
+ 3. Look at the success criteria — what's ambiguous about how to satisfy them?
122
+ 4. Consider the user's likely pain points — what would they want a say in?
123
+
124
+ **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.
125
+
126
+ ### Step 4: Present Gray Areas
127
+
128
+ Present each gray area to the user using the **gray-area-option** pattern from `skills/shared/gate-prompts.md`. For each gray area:
129
+
130
+ Use AskUserQuestion:
131
+ question: "Gray Area {N}: {Title} — {Why this matters}"
132
+ header: "Decision"
133
+ options: (generate 2-4 concrete options from analysis, each with pros/cons in the description)
134
+ - label: "{Option A}" description: "{Pros: ..., Cons: ...}"
135
+ - label: "{Option B}" description: "{Pros: ..., Cons: ...}"
136
+ - ...up to 4 options total, with "Let Claude decide" always as the last option
137
+ - label: "Let Claude decide" description: "Mark as Claude's Discretion"
138
+ multiSelect: false
139
+
140
+ 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.
141
+
142
+ **Rules for presenting options:**
143
+ - Each option must be concrete and implementable
144
+ - Include honest pros/cons (don't bias toward one option)
145
+ - "Let Claude decide" should always be available as a choice
146
+ - If the user gives a preference not in the options, accept it
147
+ - If the user says "I don't care", mark it as Claude's Discretion
148
+
149
+ ### Step 5: Deep-Dive Each Selected Area
150
+
151
+ For each gray area where the user made a decision (not "Let Claude decide"), ask **4 follow-up questions** to fully capture their intent.
152
+
153
+ **Follow-up question types:**
154
+
155
+ 1. **Scope boundary**: "Should {feature} also handle {edge case}?"
156
+ Use the **yes-no** pattern — this is a binary decision.
157
+
158
+ 2. **Quality level**: "How polished should this be?"
159
+ Do NOT use AskUserQuestion — this is freeform. Let the user describe their quality expectations in their own words.
160
+
161
+ 3. **Integration**: "How should this interact with {existing component}?"
162
+ Do NOT use AskUserQuestion — this is freeform. The answer depends on the specific component and context.
163
+
164
+ 4. **Future-proofing**: "Should we design this to support {potential future need}, or keep it simple?"
165
+ Use the **yes-no** pattern:
166
+ question: "Design {feature} to support {future need}, or keep it simple for now?"
167
+ options:
168
+ - label: "Future-proof" description: "Add extensibility for {future need}"
169
+ - label: "Keep simple" description: "Build only what's needed now"
170
+
171
+ **Rules for follow-ups:**
172
+ - Ask all 4 questions for each area
173
+ - Record exact answers (don't paraphrase)
174
+ - If the user gives a short answer, capture it as-is
175
+ - If the user says "you decide" on a follow-up, move that specific sub-decision to Claude's Discretion
176
+
177
+ ### Step 6: Capture Deferred Ideas
178
+
179
+ During the conversation, the user may mention ideas they want but not in this phase. Track these separately:
180
+ - Ideas explicitly deferred by the user ("let's do that later")
181
+ - Ideas that are out of scope for this phase based on ROADMAP.md
182
+ - Ideas the user considered but rejected
183
+
184
+ ### Step 7: Write CONTEXT.md
185
+
186
+ Write the CONTEXT.md file to the phase directory:
187
+
188
+ **Path:** `.planning/phases/{NN}-{phase-name}/CONTEXT.md`
189
+
190
+ **Content:**
191
+
192
+ Read `skills/discuss/templates/CONTEXT.md.tmpl` for the template structure.
193
+
194
+ **Placeholders to fill:**
195
+ - `{N}` -- the phase number
196
+ - `{ISO date}` -- today's date in ISO format
197
+ - `{Decision title}` / `{User's exact choice and reasoning}` -- from Step 4-5 decisions
198
+ - `{Idea}` / `{Why deferred}` -- from Step 6 deferred ideas
199
+ - `{Area}` / `{What Claude can choose}` -- items marked "Let Claude decide"
200
+ - `{2-3 sentences}` -- user's vision summary from the conversation
201
+ - `{Concern}` / `{Context}` -- concerns raised during discussion
202
+
203
+ **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.
204
+
205
+ ### Step 7.5: Update STATE.md Pointer
206
+
207
+ Update `.planning/STATE.md`'s `## Accumulated Context` section to add a reference to the new CONTEXT.md:
208
+
209
+ Add under the `### Decisions` subsection:
210
+ ```
211
+ Phase {N} discussion: .planning/phases/{NN}-{slug}/CONTEXT.md ({count} locked, {count} deferred, {count} discretion)
212
+ ```
213
+
214
+ This creates a pointer so `/pbr:resume` and `progress-tracker.js` know that phase-specific decisions exist and where to find them.
215
+
216
+ ### Step 8: Confirm and Route
217
+
218
+ After writing CONTEXT.md, display branded output:
219
+
220
+ ```
221
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
222
+ PLAN-BUILD-RUN ► DISCUSSION CAPTURED ✓
223
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
224
+
225
+ **Phase {N}: {name}**
226
+
227
+ Decisions: {count} locked, {count} deferred, {count} discretion
228
+
229
+ ───────────────────────────────────────────────────────────────
230
+
231
+ ## ▶ Next Up
232
+
233
+ **Plan this phase** — your decisions will be honored
234
+
235
+ `/pbr:plan {N}`
236
+
237
+ <sub>`/clear` first → fresh context window</sub>
238
+
239
+ ───────────────────────────────────────────────────────────────
240
+
241
+ **Also available:**
242
+ - `/pbr:status` — see project status
243
+ - `/pbr:explore` — explore ideas further
244
+
245
+ ───────────────────────────────────────────────────────────────
246
+ ```
247
+
248
+ ---
249
+
250
+ ## Decision Categories Reference
251
+
252
+ ### LOCKED Decisions
253
+
254
+ These come from:
255
+ - User selecting a specific option (not "Let Claude decide")
256
+ - User answering follow-up questions with specific preferences
257
+ - User volunteering a strong opinion during discussion
258
+
259
+ **The planner MUST:**
260
+ - Implement exactly as the user specified
261
+ - Not modify, optimize, or "improve" the decision
262
+ - Note in the plan if research suggests a different approach
263
+ - Still follow the locked decision regardless
264
+
265
+ ### DEFERRED Ideas
266
+
267
+ These come from:
268
+ - User explicitly saying "not now" or "later"
269
+ - Ideas that are out of scope per ROADMAP.md
270
+ - User rejecting an option but saying it's a good idea for later
271
+
272
+ **The planner MUST NOT:**
273
+ - Include deferred ideas in the plan
274
+ - Sneak deferred ideas in as "nice to have" tasks
275
+ - Combine deferred ideas with in-scope work
276
+
277
+ ### CLAUDE'S DISCRETION
278
+
279
+ These come from:
280
+ - User selecting "Let Claude decide"
281
+ - User saying "I don't care" or "whatever you think"
282
+ - Follow-up questions answered with "you decide"
283
+
284
+ **The planner MAY:**
285
+ - Choose any reasonable approach
286
+ - Use research results to inform the choice
287
+ - Change their mind during planning if they learn something new
288
+ - Must document their choice and rationale in the plan
289
+
290
+ ---
291
+
292
+ ## Edge Cases
293
+
294
+ ### Phase already has CONTEXT.md
295
+ - Use the **context-handling** pattern from `skills/shared/gate-prompts.md` (same as Step 2)
296
+ - If "Overwrite": replace entirely
297
+ - If "Append": add new decisions below existing ones, marking them as "Amendment"
298
+ - If "Cancel": stop the discussion, keep existing CONTEXT.md
299
+
300
+ ### Phase already has plans
301
+ - Handled by Step 1 — warn but do not block
302
+ - See Step 1 "Check for existing plans" for the exact warning message
303
+
304
+ ### User wants to discuss multiple phases
305
+ - Handle one at a time
306
+ - After completing one, suggest: "Want to discuss Phase {N+1} too? Run `/pbr:discuss {N+1}`."
307
+
308
+ ### User disagrees with all options
309
+ - Ask: "What would you prefer instead?" — this is freeform text, do NOT use AskUserQuestion.
310
+ - Accept any answer and lock it as a decision.
311
+ - The options were suggestions, not constraints
312
+
313
+ ### User wants to skip follow-ups
314
+ - If user says "that's enough" or "skip the details", respect that
315
+ - Write what you have — partial follow-ups are fine
316
+ - Mark missing follow-up areas as Claude's Discretion
317
+
318
+ ---
319
+
320
+ ## State Integration
321
+
322
+ 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.
323
+
324
+ ---
325
+
326
+ ## Git Integration
327
+
328
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
329
+
330
+ If `planning.commit_docs: true` in config.json:
331
+ - Commit CONTEXT.md: `docs(planning): capture phase {N} discussion decisions`
332
+
333
+ ---
334
+
335
+ ## Anti-Patterns
336
+
337
+ 1. **DO NOT** bias the user toward a particular option
338
+ 2. **DO NOT** skip the follow-up questions (unless the user asks to skip)
339
+ 3. **DO NOT** paraphrase the user's decisions — capture them verbatim
340
+ 4. **DO NOT** add your own opinions to LOCKED decisions
341
+ 5. **DO NOT** mark something as Claude's Discretion unless the user explicitly chose that
342
+ 6. **DO NOT** include implementation details in CONTEXT.md — it captures WHAT, not HOW
343
+ 7. **DO NOT** skip the deferred ideas section — this prevents scope creep later
344
+ 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 |