@sienklogic/plan-build-run 2.9.1 → 2.11.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 (128) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/package.json +1 -1
  3. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +42 -0
  4. package/plugins/copilot-pbr/agents/debugger.agent.md +4 -1
  5. package/plugins/copilot-pbr/agents/executor.agent.md +31 -1
  6. package/plugins/copilot-pbr/agents/integration-checker.agent.md +33 -2
  7. package/plugins/copilot-pbr/agents/planner.agent.md +58 -1
  8. package/plugins/copilot-pbr/agents/researcher.agent.md +23 -0
  9. package/plugins/copilot-pbr/agents/synthesizer.agent.md +24 -0
  10. package/plugins/copilot-pbr/agents/verifier.agent.md +35 -1
  11. package/plugins/copilot-pbr/plugin.json +1 -1
  12. package/plugins/copilot-pbr/references/agent-contracts.md +297 -0
  13. package/plugins/copilot-pbr/references/pbr-rules.md +1 -0
  14. package/plugins/copilot-pbr/references/pbr-tools-cli.md +285 -0
  15. package/plugins/copilot-pbr/references/ui-formatting.md +38 -56
  16. package/plugins/copilot-pbr/skills/begin/SKILL.md +30 -7
  17. package/plugins/copilot-pbr/skills/build/SKILL.md +28 -31
  18. package/plugins/copilot-pbr/skills/config/SKILL.md +9 -12
  19. package/plugins/copilot-pbr/skills/continue/SKILL.md +6 -6
  20. package/plugins/copilot-pbr/skills/dashboard/SKILL.md +12 -0
  21. package/plugins/copilot-pbr/skills/debug/SKILL.md +23 -26
  22. package/plugins/copilot-pbr/skills/discuss/SKILL.md +20 -10
  23. package/plugins/copilot-pbr/skills/do/SKILL.md +3 -3
  24. package/plugins/copilot-pbr/skills/explore/SKILL.md +11 -14
  25. package/plugins/copilot-pbr/skills/health/SKILL.md +75 -19
  26. package/plugins/copilot-pbr/skills/help/SKILL.md +6 -6
  27. package/plugins/copilot-pbr/skills/import/SKILL.md +22 -18
  28. package/plugins/copilot-pbr/skills/milestone/SKILL.md +90 -48
  29. package/plugins/copilot-pbr/skills/note/SKILL.md +3 -3
  30. package/plugins/copilot-pbr/skills/pause/SKILL.md +11 -10
  31. package/plugins/copilot-pbr/skills/plan/SKILL.md +22 -9
  32. package/plugins/copilot-pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  33. package/plugins/copilot-pbr/skills/quick/SKILL.md +9 -12
  34. package/plugins/copilot-pbr/skills/resume/SKILL.md +9 -9
  35. package/plugins/copilot-pbr/skills/review/SKILL.md +17 -12
  36. package/plugins/copilot-pbr/skills/scan/SKILL.md +9 -11
  37. package/plugins/copilot-pbr/skills/setup/SKILL.md +54 -8
  38. package/plugins/copilot-pbr/skills/shared/error-reporting.md +2 -1
  39. package/plugins/copilot-pbr/skills/shared/progress-display.md +0 -1
  40. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +10 -6
  41. package/plugins/copilot-pbr/skills/status/SKILL.md +3 -3
  42. package/plugins/copilot-pbr/skills/statusline/SKILL.md +12 -8
  43. package/plugins/copilot-pbr/skills/todo/SKILL.md +51 -28
  44. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  45. package/plugins/cursor-pbr/agents/codebase-mapper.md +42 -0
  46. package/plugins/cursor-pbr/agents/debugger.md +4 -1
  47. package/plugins/cursor-pbr/agents/executor.md +31 -1
  48. package/plugins/cursor-pbr/agents/integration-checker.md +33 -2
  49. package/plugins/cursor-pbr/agents/planner.md +58 -1
  50. package/plugins/cursor-pbr/agents/researcher.md +23 -0
  51. package/plugins/cursor-pbr/agents/synthesizer.md +24 -0
  52. package/plugins/cursor-pbr/agents/verifier.md +35 -1
  53. package/plugins/cursor-pbr/references/agent-contracts.md +297 -0
  54. package/plugins/cursor-pbr/references/pbr-rules.md +1 -0
  55. package/plugins/cursor-pbr/references/pbr-tools-cli.md +285 -0
  56. package/plugins/cursor-pbr/references/ui-formatting.md +38 -56
  57. package/plugins/cursor-pbr/skills/begin/SKILL.md +30 -7
  58. package/plugins/cursor-pbr/skills/build/SKILL.md +28 -31
  59. package/plugins/cursor-pbr/skills/config/SKILL.md +9 -10
  60. package/plugins/cursor-pbr/skills/continue/SKILL.md +6 -6
  61. package/plugins/cursor-pbr/skills/dashboard/SKILL.md +12 -0
  62. package/plugins/cursor-pbr/skills/debug/SKILL.md +23 -23
  63. package/plugins/cursor-pbr/skills/discuss/SKILL.md +20 -10
  64. package/plugins/cursor-pbr/skills/do/SKILL.md +3 -3
  65. package/plugins/cursor-pbr/skills/explore/SKILL.md +11 -12
  66. package/plugins/cursor-pbr/skills/health/SKILL.md +75 -19
  67. package/plugins/cursor-pbr/skills/help/SKILL.md +6 -6
  68. package/plugins/cursor-pbr/skills/import/SKILL.md +22 -16
  69. package/plugins/cursor-pbr/skills/milestone/SKILL.md +90 -48
  70. package/plugins/cursor-pbr/skills/note/SKILL.md +3 -3
  71. package/plugins/cursor-pbr/skills/pause/SKILL.md +11 -9
  72. package/plugins/cursor-pbr/skills/plan/SKILL.md +22 -9
  73. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  74. package/plugins/cursor-pbr/skills/quick/SKILL.md +9 -12
  75. package/plugins/cursor-pbr/skills/resume/SKILL.md +9 -9
  76. package/plugins/cursor-pbr/skills/review/SKILL.md +17 -12
  77. package/plugins/cursor-pbr/skills/scan/SKILL.md +9 -10
  78. package/plugins/cursor-pbr/skills/setup/SKILL.md +54 -8
  79. package/plugins/cursor-pbr/skills/shared/error-reporting.md +2 -1
  80. package/plugins/cursor-pbr/skills/shared/progress-display.md +0 -1
  81. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +10 -6
  82. package/plugins/cursor-pbr/skills/status/SKILL.md +3 -3
  83. package/plugins/cursor-pbr/skills/statusline/SKILL.md +12 -8
  84. package/plugins/cursor-pbr/skills/todo/SKILL.md +51 -28
  85. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  86. package/plugins/pbr/agents/codebase-mapper.md +42 -0
  87. package/plugins/pbr/agents/debugger.md +4 -1
  88. package/plugins/pbr/agents/executor.md +31 -1
  89. package/plugins/pbr/agents/integration-checker.md +34 -2
  90. package/plugins/pbr/agents/planner.md +58 -1
  91. package/plugins/pbr/agents/researcher.md +23 -0
  92. package/plugins/pbr/agents/synthesizer.md +24 -0
  93. package/plugins/pbr/agents/verifier.md +36 -1
  94. package/plugins/pbr/references/agent-contracts.md +297 -0
  95. package/plugins/pbr/references/pbr-rules.md +1 -0
  96. package/plugins/pbr/references/pbr-tools-cli.md +285 -0
  97. package/plugins/pbr/references/ui-formatting.md +37 -54
  98. package/plugins/pbr/scripts/check-skill-workflow.js +11 -0
  99. package/plugins/pbr/scripts/check-state-sync.js +58 -0
  100. package/plugins/pbr/scripts/check-subagent-output.js +43 -4
  101. package/plugins/pbr/scripts/validate-task.js +69 -17
  102. package/plugins/pbr/skills/begin/SKILL.md +36 -11
  103. package/plugins/pbr/skills/build/SKILL.md +37 -25
  104. package/plugins/pbr/skills/config/SKILL.md +12 -10
  105. package/plugins/pbr/skills/continue/SKILL.md +11 -9
  106. package/plugins/pbr/skills/dashboard/SKILL.md +12 -0
  107. package/plugins/pbr/skills/debug/SKILL.md +29 -23
  108. package/plugins/pbr/skills/discuss/SKILL.md +20 -10
  109. package/plugins/pbr/skills/do/SKILL.md +3 -3
  110. package/plugins/pbr/skills/explore/SKILL.md +14 -12
  111. package/plugins/pbr/skills/health/SKILL.md +76 -20
  112. package/plugins/pbr/skills/help/SKILL.md +8 -6
  113. package/plugins/pbr/skills/import/SKILL.md +25 -16
  114. package/plugins/pbr/skills/milestone/SKILL.md +88 -45
  115. package/plugins/pbr/skills/note/SKILL.md +3 -3
  116. package/plugins/pbr/skills/pause/SKILL.md +13 -9
  117. package/plugins/pbr/skills/plan/SKILL.md +28 -13
  118. package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  119. package/plugins/pbr/skills/quick/SKILL.md +12 -10
  120. package/plugins/pbr/skills/resume/SKILL.md +11 -9
  121. package/plugins/pbr/skills/review/SKILL.md +35 -24
  122. package/plugins/pbr/skills/scan/SKILL.md +12 -10
  123. package/plugins/pbr/skills/setup/SKILL.md +53 -7
  124. package/plugins/pbr/skills/shared/error-reporting.md +2 -0
  125. package/plugins/pbr/skills/shared/universal-anti-patterns.md +10 -6
  126. package/plugins/pbr/skills/status/SKILL.md +8 -6
  127. package/plugins/pbr/skills/statusline/SKILL.md +12 -8
  128. package/plugins/pbr/skills/todo/SKILL.md +51 -28
@@ -23,9 +23,9 @@ Additionally for this skill:
23
23
  **Before ANY tool calls**, display this banner:
24
24
 
25
25
  ```
26
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27
- PLAN-BUILD-RUN ► REVIEWING PHASE {N}
28
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
+ ╔══════════════════════════════════════════════════════════════╗
27
+ PLAN-BUILD-RUN ► REVIEWING PHASE {N}
28
+ ╚══════════════════════════════════════════════════════════════╝
29
29
  ```
30
30
 
31
31
  Where `{N}` is the phase number from `$ARGUMENTS`. Then proceed to Step 1.
@@ -66,6 +66,7 @@ Execute these steps in order.
66
66
 
67
67
  1. Parse `$ARGUMENTS` for phase number and `--auto-fix` flag
68
68
  2. Read `.planning/config.json`
69
+ **CRITICAL: Write .active-skill NOW.** Write the text "review" to `.planning/.active-skill` using the Write tool.
69
70
  3. Resolve depth profile: run `node ${CLAUDE_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.
70
71
  4. Validate:
71
72
  - Phase directory exists at `.planning/phases/{NN}-{slug}/`
@@ -574,6 +575,10 @@ Ask user: "Would you like to proceed with gap-closure plans without root cause a
574
575
 
575
576
  ---
576
577
 
578
+ ## Cleanup
579
+
580
+ Delete `.planning/.active-skill` if it exists. This must happen on all paths (success, partial, and failure) before reporting results.
581
+
577
582
  ## Completion
578
583
 
579
584
  After review completes, always present a clear next action:
@@ -582,9 +587,9 @@ After review completes, always present a clear next action:
582
587
 
583
588
  Display the "Phase Complete" banner inline:
584
589
  ```
585
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
586
- PLAN-BUILD-RUN ► PHASE {N} COMPLETE ✓
587
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
590
+ ╔══════════════════════════════════════════════════════════════╗
591
+ PLAN-BUILD-RUN ► PHASE {N} COMPLETE ✓
592
+ ╚══════════════════════════════════════════════════════════════╝
588
593
 
589
594
  **Phase {N}: {Name}**
590
595
 
@@ -594,9 +599,11 @@ Goal verified ✓
594
599
 
595
600
  Then the branded "Next Up" block:
596
601
  ```
597
- ───────────────────────────────────────────────────────────────
598
602
 
599
- ## ▶ Next Up
603
+
604
+ ╔══════════════════════════════════════════════════════════════╗
605
+ ║ ▶ NEXT UP ║
606
+ ╚══════════════════════════════════════════════════════════════╝
600
607
 
601
608
  **Phase {N+1}: {Name}** — {Goal from ROADMAP.md}
602
609
 
@@ -604,26 +611,28 @@ Then the branded "Next Up" block:
604
611
 
605
612
  <sub>`/clear` first → fresh context window</sub>
606
613
 
607
- ───────────────────────────────────────────────────────────────
614
+
608
615
 
609
616
  **Also available:**
610
617
  - `/pbr:discuss {N+1}` — talk through details before planning
611
618
  - `/pbr:status` — see full project status
612
619
 
613
- ───────────────────────────────────────────────────────────────
620
+
614
621
  ```
615
622
 
616
623
  **If gaps remain:**
617
624
  ```
618
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
619
- PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND ⚠
620
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
625
+ ╔══════════════════════════════════════════════════════════════╗
626
+ PLAN-BUILD-RUN ► PHASE {N} GAPS FOUND ⚠
627
+ ╚══════════════════════════════════════════════════════════════╝
621
628
 
622
629
  **Phase {N}: {name}** — {count} gaps remaining
623
630
 
624
- ───────────────────────────────────────────────────────────────
625
631
 
626
- ## ▶ Next Up
632
+
633
+ ╔══════════════════════════════════════════════════════════════╗
634
+ ║ ▶ NEXT UP ║
635
+ ╚══════════════════════════════════════════════════════════════╝
627
636
 
628
637
  **Fix gaps** — diagnose and create fix plans
629
638
 
@@ -631,22 +640,22 @@ Then the branded "Next Up" block:
631
640
 
632
641
  <sub>`/clear` first → fresh context window</sub>
633
642
 
634
- ───────────────────────────────────────────────────────────────
643
+
635
644
 
636
645
  **Also available:**
637
646
  - `/pbr:plan {N} --gaps` — create fix plans manually
638
647
  - Fix manually, then `/pbr:review {N}`
639
648
 
640
- ───────────────────────────────────────────────────────────────
649
+
641
650
  ```
642
651
 
643
652
  **If final phase:**
644
653
 
645
654
  Display the "Milestone Complete" banner inline:
646
655
  ```
647
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
648
- PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
649
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
656
+ ╔══════════════════════════════════════════════════════════════╗
657
+ PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
658
+ ╚══════════════════════════════════════════════════════════════╝
650
659
 
651
660
  {N} phases completed
652
661
  All phase goals verified ✓
@@ -654,9 +663,11 @@ All phase goals verified ✓
654
663
 
655
664
  Then:
656
665
  ```
657
- ───────────────────────────────────────────────────────────────
658
666
 
659
- ## ▶ Next Up
667
+
668
+ ╔══════════════════════════════════════════════════════════════╗
669
+ ║ ▶ NEXT UP ║
670
+ ╚══════════════════════════════════════════════════════════════╝
660
671
 
661
672
  **Audit milestone** — verify cross-phase integration
662
673
 
@@ -664,14 +675,14 @@ Then:
664
675
 
665
676
  <sub>`/clear` first → fresh context window</sub>
666
677
 
667
- ───────────────────────────────────────────────────────────────
678
+
668
679
 
669
680
  **Also available:**
670
681
  - `/pbr:milestone complete` — archive milestone after audit passes
671
682
  - `/pbr:milestone new` — start planning next features
672
683
  - `/pbr:status` — see final project status
673
684
 
674
- ───────────────────────────────────────────────────────────────
685
+
675
686
  ```
676
687
 
677
688
  ---
@@ -11,9 +11,9 @@ allowed-tools: Read, Write, Bash, Glob, Grep, Task, AskUserQuestion
11
11
  **Before ANY tool calls**, display this banner:
12
12
 
13
13
  ```
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
- PLAN-BUILD-RUN ► SCANNING CODEBASE
16
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ╔══════════════════════════════════════════════════════════════╗
15
+ PLAN-BUILD-RUN ► SCANNING CODEBASE
16
+ ╚══════════════════════════════════════════════════════════════╝
17
17
  ```
18
18
 
19
19
  Then proceed to Step 1.
@@ -180,9 +180,9 @@ Agent that failed: {focus_area} mapper
180
180
  Read key findings from each file (frontmatter or first section) and display using the branded stage banner from `references/ui-formatting.md`:
181
181
 
182
182
  ```
183
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
184
- PLAN-BUILD-RUN ► SCAN COMPLETE ✓
185
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
183
+ ╔══════════════════════════════════════════════════════════════╗
184
+ PLAN-BUILD-RUN ► SCAN COMPLETE ✓
185
+ ╚══════════════════════════════════════════════════════════════╝
186
186
 
187
187
  Project: {type} ({scale})
188
188
  Stack: {primary language} + {framework}
@@ -209,9 +209,11 @@ Top concerns:
209
209
 
210
210
  Then use the "Next Up" routing block:
211
211
  ```
212
- ───────────────────────────────────────────────────────────────
213
212
 
214
- ## ▶ Next Up
213
+
214
+ ╔══════════════════════════════════════════════════════════════╗
215
+ ║ ▶ NEXT UP ║
216
+ ╚══════════════════════════════════════════════════════════════╝
215
217
 
216
218
  **Start a project** — use the scan results to plan your work
217
219
 
@@ -219,13 +221,13 @@ Then use the "Next Up" routing block:
219
221
 
220
222
  <sub>`/clear` first → fresh context window</sub>
221
223
 
222
- ───────────────────────────────────────────────────────────────
224
+
223
225
 
224
226
  **Also available:**
225
227
  - `/pbr:milestone new` — create a milestone to address concerns
226
228
  - `/pbr:status` — see project status
227
229
 
228
- ───────────────────────────────────────────────────────────────
230
+
229
231
  ```
230
232
 
231
233
  ### Step 7: Git Integration
@@ -11,9 +11,9 @@ allowed-tools: Read, Write, Bash, Glob, AskUserQuestion
11
11
  **Before ANY tool calls**, display this banner:
12
12
 
13
13
  ```
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
- PLAN-BUILD-RUN ► SETUP
16
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ╔══════════════════════════════════════════════════════════════╗
15
+ PLAN-BUILD-RUN ► SETUP
16
+ ╚══════════════════════════════════════════════════════════════╝
17
17
  ```
18
18
 
19
19
  Then proceed to Step 1.
@@ -24,14 +24,29 @@ You are running the **setup** skill. This is an interactive onboarding wizard th
24
24
 
25
25
  ---
26
26
 
27
- ## Step 1: Detect Project State
27
+ ## Step 1: Detect Project State — Idempotency Guard
28
28
 
29
29
  Check if `.planning/` directory exists in the current working directory.
30
30
 
31
31
  **If `.planning/` exists**:
32
- - Read `.planning/config.json` to check current settings
33
- - Tell the user: "Existing Plan-Build-Run project detected. This wizard will review your configuration."
34
- - Skip to Step 3 (model selection)
32
+ - Check for existing core files: `STATE.md`, `ROADMAP.md`, `config.json`
33
+ - If ANY of these exist, present a checkpoint:
34
+
35
+ Use AskUserQuestion:
36
+ question: "Existing project detected with {list of found files}. How should we proceed?"
37
+ header: "Setup"
38
+ options:
39
+ - label: "Resume" description: "Keep existing .planning/ and review configuration (recommended)"
40
+ - label: "Reset" description: "Archive current .planning/ to .planning.bak/ and start fresh"
41
+ - label: "Abort" description: "Cancel setup — keep everything as-is"
42
+
43
+ - If "Resume": Tell the user: "Keeping existing project. Reviewing configuration." Skip to Step 3 (model selection)
44
+ - If "Reset": Run `mv .planning .planning.bak` (creating a backup), then proceed with fresh setup below
45
+ - If "Abort": Display "Setup cancelled. Run `/pbr:status` to see current project state." and stop
46
+
47
+ - If `.planning/` exists but has NONE of the core files (empty or only has subdirs):
48
+ - Tell the user: "Found empty .planning/ directory. Proceeding with initialization."
49
+ - Continue to fresh setup below
35
50
 
36
51
  **If `.planning/` does NOT exist**:
37
52
  - Ask the user:
@@ -51,10 +66,14 @@ If "No", display: "Run `/pbr:begin` when you're ready to start a project. It inc
51
66
 
52
67
  If "Yes", create the minimal `.planning/` structure:
53
68
 
69
+ **CRITICAL: Create .planning/ directory structure NOW. Do NOT skip this step.**
70
+
54
71
  ```bash
55
72
  mkdir -p .planning/phases .planning/todos/pending .planning/todos/done .planning/logs .planning/research
56
73
  ```
57
74
 
75
+ **CRITICAL: Write .planning/config.json NOW. Do NOT skip this step.**
76
+
58
77
  Create `.planning/config.json` with defaults:
59
78
  ```json
60
79
  {
@@ -123,6 +142,8 @@ Create `.planning/config.json` with defaults:
123
142
  }
124
143
  ```
125
144
 
145
+ **CRITICAL: Write .planning/STATE.md NOW. Do NOT skip this step.**
146
+
126
147
  Create `.planning/STATE.md`:
127
148
  ```markdown
128
149
  ---
@@ -218,8 +239,33 @@ Apply selections:
218
239
 
219
240
  ---
220
241
 
242
+ ## Step 4b: CLAUDE.md Integration
243
+
244
+ Check if a `CLAUDE.md` file exists in the project root.
245
+
246
+ **If it exists**: Read it. If it does NOT already contain a "Plan-Build-Run" section, append the block below.
247
+ **If it does NOT exist**: Create `CLAUDE.md` with the block below.
248
+
249
+ Append/create this content:
250
+
251
+ ```markdown
252
+ ## Plan-Build-Run
253
+
254
+ This project uses [Plan-Build-Run](https://github.com/SienkLogic/plan-build-run) for structured development.
255
+
256
+ - Project state: `.planning/STATE.md` (source of truth for current phase and progress)
257
+ - Configuration: `.planning/config.json`
258
+ - Run `/pbr:status` to see current project state and suggested next action.
259
+
260
+ **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.
261
+ ```
262
+
263
+ ---
264
+
221
265
  ## Step 5: Verification
222
266
 
267
+ **CRITICAL: Run validation checks NOW to confirm setup succeeded. Do NOT skip this step.**
268
+
223
269
  Run a quick health check:
224
270
 
225
271
  1. Verify `.planning/config.json` is valid JSON
@@ -77,3 +77,5 @@ Blocked: {short reason}
77
77
  ```
78
78
 
79
79
  This format is used by validate-commit.js and check-dangerous-commands.js. The `decision: "block"` and `reason` fields in the JSON output follow this pattern.
80
+
81
+ Block reasons should always include a "To fix:" line with actionable guidance so the user or agent knows how to resolve the block.
@@ -23,11 +23,15 @@ These rules prevent context rot -- quality degradation as the context window fil
23
23
  8. **Never** read `.planning/logs/` files -- only the health skill reads these.
24
24
  9. **Do not** re-read full file contents when frontmatter is sufficient -- frontmatter contains status, key_files, commits, and provides fields.
25
25
 
26
+ ## Task/Subagent Rules (apply to every skill)
27
+
28
+ 10. **Never** invoke `Skill()` inside a `Task()` subagent -- the Skill tool is not available in subagent contexts. Subagents spawned by `Task()` cannot resolve `/pbr:*` skill prefixes, so `Skill({ skill: "pbr:plan" })` will silently fail. Instead, chain skills at the orchestrator level (return control to the orchestrator, then call `Skill()` from there). For subagent work, use `subagent_type: "pbr:{agent}"` which auto-loads agent definitions.
29
+
26
30
  ## Behavioral Rules (apply to every skill)
27
31
 
28
- 10. **Do not** re-litigate decisions that are already locked in CONTEXT.md -- respect locked decisions unconditionally.
29
- 11. **Do not** create artifacts the user did not approve -- always confirm before writing new planning documents.
30
- 12. **Do not** modify files outside the skill's stated scope -- check the "Files Created/Modified" table in each skill.
31
- 13. **Do not** suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
32
- 14. **Do not** use `git add .` or `git add -A` -- stage specific files only.
33
- 15. **Do not** include sensitive information (API keys, passwords, tokens) in planning documents or commits.
32
+ 11. **Do not** re-litigate decisions that are already locked in CONTEXT.md -- respect locked decisions unconditionally.
33
+ 12. **Do not** create artifacts the user did not approve -- always confirm before writing new planning documents.
34
+ 13. **Do not** modify files outside the skill's stated scope -- check the "Files Created/Modified" table in each skill.
35
+ 14. **Do not** suggest multiple next actions without clear priority -- one primary suggestion, alternatives listed secondary.
36
+ 15. **Do not** use `git add .` or `git add -A` -- stage specific files only.
37
+ 16. **Do not** include sensitive information (API keys, passwords, tokens) in planning documents or commits.
@@ -11,9 +11,9 @@ allowed-tools: Read, Glob, Grep, AskUserQuestion
11
11
  **Before ANY tool calls**, display this banner:
12
12
 
13
13
  ```
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
- PLAN-BUILD-RUN ► PROJECT STATUS
16
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14
+ ╔══════════════════════════════════════════════════════════════╗
15
+ PLAN-BUILD-RUN ► PROJECT STATUS
16
+ ╚══════════════════════════════════════════════════════════════╝
17
17
  ```
18
18
 
19
19
  Then proceed to Step 1.
@@ -268,9 +268,11 @@ Based on the project state, suggest the single most logical next action:
268
268
  **If only one reasonable next action exists**, present it with branded routing:
269
269
 
270
270
  ```
271
- ───────────────────────────────────────────────────────────────
272
271
 
273
- ## ▶ Next Up
272
+
273
+ ╔══════════════════════════════════════════════════════════════╗
274
+ ║ ▶ NEXT UP ║
275
+ ╚══════════════════════════════════════════════════════════════╝
274
276
 
275
277
  **{brief explanation}**
276
278
 
@@ -278,7 +280,7 @@ Based on the project state, suggest the single most logical next action:
278
280
 
279
281
  <sub>`/clear` first → fresh context window</sub>
280
282
 
281
- ───────────────────────────────────────────────────────────────
283
+
282
284
  ```
283
285
 
284
286
  **If multiple reasonable next actions exist** (2-3 alternatives), use the **action-routing** pattern (see `skills/shared/gate-prompts.md`):
@@ -12,9 +12,9 @@ argument-hint: "[install | uninstall | preview]"
12
12
  **Before ANY tool calls**, display this banner:
13
13
 
14
14
  ```
15
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
- PLAN-BUILD-RUN ► STATUS LINE
17
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ╔══════════════════════════════════════════════════════════════╗
16
+ PLAN-BUILD-RUN ► STATUS LINE
17
+ ╚══════════════════════════════════════════════════════════════╝
18
18
  ```
19
19
 
20
20
  Then proceed to Step 1.
@@ -78,9 +78,12 @@ If "Install":
78
78
 
79
79
  **CRITICAL: Use Read tool to read the file, then Write to update it. Do NOT use sed or other text manipulation on JSON files.**
80
80
 
81
+ **CRITICAL: Back up settings.json NOW.** Write the original content to `~/.claude/settings.json.bak` before making any changes.
82
+
81
83
  1. Read `~/.claude/settings.json`
82
- 2. Parse the JSON
83
- 3. Set `statusLine` to:
84
+ 2. Write the original content to `~/.claude/settings.json.bak`
85
+ 3. Parse the JSON
86
+ 4. Set `statusLine` to:
84
87
  ```json
85
88
  {
86
89
  "type": "command",
@@ -88,7 +91,7 @@ If "Install":
88
91
  }
89
92
  ```
90
93
  Where `SCRIPT_PATH` is the resolved absolute path from Step 1. Use forward slashes even on Windows.
91
- 4. Write the updated JSON back (preserve all other settings, use 2-space indentation)
94
+ 5. Write the updated JSON back (preserve all other settings, use 2-space indentation)
92
95
 
93
96
  ### Step 4: Verify and confirm
94
97
 
@@ -115,8 +118,9 @@ Customize per-project via .planning/config.json:
115
118
 
116
119
  1. Read `~/.claude/settings.json`
117
120
  2. If no `statusLine` key: inform user "No status line configured." and stop
118
- 3. Remove the `statusLine` key from the JSON
119
- 4. Write the updated file
121
+ 3. **CRITICAL: Back up settings.json NOW.** Write the original content to `~/.claude/settings.json.bak` before making any changes.
122
+ 4. Remove the `statusLine` key from the JSON
123
+ 5. Write the updated file
120
124
  5. Display: `✓ PBR status line removed. Restart Claude Code to take effect.`
121
125
 
122
126
  ---
@@ -12,9 +12,9 @@ argument-hint: "add <description> | list [theme] | done <NNN> | work <NNN>"
12
12
  **Before ANY tool calls**, display this banner:
13
13
 
14
14
  ```
15
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16
- PLAN-BUILD-RUN ► TODO
17
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ╔══════════════════════════════════════════════════════════════╗
16
+ PLAN-BUILD-RUN ► TODO
17
+ ╚══════════════════════════════════════════════════════════════╝
18
18
  ```
19
19
 
20
20
  Then proceed to Step 1.
@@ -76,15 +76,17 @@ theme: {inferred-theme}
76
76
 
77
77
  8. Confirm with branded output:
78
78
  ```
79
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
80
- PLAN-BUILD-RUN ► TODO ADDED ✓
81
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
79
+ ╔══════════════════════════════════════════════════════════════╗
80
+ PLAN-BUILD-RUN ► TODO ADDED ✓
81
+ ╚══════════════════════════════════════════════════════════════╝
82
82
 
83
83
  **Todo {NNN}:** {description}
84
84
 
85
- ───────────────────────────────────────────────────────────────
86
85
 
87
- ## ▶ Next Up
86
+
87
+ ╔══════════════════════════════════════════════════════════════╗
88
+ ║ ▶ NEXT UP ║
89
+ ╚══════════════════════════════════════════════════════════════╝
88
90
 
89
91
  **Work on it now** or see your task list
90
92
 
@@ -92,13 +94,13 @@ theme: {inferred-theme}
92
94
 
93
95
  <sub>`/clear` first → fresh context window</sub>
94
96
 
95
- ───────────────────────────────────────────────────────────────
97
+
96
98
 
97
99
  **Also available:**
98
100
  - `/pbr:todo list` — see all pending todos
99
101
  - `/pbr:status` — see project status
100
102
 
101
- ───────────────────────────────────────────────────────────────
103
+
102
104
  ```
103
105
 
104
106
  ### `list [theme]`
@@ -118,21 +120,23 @@ Pending Todos:
118
120
 
119
121
  5. Offer actions with branded routing:
120
122
  ```
121
- ───────────────────────────────────────────────────────────────
122
123
 
123
- ## ▶ Next Up
124
+
125
+ ╔══════════════════════════════════════════════════════════════╗
126
+ ║ ▶ NEXT UP ║
127
+ ╚══════════════════════════════════════════════════════════════╝
124
128
 
125
129
  **Pick a todo** — mark one done or start working
126
130
 
127
131
  `/pbr:todo work <NNN>` — start working on a todo
128
132
  `/pbr:todo done <NNN>` — mark a todo as complete
129
133
 
130
- ───────────────────────────────────────────────────────────────
134
+
131
135
 
132
136
  **Also available:**
133
137
  - `/pbr:status` — see project status
134
138
 
135
- ───────────────────────────────────────────────────────────────
139
+
136
140
  ```
137
141
 
138
142
  ### `done <NNN>`
@@ -151,20 +155,37 @@ Todo {NNN} not found in pending todos.
151
155
  3. Ensure `.planning/todos/done/` directory exists (create if needed)
152
156
  4. Read the pending file content
153
157
  5. Update frontmatter in the content: set `status: done` and add `completed: {YYYY-MM-DD}`
158
+
159
+ **CRITICAL: Write to done/ FIRST, verify it exists, THEN delete from pending/. Do NOT delete pending before confirming done/ write succeeded.**
160
+
154
161
  6. Write the updated content to `.planning/todos/done/{NNN}-{slug}.md`
155
- 7. Delete the original file from `.planning/todos/pending/` (use `rm` via Bash)
162
+ 7. Verify the done/ file was written successfully: check that `.planning/todos/done/{NNN}-{slug}.md` exists and has content (use `ls` or Glob)
163
+ - If the done/ write failed, abort and display:
164
+ ```
165
+ ╔══════════════════════════════════════════════════════════════╗
166
+ ║ ERROR ║
167
+ ╚══════════════════════════════════════════════════════════════╝
168
+
169
+ Failed to write to done/. Pending file preserved.
170
+
171
+ **To fix:** Check that `.planning/todos/done/` exists and is writable.
172
+ ```
173
+ Do NOT proceed to delete the pending file.
174
+ 8. Only THEN delete the original file from `.planning/todos/pending/` (use `rm` via Bash)
156
175
  8. Update STATE.md
157
176
  9. Confirm with branded output:
158
177
  ```
159
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
- PLAN-BUILD-RUN ► TODO COMPLETED ✓
161
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
178
+ ╔══════════════════════════════════════════════════════════════╗
179
+ PLAN-BUILD-RUN ► TODO COMPLETED ✓
180
+ ╚══════════════════════════════════════════════════════════════╝
162
181
 
163
182
  **Todo {NNN}:** {title}
164
183
 
165
- ───────────────────────────────────────────────────────────────
166
184
 
167
- ## ▶ Next Up
185
+
186
+ ╔══════════════════════════════════════════════════════════════╗
187
+ ║ ▶ NEXT UP ║
188
+ ╚══════════════════════════════════════════════════════════════╝
168
189
 
169
190
  **See remaining tasks**
170
191
 
@@ -172,13 +193,13 @@ Todo {NNN} not found in pending todos.
172
193
 
173
194
  <sub>`/clear` first → fresh context window</sub>
174
195
 
175
- ───────────────────────────────────────────────────────────────
196
+
176
197
 
177
198
  **Also available:**
178
199
  - `/pbr:continue` — execute next logical step
179
200
  - `/pbr:status` — see project status
180
201
 
181
- ───────────────────────────────────────────────────────────────
202
+
182
203
  ```
183
204
 
184
205
  ### `work <NNN>`
@@ -210,9 +231,9 @@ Which approach?
210
231
 
211
232
  6. Display branded output:
212
233
  ```
213
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
214
- PLAN-BUILD-RUN ► WORKING ON TODO {NNN}
215
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
234
+ ╔══════════════════════════════════════════════════════════════╗
235
+ PLAN-BUILD-RUN ► WORKING ON TODO {NNN}
236
+ ╚══════════════════════════════════════════════════════════════╝
216
237
 
217
238
  **Todo {NNN}:** {title}
218
239
  **Routing to:** /pbr:{chosen-skill}
@@ -232,15 +253,17 @@ For `/pbr:plan`, if no phase exists for this work yet, suggest the user run `/pb
232
253
  8. When the skill completes, remind the user:
233
254
 
234
255
  ```
235
- ───────────────────────────────────────────────────────────────
236
256
 
237
- ## ▶ Next Up
257
+
258
+ ╔══════════════════════════════════════════════════════════════╗
259
+ ║ ▶ NEXT UP ║
260
+ ╚══════════════════════════════════════════════════════════════╝
238
261
 
239
262
  **Mark this todo as done if the work is complete**
240
263
 
241
264
  `/pbr:todo done {NNN}`
242
265
 
243
- ───────────────────────────────────────────────────────────────
266
+
244
267
  ```
245
268
 
246
269
  ### No arguments