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