@sienklogic/plan-build-run 2.0.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 (221) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/CLAUDE.md +149 -0
  3. package/LICENSE +21 -0
  4. package/README.md +247 -0
  5. package/dashboard/bin/cli.js +25 -0
  6. package/dashboard/package.json +34 -0
  7. package/dashboard/public/.gitkeep +0 -0
  8. package/dashboard/public/css/layout.css +406 -0
  9. package/dashboard/public/css/status-colors.css +98 -0
  10. package/dashboard/public/js/htmx-title.js +5 -0
  11. package/dashboard/public/js/sidebar-toggle.js +20 -0
  12. package/dashboard/src/app.js +78 -0
  13. package/dashboard/src/middleware/errorHandler.js +52 -0
  14. package/dashboard/src/middleware/notFoundHandler.js +9 -0
  15. package/dashboard/src/repositories/planning.repository.js +128 -0
  16. package/dashboard/src/routes/events.routes.js +40 -0
  17. package/dashboard/src/routes/index.routes.js +31 -0
  18. package/dashboard/src/routes/pages.routes.js +195 -0
  19. package/dashboard/src/server.js +42 -0
  20. package/dashboard/src/services/dashboard.service.js +222 -0
  21. package/dashboard/src/services/phase.service.js +167 -0
  22. package/dashboard/src/services/project.service.js +57 -0
  23. package/dashboard/src/services/roadmap.service.js +171 -0
  24. package/dashboard/src/services/sse.service.js +58 -0
  25. package/dashboard/src/services/todo.service.js +254 -0
  26. package/dashboard/src/services/watcher.service.js +48 -0
  27. package/dashboard/src/views/coming-soon.ejs +11 -0
  28. package/dashboard/src/views/error.ejs +13 -0
  29. package/dashboard/src/views/index.ejs +5 -0
  30. package/dashboard/src/views/layout.ejs +1 -0
  31. package/dashboard/src/views/partials/dashboard-content.ejs +77 -0
  32. package/dashboard/src/views/partials/footer.ejs +3 -0
  33. package/dashboard/src/views/partials/head.ejs +21 -0
  34. package/dashboard/src/views/partials/header.ejs +12 -0
  35. package/dashboard/src/views/partials/layout-bottom.ejs +15 -0
  36. package/dashboard/src/views/partials/layout-top.ejs +8 -0
  37. package/dashboard/src/views/partials/phase-content.ejs +181 -0
  38. package/dashboard/src/views/partials/phases-content.ejs +117 -0
  39. package/dashboard/src/views/partials/roadmap-content.ejs +142 -0
  40. package/dashboard/src/views/partials/sidebar.ejs +38 -0
  41. package/dashboard/src/views/partials/todo-create-content.ejs +53 -0
  42. package/dashboard/src/views/partials/todo-detail-content.ejs +38 -0
  43. package/dashboard/src/views/partials/todos-content.ejs +53 -0
  44. package/dashboard/src/views/phase-detail.ejs +5 -0
  45. package/dashboard/src/views/phases.ejs +5 -0
  46. package/dashboard/src/views/roadmap.ejs +5 -0
  47. package/dashboard/src/views/todo-create.ejs +5 -0
  48. package/dashboard/src/views/todo-detail.ejs +5 -0
  49. package/dashboard/src/views/todos.ejs +5 -0
  50. package/package.json +57 -0
  51. package/plugins/pbr/.claude-plugin/plugin.json +13 -0
  52. package/plugins/pbr/UI-CONSISTENCY-GAPS.md +61 -0
  53. package/plugins/pbr/agents/codebase-mapper.md +271 -0
  54. package/plugins/pbr/agents/debugger.md +281 -0
  55. package/plugins/pbr/agents/executor.md +407 -0
  56. package/plugins/pbr/agents/general.md +164 -0
  57. package/plugins/pbr/agents/integration-checker.md +141 -0
  58. package/plugins/pbr/agents/plan-checker.md +280 -0
  59. package/plugins/pbr/agents/planner.md +358 -0
  60. package/plugins/pbr/agents/researcher.md +363 -0
  61. package/plugins/pbr/agents/synthesizer.md +230 -0
  62. package/plugins/pbr/agents/verifier.md +454 -0
  63. package/plugins/pbr/commands/begin.md +5 -0
  64. package/plugins/pbr/commands/build.md +5 -0
  65. package/plugins/pbr/commands/config.md +5 -0
  66. package/plugins/pbr/commands/continue.md +5 -0
  67. package/plugins/pbr/commands/debug.md +5 -0
  68. package/plugins/pbr/commands/discuss.md +5 -0
  69. package/plugins/pbr/commands/explore.md +5 -0
  70. package/plugins/pbr/commands/health.md +5 -0
  71. package/plugins/pbr/commands/help.md +5 -0
  72. package/plugins/pbr/commands/import.md +5 -0
  73. package/plugins/pbr/commands/milestone.md +5 -0
  74. package/plugins/pbr/commands/note.md +5 -0
  75. package/plugins/pbr/commands/pause.md +5 -0
  76. package/plugins/pbr/commands/plan.md +5 -0
  77. package/plugins/pbr/commands/quick.md +5 -0
  78. package/plugins/pbr/commands/resume.md +5 -0
  79. package/plugins/pbr/commands/review.md +5 -0
  80. package/plugins/pbr/commands/scan.md +5 -0
  81. package/plugins/pbr/commands/setup.md +5 -0
  82. package/plugins/pbr/commands/status.md +5 -0
  83. package/plugins/pbr/commands/todo.md +5 -0
  84. package/plugins/pbr/contexts/dev.md +27 -0
  85. package/plugins/pbr/contexts/research.md +28 -0
  86. package/plugins/pbr/contexts/review.md +36 -0
  87. package/plugins/pbr/hooks/hooks.json +183 -0
  88. package/plugins/pbr/references/agent-anti-patterns.md +24 -0
  89. package/plugins/pbr/references/agent-interactions.md +134 -0
  90. package/plugins/pbr/references/agent-teams.md +54 -0
  91. package/plugins/pbr/references/checkpoints.md +157 -0
  92. package/plugins/pbr/references/common-bug-patterns.md +13 -0
  93. package/plugins/pbr/references/continuation-format.md +212 -0
  94. package/plugins/pbr/references/deviation-rules.md +112 -0
  95. package/plugins/pbr/references/git-integration.md +226 -0
  96. package/plugins/pbr/references/integration-patterns.md +117 -0
  97. package/plugins/pbr/references/model-profiles.md +99 -0
  98. package/plugins/pbr/references/model-selection.md +31 -0
  99. package/plugins/pbr/references/pbr-rules.md +193 -0
  100. package/plugins/pbr/references/plan-authoring.md +181 -0
  101. package/plugins/pbr/references/plan-format.md +283 -0
  102. package/plugins/pbr/references/planning-config.md +213 -0
  103. package/plugins/pbr/references/questioning.md +214 -0
  104. package/plugins/pbr/references/reading-verification.md +127 -0
  105. package/plugins/pbr/references/stub-patterns.md +160 -0
  106. package/plugins/pbr/references/subagent-coordination.md +119 -0
  107. package/plugins/pbr/references/ui-formatting.md +399 -0
  108. package/plugins/pbr/references/verification-patterns.md +198 -0
  109. package/plugins/pbr/references/wave-execution.md +95 -0
  110. package/plugins/pbr/scripts/auto-continue.js +80 -0
  111. package/plugins/pbr/scripts/check-dangerous-commands.js +136 -0
  112. package/plugins/pbr/scripts/check-doc-sprawl.js +102 -0
  113. package/plugins/pbr/scripts/check-phase-boundary.js +196 -0
  114. package/plugins/pbr/scripts/check-plan-format.js +270 -0
  115. package/plugins/pbr/scripts/check-roadmap-sync.js +252 -0
  116. package/plugins/pbr/scripts/check-skill-workflow.js +262 -0
  117. package/plugins/pbr/scripts/check-state-sync.js +476 -0
  118. package/plugins/pbr/scripts/check-subagent-output.js +144 -0
  119. package/plugins/pbr/scripts/config-schema.json +251 -0
  120. package/plugins/pbr/scripts/context-budget-check.js +287 -0
  121. package/plugins/pbr/scripts/event-handler.js +151 -0
  122. package/plugins/pbr/scripts/event-logger.js +92 -0
  123. package/plugins/pbr/scripts/hook-logger.js +76 -0
  124. package/plugins/pbr/scripts/hooks-schema.json +79 -0
  125. package/plugins/pbr/scripts/log-subagent.js +152 -0
  126. package/plugins/pbr/scripts/log-tool-failure.js +88 -0
  127. package/plugins/pbr/scripts/pbr-tools.js +1301 -0
  128. package/plugins/pbr/scripts/post-write-dispatch.js +66 -0
  129. package/plugins/pbr/scripts/post-write-quality.js +207 -0
  130. package/plugins/pbr/scripts/pre-bash-dispatch.js +56 -0
  131. package/plugins/pbr/scripts/pre-write-dispatch.js +62 -0
  132. package/plugins/pbr/scripts/progress-tracker.js +228 -0
  133. package/plugins/pbr/scripts/session-cleanup.js +254 -0
  134. package/plugins/pbr/scripts/status-line.js +285 -0
  135. package/plugins/pbr/scripts/suggest-compact.js +119 -0
  136. package/plugins/pbr/scripts/task-completed.js +45 -0
  137. package/plugins/pbr/scripts/track-context-budget.js +119 -0
  138. package/plugins/pbr/scripts/validate-commit.js +200 -0
  139. package/plugins/pbr/scripts/validate-plugin-structure.js +172 -0
  140. package/plugins/pbr/skills/begin/SKILL.md +545 -0
  141. package/plugins/pbr/skills/begin/templates/PROJECT.md.tmpl +33 -0
  142. package/plugins/pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +18 -0
  143. package/plugins/pbr/skills/begin/templates/STATE.md.tmpl +49 -0
  144. package/plugins/pbr/skills/begin/templates/config.json.tmpl +63 -0
  145. package/plugins/pbr/skills/begin/templates/researcher-prompt.md.tmpl +19 -0
  146. package/plugins/pbr/skills/begin/templates/roadmap-prompt.md.tmpl +30 -0
  147. package/plugins/pbr/skills/begin/templates/synthesis-prompt.md.tmpl +16 -0
  148. package/plugins/pbr/skills/build/SKILL.md +962 -0
  149. package/plugins/pbr/skills/config/SKILL.md +241 -0
  150. package/plugins/pbr/skills/continue/SKILL.md +127 -0
  151. package/plugins/pbr/skills/debug/SKILL.md +489 -0
  152. package/plugins/pbr/skills/debug/templates/continuation-prompt.md.tmpl +16 -0
  153. package/plugins/pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +27 -0
  154. package/plugins/pbr/skills/discuss/SKILL.md +338 -0
  155. package/plugins/pbr/skills/discuss/templates/CONTEXT.md.tmpl +61 -0
  156. package/plugins/pbr/skills/discuss/templates/decision-categories.md +9 -0
  157. package/plugins/pbr/skills/explore/SKILL.md +362 -0
  158. package/plugins/pbr/skills/health/SKILL.md +186 -0
  159. package/plugins/pbr/skills/health/templates/check-pattern.md.tmpl +30 -0
  160. package/plugins/pbr/skills/health/templates/output-format.md.tmpl +63 -0
  161. package/plugins/pbr/skills/help/SKILL.md +140 -0
  162. package/plugins/pbr/skills/import/SKILL.md +490 -0
  163. package/plugins/pbr/skills/milestone/SKILL.md +673 -0
  164. package/plugins/pbr/skills/milestone/templates/audit-report.md.tmpl +48 -0
  165. package/plugins/pbr/skills/milestone/templates/stats-file.md.tmpl +30 -0
  166. package/plugins/pbr/skills/note/SKILL.md +212 -0
  167. package/plugins/pbr/skills/pause/SKILL.md +235 -0
  168. package/plugins/pbr/skills/pause/templates/continue-here.md.tmpl +71 -0
  169. package/plugins/pbr/skills/plan/SKILL.md +628 -0
  170. package/plugins/pbr/skills/plan/decimal-phase-calc.md +98 -0
  171. package/plugins/pbr/skills/plan/templates/checker-prompt.md.tmpl +21 -0
  172. package/plugins/pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +32 -0
  173. package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +38 -0
  174. package/plugins/pbr/skills/plan/templates/researcher-prompt.md.tmpl +19 -0
  175. package/plugins/pbr/skills/plan/templates/revision-prompt.md.tmpl +23 -0
  176. package/plugins/pbr/skills/quick/SKILL.md +335 -0
  177. package/plugins/pbr/skills/resume/SKILL.md +388 -0
  178. package/plugins/pbr/skills/review/SKILL.md +652 -0
  179. package/plugins/pbr/skills/review/templates/debugger-prompt.md.tmpl +60 -0
  180. package/plugins/pbr/skills/review/templates/gap-planner-prompt.md.tmpl +40 -0
  181. package/plugins/pbr/skills/review/templates/verifier-prompt.md.tmpl +115 -0
  182. package/plugins/pbr/skills/scan/SKILL.md +269 -0
  183. package/plugins/pbr/skills/scan/templates/mapper-prompt.md.tmpl +201 -0
  184. package/plugins/pbr/skills/setup/SKILL.md +227 -0
  185. package/plugins/pbr/skills/shared/commit-planning-docs.md +35 -0
  186. package/plugins/pbr/skills/shared/config-loading.md +102 -0
  187. package/plugins/pbr/skills/shared/context-budget.md +40 -0
  188. package/plugins/pbr/skills/shared/context-loader-task.md +86 -0
  189. package/plugins/pbr/skills/shared/digest-select.md +79 -0
  190. package/plugins/pbr/skills/shared/domain-probes.md +125 -0
  191. package/plugins/pbr/skills/shared/error-reporting.md +79 -0
  192. package/plugins/pbr/skills/shared/gate-prompts.md +388 -0
  193. package/plugins/pbr/skills/shared/phase-argument-parsing.md +45 -0
  194. package/plugins/pbr/skills/shared/progress-display.md +53 -0
  195. package/plugins/pbr/skills/shared/revision-loop.md +81 -0
  196. package/plugins/pbr/skills/shared/state-loading.md +62 -0
  197. package/plugins/pbr/skills/shared/state-update.md +161 -0
  198. package/plugins/pbr/skills/shared/universal-anti-patterns.md +33 -0
  199. package/plugins/pbr/skills/status/SKILL.md +353 -0
  200. package/plugins/pbr/skills/todo/SKILL.md +181 -0
  201. package/plugins/pbr/templates/CONTEXT.md.tmpl +52 -0
  202. package/plugins/pbr/templates/INTEGRATION-REPORT.md.tmpl +151 -0
  203. package/plugins/pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
  204. package/plugins/pbr/templates/ROADMAP.md.tmpl +40 -0
  205. package/plugins/pbr/templates/SUMMARY.md.tmpl +81 -0
  206. package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +116 -0
  207. package/plugins/pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  208. package/plugins/pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  209. package/plugins/pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  210. package/plugins/pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  211. package/plugins/pbr/templates/codebase/STACK.md.tmpl +78 -0
  212. package/plugins/pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  213. package/plugins/pbr/templates/codebase/TESTING.md.tmpl +107 -0
  214. package/plugins/pbr/templates/continue-here.md.tmpl +73 -0
  215. package/plugins/pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
  216. package/plugins/pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  217. package/plugins/pbr/templates/research/STACK.md.tmpl +71 -0
  218. package/plugins/pbr/templates/research/SUMMARY.md.tmpl +112 -0
  219. package/plugins/pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  220. package/plugins/pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  221. package/plugins/pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
@@ -0,0 +1,545 @@
1
+ ---
2
+ name: begin
3
+ description: "Start a new project. Deep questioning, research, requirements, and roadmap."
4
+ allowed-tools: Read, Write, Bash, Glob, Grep, WebFetch, WebSearch, Task, AskUserQuestion
5
+ ---
6
+
7
+ # /pbr:begin — Project Initialization
8
+
9
+ You are the orchestrator for `/pbr:begin`. This skill initializes a new Plan-Build-Run project through deep questioning, optional research, requirements scoping, and roadmap generation. Your job is to stay lean — delegate heavy work to Task() subagents and keep the user's main context window clean.
10
+
11
+ ## Context Budget
12
+
13
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
14
+
15
+ Additionally for this skill:
16
+ - **Minimize** reading subagent output — read only summaries, not full research docs
17
+ - **Delegate** all analysis work to subagents — the orchestrator routes, it doesn't analyze
18
+
19
+ ## Prerequisites
20
+
21
+ - Working directory should be the project root
22
+ - No existing `.planning/` directory (or user confirms overwrite)
23
+
24
+ ---
25
+
26
+ ## Orchestration Flow
27
+
28
+ Execute these steps in order. Each step specifies whether it runs inline (in your context) or is delegated to a subagent.
29
+
30
+ ---
31
+
32
+ ### Step 1: Detect Brownfield (inline)
33
+
34
+ Check if the current directory has existing code:
35
+
36
+ ```
37
+ 1. Run: ls to check directory contents
38
+ 2. Look for indicators of existing code:
39
+ - package.json, requirements.txt, CMakeLists.txt, go.mod, Cargo.toml
40
+ - src/, lib/, app/ directories
41
+ - .git/ directory with commits
42
+ 3. Check if .planning/ already exists
43
+ ```
44
+
45
+ **If existing code found:**
46
+ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
47
+ question: "This looks like an existing codebase. Run /pbr:scan to analyze what's here first?"
48
+ options:
49
+ - label: "Yes, scan" description: "Run /pbr:scan first to analyze existing code"
50
+ - label: "No, begin" description: "Proceed with /pbr:begin on top of existing code"
51
+ - If user selects "Yes, scan": suggest `/pbr:scan` and stop
52
+ - If user selects "No, begin": proceed to Step 2
53
+
54
+ **If `.planning/` already exists:**
55
+ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
56
+ question: "A .planning/ directory already exists. This will overwrite it. Continue?"
57
+ options:
58
+ - label: "Yes" description: "Overwrite existing planning directory"
59
+ - label: "No" description: "Cancel — keep existing planning"
60
+ - If user selects "No": stop
61
+ - If user selects "Yes": proceed (existing directory will be overwritten during state initialization)
62
+
63
+ ---
64
+
65
+ ### Step 2: Deep Questioning (inline)
66
+
67
+ **Reference**: Read `references/questioning.md` for technique details.
68
+
69
+ Have a natural conversation to understand the user's vision. Do NOT present a form or checklist. Instead, have a flowing conversation that covers these areas organically:
70
+
71
+ **Required context to gather:**
72
+
73
+ 1. **What they want to build** — The core product/feature/system
74
+ 2. **Problem being solved** — Why does this need to exist? Who is it for?
75
+ 3. **Success criteria** — How will they know it works? What does "done" look like?
76
+ 4. **Existing constraints** — Technology choices already made, hosting, budget, timeline, team size
77
+ 5. **Key decisions already made** — Framework, language, architecture preferences
78
+ 6. **Edge cases and concerns** — What worries them? What's the hardest part?
79
+
80
+ **Conversation approach:**
81
+ - Start broad: "What are you building?"
82
+ - Go deeper on each answer: "What does that mean exactly?" "Show me an example."
83
+ - Surface assumptions: "Why do you assume that?" "Have you considered X?"
84
+ - Find edges: "What happens when...?" "What about...?"
85
+ - Reveal motivation: "Why does that matter?"
86
+ - Avoid leading questions — let the user define their vision
87
+
88
+ **Keep going until you have:**
89
+ - A clear, concrete understanding of what they want to build
90
+ - At least 3 specific success criteria
91
+ - Known constraints and decisions
92
+ - A sense of complexity and scope
93
+
94
+ **Anti-patterns:**
95
+ - DO NOT present a bulleted checklist and ask them to fill it in
96
+ - DO NOT ask all questions at once — have a conversation
97
+ - DO NOT assume technologies — let them tell you
98
+ - DO NOT rush — this is the foundation for everything that follows
99
+
100
+ ---
101
+
102
+ ### Step 3: Workflow Preferences (inline)
103
+
104
+ After understanding the project, configure the Plan-Build-Run workflow. Use AskUserQuestion for each preference below. Present them sequentially with conversational bridging (e.g., "Great. Next...") to keep the flow natural.
105
+
106
+ **3a. Mode:**
107
+ Use the **toggle-confirm** pattern from `skills/shared/gate-prompts.md`:
108
+ question: "How do you want to work?"
109
+ header: "Mode"
110
+ options:
111
+ - label: "Interactive" description: "Pause at key gates for your approval (default)"
112
+ - label: "Autonomous" description: "Auto-proceed, only stop for critical decisions"
113
+ - `interactive` (default) — confirm at gates (roadmap, plans, transitions)
114
+ - `autonomous` — auto-proceed, only stop for critical decisions
115
+
116
+ **3b. Depth:**
117
+ Use the **depth-select** pattern from `skills/shared/gate-prompts.md`:
118
+ question: "How thorough should planning be?"
119
+ - `quick` — 3-5 phases, skip research, ~50% cheaper
120
+ - `standard` (default) — 5-8 phases, includes research
121
+ - `comprehensive` — 8-12 phases, full deep research, ~2x cost
122
+
123
+ **3c. Parallelization:**
124
+ Use the **toggle-confirm** pattern from `skills/shared/gate-prompts.md`:
125
+ question: "Run multiple agents in parallel when plans are independent?"
126
+ header: "Parallel"
127
+ options:
128
+ - label: "Enable" description: "Parallel execution of independent plans (default)"
129
+ - label: "Disable" description: "Sequential execution only"
130
+ - `enabled` (default) — parallel execution of independent plans
131
+ - `disabled` — sequential execution
132
+
133
+ **3d. Git Branching:**
134
+ Use the **git-strategy-select** pattern from `skills/shared/gate-prompts.md`:
135
+ question: "Git branching strategy?"
136
+ - `none` (default) — commit to current branch
137
+ - `phase` — create branch per phase
138
+ - `milestone` — create branch per milestone
139
+
140
+ **3e. Commit Planning Docs:**
141
+ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
142
+ question: "Should planning documents (.planning/ directory) be committed to git?"
143
+ options:
144
+ - label: "Yes" description: "Commit planning docs (default)"
145
+ - label: "No" description: "Add .planning/ to .gitignore"
146
+ - `yes` (default) — commit planning docs
147
+ - `no` — add .planning/ to .gitignore
148
+
149
+ **After gathering preferences:**
150
+
151
+ 1. Read the config template from `skills/begin/templates/config.json.tmpl`
152
+ 2. Apply the user's choices to the template
153
+ 3. Create `.planning/` directory
154
+ 4. Write `.planning/config.json` with the user's preferences
155
+
156
+ **IMPORTANT**: This step MUST happen BEFORE research (Step 5) because depth controls how many researchers to spawn.
157
+
158
+ ---
159
+
160
+ ### Step 4: Research Decision (inline)
161
+
162
+ Based on the depth setting from Step 3, determine the research approach:
163
+
164
+ **Depth-to-Discovery mapping:**
165
+
166
+ | Depth | Discovery Level | Researchers | Topics |
167
+ |-------|----------------|-------------|--------|
168
+ | quick | Level 0 | 0 | Skip research entirely |
169
+ | standard | Level 1 | 2 | STACK.md, FEATURES.md |
170
+ | standard + brownfield | Level 2 | 2-3 | STACK.md, FEATURES.md, + codebase mapping |
171
+ | comprehensive | Level 3 | 4 | STACK.md, FEATURES.md, ARCHITECTURE.md, PITFALLS.md |
172
+
173
+ **If depth is `quick`:**
174
+ - Skip to Step 7 (Requirements Scoping)
175
+ - Tell user: "Skipping research phase (depth: quick). Moving straight to requirements."
176
+
177
+ **If depth is `standard` or `comprehensive`:**
178
+ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
179
+ question: "I'd like to research the technology landscape before planning. This helps create better plans. Proceed with research?"
180
+ options:
181
+ - label: "Yes" description: "Run research agents (recommended for standard/comprehensive)"
182
+ - label: "No" description: "Skip research, move straight to requirements"
183
+ - If user selects "No": skip to Step 7
184
+ - If user selects "Yes": proceed to Step 5
185
+
186
+ ---
187
+
188
+ ### Step 5: Research (delegated to subagents)
189
+
190
+ Spawn parallel Task() subagents for research. Each researcher writes to `.planning/research/`.
191
+
192
+ **Create `.planning/research/` directory first.**
193
+
194
+ **For each research topic, spawn a Task():**
195
+
196
+ ```
197
+ Task({
198
+ subagent_type: "pbr:researcher",
199
+ prompt: <see researcher prompt template below>
200
+ })
201
+ ```
202
+
203
+ **NOTE**: The `pbr:researcher` subagent type auto-loads the agent definition from `agents/researcher.md`. Do NOT inline the agent definition — it wastes main context.
204
+
205
+ #### Researcher Prompt Template
206
+
207
+ For each researcher, construct the prompt by reading the template and filling in placeholders:
208
+
209
+ Read `skills/begin/templates/researcher-prompt.md.tmpl` for the prompt structure.
210
+
211
+ **Placeholders to fill:**
212
+ - `{project name from questioning}` — project name gathered in Step 2
213
+ - `{2-3 sentence description from questioning}` — project description from Step 2
214
+ - `{any locked technology choices}` — technology constraints from Step 2
215
+ - `{budget, timeline, skill level, etc.}` — user constraints from Step 2
216
+ - `{topic}` — the research topic being assigned (e.g., "Technology Stack Analysis")
217
+ - `{TOPIC}` — the output filename (e.g., STACK, FEATURES, ARCHITECTURE, PITFALLS)
218
+ - `{topic-specific questions}` — see topic-specific questions below
219
+
220
+ **Topic-specific questions:**
221
+
222
+ **STACK.md** (Level 1+):
223
+ - What is the standard technology stack for this type of project?
224
+ - What are the current recommended versions?
225
+ - What are the key dependencies and their compatibility?
226
+ - What build tools and development workflow is standard?
227
+
228
+ **FEATURES.md** (Level 1+):
229
+ - How are similar features typically implemented in this stack?
230
+ - What libraries/packages are commonly used for each feature area?
231
+ - What are standard patterns for the key features described?
232
+ - What third-party integrations are typically needed?
233
+
234
+ **ARCHITECTURE.md** (Level 3 only):
235
+ - What is the recommended architecture for this type of project?
236
+ - How should the codebase be organized?
237
+ - What are the standard patterns for data flow, state management, etc.?
238
+ - How should components communicate?
239
+
240
+ **PITFALLS.md** (Level 3 only):
241
+ - What commonly goes wrong with this type of project?
242
+ - What are the most common mistakes developers make?
243
+ - What performance issues are typical?
244
+ - What security concerns exist?
245
+
246
+ **Parallelization:**
247
+ - Spawn ALL researchers in parallel (multiple Task() calls in one response)
248
+ - Use `run_in_background: true` for each researcher
249
+ - Before spawning, display to the user: `◐ Spawning {N} researchers in parallel...`
250
+ - While waiting, display progress to the user:
251
+ - After spawning: list of topics being researched
252
+ - Periodically (every ~30s): check `TaskOutput` with `block: false` for each agent and report status
253
+ - When each completes: "✓ {topic} researcher complete ({duration})"
254
+ - When all complete: "All {N} researchers finished. Proceeding to synthesis."
255
+ - Wait for all to complete before proceeding
256
+
257
+ ---
258
+
259
+ ### Step 6: Synthesis (delegated to subagent)
260
+
261
+ After all researchers complete, display to the user: `◐ Spawning synthesizer...`
262
+
263
+ Spawn a synthesis agent:
264
+
265
+ ```
266
+ Task({
267
+ subagent_type: "pbr:synthesizer",
268
+ model: "haiku",
269
+ prompt: <synthesis prompt>
270
+ })
271
+ ```
272
+
273
+ **NOTE**: The `pbr:synthesizer` subagent type auto-loads the agent definition. Do NOT inline it. Use `model: "haiku"` — synthesis is fast summarization work that doesn't need a large model.
274
+
275
+ #### Synthesis Prompt Template
276
+
277
+ Read `skills/begin/templates/synthesis-prompt.md.tmpl` for the prompt structure.
278
+
279
+ **Placeholders to fill:**
280
+ - `{List all .planning/research/*.md files that were created}` — list the research files produced in Step 5
281
+
282
+ ---
283
+
284
+ ### Step 7: Requirements Scoping (inline)
285
+
286
+ Present research findings (if any) and interactively scope requirements with the user.
287
+
288
+ **7a. Present findings:**
289
+ If research was done, read `.planning/research/SUMMARY.md` and present key findings:
290
+ - Recommended stack
291
+ - Key architectural decisions
292
+ - Notable pitfalls to be aware of
293
+
294
+ **7b. Feature identification:**
295
+ From the questioning session, list all features and capabilities discussed. Group them into categories.
296
+
297
+ Example categories: Auth, UI, API, Data, Infrastructure, Testing, etc.
298
+
299
+ **7c. Scope each category:**
300
+ For each category, present the features and ask the user to classify each:
301
+ - **v1 (committed)** — Will be built in this project
302
+ - **v2 (deferred)** — Will be built later, not now
303
+ - **Out of scope** — Will NOT be built
304
+
305
+ **7d. Assign REQ-IDs:**
306
+ For each committed requirement, assign an ID in the format `{CATEGORY}-{NN}`:
307
+ - `AUTH-01`: User can log in with Discord OAuth
308
+ - `AUTH-02`: Protected routes redirect to login
309
+ - `UI-01`: Dashboard shows player statistics
310
+ - `UI-02`: Mobile-responsive layout
311
+
312
+ Each requirement must be:
313
+ - **User-centric** — describes a capability from the user's perspective
314
+ - **Testable** — you can verify whether it's met or not
315
+ - **Specific** — not vague ("fast" is bad, "page loads in <2s" is good)
316
+
317
+ **7e. Write REQUIREMENTS.md:**
318
+ Read the template from `skills/begin/templates/REQUIREMENTS.md.tmpl` and write `.planning/REQUIREMENTS.md` with:
319
+ - All v1 requirements grouped by category
320
+ - All v2 requirements with deferral reasons
321
+ - Out-of-scope items with rationale
322
+ - Traceability table (all REQ-IDs, no phases assigned yet)
323
+
324
+ ---
325
+
326
+ ### Step 8: Roadmap Generation (delegated to subagent)
327
+
328
+ Display to the user: `◐ Spawning planner (roadmap)...`
329
+
330
+ Spawn the planner in roadmap mode:
331
+
332
+ ```
333
+ Task({
334
+ subagent_type: "pbr:planner",
335
+ prompt: <roadmap prompt>
336
+ })
337
+ ```
338
+
339
+ **NOTE**: The `pbr:planner` subagent type auto-loads the agent definition. Do NOT inline it. The planner agent will read REQUIREMENTS.md and SUMMARY.md from disk — you only need to tell it what to do and where files are.
340
+
341
+ #### Roadmap Prompt Template
342
+
343
+ Read `skills/begin/templates/roadmap-prompt.md.tmpl` for the prompt structure.
344
+
345
+ **Placeholders to fill:**
346
+ - `{project name}` — project name from Step 2
347
+ - `{description}` — project description from Step 2
348
+ - `{quick|standard|comprehensive}` — depth setting from Step 3
349
+
350
+ **After the planner completes:**
351
+ - Read `.planning/ROADMAP.md`
352
+ - If `gates.confirm_roadmap` is true in config, use the **approve-revise-abort** pattern from `skills/shared/gate-prompts.md`:
353
+ question: "Approve this roadmap?"
354
+ options:
355
+ - label: "Approve" description: "Proceed with this roadmap"
356
+ - label: "Request changes" description: "Discuss adjustments before proceeding"
357
+ - label: "Abort" description: "Cancel and start over"
358
+ - If user selects "Request changes": edit the roadmap inline (small changes) or re-spawn planner
359
+ - If user selects "Approve": proceed to Step 9
360
+ - If user selects "Abort": stop execution
361
+
362
+ ---
363
+
364
+ ### Step 9: State Initialization (inline)
365
+
366
+ Write the project state files from templates:
367
+
368
+ **9a. Write PROJECT.md:**
369
+ 1. Read `skills/begin/templates/PROJECT.md.tmpl`
370
+ 2. Fill in:
371
+ - `{project_name}` — from questioning
372
+ - `{2-3 sentences}` — project description from questioning
373
+ - `{ONE sentence}` — core value statement
374
+ - Out-of-scope features
375
+ - Technical context and constraints
376
+ - Initial key decisions from the questioning conversation
377
+ 3. Write to `.planning/PROJECT.md`
378
+ 4. Ensure the `## Milestones` section is filled in with the project name and phase count from the roadmap
379
+
380
+ **9b. Write STATE.md:**
381
+ 1. Read `skills/begin/templates/STATE.md.tmpl`
382
+ 2. Fill in:
383
+ - `{date}` — today's date
384
+ - `{total}` — total phase count from roadmap
385
+ - `{Phase 1 name}` — from roadmap
386
+ - Core value one-liner
387
+ - Decisions from initialization
388
+ 3. Write to `.planning/STATE.md`
389
+ 4. Fill in the `## Milestone` section with the project name and total phase count
390
+ 5. **STATE.md size limit**: Follow size limit enforcement rules in `skills/shared/state-update.md` (150 lines max).
391
+
392
+ **9c. Write CONTEXT.md:**
393
+ Create `.planning/CONTEXT.md` from information gathered during questioning:
394
+
395
+ ```markdown
396
+ # Project Context
397
+
398
+ ## Locked Decisions
399
+ {Technology choices, architecture decisions, and constraints that are NON-NEGOTIABLE}
400
+
401
+ | Decision | Rationale | Locked By |
402
+ |----------|-----------|-----------|
403
+ | {e.g., "Use TypeScript"} | {User preference, team skill} | User |
404
+
405
+ ## User Constraints
406
+ {Budget, timeline, skill level, hosting, team size}
407
+
408
+ ## Deferred Ideas
409
+ {Features explicitly moved to v2 or out-of-scope}
410
+
411
+ | Idea | Reason Deferred |
412
+ |------|----------------|
413
+ | {feature} | {reason} |
414
+ ```
415
+
416
+ **9d. Create phase directories:**
417
+ For each phase in the roadmap, create the directory structure:
418
+ ```
419
+ .planning/phases/01-{slug}/
420
+ .planning/phases/02-{slug}/
421
+ ...
422
+ ```
423
+
424
+ Where `{slug}` is the phase name in kebab-case (e.g., `project-setup`, `authentication`).
425
+
426
+ ---
427
+
428
+ ### Step 10: Git Setup (inline)
429
+
430
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
431
+
432
+ **10a. Gitignore:**
433
+ If `planning.commit_docs` is `false` in config:
434
+ - Add `.planning/` to `.gitignore`
435
+
436
+ If `planning.commit_docs` is `true`:
437
+ - Add `.planning/research/` to `.gitignore` (research is always excluded — it's reference material, not project state)
438
+
439
+ **10b. Initial commit (if desired):**
440
+ If `gates.confirm_project` is true in config:
441
+ - Present a summary of everything created:
442
+ - Project: {name}
443
+ - Core value: {one-liner}
444
+ - Phases: {count} phases in roadmap
445
+ - Requirements: {count} v1 requirements
446
+ - Config: depth={depth}, mode={mode}
447
+ - Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
448
+ question: "Everything look good? Commit the planning docs?"
449
+ options:
450
+ - label: "Yes" description: "Stage and commit .planning/ files"
451
+ - label: "No" description: "Let me review and adjust first"
452
+ - If user selects "Yes" and `planning.commit_docs` is true:
453
+ - Stage `.planning/` files (excluding research/ if gitignored)
454
+ - Commit: `chore: initialize plan-build-run project planning`
455
+ - If user selects "No": let user review and adjust
456
+
457
+ ---
458
+
459
+ ## Completion
460
+
461
+ After all steps complete, present the final summary:
462
+
463
+ Use the branded stage banner from `references/ui-formatting.md`:
464
+
465
+ ```
466
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
467
+ PLAN-BUILD-RUN ► PROJECT INITIALIZED ✓
468
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
469
+
470
+ **{name}**
471
+
472
+ {core value one-liner}
473
+
474
+ Roadmap: {N} phases
475
+ 1. {Phase 1 name}
476
+ 2. {Phase 2 name}
477
+ ...
478
+
479
+ Requirements: {N} committed, {M} deferred, {K} out-of-scope
480
+ ```
481
+
482
+ Then use the "Next Up" routing block:
483
+ ```
484
+ ───────────────────────────────────────────────────────────────
485
+
486
+ ## ▶ Next Up
487
+
488
+ **Phase 1: {Name}** — {one-line goal}
489
+
490
+ `/pbr:explore`
491
+
492
+ <sub>`/clear` first → fresh context window</sub>
493
+
494
+ ───────────────────────────────────────────────────────────────
495
+
496
+ **Also available:**
497
+ - `/pbr:discuss 1` — talk through Phase 1 details before planning
498
+ - `/pbr:plan 1` — jump straight to planning Phase 1
499
+ - `/pbr:config` — adjust workflow settings
500
+
501
+ ───────────────────────────────────────────────────────────────
502
+ ```
503
+
504
+ ---
505
+
506
+ ## Error Handling
507
+
508
+ ### Research agent fails
509
+ If a researcher Task() fails or times out:
510
+ - Note which topic wasn't researched
511
+ - Continue with available research
512
+ - Display: `⚠ Research on {topic} failed. Proceeding without it. You can re-research during /pbr:plan.`
513
+
514
+ ### User wants to restart
515
+ If user says they want to start over mid-flow:
516
+ - Confirm: "Start over from the beginning? Current progress will be lost."
517
+ - If yes: restart from Step 2
518
+
519
+ ### Config write fails
520
+ If `.planning/` directory can't be created, display:
521
+ ```
522
+ ╔══════════════════════════════════════════════════════════════╗
523
+ ║ ERROR ║
524
+ ╚══════════════════════════════════════════════════════════════╝
525
+
526
+ Cannot create .planning/ directory.
527
+
528
+ **To fix:** Check directory permissions or specify an alternative path.
529
+ ```
530
+
531
+ ---
532
+
533
+ ## Files Created by /pbr:begin
534
+
535
+ | File | Purpose | When |
536
+ |------|---------|------|
537
+ | `.planning/config.json` | Workflow configuration | Step 3 |
538
+ | `.planning/research/*.md` | Research documents | Step 5 (if research enabled) |
539
+ | `.planning/research/SUMMARY.md` | Research synthesis | Step 6 (if research enabled) |
540
+ | `.planning/REQUIREMENTS.md` | Scoped requirements | Step 7 |
541
+ | `.planning/ROADMAP.md` | Phase roadmap | Step 8 |
542
+ | `.planning/PROJECT.md` | Project overview | Step 9 |
543
+ | `.planning/STATE.md` | Current state tracker | Step 9 |
544
+ | `.planning/CONTEXT.md` | Decisions and constraints | Step 9 |
545
+ | `.planning/phases/NN-*/` | Phase directories | Step 9 |
@@ -0,0 +1,33 @@
1
+ # {project_name}
2
+
3
+ ## What This Is
4
+ {2-3 sentences: current, accurate description}
5
+
6
+ ## Core Value
7
+ {ONE sentence: the thing that matters most}
8
+
9
+ ## Requirements
10
+ ### Active (current scope)
11
+ See: .planning/REQUIREMENTS.md
12
+
13
+ ### Out of Scope
14
+ {Features explicitly excluded and why}
15
+
16
+ ## Context
17
+ {Technical environment, prior work, constraints}
18
+
19
+ ## Constraints
20
+ {Known constraints with rationale}
21
+
22
+ ## Key Decisions
23
+ | Decision | Rationale | Outcome |
24
+ |----------|-----------|---------|
25
+ | {initial decisions from questioning} | {why} | -- Pending |
26
+
27
+ ## Milestones
28
+
29
+ ### Active
30
+ - **{project_name} v1.0** -- Phases 1-{total} -- In progress
31
+
32
+ ### Completed
33
+ (none yet)
@@ -0,0 +1,18 @@
1
+ # Requirements: {project_name}
2
+
3
+ ## v1 Requirements (committed scope)
4
+
5
+ ### {Category}
6
+ - [ ] **{CAT}-01**: {User-centric, testable requirement}
7
+
8
+ ## v2 Requirements (deferred)
9
+ - **{CAT}-01**: {Deferred requirement with reason}
10
+
11
+ ## Out of Scope
12
+ | Feature | Reason |
13
+ |---------|--------|
14
+
15
+ ## Traceability
16
+ | Requirement | Phase | Status |
17
+ |-------------|-------|--------|
18
+ | {REQ-ID} | -- | Pending |
@@ -0,0 +1,49 @@
1
+ ---
2
+ version: 2
3
+ current_phase: 1
4
+ total_phases: {total}
5
+ phase_slug: "{phase_1_slug}"
6
+ phase_name: "{Phase 1 name}"
7
+ status: "ready_to_plan"
8
+ progress_percent: 0
9
+ plans_total: 0
10
+ plans_complete: 0
11
+ last_activity: "{date}"
12
+ last_command: "/pbr:begin"
13
+ blockers: []
14
+ active_checkpoint: null
15
+ ---
16
+ # Project State
17
+
18
+ ## Project Reference
19
+ See: .planning/PROJECT.md (updated {date})
20
+ **Core value:** {One-liner}
21
+ **Current focus:** Phase 1 - {name}
22
+
23
+ ## Current Position
24
+ Phase: 1 of {total} ({Phase 1 name})
25
+ Plan: 0 of 0 in current phase
26
+ Status: Ready to plan
27
+ Last activity: {date} -- Project initialized
28
+ Progress: [░░░░░░░░░░░░░░░░░░░░] 0%
29
+
30
+ ## Accumulated Context
31
+
32
+ ### Decisions
33
+ {Decisions from initialization}
34
+
35
+ ### Pending Todos
36
+ None yet
37
+
38
+ ### Blockers/Concerns
39
+ None yet
40
+
41
+ ## Milestone
42
+ Current: {project_name} v1.0
43
+ Phases: 1-{total}
44
+ Status: In progress
45
+
46
+ ## Session Continuity
47
+ Last session: {timestamp}
48
+ Stopped at: Project initialization complete
49
+ Resume file: None