@sienklogic/plan-build-run 2.58.0 → 2.60.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.
- package/CHANGELOG.md +56 -0
- package/package.json +1 -1
- package/plugins/codex-pbr/agents/executor.md +8 -0
- package/plugins/codex-pbr/agents/plan-checker.md +5 -3
- package/plugins/codex-pbr/agents/planner.md +13 -7
- package/plugins/codex-pbr/agents/verifier.md +10 -1
- package/plugins/codex-pbr/commands/profile.md +7 -0
- package/plugins/codex-pbr/references/model-profiles.md +29 -3
- package/plugins/codex-pbr/references/plan-format.md +46 -8
- package/plugins/codex-pbr/skills/begin/SKILL.md +18 -34
- package/plugins/codex-pbr/skills/build/SKILL.md +8 -4
- package/plugins/codex-pbr/skills/debug/SKILL.md +2 -2
- package/plugins/codex-pbr/skills/discuss/SKILL.md +54 -4
- package/plugins/codex-pbr/skills/health/SKILL.md +15 -2
- package/plugins/codex-pbr/skills/milestone/SKILL.md +8 -8
- package/plugins/codex-pbr/skills/pause/SKILL.md +1 -1
- package/plugins/codex-pbr/skills/plan/SKILL.md +20 -8
- package/plugins/codex-pbr/skills/profile/SKILL.md +171 -0
- package/plugins/codex-pbr/skills/review/SKILL.md +5 -3
- package/plugins/codex-pbr/skills/scan/SKILL.md +2 -2
- package/plugins/codex-pbr/skills/setup/SKILL.md +66 -2
- package/plugins/codex-pbr/skills/shared/context-loader-task.md +2 -0
- package/plugins/codex-pbr/skills/status/SKILL.md +17 -0
- package/plugins/codex-pbr/templates/PROJECT.md.tmpl +41 -0
- package/plugins/codex-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
- package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
- package/plugins/codex-pbr/templates/project-CONTEXT.md.tmpl +43 -0
- package/plugins/copilot-pbr/agents/executor.agent.md +8 -0
- package/plugins/copilot-pbr/agents/plan-checker.agent.md +5 -3
- package/plugins/copilot-pbr/agents/planner.agent.md +13 -7
- package/plugins/copilot-pbr/agents/verifier.agent.md +10 -1
- package/plugins/copilot-pbr/commands/profile.md +7 -0
- package/plugins/copilot-pbr/hooks/hooks.json +27 -0
- package/plugins/copilot-pbr/plugin.json +1 -1
- package/plugins/copilot-pbr/references/model-profiles.md +29 -3
- package/plugins/copilot-pbr/references/plan-format.md +46 -8
- package/plugins/copilot-pbr/skills/begin/SKILL.md +18 -34
- package/plugins/copilot-pbr/skills/build/SKILL.md +8 -4
- package/plugins/copilot-pbr/skills/debug/SKILL.md +2 -2
- package/plugins/copilot-pbr/skills/discuss/SKILL.md +54 -4
- package/plugins/copilot-pbr/skills/health/SKILL.md +15 -2
- package/plugins/copilot-pbr/skills/milestone/SKILL.md +8 -8
- package/plugins/copilot-pbr/skills/pause/SKILL.md +1 -1
- package/plugins/copilot-pbr/skills/plan/SKILL.md +20 -8
- package/plugins/copilot-pbr/skills/profile/SKILL.md +171 -0
- package/plugins/copilot-pbr/skills/review/SKILL.md +5 -3
- package/plugins/copilot-pbr/skills/scan/SKILL.md +2 -2
- package/plugins/copilot-pbr/skills/setup/SKILL.md +66 -2
- package/plugins/copilot-pbr/skills/shared/context-loader-task.md +2 -0
- package/plugins/copilot-pbr/skills/status/SKILL.md +17 -0
- package/plugins/copilot-pbr/templates/PROJECT.md.tmpl +41 -0
- package/plugins/copilot-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
- package/plugins/copilot-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
- package/plugins/copilot-pbr/templates/project-CONTEXT.md.tmpl +43 -0
- package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor-pbr/agents/executor.md +8 -0
- package/plugins/cursor-pbr/agents/plan-checker.md +5 -3
- package/plugins/cursor-pbr/agents/planner.md +13 -7
- package/plugins/cursor-pbr/agents/verifier.md +10 -1
- package/plugins/cursor-pbr/commands/profile.md +7 -0
- package/plugins/cursor-pbr/hooks/hooks.json +23 -0
- package/plugins/cursor-pbr/references/model-profiles.md +29 -3
- package/plugins/cursor-pbr/references/plan-format.md +46 -8
- package/plugins/cursor-pbr/skills/begin/SKILL.md +18 -34
- package/plugins/cursor-pbr/skills/build/SKILL.md +9 -5
- package/plugins/cursor-pbr/skills/debug/SKILL.md +2 -2
- package/plugins/cursor-pbr/skills/discuss/SKILL.md +55 -5
- package/plugins/cursor-pbr/skills/health/SKILL.md +15 -2
- package/plugins/cursor-pbr/skills/milestone/SKILL.md +8 -8
- package/plugins/cursor-pbr/skills/pause/SKILL.md +1 -1
- package/plugins/cursor-pbr/skills/plan/SKILL.md +21 -9
- package/plugins/cursor-pbr/skills/profile/SKILL.md +172 -0
- package/plugins/cursor-pbr/skills/review/SKILL.md +6 -4
- package/plugins/cursor-pbr/skills/scan/SKILL.md +2 -2
- package/plugins/cursor-pbr/skills/setup/SKILL.md +66 -2
- package/plugins/cursor-pbr/skills/shared/context-loader-task.md +2 -0
- package/plugins/cursor-pbr/skills/status/SKILL.md +17 -0
- package/plugins/cursor-pbr/templates/PROJECT.md.tmpl +41 -0
- package/plugins/cursor-pbr/templates/REQUIREMENTS.md.tmpl +52 -0
- package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
- package/plugins/cursor-pbr/templates/project-CONTEXT.md.tmpl +43 -0
- package/plugins/pbr/.claude-plugin/plugin.json +1 -1
- package/plugins/pbr/agents/audit.md +0 -1
- package/plugins/pbr/agents/codebase-mapper.md +0 -1
- package/plugins/pbr/agents/debugger.md +0 -1
- package/plugins/pbr/agents/dev-sync.md +0 -1
- package/plugins/pbr/agents/executor.md +8 -1
- package/plugins/pbr/agents/general.md +0 -1
- package/plugins/pbr/agents/integration-checker.md +0 -1
- package/plugins/pbr/agents/plan-checker.md +5 -4
- package/plugins/pbr/agents/planner.md +13 -8
- package/plugins/pbr/agents/researcher.md +0 -1
- package/plugins/pbr/agents/synthesizer.md +0 -1
- package/plugins/pbr/agents/verifier.md +10 -2
- package/plugins/pbr/commands/profile.md +7 -0
- package/plugins/pbr/hooks/hooks.json +23 -0
- package/plugins/pbr/references/model-profiles.md +29 -3
- package/plugins/pbr/references/plan-format.md +46 -8
- package/plugins/pbr/scripts/check-plan-format.js +29 -0
- package/plugins/pbr/scripts/config-schema.json +20 -1
- package/plugins/pbr/scripts/context-bridge.js +1 -1
- package/plugins/pbr/scripts/hooks-schema.json +3 -1
- package/plugins/pbr/scripts/lib/gates/doc-existence.js +46 -0
- package/plugins/pbr/scripts/lib/init.js +10 -7
- package/plugins/pbr/scripts/pbr-tools.js +6 -6
- package/plugins/pbr/scripts/post-write-dispatch.js +22 -2
- package/plugins/pbr/scripts/sync-context-to-claude.js +100 -0
- package/plugins/pbr/scripts/validate-task.js +14 -1
- package/plugins/pbr/scripts/worktree-create.js +93 -0
- package/plugins/pbr/scripts/worktree-remove.js +83 -0
- package/plugins/pbr/skills/begin/SKILL.md +18 -34
- package/plugins/pbr/skills/build/SKILL.md +9 -5
- package/plugins/pbr/skills/debug/SKILL.md +2 -2
- package/plugins/pbr/skills/discuss/SKILL.md +55 -5
- package/plugins/pbr/skills/health/SKILL.md +15 -2
- package/plugins/pbr/skills/milestone/SKILL.md +8 -8
- package/plugins/pbr/skills/pause/SKILL.md +1 -1
- package/plugins/pbr/skills/plan/SKILL.md +21 -9
- package/plugins/pbr/skills/profile/SKILL.md +173 -0
- package/plugins/pbr/skills/review/SKILL.md +6 -4
- package/plugins/pbr/skills/scan/SKILL.md +2 -2
- package/plugins/pbr/skills/setup/SKILL.md +66 -2
- package/plugins/pbr/skills/shared/context-loader-task.md +2 -0
- package/plugins/pbr/skills/status/SKILL.md +17 -0
- package/plugins/pbr/templates/PROJECT.md.tmpl +41 -0
- package/plugins/pbr/templates/REQUIREMENTS.md.tmpl +52 -0
- package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +5 -0
- package/plugins/pbr/templates/project-CONTEXT.md.tmpl +43 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: profile
|
|
3
|
+
description: "Switch the active model profile. Presets: quality, balanced, budget, adaptive. Supports custom profiles from config.json model_profiles."
|
|
4
|
+
argument-hint: "[quality|balanced|budget|adaptive|<custom>]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Begin executing Step 0 immediately.**
|
|
8
|
+
|
|
9
|
+
# /pbr:profile — Model Profile Manager
|
|
10
|
+
|
|
11
|
+
You are running the **profile** skill. Your job is to show the current model profile or switch to a new one by writing model assignments to `.planning/config.json`.
|
|
12
|
+
|
|
13
|
+
## Step 0 — Immediate Output
|
|
14
|
+
|
|
15
|
+
**Before ANY tool calls**, display this banner:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
19
|
+
║ PLAN-BUILD-RUN ► MODEL PROFILE ║
|
|
20
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then proceed to Step 1.
|
|
24
|
+
|
|
25
|
+
## Step 1 — Load Config
|
|
26
|
+
|
|
27
|
+
Read `.planning/config.json`.
|
|
28
|
+
|
|
29
|
+
If the file does not exist, output:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Error: .planning/config.json not found. Run /pbr:begin first.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Stop immediately.
|
|
36
|
+
|
|
37
|
+
## Step 2 — Parse Arguments
|
|
38
|
+
|
|
39
|
+
Extract the first word from `$ARGUMENTS` as the profile name. Trim whitespace.
|
|
40
|
+
|
|
41
|
+
- If `$ARGUMENTS` is empty or blank → **show-mode** (go to Step 3).
|
|
42
|
+
- If a profile name is present → **switch-mode** (go to Step 4).
|
|
43
|
+
|
|
44
|
+
## Step 3 — Show Mode (no argument)
|
|
45
|
+
|
|
46
|
+
Display the current profile status and available options.
|
|
47
|
+
|
|
48
|
+
1. Read `config.json` key `model_profile`. If absent, treat as `"balanced"`.
|
|
49
|
+
2. Read `config.json` key `models` (object). If absent, use empty object.
|
|
50
|
+
3. Read `config.json` key `model_profiles` (object, optional custom profiles). If absent, use empty object.
|
|
51
|
+
|
|
52
|
+
Output the following (fill in actual values):
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Active profile: <model_profile value>
|
|
56
|
+
|
|
57
|
+
Current model assignments:
|
|
58
|
+
researcher : <models.researcher or "not set">
|
|
59
|
+
planner : <models.planner or "not set">
|
|
60
|
+
executor : <models.executor or "not set">
|
|
61
|
+
verifier : <models.verifier or "not set">
|
|
62
|
+
integration_checker : <models.integration_checker or "not set">
|
|
63
|
+
debugger : <models.debugger or "not set">
|
|
64
|
+
mapper : <models.mapper or "not set">
|
|
65
|
+
synthesizer : <models.synthesizer or "not set">
|
|
66
|
+
|
|
67
|
+
Available presets:
|
|
68
|
+
quality — all agents use opus (maximum capability)
|
|
69
|
+
balanced — mix of sonnet/inherit/haiku (default)
|
|
70
|
+
budget — all agents use haiku (minimum cost)
|
|
71
|
+
adaptive — sonnet for planning/verification, inherit/haiku for execution
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If `model_profiles` has any keys, also display:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
Custom profiles:
|
|
78
|
+
<profile-name> — <key count> model overrides
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Output: "Run `/pbr:profile <name>` to switch profiles."
|
|
82
|
+
|
|
83
|
+
Stop. Do not write anything.
|
|
84
|
+
|
|
85
|
+
## Step 4 — Switch Mode (argument provided)
|
|
86
|
+
|
|
87
|
+
### Step 4a — Validate Profile Name
|
|
88
|
+
|
|
89
|
+
Built-in preset names: `quality`, `balanced`, `budget`, `adaptive`.
|
|
90
|
+
|
|
91
|
+
Custom profile names: keys in `config.json model_profiles` (if any).
|
|
92
|
+
|
|
93
|
+
If the provided name does not match any of the above:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Error: Unknown profile "<name>".
|
|
97
|
+
|
|
98
|
+
Valid presets: quality, balanced, budget, adaptive
|
|
99
|
+
<list any custom profile names from config.json model_profiles, if any>
|
|
100
|
+
|
|
101
|
+
Run `/pbr:profile` to see the current status.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Stop immediately.
|
|
105
|
+
|
|
106
|
+
### Step 4b — Resolve Model Values
|
|
107
|
+
|
|
108
|
+
Use the preset table to resolve model values:
|
|
109
|
+
|
|
110
|
+
| Agent | quality | balanced | budget | adaptive |
|
|
111
|
+
|---------------------|---------|----------|--------|----------|
|
|
112
|
+
| researcher | opus | sonnet | haiku | sonnet |
|
|
113
|
+
| planner | opus | inherit | haiku | sonnet |
|
|
114
|
+
| executor | opus | inherit | haiku | inherit |
|
|
115
|
+
| verifier | opus | sonnet | haiku | sonnet |
|
|
116
|
+
| integration_checker | sonnet | sonnet | haiku | haiku |
|
|
117
|
+
| debugger | opus | inherit | haiku | inherit |
|
|
118
|
+
| mapper | sonnet | sonnet | haiku | haiku |
|
|
119
|
+
| synthesizer | sonnet | haiku | haiku | haiku |
|
|
120
|
+
|
|
121
|
+
For a **custom profile** (name found in `config.json model_profiles`):
|
|
122
|
+
- Start with the `balanced` defaults from the table above.
|
|
123
|
+
- Overlay any keys present in `config.json model_profiles[<name>]`.
|
|
124
|
+
- Any agents not specified in the custom profile use the balanced default.
|
|
125
|
+
|
|
126
|
+
### Step 4c — Write to config.json
|
|
127
|
+
|
|
128
|
+
Update `config.json` using the Bash tool with `node -e` inline script:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
node -e "
|
|
132
|
+
const fs = require('fs');
|
|
133
|
+
const cfg = JSON.parse(fs.readFileSync('.planning/config.json', 'utf8'));
|
|
134
|
+
cfg.model_profile = '<name>';
|
|
135
|
+
cfg.models = cfg.models || {};
|
|
136
|
+
cfg.models.researcher = '<value>';
|
|
137
|
+
cfg.models.planner = '<value>';
|
|
138
|
+
cfg.models.executor = '<value>';
|
|
139
|
+
cfg.models.verifier = '<value>';
|
|
140
|
+
cfg.models.integration_checker = '<value>';
|
|
141
|
+
cfg.models.debugger = '<value>';
|
|
142
|
+
cfg.models.mapper = '<value>';
|
|
143
|
+
cfg.models.synthesizer = '<value>';
|
|
144
|
+
fs.writeFileSync('.planning/config.json', JSON.stringify(cfg, null, 2));
|
|
145
|
+
console.log('OK');
|
|
146
|
+
"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Replace each `<value>` with the resolved model string for that agent. Replace `<name>` with the profile name.
|
|
150
|
+
|
|
151
|
+
### Step 4d — Confirm
|
|
152
|
+
|
|
153
|
+
Output:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
Active profile set to: <name>
|
|
157
|
+
|
|
158
|
+
Model assignments updated:
|
|
159
|
+
researcher : <value>
|
|
160
|
+
planner : <value>
|
|
161
|
+
executor : <value>
|
|
162
|
+
verifier : <value>
|
|
163
|
+
integration_checker : <value>
|
|
164
|
+
debugger : <value>
|
|
165
|
+
mapper : <value>
|
|
166
|
+
synthesizer : <value>
|
|
167
|
+
|
|
168
|
+
Config written to .planning/config.json.
|
|
169
|
+
Run /pbr:profile to verify.
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Stop. Done.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: review
|
|
3
3
|
description: "Verify the build matched the plan. Automated checks + walkthrough with you."
|
|
4
|
-
argument-hint: "<phase-number> [--auto-fix] [--teams]"
|
|
4
|
+
argument-hint: "<phase-number> [--auto-fix] [--teams] [--model <model>]"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
**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.**
|
|
@@ -51,6 +51,7 @@ Parse `$ARGUMENTS` according to `skills/shared/phase-argument-parsing.md`.
|
|
|
51
51
|
| `3` | Review phase 3 |
|
|
52
52
|
| `3 --auto-fix` | Review phase 3, automatically diagnose and create gap-closure plans for failures |
|
|
53
53
|
| `3 --teams` | Review phase 3 with parallel specialist verifiers (functional + security + performance) |
|
|
54
|
+
| `3 --model opus` | Use opus for all verifier spawns in phase 3 (overrides config verifier_model) |
|
|
54
55
|
| (no number) | Use current phase from STATE.md |
|
|
55
56
|
|
|
56
57
|
---
|
|
@@ -66,6 +67,7 @@ Execute these steps in order.
|
|
|
66
67
|
**Init-first pattern**: When spawning agents, pass the output of `node plugins/pbr/scripts/pbr-tools.js init verify-work {N}` as context rather than having the agent read multiple files separately. This reduces file reads and prevents context-loading failures.
|
|
67
68
|
|
|
68
69
|
1. Parse `$ARGUMENTS` for phase number and `--auto-fix` flag
|
|
70
|
+
- If `--model <value>` is present in `$ARGUMENTS`, extract the value (sonnet, opus, haiku, inherit). Store as `override_model`. When spawning verifier Task() agents, use `override_model` instead of the config-derived verifier_model. If an invalid value is provided, display an error and list valid values.
|
|
69
71
|
2. Read `.planning/config.json`
|
|
70
72
|
**CRITICAL (hook-enforced): Write .active-skill NOW.** Write the text "review" to `.planning/.active-skill` using the Write tool.
|
|
71
73
|
3. Resolve depth profile: run `node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
|
|
@@ -185,7 +187,7 @@ Task({
|
|
|
185
187
|
|
|
186
188
|
#### Verifier Prompt Template
|
|
187
189
|
|
|
188
|
-
Read
|
|
190
|
+
Read `${CLAUDE_SKILL_DIR}/templates/verifier-prompt.md.tmpl` and use its content as the verifier prompt.
|
|
189
191
|
|
|
190
192
|
**Prepend this block to the verifier prompt before sending:**
|
|
191
193
|
```
|
|
@@ -427,7 +429,7 @@ Task({
|
|
|
427
429
|
|
|
428
430
|
##### Debugger Prompt Template
|
|
429
431
|
|
|
430
|
-
Read
|
|
432
|
+
Read `${CLAUDE_SKILL_DIR}/templates/debugger-prompt.md.tmpl` and use its content as the debugger prompt.
|
|
431
433
|
|
|
432
434
|
**Prepend this block to the debugger prompt before sending:**
|
|
433
435
|
```
|
|
@@ -459,7 +461,7 @@ Task({
|
|
|
459
461
|
|
|
460
462
|
##### Gap Planner Prompt Template
|
|
461
463
|
|
|
462
|
-
Read
|
|
464
|
+
Read `${CLAUDE_SKILL_DIR}/templates/gap-planner-prompt.md.tmpl` and use its content as the gap planner prompt.
|
|
463
465
|
|
|
464
466
|
**Prepend this block to the gap planner prompt before sending:**
|
|
465
467
|
```
|
|
@@ -89,7 +89,7 @@ Before spawning agents, do a quick scan to identify what we're working with. Thi
|
|
|
89
89
|
4. **Read existing docs** — README.md, architecture docs, .env.example
|
|
90
90
|
5. **Write `.planning/codebase/RECON.md`** with project type, scale, key directories, entry points, and quick stats
|
|
91
91
|
|
|
92
|
-
Refer to the "Reconnaissance Detection Reference" section of
|
|
92
|
+
Refer to the "Reconnaissance Detection Reference" section of `${CLAUDE_SKILL_DIR}/templates/mapper-prompt.md.tmpl` for the full detection checklists.
|
|
93
93
|
|
|
94
94
|
### Step 3: Spawn Analysis Agents
|
|
95
95
|
|
|
@@ -118,7 +118,7 @@ Display to the user:
|
|
|
118
118
|
|
|
119
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
120
|
|
|
121
|
-
For each agent, read
|
|
121
|
+
For each agent, read `${CLAUDE_SKILL_DIR}/templates/mapper-prompt.md.tmpl` and fill in the placeholders:
|
|
122
122
|
- `{focus_area}`: one of `tech`, `arch`, `quality`, `concerns`
|
|
123
123
|
- `{project_path}`: the working directory
|
|
124
124
|
- `{recon_data}`: contents of RECON.md
|
|
@@ -135,7 +135,69 @@ This project uses [Plan-Build-Run](https://github.com/SienkLogic/plan-build-run)
|
|
|
135
135
|
|
|
136
136
|
---
|
|
137
137
|
|
|
138
|
-
## Step 5:
|
|
138
|
+
## Step 5: Platform Settings
|
|
139
|
+
|
|
140
|
+
Manage Claude Code platform settings that PBR recommends for optimal token usage.
|
|
141
|
+
|
|
142
|
+
**Read `.planning/config.json`** (already loaded in Step 1). Check for a `platform_settings` block:
|
|
143
|
+
- If absent, treat it as `{}` (no managed settings).
|
|
144
|
+
|
|
145
|
+
**Check for existing `.claude/settings.json`**:
|
|
146
|
+
- If it exists, read its contents. Parse as JSON (or `{}` if empty/missing).
|
|
147
|
+
- If it does not exist, start from `{}`.
|
|
148
|
+
|
|
149
|
+
**Compute the merge**:
|
|
150
|
+
- Start with the existing `.claude/settings.json` content.
|
|
151
|
+
- Apply each key from `platform_settings` in config.json on top.
|
|
152
|
+
- If `platform_settings` is absent or empty, skip the write entirely.
|
|
153
|
+
|
|
154
|
+
**Report drift** (compare before/after):
|
|
155
|
+
- List keys being ADDED (were absent in .claude/settings.json)
|
|
156
|
+
- List keys being CHANGED (differ from existing .claude/settings.json value)
|
|
157
|
+
- List keys that MATCH (already correct — no change needed)
|
|
158
|
+
|
|
159
|
+
Display the report:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Platform Settings:
|
|
163
|
+
Keys added: includeGitInstructions → false
|
|
164
|
+
Keys matched: (none)
|
|
165
|
+
Keys changed: (none)
|
|
166
|
+
|
|
167
|
+
Writing .claude/settings.json...
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
If all keys already match, display:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Platform Settings: .claude/settings.json is already in sync — no changes needed.
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Conflict detection**: If an existing `.claude/settings.json` has a key from `platform_settings` set to the OPPOSITE value (e.g., `"includeGitInstructions": true` when PBR wants `false`), display a WARNING before overwriting:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
WARNING: .claude/settings.json has includeGitInstructions: true
|
|
180
|
+
PBR recommends false (removes redundant built-in git instructions).
|
|
181
|
+
Overwriting with PBR recommended value.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Write the merged settings.json**:
|
|
185
|
+
- Write to `.claude/settings.json` in the project root (alongside `.planning/`).
|
|
186
|
+
- Ensure the directory `.claude/` exists (create it if needed with Bash `mkdir -p .claude`).
|
|
187
|
+
- Write with 2-space indentation. Include a `$schema` key at the top:
|
|
188
|
+
```json
|
|
189
|
+
{
|
|
190
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
191
|
+
"includeGitInstructions": false
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
(Merge in any pre-existing keys from .claude/settings.json that are NOT managed by PBR — pass them through unchanged at the bottom of the object.)
|
|
195
|
+
|
|
196
|
+
**Drift detection note**: On subsequent /pbr:setup runs, if `.claude/settings.json` has drifted from `platform_settings` (e.g., user manually changed it), this step will detect and re-apply the PBR values with a drift warning. This is by design — platform_settings in config.json is the source of truth.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Step 6: Write Updated Config
|
|
139
201
|
|
|
140
202
|
**CRITICAL: Write `.planning/config.json` NOW with all changes from Steps 2-3. Do NOT skip this step.**
|
|
141
203
|
|
|
@@ -143,13 +205,14 @@ Write the updated config.json to disk with all applied changes.
|
|
|
143
205
|
|
|
144
206
|
---
|
|
145
207
|
|
|
146
|
-
## Step
|
|
208
|
+
## Step 7: Verification
|
|
147
209
|
|
|
148
210
|
Run a quick check:
|
|
149
211
|
1. Verify `.planning/config.json` is valid JSON (read it back)
|
|
150
212
|
2. Display updated settings summary
|
|
151
213
|
|
|
152
214
|
Display:
|
|
215
|
+
|
|
153
216
|
```
|
|
154
217
|
╔══════════════════════════════════════════════════════════════╗
|
|
155
218
|
║ PLAN-BUILD-RUN ► RECONFIGURE COMPLETE ✓ ║
|
|
@@ -159,6 +222,7 @@ Updated:
|
|
|
159
222
|
- Model profile: {new profile}
|
|
160
223
|
- Features changed: {list or "none"}
|
|
161
224
|
- CLAUDE.md: {updated/skipped}
|
|
225
|
+
- Platform settings: {".claude/settings.json updated" or "already in sync" or "no managed settings"}
|
|
162
226
|
|
|
163
227
|
Run /pbr:status to see current project state.
|
|
164
228
|
```
|
|
@@ -28,6 +28,7 @@ Task({
|
|
|
28
28
|
- .planning/STATE.md
|
|
29
29
|
- .planning/ROADMAP.md
|
|
30
30
|
- .planning/REQUIREMENTS.md
|
|
31
|
+
- .planning/PROJECT.md (if exists — project vision and scope)
|
|
31
32
|
- .planning/CONTEXT.md
|
|
32
33
|
- Any .planning/phases/*/CONTEXT.md files
|
|
33
34
|
- .planning/research/SUMMARY.md (if exists)
|
|
@@ -65,6 +66,7 @@ Task({
|
|
|
65
66
|
- .planning/STATE.md
|
|
66
67
|
- .planning/ROADMAP.md
|
|
67
68
|
- .planning/REQUIREMENTS.md
|
|
69
|
+
- .planning/PROJECT.md (if exists — project vision and scope)
|
|
68
70
|
- .planning/CONTEXT.md
|
|
69
71
|
- Any .planning/phases/*/CONTEXT.md files
|
|
70
72
|
- .planning/HISTORY.md (if exists — scan for decisions relevant to '{topic}' only, do NOT summarize all history)
|
|
@@ -111,6 +111,16 @@ Parse the JSON response. Capture:
|
|
|
111
111
|
|
|
112
112
|
Store these for use in Step 4 display and Step 5 routing.
|
|
113
113
|
|
|
114
|
+
6. **`.planning/CONTEXT.md`** (project-level, if exists)
|
|
115
|
+
- Note: project-level locked decisions file
|
|
116
|
+
|
|
117
|
+
### Step 1d: Check Project Documents
|
|
118
|
+
|
|
119
|
+
Check existence of the three project-level documents and record their status for Step 4 display:
|
|
120
|
+
- `.planning/PROJECT.md` — exists or not
|
|
121
|
+
- `.planning/REQUIREMENTS.md` — exists or not
|
|
122
|
+
- `.planning/CONTEXT.md` — exists or not
|
|
123
|
+
|
|
114
124
|
### Step 2: Scan Phase Directories
|
|
115
125
|
|
|
116
126
|
For each phase listed in ROADMAP.md:
|
|
@@ -221,6 +231,13 @@ Phase Status:
|
|
|
221
231
|
| 2. {name} | {status indicator} {status text} | {completed}/{total} | {percentage}% |
|
|
222
232
|
| ...
|
|
223
233
|
|
|
234
|
+
**Project documents:**
|
|
235
|
+
| File | Status |
|
|
236
|
+
|------|--------|
|
|
237
|
+
| PROJECT.md | {exists / not found — run /pbr:begin} |
|
|
238
|
+
| REQUIREMENTS.md | {exists / not found — run /pbr:begin} |
|
|
239
|
+
| CONTEXT.md | {exists / not found — run /pbr:discuss --project} |
|
|
240
|
+
|
|
224
241
|
{If context tier is DEGRADING, POOR, or CRITICAL:}
|
|
225
242
|
⚠ Context: {percentage}% used ({tier}) — {recommendation_text}
|
|
226
243
|
Run `/compact` to reclaim context before spawning more agents.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# {project_name}
|
|
2
|
+
|
|
3
|
+
> {ONE sentence core value statement}
|
|
4
|
+
|
|
5
|
+
## Vision
|
|
6
|
+
|
|
7
|
+
{2-3 sentences describing the product and problem it solves. Who is it for? What does it replace or improve?}
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
|
|
11
|
+
### In Scope (v1)
|
|
12
|
+
|
|
13
|
+
{Bulleted list of features and capabilities committed for this project.}
|
|
14
|
+
|
|
15
|
+
- {Feature area}: {brief description}
|
|
16
|
+
|
|
17
|
+
### Out of Scope
|
|
18
|
+
|
|
19
|
+
{Features explicitly excluded from this project.}
|
|
20
|
+
|
|
21
|
+
- {Feature}: {brief reason why excluded}
|
|
22
|
+
|
|
23
|
+
## Success Criteria
|
|
24
|
+
|
|
25
|
+
{Observable conditions that define project success. Each must be testable.}
|
|
26
|
+
|
|
27
|
+
- {Criterion 1 — specific and measurable}
|
|
28
|
+
- {Criterion 2 — specific and measurable}
|
|
29
|
+
- {Criterion 3 — specific and measurable}
|
|
30
|
+
|
|
31
|
+
## Stakeholders
|
|
32
|
+
|
|
33
|
+
{Who cares about this project and why.}
|
|
34
|
+
|
|
35
|
+
- **Primary user**: {description}
|
|
36
|
+
- **Team**: {description}
|
|
37
|
+
|
|
38
|
+
## Milestones
|
|
39
|
+
|
|
40
|
+
{project_name} planned in {phase_count} phases across {milestone_count} milestone(s).
|
|
41
|
+
See `.planning/ROADMAP.md` for phase details.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Requirements
|
|
2
|
+
|
|
3
|
+
> Living document. Generated by `/pbr:begin`, updated via `/pbr:discuss`.
|
|
4
|
+
> All requirements flow from here into plans via `implements:[]` in PLAN.md frontmatter.
|
|
5
|
+
|
|
6
|
+
## Functional Requirements
|
|
7
|
+
|
|
8
|
+
Capabilities the system must provide from the user's perspective.
|
|
9
|
+
|
|
10
|
+
### {Category} (e.g., Authentication, API, UI)
|
|
11
|
+
|
|
12
|
+
| ID | Requirement | Priority | Status |
|
|
13
|
+
|----|-------------|----------|--------|
|
|
14
|
+
| REQ-F-001 | {User-centric, testable statement of capability} | Must | Open |
|
|
15
|
+
| REQ-F-002 | {User-centric, testable statement of capability} | Should | Open |
|
|
16
|
+
|
|
17
|
+
### {Category 2}
|
|
18
|
+
|
|
19
|
+
| ID | Requirement | Priority | Status |
|
|
20
|
+
|----|-------------|----------|--------|
|
|
21
|
+
| REQ-F-010 | {User-centric, testable statement of capability} | Must | Open |
|
|
22
|
+
|
|
23
|
+
## Non-Functional Requirements
|
|
24
|
+
|
|
25
|
+
Quality attributes and constraints the system must satisfy.
|
|
26
|
+
|
|
27
|
+
| ID | Requirement | Category | Priority |
|
|
28
|
+
|----|-------------|----------|----------|
|
|
29
|
+
| REQ-NF-001 | {Observable quality statement — e.g., "Page loads in <2s on 4G"} | Performance | Must |
|
|
30
|
+
| REQ-NF-002 | {Observable quality statement} | Security | Must |
|
|
31
|
+
| REQ-NF-003 | {Observable quality statement} | Reliability | Should |
|
|
32
|
+
|
|
33
|
+
## Deferred Requirements (v2+)
|
|
34
|
+
|
|
35
|
+
Requirements explicitly out of scope for v1.
|
|
36
|
+
|
|
37
|
+
| ID | Requirement | Deferred Reason |
|
|
38
|
+
|----|-------------|----------------|
|
|
39
|
+
| REQ-F-099 | {requirement} | {reason — e.g., "Phase 2 priority"} |
|
|
40
|
+
|
|
41
|
+
## Out of Scope
|
|
42
|
+
|
|
43
|
+
Features explicitly excluded. These must NOT appear in any plan.
|
|
44
|
+
|
|
45
|
+
- {Feature}: {brief rationale}
|
|
46
|
+
|
|
47
|
+
## Traceability
|
|
48
|
+
|
|
49
|
+
| REQ-ID | Implemented In | Verified In |
|
|
50
|
+
|--------|---------------|------------|
|
|
51
|
+
| REQ-F-001 | Phase 01 PLAN-01 | Phase 01 VERIFICATION.md |
|
|
52
|
+
| REQ-F-002 | — | — |
|
|
@@ -23,6 +23,11 @@ anti_patterns:
|
|
|
23
23
|
console_logs: {count}
|
|
24
24
|
skipped_tests: {count}
|
|
25
25
|
hardcoded_secrets: {count}
|
|
26
|
+
# populated by verifier from implements:[] in plan frontmatter
|
|
27
|
+
satisfied:
|
|
28
|
+
- "REQ-F-001" # REQ-IDs confirmed verified in this phase
|
|
29
|
+
unsatisfied:
|
|
30
|
+
- "REQ-F-002" # REQ-IDs that failed verification
|
|
26
31
|
---
|
|
27
32
|
|
|
28
33
|
# Phase Verification: {phase_name}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Project Context
|
|
2
|
+
|
|
3
|
+
> Cross-cutting decisions that ALL phases must honor.
|
|
4
|
+
> Updated via `/pbr:discuss --project`. Auto-synced to CLAUDE.md on write.
|
|
5
|
+
> Phase-level CONTEXT.md (in phase directories) overrides project-level for that phase.
|
|
6
|
+
>
|
|
7
|
+
> PLANNER NOTE: Embed each locked decision directly into the relevant task's action block.
|
|
8
|
+
> Executors NEVER read this file — PLAN.md is self-contained.
|
|
9
|
+
|
|
10
|
+
## Locked Decisions
|
|
11
|
+
|
|
12
|
+
Technology choices, architecture decisions, and constraints that are NON-NEGOTIABLE across ALL phases.
|
|
13
|
+
The planner embeds these into PLAN.md task actions. Executors never read this file directly.
|
|
14
|
+
|
|
15
|
+
| Decision | Rationale | Locked By |
|
|
16
|
+
|----------|-----------|-----------|
|
|
17
|
+
| {e.g., "Use TypeScript strict mode"} | {User preference, team skill} | User |
|
|
18
|
+
| {e.g., "PostgreSQL via Supabase"} | {Existing infrastructure} | User |
|
|
19
|
+
|
|
20
|
+
## User Constraints
|
|
21
|
+
|
|
22
|
+
Budget, timeline, skill level, hosting, team size — factors that shape ALL planning decisions.
|
|
23
|
+
|
|
24
|
+
- {e.g., "Solo developer, no team"}
|
|
25
|
+
- {e.g., "Deploy to Hetzner VPS"}
|
|
26
|
+
- {e.g., "Must work offline"}
|
|
27
|
+
|
|
28
|
+
## Deferred Ideas
|
|
29
|
+
|
|
30
|
+
Ideas explicitly moved to v2 or ruled out. Plans at ANY phase MUST NOT include these.
|
|
31
|
+
|
|
32
|
+
| Idea | Reason Deferred |
|
|
33
|
+
|------|----------------|
|
|
34
|
+
| {feature} | {reason — e.g., "Post-launch priority"} |
|
|
35
|
+
|
|
36
|
+
## Claude's Discretion Areas
|
|
37
|
+
|
|
38
|
+
Areas where planners can make implementation choices without asking the user.
|
|
39
|
+
Document the choice made and rationale when exercised.
|
|
40
|
+
|
|
41
|
+
| Area | Choice Made | Rationale |
|
|
42
|
+
|------|------------|-----------|
|
|
43
|
+
| {e.g., "Logging library"} | {e.g., "pino"} | {e.g., "Lightweight, structured output"} |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pbr",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.60.0",
|
|
4
4
|
"description": "Plan-Build-Run — Structured development workflow for Claude Code. Solves context rot through disciplined subagent delegation, structured planning, atomic execution, and goal-backward verification.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SienkLogic",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: executor
|
|
3
3
|
description: "Executes plan tasks with atomic commits, deviation handling, checkpoint protocols, TDD support, and self-verification."
|
|
4
|
-
model: sonnet
|
|
5
4
|
memory: project
|
|
6
5
|
tools:
|
|
7
6
|
- Read
|
|
@@ -44,6 +43,9 @@ You are **executor**, the code execution agent for Plan-Build-Run. You receive v
|
|
|
44
43
|
a. Read task XML
|
|
45
44
|
b. Execute <action> steps
|
|
46
45
|
c. Run <verify> commands
|
|
46
|
+
- If <verify> contains an <automated> child element, extract and run the command inside it
|
|
47
|
+
- If <verify> is plain text (no <automated> child), run it as before (backward compat)
|
|
48
|
+
- Both forms produce the same result — <automated> is machine-parseable, plain text is human-readable
|
|
47
49
|
d. If verify passes: commit
|
|
48
50
|
e. If verify fails: apply deviation rules
|
|
49
51
|
f. If checkpoint: STOP and return
|
|
@@ -205,6 +207,11 @@ When a task has a checkpoint type, **STOP execution** and return a structured re
|
|
|
205
207
|
| `decision` | Before executing | Decision needed, options, context |
|
|
206
208
|
| `human-action` | Before executing | What user must do, step-by-step |
|
|
207
209
|
|
|
210
|
+
**auto_checkpoints config**: After loading plan frontmatter, read `gates.auto_checkpoints` from config.json (default false):
|
|
211
|
+
- Load with: `node pbr-tools.js config-get gates.auto_checkpoints`
|
|
212
|
+
- When `auto_checkpoints` is true AND task type is `checkpoint:human-verify`: run the automated verify command. If it passes, auto-approve and continue. If it fails, still STOP and return the checkpoint response.
|
|
213
|
+
- `checkpoint:decision` and `checkpoint:human-action` always require human input regardless of `auto_checkpoints`.
|
|
214
|
+
|
|
208
215
|
**Automation-first**: Complete all automatable pre-work before any checkpoint. Only checkpoint for genuinely human-required actions (API keys needing account login, architectural choices, destructive approvals).
|
|
209
216
|
|
|
210
217
|
All responses use: `CHECKPOINT: {TYPE}` header, task info, type-specific fields, completed tasks table, remaining tasks list.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-checker
|
|
3
3
|
description: "Verifies plans will achieve phase goals before execution. Goal-backward analysis of plan quality across 10 dimensions."
|
|
4
|
-
model: sonnet
|
|
5
4
|
memory: none
|
|
6
5
|
tools:
|
|
7
6
|
- Read
|
|
@@ -164,14 +163,16 @@ Plans declare `provides`/`consumes`; all consumed items must have providers.
|
|
|
164
163
|
| Missing provides/consumes for exports | INFO |
|
|
165
164
|
|
|
166
165
|
### D9: Requirement Traceability
|
|
167
|
-
Plans declare `
|
|
166
|
+
Plans declare `implements` with bidirectional coverage. Forward: IDs trace to REQUIREMENTS.md (or ROADMAP.md goals). Backward: every requirement covered by at least one plan.
|
|
167
|
+
|
|
168
|
+
> **Note:** `requirement_ids:` is a deprecated alias for `implements:` — treat as equivalent during transition.
|
|
168
169
|
|
|
169
170
|
| Condition | Severity |
|
|
170
171
|
|-----------|----------|
|
|
171
|
-
|
|
|
172
|
+
| implements: ID references nonexistent requirement | BLOCKER |
|
|
172
173
|
| Requirement not covered by any plan | WARNING |
|
|
173
174
|
| ROADMAP goal not covered (no REQUIREMENTS.md) | WARNING |
|
|
174
|
-
| Plan missing
|
|
175
|
+
| Plan missing implements: entirely | WARNING |
|
|
175
176
|
|
|
176
177
|
### D10: Test Plan Coverage
|
|
177
178
|
Code-producing tasks should include test expectations. Check that tasks creating or modifying source code have corresponding test references in `<files>`, `<action>`, or `<verify>`. Test files should appear in `<files>`, test commands in `<verify>`, and test outcomes in `<done>`.
|