@sienklogic/plan-build-run 2.0.2 → 2.2.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 (166) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +25 -6
  3. package/dashboard/src/routes/pages.routes.js +11 -4
  4. package/dashboard/src/services/dashboard.service.js +81 -17
  5. package/dashboard/src/services/phase.service.js +30 -24
  6. package/dashboard/src/services/roadmap.service.js +3 -3
  7. package/dashboard/src/views/partials/phase-content.ejs +5 -4
  8. package/package.json +1 -1
  9. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  10. package/plugins/cursor-pbr/CHANGELOG.md +15 -0
  11. package/plugins/cursor-pbr/README.md +118 -0
  12. package/plugins/cursor-pbr/agents/codebase-mapper.md +108 -0
  13. package/plugins/cursor-pbr/agents/debugger.md +168 -0
  14. package/plugins/cursor-pbr/agents/executor.md +236 -0
  15. package/plugins/cursor-pbr/agents/general.md +87 -0
  16. package/plugins/cursor-pbr/agents/integration-checker.md +87 -0
  17. package/plugins/cursor-pbr/agents/plan-checker.md +198 -0
  18. package/plugins/cursor-pbr/agents/planner.md +180 -0
  19. package/plugins/cursor-pbr/agents/researcher.md +162 -0
  20. package/plugins/cursor-pbr/agents/synthesizer.md +101 -0
  21. package/plugins/cursor-pbr/agents/verifier.md +193 -0
  22. package/plugins/cursor-pbr/assets/logo.svg +21 -0
  23. package/plugins/cursor-pbr/hooks/hooks.json +189 -7
  24. package/plugins/cursor-pbr/references/agent-anti-patterns.md +25 -0
  25. package/plugins/cursor-pbr/references/agent-interactions.md +135 -0
  26. package/plugins/cursor-pbr/references/agent-teams.md +55 -0
  27. package/plugins/cursor-pbr/references/checkpoints.md +158 -0
  28. package/plugins/cursor-pbr/references/common-bug-patterns.md +14 -0
  29. package/plugins/cursor-pbr/references/config-reference.md +442 -0
  30. package/plugins/cursor-pbr/references/continuation-format.md +213 -0
  31. package/plugins/cursor-pbr/references/deviation-rules.md +113 -0
  32. package/plugins/cursor-pbr/references/git-integration.md +227 -0
  33. package/plugins/cursor-pbr/references/integration-patterns.md +118 -0
  34. package/plugins/cursor-pbr/references/model-profiles.md +100 -0
  35. package/plugins/cursor-pbr/references/model-selection.md +32 -0
  36. package/plugins/cursor-pbr/references/pbr-rules.md +194 -0
  37. package/plugins/cursor-pbr/references/plan-authoring.md +182 -0
  38. package/plugins/cursor-pbr/references/plan-format.md +288 -0
  39. package/plugins/cursor-pbr/references/planning-config.md +214 -0
  40. package/plugins/cursor-pbr/references/questioning.md +215 -0
  41. package/plugins/cursor-pbr/references/reading-verification.md +128 -0
  42. package/plugins/cursor-pbr/references/stub-patterns.md +161 -0
  43. package/plugins/cursor-pbr/references/subagent-coordination.md +120 -0
  44. package/plugins/cursor-pbr/references/ui-formatting.md +462 -0
  45. package/plugins/cursor-pbr/references/verification-patterns.md +199 -0
  46. package/plugins/cursor-pbr/references/wave-execution.md +96 -0
  47. package/plugins/cursor-pbr/rules/pbr-workflow.mdc +48 -0
  48. package/plugins/cursor-pbr/setup.ps1 +78 -0
  49. package/plugins/cursor-pbr/setup.sh +83 -0
  50. package/plugins/cursor-pbr/skills/begin/SKILL.md +566 -0
  51. package/plugins/cursor-pbr/skills/begin/templates/PROJECT.md.tmpl +34 -0
  52. package/plugins/cursor-pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +19 -0
  53. package/plugins/cursor-pbr/skills/begin/templates/STATE.md.tmpl +50 -0
  54. package/plugins/cursor-pbr/skills/begin/templates/config.json.tmpl +64 -0
  55. package/plugins/cursor-pbr/skills/begin/templates/researcher-prompt.md.tmpl +20 -0
  56. package/plugins/cursor-pbr/skills/begin/templates/roadmap-prompt.md.tmpl +31 -0
  57. package/plugins/cursor-pbr/skills/begin/templates/synthesis-prompt.md.tmpl +17 -0
  58. package/plugins/cursor-pbr/skills/build/SKILL.md +902 -0
  59. package/plugins/cursor-pbr/skills/config/SKILL.md +253 -0
  60. package/plugins/cursor-pbr/skills/continue/SKILL.md +159 -0
  61. package/plugins/cursor-pbr/skills/debug/SKILL.md +512 -0
  62. package/plugins/cursor-pbr/skills/debug/templates/continuation-prompt.md.tmpl +17 -0
  63. package/plugins/cursor-pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +28 -0
  64. package/plugins/cursor-pbr/skills/discuss/SKILL.md +344 -0
  65. package/plugins/cursor-pbr/skills/discuss/templates/CONTEXT.md.tmpl +62 -0
  66. package/plugins/cursor-pbr/skills/discuss/templates/decision-categories.md +10 -0
  67. package/plugins/cursor-pbr/skills/explore/SKILL.md +375 -0
  68. package/plugins/cursor-pbr/skills/health/SKILL.md +218 -0
  69. package/plugins/cursor-pbr/skills/health/templates/check-pattern.md.tmpl +31 -0
  70. package/plugins/cursor-pbr/skills/health/templates/output-format.md.tmpl +64 -0
  71. package/plugins/cursor-pbr/skills/help/SKILL.md +152 -0
  72. package/plugins/cursor-pbr/skills/import/SKILL.md +499 -0
  73. package/plugins/cursor-pbr/skills/milestone/SKILL.md +701 -0
  74. package/plugins/cursor-pbr/skills/milestone/templates/audit-report.md.tmpl +49 -0
  75. package/plugins/cursor-pbr/skills/milestone/templates/stats-file.md.tmpl +31 -0
  76. package/plugins/cursor-pbr/skills/note/SKILL.md +228 -0
  77. package/plugins/cursor-pbr/skills/pause/SKILL.md +246 -0
  78. package/plugins/cursor-pbr/skills/pause/templates/continue-here.md.tmpl +72 -0
  79. package/plugins/cursor-pbr/skills/plan/SKILL.md +648 -0
  80. package/plugins/cursor-pbr/skills/plan/templates/checker-prompt.md.tmpl +22 -0
  81. package/plugins/cursor-pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +33 -0
  82. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +39 -0
  83. package/plugins/cursor-pbr/skills/plan/templates/researcher-prompt.md.tmpl +20 -0
  84. package/plugins/cursor-pbr/skills/plan/templates/revision-prompt.md.tmpl +24 -0
  85. package/plugins/cursor-pbr/skills/quick/SKILL.md +351 -0
  86. package/plugins/cursor-pbr/skills/resume/SKILL.md +399 -0
  87. package/plugins/cursor-pbr/skills/review/SKILL.md +649 -0
  88. package/plugins/cursor-pbr/skills/review/templates/debugger-prompt.md.tmpl +61 -0
  89. package/plugins/cursor-pbr/skills/review/templates/gap-planner-prompt.md.tmpl +41 -0
  90. package/plugins/cursor-pbr/skills/review/templates/verifier-prompt.md.tmpl +116 -0
  91. package/plugins/cursor-pbr/skills/scan/SKILL.md +301 -0
  92. package/plugins/cursor-pbr/skills/scan/templates/mapper-prompt.md.tmpl +202 -0
  93. package/plugins/cursor-pbr/skills/setup/SKILL.md +250 -0
  94. package/plugins/cursor-pbr/skills/shared/commit-planning-docs.md +36 -0
  95. package/plugins/cursor-pbr/skills/shared/config-loading.md +103 -0
  96. package/plugins/cursor-pbr/skills/shared/context-budget.md +41 -0
  97. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +87 -0
  98. package/plugins/cursor-pbr/skills/shared/digest-select.md +80 -0
  99. package/plugins/cursor-pbr/skills/shared/domain-probes.md +126 -0
  100. package/plugins/cursor-pbr/skills/shared/error-reporting.md +80 -0
  101. package/plugins/cursor-pbr/skills/shared/gate-prompts.md +389 -0
  102. package/plugins/cursor-pbr/skills/shared/phase-argument-parsing.md +46 -0
  103. package/plugins/cursor-pbr/skills/shared/progress-display.md +54 -0
  104. package/plugins/cursor-pbr/skills/shared/revision-loop.md +82 -0
  105. package/plugins/cursor-pbr/skills/shared/state-loading.md +63 -0
  106. package/plugins/cursor-pbr/skills/shared/state-update.md +162 -0
  107. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +34 -0
  108. package/plugins/cursor-pbr/skills/status/SKILL.md +362 -0
  109. package/plugins/cursor-pbr/skills/todo/SKILL.md +195 -0
  110. package/plugins/cursor-pbr/templates/CONTEXT.md.tmpl +53 -0
  111. package/plugins/cursor-pbr/templates/INTEGRATION-REPORT.md.tmpl +152 -0
  112. package/plugins/cursor-pbr/templates/RESEARCH-SUMMARY.md.tmpl +98 -0
  113. package/plugins/cursor-pbr/templates/ROADMAP.md.tmpl +41 -0
  114. package/plugins/cursor-pbr/templates/SUMMARY.md.tmpl +82 -0
  115. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  116. package/plugins/cursor-pbr/templates/continue-here.md.tmpl +74 -0
  117. package/plugins/cursor-pbr/templates/prompt-partials/phase-project-context.md.tmpl +38 -0
  118. package/plugins/pbr/agents/codebase-mapper.md +41 -206
  119. package/plugins/pbr/agents/debugger.md +65 -171
  120. package/plugins/pbr/agents/executor.md +90 -275
  121. package/plugins/pbr/agents/general.md +27 -97
  122. package/plugins/pbr/agents/integration-checker.md +35 -112
  123. package/plugins/pbr/agents/plan-checker.md +71 -164
  124. package/plugins/pbr/agents/planner.md +76 -245
  125. package/plugins/pbr/agents/researcher.md +63 -255
  126. package/plugins/pbr/agents/synthesizer.md +49 -174
  127. package/plugins/pbr/agents/verifier.md +75 -366
  128. package/plugins/pbr/hooks/hooks.json +14 -10
  129. package/plugins/pbr/references/ui-formatting.md +1 -1
  130. package/plugins/pbr/scripts/auto-continue.js +20 -4
  131. package/plugins/pbr/scripts/check-dangerous-commands.js +1 -1
  132. package/plugins/pbr/scripts/check-phase-boundary.js +1 -1
  133. package/plugins/pbr/scripts/check-plan-format.js +3 -3
  134. package/plugins/pbr/scripts/check-roadmap-sync.js +3 -3
  135. package/plugins/pbr/scripts/check-skill-workflow.js +1 -1
  136. package/plugins/pbr/scripts/check-state-sync.js +2 -2
  137. package/plugins/pbr/scripts/check-subagent-output.js +1 -1
  138. package/plugins/pbr/scripts/check-summary-gate.js +198 -0
  139. package/plugins/pbr/scripts/context-budget-check.js +1 -1
  140. package/plugins/pbr/scripts/event-handler.js +2 -2
  141. package/plugins/pbr/scripts/event-logger.js +1 -1
  142. package/plugins/pbr/scripts/log-subagent.js +1 -1
  143. package/plugins/pbr/scripts/pbr-tools.js +1 -1
  144. package/plugins/pbr/scripts/post-write-dispatch.js +1 -1
  145. package/plugins/pbr/scripts/post-write-quality.js +1 -1
  146. package/plugins/pbr/scripts/pre-bash-dispatch.js +1 -1
  147. package/plugins/pbr/scripts/pre-write-dispatch.js +16 -3
  148. package/plugins/pbr/scripts/session-cleanup.js +1 -1
  149. package/plugins/pbr/scripts/status-line.js +1 -1
  150. package/plugins/pbr/scripts/suggest-compact.js +1 -1
  151. package/plugins/pbr/scripts/task-completed.js +1 -1
  152. package/plugins/pbr/scripts/track-context-budget.js +11 -6
  153. package/plugins/pbr/scripts/validate-commit.js +1 -1
  154. package/plugins/pbr/scripts/validate-task.js +1 -1
  155. package/plugins/pbr/skills/begin/SKILL.md +4 -2
  156. package/plugins/pbr/skills/begin/templates/roadmap-prompt.md.tmpl +2 -0
  157. package/plugins/pbr/skills/build/SKILL.md +6 -4
  158. package/plugins/pbr/skills/continue/SKILL.md +2 -1
  159. package/plugins/pbr/skills/review/SKILL.md +4 -3
  160. package/plugins/pbr/skills/status/SKILL.md +5 -2
  161. package/plugins/pbr/templates/ROADMAP.md.tmpl +6 -1
  162. package/plugins/cursor-pbr/agents/.gitkeep +0 -0
  163. package/plugins/cursor-pbr/references/.gitkeep +0 -0
  164. package/plugins/cursor-pbr/rules/.gitkeep +0 -0
  165. package/plugins/cursor-pbr/skills/.gitkeep +0 -0
  166. package/plugins/cursor-pbr/templates/.gitkeep +0 -0
@@ -0,0 +1,202 @@
1
+ <\!-- canonical: ../../../../pbr/skills/scan/templates/mapper-prompt.md.tmpl -->
2
+ <!-- Source: scan/SKILL.md | Purpose: Prompt template for spawning codebase-mapper agents during /pbr:scan -->
3
+
4
+ You are codebase-mapper with focus="{focus_area}".
5
+
6
+ <reconnaissance>
7
+ {recon_data}
8
+ </reconnaissance>
9
+
10
+ <project>
11
+ Working directory: {project_path}
12
+ Scale: {scale}
13
+ </project>
14
+
15
+ ---
16
+
17
+ ## Scale-Aware Guidance
18
+
19
+ ### Small projects (< 50 files)
20
+ - Be thorough — read most files
21
+ - Output should be concise (don't pad)
22
+ - Findings lists may be short — that's fine
23
+
24
+ ### Medium projects (50-200 files)
25
+ - Sample representative files
26
+ - Focus on entry points, configuration, and key modules
27
+ - Use Grep patterns to find conventions rather than reading every file
28
+
29
+ ### Large projects (200-1000 files)
30
+ - Be selective — read key files only
31
+ - Use Glob and Grep extensively for pattern detection
32
+ - Focus on architecture and module boundaries
33
+ - Sample 3-5 files per module for conventions
34
+
35
+ ### Very large projects (1000+ files)
36
+ - Limit file reads aggressively
37
+ - Architecture focus > file-level detail
38
+ - Sample at most 2-3 files per module
39
+
40
+ ---
41
+
42
+ ## Focus Area Instructions
43
+
44
+ ### If focus="tech"
45
+
46
+ Analyze the codebase technology stack and external integrations.
47
+
48
+ 1. STACK.md — Technology inventory
49
+ - Languages and versions (from config files, shebang lines, etc.)
50
+ - Frameworks and their versions
51
+ - Build tools and configuration
52
+ - Package manager and dependency count
53
+ - Runtime requirements
54
+ - Development tools (linters, formatters, type checkers)
55
+
56
+ 2. INTEGRATIONS.md — External connections
57
+ - APIs consumed (look for HTTP clients, SDK imports, API keys)
58
+ - Databases used (look for connection strings, ORM configs, migrations)
59
+ - Third-party services (auth providers, payment, email, etc.)
60
+ - Message queues, caches, file storage
61
+ - CI/CD pipelines (GitHub Actions, Jenkins, etc.)
62
+ - Deployment targets (Docker, Kubernetes, serverless, etc.)
63
+
64
+ Write both files to .planning/codebase/
65
+
66
+ Read `templates/codebase/STACK.md.tmpl` for the STACK.md output format.
67
+ Read `templates/codebase/INTEGRATIONS.md.tmpl` for the INTEGRATIONS.md output format.
68
+ Fill in all placeholder fields with data from your codebase analysis.
69
+
70
+ ### If focus="arch"
71
+
72
+ Analyze the codebase architecture and structure.
73
+
74
+ 1. ARCHITECTURE.md — High-level architecture
75
+ - Architecture style (monolith, microservices, serverless, MVC, etc.)
76
+ - Layer structure (presentation, business logic, data access)
77
+ - Module boundaries and how they communicate
78
+ - Data flow through the system
79
+ - Key abstractions and interfaces
80
+ - State management approach
81
+ - Error handling strategy
82
+ - Authentication/authorization architecture
83
+
84
+ 2. STRUCTURE.md — Directory and file organization
85
+ - Directory tree with annotations
86
+ - File naming conventions
87
+ - Module organization pattern
88
+ - Entry points and their roles
89
+ - Configuration file locations
90
+ - Environment-specific files
91
+
92
+ Write both files to .planning/codebase/
93
+
94
+ Read `templates/codebase/ARCHITECTURE.md.tmpl` for the ARCHITECTURE.md output format.
95
+ Read `templates/codebase/STRUCTURE.md.tmpl` for the STRUCTURE.md output format.
96
+ Fill in all placeholder fields with data from your codebase analysis.
97
+
98
+ ### If focus="quality"
99
+
100
+ Analyze the codebase quality, conventions, and testing approach.
101
+
102
+ 1. CONVENTIONS.md — Coding standards in practice
103
+ - Naming conventions (files, functions, variables, classes)
104
+ - Code style (indentation, quotes, semicolons, etc.)
105
+ - Import/export patterns
106
+ - Comment style and documentation patterns
107
+ - Error handling patterns
108
+ - Logging patterns
109
+ - Configuration patterns (env vars, config files, constants)
110
+
111
+ IMPORTANT: Document what the codebase ACTUALLY does, not what it should do.
112
+ Look at multiple files to identify the dominant pattern.
113
+
114
+ 2. TESTING.md — Test infrastructure and coverage
115
+ - Test framework(s) used
116
+ - Test file organization
117
+ - Test types present (unit, integration, e2e)
118
+ - Test coverage (rough estimate from test file count vs source file count)
119
+ - Mocking patterns
120
+ - Test data management
121
+ - CI test configuration
122
+ - Notable gaps in testing
123
+
124
+ Write both files to .planning/codebase/
125
+
126
+ Read `templates/codebase/CONVENTIONS.md.tmpl` for the CONVENTIONS.md output format.
127
+ Read `templates/codebase/TESTING.md.tmpl` for the TESTING.md output format.
128
+ Fill in all placeholder fields with data from your codebase analysis.
129
+
130
+ ### If focus="concerns"
131
+
132
+ Identify concerns, risks, and improvement opportunities in the codebase.
133
+
134
+ Write CONCERNS.md to .planning/codebase/
135
+
136
+ Analyze the codebase for:
137
+
138
+ 1. Security concerns
139
+ - Hardcoded secrets or credentials
140
+ - Injection vulnerabilities
141
+ - Insecure authentication patterns
142
+ - Missing input validation
143
+ - Outdated dependencies with known vulnerabilities
144
+
145
+ 2. Technical debt
146
+ - TODO/FIXME/HACK comments
147
+ - Dead code (unused exports, unreachable branches)
148
+ - Copy-pasted code (duplication)
149
+ - Overly complex functions
150
+ - Missing error handling
151
+ - Inconsistent patterns
152
+
153
+ 3. Scalability concerns
154
+ - N+1 query patterns
155
+ - Missing pagination
156
+ - Unbounded data loading
157
+ - Synchronous blocking operations
158
+ - Missing caching opportunities
159
+
160
+ 4. Maintainability concerns
161
+ - Missing documentation
162
+ - Complex inheritance hierarchies
163
+ - Tight coupling between modules
164
+ - Magic numbers/strings
165
+ - Missing type safety
166
+
167
+ 5. Operational concerns
168
+ - Missing health checks
169
+ - Insufficient logging
170
+ - No monitoring hooks
171
+ - Unclear deployment process
172
+
173
+ Read `templates/codebase/CONCERNS.md.tmpl` for the CONCERNS.md output format.
174
+ Fill in all placeholder fields with data from your codebase analysis.
175
+
176
+ ---
177
+
178
+ ## Reconnaissance Detection Reference
179
+
180
+ ### Project Type Detection
181
+ Look for:
182
+ - package.json -> Node.js/JavaScript/TypeScript
183
+ - requirements.txt / setup.py / pyproject.toml -> Python
184
+ - CMakeLists.txt -> C/C++
185
+ - go.mod -> Go
186
+ - Cargo.toml -> Rust
187
+ - pom.xml / build.gradle -> Java
188
+ - *.sln / *.csproj -> .NET
189
+ - Gemfile -> Ruby
190
+ - composer.json -> PHP
191
+
192
+ ### Key Directory Detection
193
+ Look for:
194
+ - src/, lib/, app/ -> source code
195
+ - test/, tests/, __tests__/, spec/ -> tests
196
+ - docs/ -> documentation
197
+ - config/, .config/ -> configuration
198
+ - scripts/ -> build/deploy scripts
199
+ - public/, static/, assets/ -> static assets
200
+ - migrations/ -> database migrations
201
+
202
+ Write output to: {output_path}
@@ -0,0 +1,250 @@
1
+ ---
2
+ name: setup
3
+ description: "Onboarding wizard. Initialize project, select models, verify setup."
4
+ ---
5
+
6
+ ## Step 0 — Immediate Output
7
+
8
+ **Before ANY tool calls**, display this banner:
9
+
10
+ ```
11
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ PLAN-BUILD-RUN ► SETUP
13
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ```
15
+
16
+ Then proceed to Step 1.
17
+
18
+ # /pbr:setup — Plan-Build-Run Setup Wizard
19
+
20
+ You are running the **setup** skill. This is an interactive onboarding wizard that guides users through Plan-Build-Run project setup. Use AskUserQuestion at each step for clear choices.
21
+
22
+ ---
23
+
24
+ ## Step 1: Detect Project State
25
+
26
+ Check if `.planning/` directory exists in the current working directory.
27
+
28
+ **If `.planning/` exists**:
29
+ - Read `.planning/config.json` to check current settings
30
+ - Tell the user: "Existing Plan-Build-Run project detected. This wizard will review your configuration."
31
+ - Skip to Step 3 (model selection)
32
+
33
+ **If `.planning/` does NOT exist**:
34
+ - Ask the user:
35
+
36
+ ```
37
+ AskUserQuestion:
38
+ question: "No Plan-Build-Run project found. Would you like to initialize one?"
39
+ header: "Initialize"
40
+ options:
41
+ - label: "Yes, initialize here"
42
+ description: "Creates .planning/ directory with default config, STATE.md, and ROADMAP.md"
43
+ - label: "No, just exploring"
44
+ description: "Exit the wizard — you can run /pbr:begin later for full project setup"
45
+ ```
46
+
47
+ If "No", display: "Run `/pbr:begin` when you're ready to start a project. It includes deep requirements gathering and roadmap creation." Then stop.
48
+
49
+ If "Yes", create the minimal `.planning/` structure:
50
+
51
+ ```bash
52
+ mkdir -p .planning/phases .planning/todos/pending .planning/todos/done .planning/logs .planning/research
53
+ ```
54
+
55
+ Create `.planning/config.json` with defaults:
56
+ ```json
57
+ {
58
+ "version": 2,
59
+ "context_strategy": "aggressive",
60
+ "mode": "interactive",
61
+ "depth": "standard",
62
+ "features": {
63
+ "structured_planning": true,
64
+ "goal_verification": true,
65
+ "integration_verification": true,
66
+ "context_isolation": true,
67
+ "atomic_commits": true,
68
+ "session_persistence": true,
69
+ "research_phase": true,
70
+ "plan_checking": true,
71
+ "tdd_mode": false,
72
+ "status_line": true,
73
+ "auto_continue": false,
74
+ "auto_advance": false,
75
+ "team_discussions": false,
76
+ "inline_verify": false
77
+ },
78
+ "models": {
79
+ "researcher": "sonnet",
80
+ "planner": "inherit",
81
+ "executor": "inherit",
82
+ "verifier": "sonnet",
83
+ "integration_checker": "sonnet",
84
+ "debugger": "inherit",
85
+ "mapper": "sonnet",
86
+ "synthesizer": "sonnet"
87
+ },
88
+ "parallelization": {
89
+ "enabled": true,
90
+ "plan_level": true,
91
+ "task_level": false,
92
+ "max_concurrent_agents": 3,
93
+ "min_plans_for_parallel": 2,
94
+ "use_teams": false
95
+ },
96
+ "planning": {
97
+ "commit_docs": true,
98
+ "max_tasks_per_plan": 3,
99
+ "search_gitignored": false
100
+ },
101
+ "git": {
102
+ "branching": "none",
103
+ "commit_format": "{type}({phase}-{plan}): {description}",
104
+ "phase_branch_template": "plan-build-run/phase-{phase}-{slug}",
105
+ "milestone_branch_template": "plan-build-run/{milestone}-{slug}",
106
+ "mode": "enabled"
107
+ },
108
+ "gates": {
109
+ "confirm_project": true,
110
+ "confirm_roadmap": true,
111
+ "confirm_plan": true,
112
+ "confirm_execute": false,
113
+ "confirm_transition": true,
114
+ "issues_review": true
115
+ },
116
+ "safety": {
117
+ "always_confirm_destructive": true,
118
+ "always_confirm_external_services": true
119
+ }
120
+ }
121
+ ```
122
+
123
+ Create `.planning/STATE.md`:
124
+ ```markdown
125
+ ---
126
+ version: 2
127
+ current_phase: 0
128
+ total_phases: 0
129
+ status: "initialized"
130
+ progress_percent: 0
131
+ last_activity: "{today's date}"
132
+ last_command: "/pbr:setup"
133
+ blockers: []
134
+ ---
135
+ # Project State
136
+
137
+ ## Current Position
138
+ Phase: 0 of 0
139
+ Status: initialized
140
+
141
+ Plan-Build-Run project initialized via /pbr:setup. Run /pbr:begin to start requirements gathering and roadmap creation.
142
+ ```
143
+
144
+ ---
145
+
146
+ ## Step 2: Project Type (new projects only)
147
+
148
+ ```
149
+ AskUserQuestion:
150
+ question: "What kind of project is this?"
151
+ header: "Project type"
152
+ options:
153
+ - label: "Greenfield"
154
+ description: "Starting from scratch — full planning cycle recommended"
155
+ - label: "Existing codebase"
156
+ description: "Adding Plan-Build-Run to an existing project — run /pbr:scan first"
157
+ - label: "Prototype/experiment"
158
+ description: "Quick iteration — lighter workflow with fewer gates"
159
+ ```
160
+
161
+ Based on selection:
162
+ - **Greenfield**: Keep defaults (full gates, structured planning)
163
+ - **Existing codebase**: Suggest running `/pbr:scan` after setup to map the codebase
164
+ - **Prototype**: Set `depth: "quick"`, disable `gates.verification`, disable `gates.review`, set `features.research_phase: false`
165
+
166
+ Update config.json with any changes.
167
+
168
+ ---
169
+
170
+ ## Step 3: Model Selection
171
+
172
+ ```
173
+ AskUserQuestion:
174
+ question: "Which model profile should Plan-Build-Run use for agents?"
175
+ header: "Models"
176
+ options:
177
+ - label: "Balanced (Recommended)"
178
+ description: "Sonnet for most agents, Haiku for synthesizer. Good quality/cost tradeoff."
179
+ - label: "Quality"
180
+ description: "Opus for executor and planner, Sonnet for others. Best results, highest cost."
181
+ - label: "Budget"
182
+ description: "Haiku for most agents. Fastest and cheapest, but lower quality."
183
+ ```
184
+
185
+ Apply the selected profile to `config.json`:
186
+ - **Balanced**: executor=sonnet, researcher=sonnet, planner=sonnet, verifier=sonnet, synthesizer=haiku
187
+ - **Quality**: executor=opus, researcher=sonnet, planner=opus, verifier=sonnet, synthesizer=sonnet
188
+ - **Budget**: executor=haiku, researcher=haiku, planner=sonnet, verifier=haiku, synthesizer=haiku
189
+
190
+ ---
191
+
192
+ ## Step 4: Workflow Preferences
193
+
194
+ ```
195
+ AskUserQuestion:
196
+ question: "Which workflow features do you want enabled?"
197
+ header: "Features"
198
+ multiSelect: true
199
+ options:
200
+ - label: "Auto-continue"
201
+ description: "Automatically chain commands (build → review → next phase) without prompting"
202
+ - label: "TDD mode"
203
+ description: "Write tests before implementation in executor agents"
204
+ - label: "Strict gates"
205
+ description: "Require verification AND review to pass before advancing phases"
206
+ - label: "Git branching"
207
+ description: "Create a branch per phase for cleaner PR history"
208
+ ```
209
+
210
+ Apply selections:
211
+ - **Auto-continue**: Set `features.auto_continue: true`
212
+ - **TDD mode**: Set `features.tdd_mode: true`
213
+ - **Strict gates**: Set `gates.verification: true`, `gates.review: true`, `gates.plan_approval: true`
214
+ - **Git branching**: Set `git.branching: "phase"`
215
+
216
+ ---
217
+
218
+ ## Step 5: Verification
219
+
220
+ Run a quick health check:
221
+
222
+ 1. Verify `.planning/config.json` is valid JSON
223
+ 2. Verify `.planning/STATE.md` exists and is parseable
224
+ 3. Verify hook scripts are accessible: `node ${CLAUDE_PLUGIN_ROOT}/scripts/progress-tracker.js` from the project directory
225
+ 4. Check that `npm test` works (if package.json exists)
226
+
227
+ Display results:
228
+
229
+ ```
230
+ Setup Complete!
231
+
232
+ Project: {cwd basename}
233
+ Model profile: {balanced/quality/budget}
234
+ Depth: {quick/standard/comprehensive}
235
+ Features: {list of enabled non-default features}
236
+
237
+ Next steps:
238
+ /pbr:begin — Full project setup with requirements and roadmap
239
+ /pbr:scan — Analyze existing codebase (if adding to existing project)
240
+ /pbr:help — Command reference
241
+ /pbr:config — Fine-tune individual settings
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Error Handling
247
+
248
+ - If `.planning/` creation fails (permissions): Tell user to create it manually and retry
249
+ - If config.json write fails: Display the JSON content and ask user to save it manually
250
+ - If health check fails: Display specific failure and suggest `/pbr:health` for diagnostics
@@ -0,0 +1,36 @@
1
+ <!-- canonical: ../../../pbr/skills/shared/commit-planning-docs.md -->
2
+ # Commit Planning Docs Pattern
3
+
4
+ Standard pattern for committing planning artifacts to git. Reference this fragment in skills that create or modify `.planning/` files.
5
+
6
+ ---
7
+
8
+ ## Pattern
9
+
10
+ ```
11
+ If `planning.commit_docs: true` in config.json:
12
+ 1. Stage the relevant .planning/ files for this skill's output
13
+ 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):`)
14
+ 3. Use the appropriate scope from the skill's commit conventions
15
+
16
+ If `planning.commit_docs: false` or config.json missing:
17
+ - Skip the commit step
18
+ ```
19
+
20
+ ## Commit Messages by Skill
21
+
22
+ | Skill | Commit message format |
23
+ |-------|----------------------|
24
+ | build | `docs({phase}): add build summaries and verification` |
25
+ | plan | `docs({phase}): add phase plans` |
26
+ | review | `docs({phase}): add verification report` |
27
+ | begin | `chore: initialize plan-build-run project planning` |
28
+ | import | `docs({phase}): import external plans` |
29
+ | quick | `docs(planning): quick task {NNN} - {slug}` |
30
+ | scan | `docs(planning): initial codebase analysis` |
31
+ | explore | `docs(planning): capture explore session outputs` |
32
+ | debug | `docs(planning): open/resolve debug session {NNN}` |
33
+ | discuss | `docs(planning): capture phase {N} discussion decisions` |
34
+ | pause | `wip(planning): save session state — phase {N} plan {M}` |
35
+ | todo | `docs(planning): add/complete todo {NNN}` |
36
+ | milestone | `docs(planning): start/complete/audit milestone` |
@@ -0,0 +1,103 @@
1
+ <!-- canonical: ../../../pbr/skills/shared/config-loading.md -->
2
+ # Config Loading Pattern
3
+
4
+ Standard pattern for loading `.planning/config.json` fields at the start of a skill invocation.
5
+
6
+ > Referenced by: build, plan, review, import, begin, quick, milestone, scan skills
7
+
8
+ ---
9
+
10
+ ## Tooling Shortcut
11
+
12
+ Instead of reading and parsing STATE.md, ROADMAP.md, and config.json manually, run:
13
+ ```bash
14
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state load
15
+ ```
16
+ 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.
17
+
18
+ Additional tooling shortcuts:
19
+ - `plan-index <phase>` -- returns plan inventory (plan_id, wave, depends_on, autonomous, must_haves_count per plan)
20
+ - `phase-info <phase>` -- returns comprehensive phase status (verification, summaries, roadmap_status, filesystem_status, plan_count, completed)
21
+
22
+ ---
23
+
24
+ ## Standard Config Fields
25
+
26
+ These are the config.json fields commonly read by workflow skills. Each skill reads a subset depending on its needs.
27
+
28
+ ### Core Settings
29
+ ```
30
+ depth -- quick | standard | comprehensive
31
+ mode -- interactive | autonomous
32
+ ```
33
+
34
+ ### Feature Flags
35
+ ```
36
+ features.research_phase -- run researcher before planning
37
+ features.plan_checking -- validate plans via plan-checker agent
38
+ features.goal_verification -- run verifier after build
39
+ features.inline_verify -- per-task verification after each executor commit (opt-in)
40
+ features.atomic_commits -- require atomic commits per task
41
+ features.auto_continue -- write .auto-next signal on phase completion
42
+ features.auto_advance -- chain build->review->plan in autonomous mode
43
+ features.integration_verification -- check cross-phase integration
44
+ ```
45
+
46
+ ### Gate Flags
47
+ ```
48
+ gates.confirm_plan -- require user approval before building
49
+ gates.confirm_execute -- require user confirmation before executing build
50
+ gates.confirm_transition -- require confirmation before advancing to next phase
51
+ ```
52
+
53
+ ### Parallelization
54
+ ```
55
+ parallelization.enabled -- whether to run plans in parallel
56
+ parallelization.plan_level -- parallel at plan level (within a wave)
57
+ parallelization.max_concurrent_agents -- max simultaneous executors
58
+ ```
59
+
60
+ ### Planning
61
+ ```
62
+ planning.commit_docs -- commit planning docs after operations
63
+ planning.max_tasks_per_plan -- maximum tasks in a single plan
64
+ ```
65
+
66
+ ### Git
67
+ ```
68
+ git.commit_format -- commit message format
69
+ git.branching -- none | phase | milestone
70
+ ```
71
+
72
+ ### Models
73
+ ```
74
+ models.researcher -- model for researcher agent
75
+ models.planner -- model for planner agent
76
+ models.executor -- model for executor agent
77
+ models.verifier -- model for verifier agent
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Config Field Matrix by Skill
83
+
84
+ | Field | build | plan | review | import | begin | quick | milestone |
85
+ |-------|-------|------|--------|--------|-------|-------|-----------|
86
+ | depth | | X | | | X | | |
87
+ | mode | X | X | X | | X | | |
88
+ | features.research_phase | | X | | | | | |
89
+ | features.plan_checking | | X | | X | | | |
90
+ | features.goal_verification | X | | X | | | | |
91
+ | features.inline_verify | X | | | | | | |
92
+ | features.atomic_commits | X | | | | | | |
93
+ | features.auto_continue | X | | | | | | |
94
+ | features.auto_advance | X | X | X | | | | |
95
+ | features.integration_verification | | | X | | | | X |
96
+ | gates.confirm_plan | | X | | | | | |
97
+ | gates.confirm_execute | X | | | | | | |
98
+ | gates.confirm_transition | | | X | | | | |
99
+ | parallelization.* | X | | | | | | |
100
+ | planning.commit_docs | X | | | | | X | X |
101
+ | git.commit_format | X | | | | X | X | |
102
+ | git.branching | X | | | | | | |
103
+ | models.* | | X | X | | X | | X |
@@ -0,0 +1,41 @@
1
+ <!-- canonical: ../../../pbr/skills/shared/context-budget.md -->
2
+ # Context Budget Rules
3
+
4
+ Standard rules for keeping orchestrator context lean. Reference this fragment in skills that spawn Task() subagents.
5
+
6
+ See also: `skills/shared/universal-anti-patterns.md` for the complete set of universal rules (context budget + file reading + behavioral rules).
7
+
8
+ ---
9
+
10
+ ## Universal Rules
11
+
12
+ Every skill that spawns agents or reads significant content must follow these rules:
13
+
14
+ 1. **Never** read agent definition files (`agents/*.md`) — `subagent_type` auto-loads them
15
+ 2. **Never** inline large files into Task() prompts — tell agents to read files from disk instead
16
+ 3. **Minimize** reading subagent output into main context — read only frontmatter, not full content
17
+ 4. **Delegate** heavy work to subagents — the orchestrator routes, it doesn't execute
18
+ 5. **Before spawning agents**: If you've already consumed significant context (large file reads, multiple subagent results), warn the user: "Context budget is getting heavy. Consider running `/pbr:pause` to checkpoint progress." Suggest pause proactively rather than waiting for compaction.
19
+
20
+ ## Customization
21
+
22
+ Skills should add skill-specific rules below the reference line. Common skill-specific additions:
23
+
24
+ - **build**: "Minimize reading executor output — read only SUMMARY.md frontmatter, not full content"
25
+ - **plan**: "Minimize reading subagent output — read only plan frontmatter for summaries"
26
+ - **review**: "Minimize reading subagent output — read only VERIFICATION.md frontmatter for summaries"
27
+ - **scan**: "Delegate ALL analysis to the 4 parallel codebase-mapper subagents"
28
+ - **quick**: "Never implement the task yourself — ALL code changes go through a spawned executor"
29
+ - **debug**: "Never perform investigation work yourself — delegate ALL analysis to the debugger subagent"
30
+
31
+ Format in the SKILL.md:
32
+
33
+ ```markdown
34
+ ## Context Budget
35
+
36
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
37
+
38
+ Additionally for this skill:
39
+ - {Skill-specific rule 1}
40
+ - {Skill-specific rule 2}
41
+ ```