@sienklogic/plan-build-run 2.54.0 → 2.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/plugins/codex-pbr/agents/audit.md +223 -0
  4. package/plugins/codex-pbr/agents/codebase-mapper.md +196 -0
  5. package/plugins/codex-pbr/agents/debugger.md +245 -0
  6. package/plugins/codex-pbr/agents/dev-sync.md +142 -0
  7. package/plugins/codex-pbr/agents/executor.md +429 -0
  8. package/plugins/codex-pbr/agents/general.md +131 -0
  9. package/plugins/codex-pbr/agents/integration-checker.md +178 -0
  10. package/plugins/codex-pbr/agents/plan-checker.md +253 -0
  11. package/plugins/codex-pbr/agents/planner.md +343 -0
  12. package/plugins/codex-pbr/agents/researcher.md +253 -0
  13. package/plugins/codex-pbr/agents/synthesizer.md +183 -0
  14. package/plugins/codex-pbr/agents/verifier.md +352 -0
  15. package/plugins/codex-pbr/commands/audit.md +5 -0
  16. package/plugins/codex-pbr/commands/begin.md +5 -0
  17. package/plugins/codex-pbr/commands/build.md +5 -0
  18. package/plugins/codex-pbr/commands/config.md +5 -0
  19. package/plugins/codex-pbr/commands/continue.md +5 -0
  20. package/plugins/codex-pbr/commands/dashboard.md +5 -0
  21. package/plugins/codex-pbr/commands/debug.md +5 -0
  22. package/plugins/codex-pbr/commands/discuss.md +5 -0
  23. package/plugins/codex-pbr/commands/do.md +5 -0
  24. package/plugins/codex-pbr/commands/explore.md +5 -0
  25. package/plugins/codex-pbr/commands/health.md +5 -0
  26. package/plugins/codex-pbr/commands/help.md +5 -0
  27. package/plugins/codex-pbr/commands/import.md +5 -0
  28. package/plugins/codex-pbr/commands/milestone.md +5 -0
  29. package/plugins/codex-pbr/commands/note.md +5 -0
  30. package/plugins/codex-pbr/commands/pause.md +5 -0
  31. package/plugins/codex-pbr/commands/plan.md +5 -0
  32. package/plugins/codex-pbr/commands/quick.md +5 -0
  33. package/plugins/codex-pbr/commands/resume.md +5 -0
  34. package/plugins/codex-pbr/commands/review.md +5 -0
  35. package/plugins/codex-pbr/commands/scan.md +5 -0
  36. package/plugins/codex-pbr/commands/setup.md +5 -0
  37. package/plugins/codex-pbr/commands/status.md +5 -0
  38. package/plugins/codex-pbr/commands/statusline.md +5 -0
  39. package/plugins/codex-pbr/commands/test.md +5 -0
  40. package/plugins/codex-pbr/commands/todo.md +5 -0
  41. package/plugins/codex-pbr/commands/undo.md +5 -0
  42. package/plugins/codex-pbr/references/agent-contracts.md +324 -0
  43. package/plugins/codex-pbr/references/agent-teams.md +54 -0
  44. package/plugins/codex-pbr/references/common-bug-patterns.md +13 -0
  45. package/plugins/codex-pbr/references/config-reference.md +552 -0
  46. package/plugins/codex-pbr/references/continuation-format.md +212 -0
  47. package/plugins/codex-pbr/references/deviation-rules.md +112 -0
  48. package/plugins/codex-pbr/references/git-integration.md +256 -0
  49. package/plugins/codex-pbr/references/integration-patterns.md +117 -0
  50. package/plugins/codex-pbr/references/model-profiles.md +99 -0
  51. package/plugins/codex-pbr/references/model-selection.md +31 -0
  52. package/plugins/codex-pbr/references/pbr-tools-cli.md +400 -0
  53. package/plugins/codex-pbr/references/plan-authoring.md +246 -0
  54. package/plugins/codex-pbr/references/plan-format.md +313 -0
  55. package/plugins/codex-pbr/references/questioning.md +235 -0
  56. package/plugins/codex-pbr/references/reading-verification.md +127 -0
  57. package/plugins/codex-pbr/references/signal-files.md +41 -0
  58. package/plugins/codex-pbr/references/stub-patterns.md +160 -0
  59. package/plugins/codex-pbr/references/ui-formatting.md +444 -0
  60. package/plugins/codex-pbr/references/wave-execution.md +95 -0
  61. package/plugins/codex-pbr/skills/audit/SKILL.md +346 -0
  62. package/plugins/codex-pbr/skills/begin/SKILL.md +800 -0
  63. package/plugins/codex-pbr/skills/build/SKILL.md +958 -0
  64. package/plugins/codex-pbr/skills/config/SKILL.md +267 -0
  65. package/plugins/codex-pbr/skills/continue/SKILL.md +172 -0
  66. package/plugins/codex-pbr/skills/dashboard/SKILL.md +44 -0
  67. package/plugins/codex-pbr/skills/debug/SKILL.md +530 -0
  68. package/plugins/codex-pbr/skills/discuss/SKILL.md +355 -0
  69. package/plugins/codex-pbr/skills/do/SKILL.md +68 -0
  70. package/plugins/codex-pbr/skills/explore/SKILL.md +407 -0
  71. package/plugins/codex-pbr/skills/health/SKILL.md +300 -0
  72. package/plugins/codex-pbr/skills/help/SKILL.md +229 -0
  73. package/plugins/codex-pbr/skills/import/SKILL.md +538 -0
  74. package/plugins/codex-pbr/skills/milestone/SKILL.md +620 -0
  75. package/plugins/codex-pbr/skills/note/SKILL.md +215 -0
  76. package/plugins/codex-pbr/skills/pause/SKILL.md +258 -0
  77. package/plugins/codex-pbr/skills/plan/SKILL.md +650 -0
  78. package/plugins/codex-pbr/skills/quick/SKILL.md +417 -0
  79. package/plugins/codex-pbr/skills/resume/SKILL.md +403 -0
  80. package/plugins/codex-pbr/skills/review/SKILL.md +669 -0
  81. package/plugins/codex-pbr/skills/scan/SKILL.md +325 -0
  82. package/plugins/codex-pbr/skills/setup/SKILL.md +169 -0
  83. package/plugins/codex-pbr/skills/shared/commit-planning-docs.md +35 -0
  84. package/plugins/codex-pbr/skills/shared/config-loading.md +102 -0
  85. package/plugins/codex-pbr/skills/shared/context-budget.md +77 -0
  86. package/plugins/codex-pbr/skills/shared/context-loader-task.md +86 -0
  87. package/plugins/codex-pbr/skills/shared/digest-select.md +79 -0
  88. package/plugins/codex-pbr/skills/shared/domain-probes.md +125 -0
  89. package/plugins/codex-pbr/skills/shared/error-reporting.md +59 -0
  90. package/plugins/codex-pbr/skills/shared/gate-prompts.md +388 -0
  91. package/plugins/codex-pbr/skills/shared/phase-argument-parsing.md +45 -0
  92. package/plugins/codex-pbr/skills/shared/revision-loop.md +81 -0
  93. package/plugins/codex-pbr/skills/shared/state-update.md +169 -0
  94. package/plugins/codex-pbr/skills/shared/universal-anti-patterns.md +43 -0
  95. package/plugins/codex-pbr/skills/status/SKILL.md +449 -0
  96. package/plugins/codex-pbr/skills/statusline/SKILL.md +149 -0
  97. package/plugins/codex-pbr/skills/test/SKILL.md +210 -0
  98. package/plugins/codex-pbr/skills/todo/SKILL.md +281 -0
  99. package/plugins/codex-pbr/skills/undo/SKILL.md +172 -0
  100. package/plugins/codex-pbr/templates/CONTEXT.md.tmpl +52 -0
  101. package/plugins/codex-pbr/templates/INTEGRATION-REPORT.md.tmpl +167 -0
  102. package/plugins/codex-pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
  103. package/plugins/codex-pbr/templates/ROADMAP.md.tmpl +47 -0
  104. package/plugins/codex-pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  105. package/plugins/codex-pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
  106. package/plugins/codex-pbr/templates/SUMMARY.md.tmpl +81 -0
  107. package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  108. package/plugins/codex-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  109. package/plugins/codex-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  110. package/plugins/codex-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  111. package/plugins/codex-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  112. package/plugins/codex-pbr/templates/codebase/STACK.md.tmpl +78 -0
  113. package/plugins/codex-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  114. package/plugins/codex-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  115. package/plugins/codex-pbr/templates/continue-here.md.tmpl +73 -0
  116. package/plugins/codex-pbr/templates/pr-body.md.tmpl +22 -0
  117. package/plugins/codex-pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
  118. package/plugins/codex-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  119. package/plugins/codex-pbr/templates/research/STACK.md.tmpl +71 -0
  120. package/plugins/codex-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  121. package/plugins/codex-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  122. package/plugins/codex-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  123. package/plugins/codex-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  124. package/plugins/copilot-pbr/plugin.json +1 -1
  125. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  126. package/plugins/jules-pbr/AGENTS.md +600 -0
  127. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
@@ -0,0 +1,325 @@
1
+ ---
2
+ name: scan
3
+ description: "Analyze an existing codebase. Maps structure, architecture, conventions, and concerns."
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 ► SCANNING CODEBASE ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ # $pbr-scan — Codebase Analysis
21
+
22
+ You are running the **scan** skill. Your job is to analyze an existing codebase and produce a comprehensive map of its structure, architecture, conventions, and concerns. This is the entry point for brownfield projects — codebases that already have code before Plan-Build-Run is introduced.
23
+
24
+ This skill **spawns 4 parallel Task(subagent_type: "pbr:codebase-mapper")** agents for analysis.
25
+
26
+ ---
27
+
28
+ ## Context Budget
29
+
30
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
31
+
32
+ Additionally for this skill:
33
+ - **Never** analyze the codebase yourself — delegate ALL analysis to the 4 parallel codebase-mapper agents
34
+ - **Minimize** reading mapper outputs — read only frontmatter or first 20 lines of each output document
35
+ - **Delegate** all file reading, pattern analysis, and architecture mapping to the codebase-mapper agents
36
+
37
+ ---
38
+
39
+ ## Core Principle
40
+
41
+ **Understand before you change.** Scanning a codebase is about building a mental model of what exists. Every file produced by this skill becomes context that the planner and executor use to make informed decisions. Accuracy matters more than speed.
42
+
43
+ ---
44
+
45
+ ## Flow
46
+
47
+ ### Step 1: Check for Existing Analysis
48
+
49
+ Check if `.planning/codebase/` directory exists:
50
+
51
+ **If it exists and has files:**
52
+
53
+ First, resolve the depth profile so you know which areas are available:
54
+ ```bash
55
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
56
+ ```
57
+ Read `profile["scan.mapper_areas"]` to determine available areas (quick: tech, arch; standard/comprehensive: tech, arch, quality, concerns).
58
+
59
+ Then present to user via AskUserQuestion:
60
+ ```
61
+ A codebase analysis already exists (from {date based on file modification}).
62
+
63
+ Files found:
64
+ - {list of .md files in the directory}
65
+
66
+ Options:
67
+ 1. Refresh the full analysis (overwrites existing)
68
+ 2. Refresh a specific area ({list available areas from depth profile})
69
+ 3. Keep existing analysis
70
+ ```
71
+ - If user chooses "Keep": display a summary of existing analysis and stop
72
+ - If user chooses "Refresh specific": present the available areas based on the already-resolved depth profile (quick mode only offers tech/arch; standard/comprehensive offers all 4). Only spawn the selected agent. Skip re-resolving depth in Step 3 since it was already resolved here.
73
+ - If user chooses "Refresh all": proceed with full scan
74
+
75
+ **If it doesn't exist:**
76
+ - Create `.planning/codebase/` directory
77
+ - Also create `.planning/` if it doesn't exist (scan can be run before begin)
78
+ - Proceed with full scan
79
+
80
+ ### Step 2: Initial Reconnaissance
81
+
82
+ Reference: `skills/shared/context-loader-task.md` (Scan Reconnaissance variation) for the underlying pattern.
83
+
84
+ Before spawning agents, do a quick scan to identify what we're working with. This gives agents better context.
85
+
86
+ 1. **Detect project type** — check for language-specific config files (package.json, requirements.txt, go.mod, Cargo.toml, etc.)
87
+ 2. **Detect project scale** — count source files (exclude node_modules, venv, .git, build, dist). Categories: Small (<50), Medium (50-200), Large (200-1000), Very Large (1000+)
88
+ 3. **Detect key directories** — identify src, test, docs, config, scripts, public, migrations directories
89
+ 4. **Read existing docs** — README.md, architecture docs, .env.example
90
+ 5. **Write `.planning/codebase/RECON.md`** with project type, scale, key directories, entry points, and quick stats
91
+
92
+ Refer to the "Reconnaissance Detection Reference" section of `skills/scan/templates/mapper-prompt.md.tmpl` for the full detection checklists.
93
+
94
+ ### Step 3: Spawn Analysis Agents
95
+
96
+ **Resolve mapper configuration:** Before spawning, resolve the depth profile:
97
+ ```bash
98
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
99
+ ```
100
+
101
+ Read `profile["scan.mapper_count"]` and `profile["scan.mapper_areas"]` to determine how many mappers to spawn and which focus areas to cover.
102
+
103
+ **Default mappings by depth:**
104
+ - `quick` (budget): 2 mappers -- `tech` and `arch` only. Produces STACK.md, INTEGRATIONS.md, ARCHITECTURE.md, STRUCTURE.md. Skips quality and concerns analysis.
105
+ - `standard` (balanced): 4 mappers -- all areas. Full analysis.
106
+ - `comprehensive` (thorough): 4 mappers -- all areas. Full analysis.
107
+
108
+ Display to the user:
109
+ ```
110
+ ◐ Spawning {mapper_count} codebase mapper(s) in parallel...
111
+ → Technology stack analysis
112
+ → Architecture patterns
113
+ → Code quality assessment
114
+ → Concerns & risks
115
+ ```
116
+
117
+ (Only list the focus areas that will actually be spawned based on the depth profile.)
118
+
119
+ Spawn `{mapper_count}` parallel `Task(subagent_type: "pbr:codebase-mapper")` agents, one for each area in `scan.mapper_areas`. All should be spawned in a single response for maximum parallelism.
120
+
121
+ For each agent, read `skills/scan/templates/mapper-prompt.md.tmpl` and fill in the placeholders:
122
+ - `{focus_area}`: one of `tech`, `arch`, `quality`, `concerns`
123
+ - `{project_path}`: the working directory
124
+ - `{recon_data}`: contents of RECON.md
125
+ - `{scale}`: detected scale from Step 2
126
+ - `{output_path}`: `.planning/codebase/`
127
+
128
+ **Prepend this block to each mapper prompt before sending:**
129
+ ```
130
+ <files_to_read>
131
+ CRITICAL: Read these files BEFORE any other action:
132
+ 1. .planning/codebase/RECON.md — baseline reconnaissance data (if exists)
133
+ </files_to_read>
134
+ ```
135
+
136
+ | Agent | Focus | Output Files | When |
137
+ |-------|-------|-------------|------|
138
+ | 1 | tech | STACK.md, INTEGRATIONS.md | Always |
139
+ | 2 | arch | ARCHITECTURE.md, STRUCTURE.md | Always |
140
+ | 3 | quality | CONVENTIONS.md, TESTING.md | standard + comprehensive |
141
+ | 4 | concerns | CONCERNS.md | standard + comprehensive |
142
+
143
+ ### Step 4: Wait for Agents
144
+
145
+ All agents run in parallel. As each completes, display:
146
+ ```
147
+ ✓ Technology stack analysis complete
148
+ ✓ Architecture patterns complete
149
+ ✓ Code quality assessment complete
150
+ ✓ Concerns & risks complete
151
+ ```
152
+
153
+ (Only display lines for the focus areas that were actually spawned.)
154
+
155
+ ### Step 4b: Check Completion Markers
156
+
157
+ After each codebase-mapper Task() completes, check the Task() output for the `## MAPPING COMPLETE` marker:
158
+
159
+ - If `## MAPPING COMPLETE` is present: the mapper finished successfully, proceed normally
160
+ - If the marker is missing: warn the user that the mapper may not have completed successfully:
161
+ ```
162
+ ⚠ Codebase mapper ({focus_area}) did not report MAPPING COMPLETE.
163
+ Output may be incomplete — check .planning/codebase/ for partial results.
164
+ ```
165
+ Continue to Step 5 verification regardless (the file existence checks will catch truly missing output).
166
+
167
+ ### Step 5: Verify Output
168
+
169
+ After all agents complete, verify the expected files exist:
170
+
171
+ **Required files (always):**
172
+ - `.planning/codebase/RECON.md` (created in Step 2)
173
+ - `.planning/codebase/STACK.md` (tech mapper)
174
+ - `.planning/codebase/INTEGRATIONS.md` (tech mapper)
175
+ - `.planning/codebase/ARCHITECTURE.md` (arch mapper)
176
+ - `.planning/codebase/STRUCTURE.md` (arch mapper)
177
+
178
+ **Required files (standard + comprehensive only):**
179
+ - `.planning/codebase/CONVENTIONS.md` (quality mapper)
180
+ - `.planning/codebase/TESTING.md` (quality mapper)
181
+ - `.planning/codebase/CONCERNS.md` (concerns mapper)
182
+
183
+ Check only the files that correspond to the mapper areas that were actually spawned.
184
+
185
+ For any missing files, display:
186
+ ```
187
+ ╔══════════════════════════════════════════════════════════════╗
188
+ ║ ERROR ║
189
+ ╚══════════════════════════════════════════════════════════════╝
190
+
191
+ Missing analysis output: {filename}
192
+ Agent that failed: {focus_area} mapper
193
+
194
+ **To fix:** Re-run with `$pbr-scan` and select "Refresh a specific area" → {focus_area}.
195
+ ```
196
+
197
+ ### Step 6: Present Summary
198
+
199
+ Read key findings from each file (frontmatter or first section) and display using the branded stage banner from `references/ui-formatting.md`:
200
+
201
+ ```
202
+ ╔══════════════════════════════════════════════════════════════╗
203
+ ║ PLAN-BUILD-RUN ► SCAN COMPLETE ✓ ║
204
+ ╚══════════════════════════════════════════════════════════════╝
205
+
206
+ Project: {type} ({scale})
207
+ Stack: {primary language} + {framework}
208
+ Architecture: {style}
209
+
210
+ Key Stats:
211
+ - {file count} source files, {test count} test files
212
+ - {dependency count} dependencies
213
+ - {integration count} external integrations
214
+
215
+ Full analysis: .planning/codebase/
216
+ ```
217
+
218
+ **Concerns section** (only display if ALL of these conditions are true: (1) the concerns mapper was included in `scan.mapper_areas` for the resolved depth profile, (2) the concerns mapper was actually spawned, AND (3) `.planning/codebase/CONCERNS.md` exists and contains at least one concern entry). If any condition is false, skip this entire section silently — do NOT display an empty concerns block or a "no concerns" message:
219
+
220
+ ```
221
+ Concerns: {critical} critical, {high} high, {medium} medium
222
+
223
+ Top concerns:
224
+ 1. {most critical concern}
225
+ 2. {second concern}
226
+ 3. {third concern}
227
+ ```
228
+
229
+ Then use the "Next Up" routing block:
230
+ ```
231
+
232
+
233
+ ╔══════════════════════════════════════════════════════════════╗
234
+ ║ ▶ NEXT UP ║
235
+ ╚══════════════════════════════════════════════════════════════╝
236
+
237
+ **Start a project** — use the scan results to plan your work
238
+
239
+ `$pbr-begin`
240
+
241
+ <sub>`/clear` first → fresh context window</sub>
242
+
243
+
244
+
245
+ **Also available:**
246
+ - `$pbr-milestone new` — create a milestone to address concerns
247
+ - `$pbr-status` — see project status
248
+
249
+
250
+ ```
251
+
252
+ ### Step 7: Git Integration
253
+
254
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
255
+
256
+ If `.planning/config.json` exists and `planning.commit_docs: true`:
257
+
258
+ ```bash
259
+ git add .planning/codebase/
260
+ git commit -m "docs(planning): map existing codebase"
261
+ ```
262
+
263
+ If no config exists yet (scan before begin), use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
264
+ question: "Commit the codebase analysis to git?"
265
+ header: "Commit?"
266
+ options:
267
+ - label: "Yes" description: "Stage and commit .planning/codebase/ files"
268
+ - label: "No" description: "Skip commit — files are saved but not committed"
269
+ - If "Yes": run `git add .planning/codebase/ && git commit -m "docs(planning): map existing codebase"`
270
+ - If "No" or "Other": skip commit
271
+
272
+ ---
273
+
274
+ ## Edge Cases
275
+
276
+ ### Monorepo with multiple projects
277
+ - Detect by multiple package.json, separate src directories, workspace config
278
+ - Ask user via AskUserQuestion: "This looks like a monorepo. Scan the whole repo or a specific project?"
279
+ - If specific: scope all agents to that subdirectory
280
+ - If whole: note the monorepo structure in ARCHITECTURE.md
281
+
282
+ ### Empty or near-empty codebase
283
+ - If fewer than 5 source files: "This codebase is very small. A scan may not be necessary."
284
+ - Still allow it if user wants
285
+ - Output will be minimal
286
+
287
+ ### No source code (config-only repo, docs repo)
288
+ - Detect: no recognized source file extensions
289
+ - Adapt: focus on documentation quality, config structure
290
+ - Skip code quality analysis
291
+
292
+ ### Codebase has existing analysis
293
+ - Check for architectural docs, ADRs, design docs
294
+ - Reference them in the scan output
295
+ - Don't contradict existing docs without strong evidence
296
+
297
+ ### Binary files, large assets
298
+ - Skip binary files in analysis
299
+ - Note their existence in STRUCTURE.md
300
+ - Flag large committed binaries as a concern
301
+
302
+ ### Scan before $pbr-begin
303
+ - This is a valid and encouraged workflow
304
+ - Scan results become input for the begin skill
305
+ - Create `.planning/` and `.planning/codebase/` if needed
306
+ - Don't require config.json
307
+
308
+ ---
309
+
310
+ ## Anti-Patterns
311
+
312
+ Reference: `skills/shared/universal-anti-patterns.md` for rules that apply to ALL skills.
313
+
314
+ Additionally for this skill:
315
+
316
+ 1. **DO NOT** modify any source code — scan is read-only analysis
317
+ 2. **DO NOT** run the project (no `npm start`, `python app.py`, etc.) — analyze statically
318
+ 3. **DO NOT** install dependencies — analyze package files, don't install
319
+ 4. **DO NOT** generate concerns without evidence — every concern needs a file reference
320
+ 5. **DO NOT** ignore positive observations — knowing what works well is valuable
321
+ 6. **DO NOT** produce generic output — every finding should be specific to THIS codebase
322
+ 7. **DO NOT** scan node_modules, venv, .git, or build output directories
323
+ 8. **DO NOT** read every file in large codebases — sample and extrapolate
324
+ 9. **DO NOT** skip the RECON step — agents need baseline context
325
+ 10. **DO NOT** combine agents — the 4 agents must run in parallel with separate focuses
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: setup
3
+ description: "Reconfigure an existing Plan-Build-Run project (models, features, CLAUDE.md)."
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 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 ► RECONFIGURE ║
15
+ ╚══════════════════════════════════════════════════════════════╝
16
+ ```
17
+
18
+ Then proceed to Step 1.
19
+
20
+ # $pbr-setup — Plan-Build-Run Reconfigure
21
+
22
+ You are running the **setup** skill in **reconfigure mode**. This wizard lets existing Plan-Build-Run projects change model profiles, workflow features, and CLAUDE.md integration. It does NOT re-initialize or overwrite project state.
23
+
24
+ ---
25
+
26
+ ## Step 1: Detect Project State
27
+
28
+ Check if `.planning/config.json` exists.
29
+
30
+ **If `.planning/config.json` does NOT exist:**
31
+ Display:
32
+ ```
33
+ No Plan-Build-Run project found in this directory.
34
+
35
+ $pbr-setup is for reconfiguring existing projects.
36
+ To start a new project, run: $pbr-begin
37
+
38
+ $pbr-begin includes everything $pbr-setup used to do, plus deep requirements gathering and roadmap creation.
39
+ ```
40
+ Stop. Do not proceed further.
41
+
42
+ **If `.planning/config.json` exists:**
43
+ - Read `.planning/config.json`
44
+ - Display the current settings summary:
45
+ ```
46
+ Current configuration:
47
+ - Model profile: {derived from models block — balanced/quality/budget or custom}
48
+ - Depth: {depth}
49
+ - Mode: {mode}
50
+ - Auto-continue: {features.auto_continue}
51
+ - TDD mode: {features.tdd_mode}
52
+ - Git branching: {git.branching}
53
+ ```
54
+ - Proceed to Step 2.
55
+
56
+ ---
57
+
58
+ ## Step 2: Model Selection
59
+
60
+ Use AskUserQuestion:
61
+ question: "Which model profile should agents use?"
62
+ header: "Models"
63
+ options:
64
+ - label: "Balanced (Recommended)"
65
+ description: "Sonnet for most agents, Haiku for synthesizer. Good quality/cost tradeoff."
66
+ - label: "Quality"
67
+ description: "Opus for executor and planner, Sonnet for others. Best results, highest cost."
68
+ - label: "Budget"
69
+ description: "Haiku for most agents. Fastest and cheapest, but lower quality."
70
+ - label: "Keep current"
71
+ description: "Leave model settings unchanged."
72
+
73
+ Apply the selected profile to the models block in config.json:
74
+ - **Balanced**: executor=sonnet, researcher=sonnet, planner=sonnet, verifier=sonnet, synthesizer=haiku
75
+ - **Quality**: executor=opus, researcher=sonnet, planner=opus, verifier=sonnet, synthesizer=sonnet
76
+ - **Budget**: executor=haiku, researcher=haiku, planner=sonnet, verifier=haiku, synthesizer=haiku
77
+ - **Keep current**: no change to models block
78
+
79
+ ---
80
+
81
+ ## Step 3: Workflow Features
82
+
83
+ Use AskUserQuestion:
84
+ question: "Which workflow features do you want enabled?"
85
+ header: "Features"
86
+ multiSelect: true
87
+ options:
88
+ - label: "Auto-continue"
89
+ description: "Automatically chain commands (build → review → next phase) without prompting"
90
+ - label: "TDD mode"
91
+ description: "Write tests before implementation in executor agents"
92
+ - label: "Strict gates"
93
+ description: "Require verification AND review to pass before advancing phases"
94
+ - label: "Git branching"
95
+ description: "Create a branch per phase for cleaner PR history"
96
+
97
+ Apply selections (others unchanged):
98
+ - **Auto-continue**: Set `features.auto_continue: true`
99
+ - **TDD mode**: Set `features.tdd_mode: true`
100
+ - **Strict gates**: Set `gates.verification: true`, `gates.review: true`, `gates.plan_approval: true`
101
+ - **Git branching**: Set `git.branching: "phase"`
102
+
103
+ ---
104
+
105
+ ## Step 4: CLAUDE.md Integration
106
+
107
+ Check if a `CLAUDE.md` file exists in the project root.
108
+
109
+ **If it exists**: Read it. If it does NOT already contain a "Plan-Build-Run" section, offer to append the integration block.
110
+ **If it does NOT exist**: Offer to create `CLAUDE.md` with the integration block.
111
+
112
+ Use AskUserQuestion:
113
+ question: "Update CLAUDE.md with Plan-Build-Run integration notes?"
114
+ header: "CLAUDE.md"
115
+ options:
116
+ - label: "Yes"
117
+ description: "Add or update the Plan-Build-Run section in CLAUDE.md"
118
+ - label: "No"
119
+ description: "Skip — leave CLAUDE.md as-is"
120
+
121
+ If "Yes", append/create:
122
+ ```markdown
123
+ ## Plan-Build-Run
124
+
125
+ This project uses [Plan-Build-Run](https://github.com/SienkLogic/plan-build-run) for structured development.
126
+
127
+ - Project state: `.planning/STATE.md` (source of truth for current phase and progress)
128
+ - Configuration: `.planning/config.json`
129
+ - Run `$pbr-status` to see current project state and suggested next action.
130
+
131
+ **After compaction or context recovery**: Read `.planning/STATE.md` (especially the `## Session Continuity` section) before proceeding with any work. The PreCompact hook writes recovery state there automatically.
132
+ ```
133
+
134
+ ---
135
+
136
+ ## Step 5: Write Updated Config
137
+
138
+ **CRITICAL: Write `.planning/config.json` NOW with all changes from Steps 2-3. Do NOT skip this step.**
139
+
140
+ Write the updated config.json to disk with all applied changes.
141
+
142
+ ---
143
+
144
+ ## Step 6: Verification
145
+
146
+ Run a quick check:
147
+ 1. Verify `.planning/config.json` is valid JSON (read it back)
148
+ 2. Display updated settings summary
149
+
150
+ Display:
151
+ ```
152
+ ╔══════════════════════════════════════════════════════════════╗
153
+ ║ PLAN-BUILD-RUN ► RECONFIGURE COMPLETE ✓ ║
154
+ ╚══════════════════════════════════════════════════════════════╝
155
+
156
+ Updated:
157
+ - Model profile: {new profile}
158
+ - Features changed: {list or "none"}
159
+ - CLAUDE.md: {updated/skipped}
160
+
161
+ Run $pbr-status to see current project state.
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Error Handling
167
+
168
+ - If config.json parse fails: Display the raw content and ask user to fix it manually, then retry
169
+ - If config.json write fails: Display the JSON content and ask user to save it manually
@@ -0,0 +1,35 @@
1
+ # Commit Planning Docs Pattern
2
+
3
+ Standard pattern for committing planning artifacts to git. Reference this fragment in skills that create or modify `.planning/` files.
4
+
5
+ ---
6
+
7
+ ## Pattern
8
+
9
+ ```
10
+ If `planning.commit_docs: true` in config.json:
11
+ 1. Stage the relevant .planning/ files for this skill's output
12
+ 2. Commit with the format from the **Commit Messages by Skill** table below (most use `docs({scope}):` but some skills like pause use `wip(planning):`)
13
+ 3. Use the appropriate scope from the skill's commit conventions
14
+
15
+ If `planning.commit_docs: false` or config.json missing:
16
+ - Skip the commit step
17
+ ```
18
+
19
+ ## Commit Messages by Skill
20
+
21
+ | Skill | Commit message format |
22
+ |-------|----------------------|
23
+ | build | `docs({phase}): add build summaries and verification` |
24
+ | plan | `docs({phase}): add phase plans` |
25
+ | review | `docs({phase}): add verification report` |
26
+ | begin | `chore: initialize plan-build-run project planning` |
27
+ | import | `docs({phase}): import external plans` |
28
+ | quick | `docs(planning): quick task {NNN} - {slug}` |
29
+ | scan | `docs(planning): initial codebase analysis` |
30
+ | explore | `docs(planning): capture explore session outputs` |
31
+ | debug | `docs(planning): open/resolve debug session {NNN}` |
32
+ | discuss | `docs(planning): capture phase {N} discussion decisions` |
33
+ | pause | `wip(planning): save session state — phase {N} plan {M}` |
34
+ | todo | `docs(planning): add/complete todo {NNN}` |
35
+ | milestone | `docs(planning): start/complete/audit milestone` |
@@ -0,0 +1,102 @@
1
+ # Config Loading Pattern
2
+
3
+ Standard pattern for loading `.planning/config.json` fields at the start of a skill invocation.
4
+
5
+ > Referenced by: build, plan, review, import, begin, quick, milestone, scan skills
6
+
7
+ ---
8
+
9
+ ## Tooling Shortcut
10
+
11
+ Instead of reading and parsing STATE.md, ROADMAP.md, and config.json manually, run:
12
+ ```bash
13
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js state load
14
+ ```
15
+ This returns a JSON object with `config`, `state`, `roadmap`, `current_phase`, and `progress`. Falls back gracefully if the script is missing -- parse files manually in that case.
16
+
17
+ Additional tooling shortcuts:
18
+ - `plan-index <phase>` -- returns plan inventory (plan_id, wave, depends_on, autonomous, must_haves_count per plan)
19
+ - `phase-info <phase>` -- returns comprehensive phase status (verification, summaries, roadmap_status, filesystem_status, plan_count, completed)
20
+
21
+ ---
22
+
23
+ ## Standard Config Fields
24
+
25
+ These are the config.json fields commonly read by workflow skills. Each skill reads a subset depending on its needs.
26
+
27
+ ### Core Settings
28
+ ```
29
+ depth -- quick | standard | comprehensive
30
+ mode -- interactive | autonomous
31
+ ```
32
+
33
+ ### Feature Flags
34
+ ```
35
+ features.research_phase -- run researcher before planning
36
+ features.plan_checking -- validate plans via plan-checker agent
37
+ features.goal_verification -- run verifier after build
38
+ features.inline_verify -- per-task verification after each executor commit (opt-in)
39
+ features.atomic_commits -- require atomic commits per task
40
+ features.auto_continue -- write .auto-next signal on phase completion
41
+ features.auto_advance -- chain build->review->plan in autonomous mode
42
+ features.integration_verification -- check cross-phase integration
43
+ ```
44
+
45
+ ### Gate Flags
46
+ ```
47
+ gates.confirm_plan -- require user approval before building
48
+ gates.confirm_execute -- require user confirmation before executing build
49
+ gates.confirm_transition -- require confirmation before advancing to next phase
50
+ ```
51
+
52
+ ### Parallelization
53
+ ```
54
+ parallelization.enabled -- whether to run plans in parallel
55
+ parallelization.plan_level -- parallel at plan level (within a wave)
56
+ parallelization.max_concurrent_agents -- max simultaneous executors
57
+ ```
58
+
59
+ ### Planning
60
+ ```
61
+ planning.commit_docs -- commit planning docs after operations
62
+ planning.max_tasks_per_plan -- maximum tasks in a single plan
63
+ ```
64
+
65
+ ### Git
66
+ ```
67
+ git.commit_format -- commit message format
68
+ git.branching -- none | phase | milestone
69
+ ```
70
+
71
+ ### Models
72
+ ```
73
+ models.researcher -- model for researcher agent
74
+ models.planner -- model for planner agent
75
+ models.executor -- model for executor agent
76
+ models.verifier -- model for verifier agent
77
+ ```
78
+
79
+ ---
80
+
81
+ ## Config Field Matrix by Skill
82
+
83
+ | Field | build | plan | review | import | begin | quick | milestone |
84
+ |-------|-------|------|--------|--------|-------|-------|-----------|
85
+ | depth | | X | | | X | | |
86
+ | mode | X | X | X | | X | | |
87
+ | features.research_phase | | X | | | | | |
88
+ | features.plan_checking | | X | | X | | | |
89
+ | features.goal_verification | X | | X | | | | |
90
+ | features.inline_verify | X | | | | | | |
91
+ | features.atomic_commits | X | | | | | | |
92
+ | features.auto_continue | X | | | | | | |
93
+ | features.auto_advance | X | X | X | | | | |
94
+ | features.integration_verification | | | X | | | | X |
95
+ | gates.confirm_plan | | X | | | | | |
96
+ | gates.confirm_execute | X | | | | | | |
97
+ | gates.confirm_transition | | | X | | | | |
98
+ | parallelization.* | X | | | | | | |
99
+ | planning.commit_docs | X | | | | | X | X |
100
+ | git.commit_format | X | | | | X | X | |
101
+ | git.branching | X | | | | | | |
102
+ | models.* | | X | X | | X | | X |