@sienklogic/plan-build-run 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/CLAUDE.md +149 -0
  3. package/LICENSE +21 -0
  4. package/README.md +247 -0
  5. package/dashboard/bin/cli.js +25 -0
  6. package/dashboard/package.json +34 -0
  7. package/dashboard/public/.gitkeep +0 -0
  8. package/dashboard/public/css/layout.css +406 -0
  9. package/dashboard/public/css/status-colors.css +98 -0
  10. package/dashboard/public/js/htmx-title.js +5 -0
  11. package/dashboard/public/js/sidebar-toggle.js +20 -0
  12. package/dashboard/src/app.js +78 -0
  13. package/dashboard/src/middleware/errorHandler.js +52 -0
  14. package/dashboard/src/middleware/notFoundHandler.js +9 -0
  15. package/dashboard/src/repositories/planning.repository.js +128 -0
  16. package/dashboard/src/routes/events.routes.js +40 -0
  17. package/dashboard/src/routes/index.routes.js +31 -0
  18. package/dashboard/src/routes/pages.routes.js +195 -0
  19. package/dashboard/src/server.js +42 -0
  20. package/dashboard/src/services/dashboard.service.js +222 -0
  21. package/dashboard/src/services/phase.service.js +167 -0
  22. package/dashboard/src/services/project.service.js +57 -0
  23. package/dashboard/src/services/roadmap.service.js +171 -0
  24. package/dashboard/src/services/sse.service.js +58 -0
  25. package/dashboard/src/services/todo.service.js +254 -0
  26. package/dashboard/src/services/watcher.service.js +48 -0
  27. package/dashboard/src/views/coming-soon.ejs +11 -0
  28. package/dashboard/src/views/error.ejs +13 -0
  29. package/dashboard/src/views/index.ejs +5 -0
  30. package/dashboard/src/views/layout.ejs +1 -0
  31. package/dashboard/src/views/partials/dashboard-content.ejs +77 -0
  32. package/dashboard/src/views/partials/footer.ejs +3 -0
  33. package/dashboard/src/views/partials/head.ejs +21 -0
  34. package/dashboard/src/views/partials/header.ejs +12 -0
  35. package/dashboard/src/views/partials/layout-bottom.ejs +15 -0
  36. package/dashboard/src/views/partials/layout-top.ejs +8 -0
  37. package/dashboard/src/views/partials/phase-content.ejs +181 -0
  38. package/dashboard/src/views/partials/phases-content.ejs +117 -0
  39. package/dashboard/src/views/partials/roadmap-content.ejs +142 -0
  40. package/dashboard/src/views/partials/sidebar.ejs +38 -0
  41. package/dashboard/src/views/partials/todo-create-content.ejs +53 -0
  42. package/dashboard/src/views/partials/todo-detail-content.ejs +38 -0
  43. package/dashboard/src/views/partials/todos-content.ejs +53 -0
  44. package/dashboard/src/views/phase-detail.ejs +5 -0
  45. package/dashboard/src/views/phases.ejs +5 -0
  46. package/dashboard/src/views/roadmap.ejs +5 -0
  47. package/dashboard/src/views/todo-create.ejs +5 -0
  48. package/dashboard/src/views/todo-detail.ejs +5 -0
  49. package/dashboard/src/views/todos.ejs +5 -0
  50. package/package.json +57 -0
  51. package/plugins/pbr/.claude-plugin/plugin.json +13 -0
  52. package/plugins/pbr/UI-CONSISTENCY-GAPS.md +61 -0
  53. package/plugins/pbr/agents/codebase-mapper.md +271 -0
  54. package/plugins/pbr/agents/debugger.md +281 -0
  55. package/plugins/pbr/agents/executor.md +407 -0
  56. package/plugins/pbr/agents/general.md +164 -0
  57. package/plugins/pbr/agents/integration-checker.md +141 -0
  58. package/plugins/pbr/agents/plan-checker.md +280 -0
  59. package/plugins/pbr/agents/planner.md +358 -0
  60. package/plugins/pbr/agents/researcher.md +363 -0
  61. package/plugins/pbr/agents/synthesizer.md +230 -0
  62. package/plugins/pbr/agents/verifier.md +454 -0
  63. package/plugins/pbr/commands/begin.md +5 -0
  64. package/plugins/pbr/commands/build.md +5 -0
  65. package/plugins/pbr/commands/config.md +5 -0
  66. package/plugins/pbr/commands/continue.md +5 -0
  67. package/plugins/pbr/commands/debug.md +5 -0
  68. package/plugins/pbr/commands/discuss.md +5 -0
  69. package/plugins/pbr/commands/explore.md +5 -0
  70. package/plugins/pbr/commands/health.md +5 -0
  71. package/plugins/pbr/commands/help.md +5 -0
  72. package/plugins/pbr/commands/import.md +5 -0
  73. package/plugins/pbr/commands/milestone.md +5 -0
  74. package/plugins/pbr/commands/note.md +5 -0
  75. package/plugins/pbr/commands/pause.md +5 -0
  76. package/plugins/pbr/commands/plan.md +5 -0
  77. package/plugins/pbr/commands/quick.md +5 -0
  78. package/plugins/pbr/commands/resume.md +5 -0
  79. package/plugins/pbr/commands/review.md +5 -0
  80. package/plugins/pbr/commands/scan.md +5 -0
  81. package/plugins/pbr/commands/setup.md +5 -0
  82. package/plugins/pbr/commands/status.md +5 -0
  83. package/plugins/pbr/commands/todo.md +5 -0
  84. package/plugins/pbr/contexts/dev.md +27 -0
  85. package/plugins/pbr/contexts/research.md +28 -0
  86. package/plugins/pbr/contexts/review.md +36 -0
  87. package/plugins/pbr/hooks/hooks.json +183 -0
  88. package/plugins/pbr/references/agent-anti-patterns.md +24 -0
  89. package/plugins/pbr/references/agent-interactions.md +134 -0
  90. package/plugins/pbr/references/agent-teams.md +54 -0
  91. package/plugins/pbr/references/checkpoints.md +157 -0
  92. package/plugins/pbr/references/common-bug-patterns.md +13 -0
  93. package/plugins/pbr/references/continuation-format.md +212 -0
  94. package/plugins/pbr/references/deviation-rules.md +112 -0
  95. package/plugins/pbr/references/git-integration.md +226 -0
  96. package/plugins/pbr/references/integration-patterns.md +117 -0
  97. package/plugins/pbr/references/model-profiles.md +99 -0
  98. package/plugins/pbr/references/model-selection.md +31 -0
  99. package/plugins/pbr/references/pbr-rules.md +193 -0
  100. package/plugins/pbr/references/plan-authoring.md +181 -0
  101. package/plugins/pbr/references/plan-format.md +283 -0
  102. package/plugins/pbr/references/planning-config.md +213 -0
  103. package/plugins/pbr/references/questioning.md +214 -0
  104. package/plugins/pbr/references/reading-verification.md +127 -0
  105. package/plugins/pbr/references/stub-patterns.md +160 -0
  106. package/plugins/pbr/references/subagent-coordination.md +119 -0
  107. package/plugins/pbr/references/ui-formatting.md +399 -0
  108. package/plugins/pbr/references/verification-patterns.md +198 -0
  109. package/plugins/pbr/references/wave-execution.md +95 -0
  110. package/plugins/pbr/scripts/auto-continue.js +80 -0
  111. package/plugins/pbr/scripts/check-dangerous-commands.js +136 -0
  112. package/plugins/pbr/scripts/check-doc-sprawl.js +102 -0
  113. package/plugins/pbr/scripts/check-phase-boundary.js +196 -0
  114. package/plugins/pbr/scripts/check-plan-format.js +270 -0
  115. package/plugins/pbr/scripts/check-roadmap-sync.js +252 -0
  116. package/plugins/pbr/scripts/check-skill-workflow.js +262 -0
  117. package/plugins/pbr/scripts/check-state-sync.js +476 -0
  118. package/plugins/pbr/scripts/check-subagent-output.js +144 -0
  119. package/plugins/pbr/scripts/config-schema.json +251 -0
  120. package/plugins/pbr/scripts/context-budget-check.js +287 -0
  121. package/plugins/pbr/scripts/event-handler.js +151 -0
  122. package/plugins/pbr/scripts/event-logger.js +92 -0
  123. package/plugins/pbr/scripts/hook-logger.js +76 -0
  124. package/plugins/pbr/scripts/hooks-schema.json +79 -0
  125. package/plugins/pbr/scripts/log-subagent.js +152 -0
  126. package/plugins/pbr/scripts/log-tool-failure.js +88 -0
  127. package/plugins/pbr/scripts/pbr-tools.js +1301 -0
  128. package/plugins/pbr/scripts/post-write-dispatch.js +66 -0
  129. package/plugins/pbr/scripts/post-write-quality.js +207 -0
  130. package/plugins/pbr/scripts/pre-bash-dispatch.js +56 -0
  131. package/plugins/pbr/scripts/pre-write-dispatch.js +62 -0
  132. package/plugins/pbr/scripts/progress-tracker.js +228 -0
  133. package/plugins/pbr/scripts/session-cleanup.js +254 -0
  134. package/plugins/pbr/scripts/status-line.js +285 -0
  135. package/plugins/pbr/scripts/suggest-compact.js +119 -0
  136. package/plugins/pbr/scripts/task-completed.js +45 -0
  137. package/plugins/pbr/scripts/track-context-budget.js +119 -0
  138. package/plugins/pbr/scripts/validate-commit.js +200 -0
  139. package/plugins/pbr/scripts/validate-plugin-structure.js +172 -0
  140. package/plugins/pbr/skills/begin/SKILL.md +545 -0
  141. package/plugins/pbr/skills/begin/templates/PROJECT.md.tmpl +33 -0
  142. package/plugins/pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +18 -0
  143. package/plugins/pbr/skills/begin/templates/STATE.md.tmpl +49 -0
  144. package/plugins/pbr/skills/begin/templates/config.json.tmpl +63 -0
  145. package/plugins/pbr/skills/begin/templates/researcher-prompt.md.tmpl +19 -0
  146. package/plugins/pbr/skills/begin/templates/roadmap-prompt.md.tmpl +30 -0
  147. package/plugins/pbr/skills/begin/templates/synthesis-prompt.md.tmpl +16 -0
  148. package/plugins/pbr/skills/build/SKILL.md +962 -0
  149. package/plugins/pbr/skills/config/SKILL.md +241 -0
  150. package/plugins/pbr/skills/continue/SKILL.md +127 -0
  151. package/plugins/pbr/skills/debug/SKILL.md +489 -0
  152. package/plugins/pbr/skills/debug/templates/continuation-prompt.md.tmpl +16 -0
  153. package/plugins/pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +27 -0
  154. package/plugins/pbr/skills/discuss/SKILL.md +338 -0
  155. package/plugins/pbr/skills/discuss/templates/CONTEXT.md.tmpl +61 -0
  156. package/plugins/pbr/skills/discuss/templates/decision-categories.md +9 -0
  157. package/plugins/pbr/skills/explore/SKILL.md +362 -0
  158. package/plugins/pbr/skills/health/SKILL.md +186 -0
  159. package/plugins/pbr/skills/health/templates/check-pattern.md.tmpl +30 -0
  160. package/plugins/pbr/skills/health/templates/output-format.md.tmpl +63 -0
  161. package/plugins/pbr/skills/help/SKILL.md +140 -0
  162. package/plugins/pbr/skills/import/SKILL.md +490 -0
  163. package/plugins/pbr/skills/milestone/SKILL.md +673 -0
  164. package/plugins/pbr/skills/milestone/templates/audit-report.md.tmpl +48 -0
  165. package/plugins/pbr/skills/milestone/templates/stats-file.md.tmpl +30 -0
  166. package/plugins/pbr/skills/note/SKILL.md +212 -0
  167. package/plugins/pbr/skills/pause/SKILL.md +235 -0
  168. package/plugins/pbr/skills/pause/templates/continue-here.md.tmpl +71 -0
  169. package/plugins/pbr/skills/plan/SKILL.md +628 -0
  170. package/plugins/pbr/skills/plan/decimal-phase-calc.md +98 -0
  171. package/plugins/pbr/skills/plan/templates/checker-prompt.md.tmpl +21 -0
  172. package/plugins/pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +32 -0
  173. package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +38 -0
  174. package/plugins/pbr/skills/plan/templates/researcher-prompt.md.tmpl +19 -0
  175. package/plugins/pbr/skills/plan/templates/revision-prompt.md.tmpl +23 -0
  176. package/plugins/pbr/skills/quick/SKILL.md +335 -0
  177. package/plugins/pbr/skills/resume/SKILL.md +388 -0
  178. package/plugins/pbr/skills/review/SKILL.md +652 -0
  179. package/plugins/pbr/skills/review/templates/debugger-prompt.md.tmpl +60 -0
  180. package/plugins/pbr/skills/review/templates/gap-planner-prompt.md.tmpl +40 -0
  181. package/plugins/pbr/skills/review/templates/verifier-prompt.md.tmpl +115 -0
  182. package/plugins/pbr/skills/scan/SKILL.md +269 -0
  183. package/plugins/pbr/skills/scan/templates/mapper-prompt.md.tmpl +201 -0
  184. package/plugins/pbr/skills/setup/SKILL.md +227 -0
  185. package/plugins/pbr/skills/shared/commit-planning-docs.md +35 -0
  186. package/plugins/pbr/skills/shared/config-loading.md +102 -0
  187. package/plugins/pbr/skills/shared/context-budget.md +40 -0
  188. package/plugins/pbr/skills/shared/context-loader-task.md +86 -0
  189. package/plugins/pbr/skills/shared/digest-select.md +79 -0
  190. package/plugins/pbr/skills/shared/domain-probes.md +125 -0
  191. package/plugins/pbr/skills/shared/error-reporting.md +79 -0
  192. package/plugins/pbr/skills/shared/gate-prompts.md +388 -0
  193. package/plugins/pbr/skills/shared/phase-argument-parsing.md +45 -0
  194. package/plugins/pbr/skills/shared/progress-display.md +53 -0
  195. package/plugins/pbr/skills/shared/revision-loop.md +81 -0
  196. package/plugins/pbr/skills/shared/state-loading.md +62 -0
  197. package/plugins/pbr/skills/shared/state-update.md +161 -0
  198. package/plugins/pbr/skills/shared/universal-anti-patterns.md +33 -0
  199. package/plugins/pbr/skills/status/SKILL.md +353 -0
  200. package/plugins/pbr/skills/todo/SKILL.md +181 -0
  201. package/plugins/pbr/templates/CONTEXT.md.tmpl +52 -0
  202. package/plugins/pbr/templates/INTEGRATION-REPORT.md.tmpl +151 -0
  203. package/plugins/pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
  204. package/plugins/pbr/templates/ROADMAP.md.tmpl +40 -0
  205. package/plugins/pbr/templates/SUMMARY.md.tmpl +81 -0
  206. package/plugins/pbr/templates/VERIFICATION-DETAIL.md.tmpl +116 -0
  207. package/plugins/pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  208. package/plugins/pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  209. package/plugins/pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  210. package/plugins/pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  211. package/plugins/pbr/templates/codebase/STACK.md.tmpl +78 -0
  212. package/plugins/pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  213. package/plugins/pbr/templates/codebase/TESTING.md.tmpl +107 -0
  214. package/plugins/pbr/templates/continue-here.md.tmpl +73 -0
  215. package/plugins/pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
  216. package/plugins/pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  217. package/plugins/pbr/templates/research/STACK.md.tmpl +71 -0
  218. package/plugins/pbr/templates/research/SUMMARY.md.tmpl +112 -0
  219. package/plugins/pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  220. package/plugins/pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  221. package/plugins/pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
@@ -0,0 +1,81 @@
1
+ # Revision Loop Pattern
2
+
3
+ Standard pattern for iterative agent revision with feedback. Used when a checker/validator finds issues and the producing agent needs to revise its output.
4
+
5
+ > Referenced by: plan, import, review skills
6
+
7
+ ---
8
+
9
+ ## Pattern: Check-Revise-Escalate (max 3 iterations)
10
+
11
+ This pattern applies whenever:
12
+ 1. An agent produces output (plans, imports, gap-closure plans)
13
+ 2. A checker/validator evaluates that output
14
+ 3. Issues are found that need revision
15
+
16
+ ### Flow
17
+
18
+ ```
19
+ iteration = 0
20
+
21
+ LOOP:
22
+ 1. Run checker/validator on current output
23
+ 2. Read checker results
24
+ 3. If PASSED or only INFO-level issues:
25
+ → Accept output, exit loop
26
+ 4. If BLOCKER or WARNING issues found:
27
+ a. iteration += 1
28
+ b. If iteration > 3:
29
+ → Escalate to user (see "After 3 Iterations" below)
30
+ c. Re-spawn the producing agent with checker feedback appended
31
+ d. After revision completes, go to LOOP
32
+ ```
33
+
34
+ ### Re-spawn Prompt Structure
35
+
36
+ When re-spawning the producing agent for revision, append the checker feedback:
37
+
38
+ ```
39
+ <checker_feedback>
40
+ {Inline the checker's issue report}
41
+ </checker_feedback>
42
+
43
+ <revision_instructions>
44
+ Address ALL BLOCKER and WARNING issues identified above.
45
+ - For each BLOCKER: make the required change
46
+ - For each WARNING: address or explain why it's acceptable
47
+ - Do NOT introduce new issues while fixing existing ones
48
+ - Preserve all content not flagged by the checker
49
+ </revision_instructions>
50
+ ```
51
+
52
+ ### After 3 Iterations
53
+
54
+ If issues persist after 3 revision cycles:
55
+
56
+ 1. Present remaining issues to the user
57
+ 2. Use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
58
+ question: "Issues remain after 3 revision attempts. Proceed with current output?"
59
+ header: "Proceed?"
60
+ options:
61
+ - label: "Proceed anyway" description: "Accept output with remaining issues"
62
+ - label: "Adjust approach" description: "Discuss a different approach"
63
+ 3. If "Proceed anyway": accept current output and continue
64
+ 4. If "Adjust approach" or "Other": discuss with user, then re-enter the producing step with updated context
65
+
66
+ ### Skill-Specific Variations
67
+
68
+ | Skill | Producer Agent | Checker Agent | Revision Template |
69
+ |-------|---------------|---------------|-------------------|
70
+ | plan | planner | plan-checker | `skills/plan/templates/revision-prompt.md.tmpl` |
71
+ | import | inline (orchestrator) | plan-checker | Inline revision by orchestrator |
72
+ | review (auto-fix) | planner (gap mode) | plan-checker | Same as plan |
73
+
74
+ ---
75
+
76
+ ## Important Notes
77
+
78
+ - **INFO-level issues are always acceptable** -- they don't trigger revision
79
+ - **Each iteration gets a fresh agent spawn** -- don't try to continue in the same context
80
+ - **Checker feedback must be inlined** -- the revision agent needs to see exactly what failed
81
+ - **Don't silently swallow issues** -- always present the final state to the user after exiting the loop
@@ -0,0 +1,62 @@
1
+ # State Loading Pattern
2
+
3
+ Standard pattern for loading project state at the start of a skill invocation. Include this fragment in skills that need project context.
4
+
5
+ ---
6
+
7
+ ## Minimal State Read (for simple skills)
8
+
9
+ Use when the skill only needs to know the current position. Skills: status, help, note, todo, pause, config.
10
+ STATE.md is lean — it contains only current-phase context. Historical data lives in HISTORY.md.
11
+
12
+ ```
13
+ 1. Read .planning/STATE.md lines 1-20 only
14
+ 2. Extract: current phase, plan, status
15
+ 3. If STATE.md missing: inform user, suggest /pbr:begin
16
+ ```
17
+
18
+ ## Full State Read (for workflow skills)
19
+
20
+ Use when the skill needs complete project context. Skills: build, plan, review, begin, milestone, continue, resume, debug.
21
+
22
+ Reading order (always this sequence):
23
+
24
+ ```
25
+ 1. Read .planning/STATE.md
26
+ - Extract: Current Position section (phase, plan, status)
27
+ - Extract: Blockers/Concerns section (if not "None")
28
+ - Extract: Session Continuity section (if present)
29
+
30
+ 2. Read .planning/config.json
31
+ - Extract: depth, mode, features flags
32
+ - Extract: models configuration
33
+ - Extract: gates configuration
34
+
35
+ 3. Read .planning/ROADMAP.md (if exists)
36
+ - Extract: Phase Overview table (current + next 2 phases)
37
+ - Extract: dependency chain for current phase
38
+ - Do NOT read full phase details for past phases
39
+
40
+ 4. Read .planning/HISTORY.md (ONLY when cross-phase context is needed)
41
+ - Do NOT read HISTORY.md for normal build/plan/review operations
42
+ - Read ONLY when: debugging a regression that may trace to a prior phase,
43
+ or when a milestone audit needs historical context
44
+ - Use: `node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history load`
45
+ - This returns structured JSON -- do not read the raw file
46
+ ```
47
+
48
+ ## Error Handling
49
+
50
+ | File Missing | Action |
51
+ |-------------|--------|
52
+ | STATE.md | Warn user: "No STATE.md found. Run /pbr:begin to initialize." |
53
+ | config.json | Use defaults (depth: standard, mode: interactive) |
54
+ | ROADMAP.md | Continue without roadmap context (acceptable for quick tasks) |
55
+ | .planning/ dir | Exit: "No .planning directory. This is not a Plan-Build-Run project." |
56
+
57
+ ## What NOT to Read During State Loading
58
+
59
+ - Full SUMMARY.md bodies from prior phases (read frontmatter only if needed)
60
+ - Agent definition files (agents/*.md) — auto-loaded by subagent_type
61
+ - PLAN.md files from other phases (only current phase plans)
62
+ - .planning/logs/ files (only health skill reads these)
@@ -0,0 +1,161 @@
1
+ # STATE.md Update Pattern
2
+
3
+ Standard pattern for updating `.planning/STATE.md`. Include this fragment in skills that modify project state.
4
+
5
+ ---
6
+
7
+ ## When to Update STATE.md
8
+
9
+ | Event | What to Update |
10
+ |-------|---------------|
11
+ | Phase status changes (planned, building, verified) | Current Position section |
12
+ | Plan completes or fails | Plan counter, status, last activity |
13
+ | New decision made | Accumulated Context > Decisions |
14
+ | Blocker discovered or resolved | Accumulated Context > Blockers/Concerns |
15
+ | Session starts or ends | Session Continuity section |
16
+ | Milestone boundary | Milestone section |
17
+
18
+ ---
19
+
20
+ ## Section Format
21
+
22
+ STATE.md has 5 sections. Always preserve this order:
23
+
24
+ ### 1. Project Reference (lines 4-7)
25
+ ```
26
+ ## Project Reference
27
+ See: .planning/PROJECT.md (updated {date})
28
+ **Core value:** {one-liner from PROJECT.md}
29
+ **Current focus:** Phase {N} - {name}
30
+ ```
31
+ Update `Current focus` when phase changes.
32
+
33
+ ### 2. Current Position (lines 9-14)
34
+ ```
35
+ ## Current Position
36
+ Phase: {N} of {total} ({Phase name})
37
+ Plan: {completed} of {total_plans} in current phase
38
+ Status: {Ready to plan | Planning | Building | Reviewing | Verified}
39
+ Last activity: {YYYY-MM-DD} -- {brief description}
40
+ Progress: [{progress_bar}] {percent}%
41
+ ```
42
+
43
+ **Progress bar format:** 20 characters using `█` (done) and `░` (remaining).
44
+ ```
45
+ Phase 3 of 10 = 20% → [████░░░░░░░░░░░░░░░░] 20%
46
+ Phase 7 of 10 = 70% → [██████████████░░░░░░] 70%
47
+ ```
48
+ Calculation: `filled = Math.round((completed_phases / total_phases) * 20)`
49
+
50
+ ### 3. Accumulated Context (lines 16-25)
51
+ ```
52
+ ## Accumulated Context
53
+
54
+ ### Decisions
55
+ {Active decisions relevant to current work}
56
+
57
+ ### Pending Todos
58
+ {Outstanding items, or "None"}
59
+
60
+ ### Blockers/Concerns
61
+ {Active blockers, or "None"}
62
+ ```
63
+
64
+ ### 4. Milestone (lines 27-30)
65
+ ```
66
+ ## Milestone
67
+ Current: {project_name} {version}
68
+ Phases: {start}-{end}
69
+ Status: {In progress | Complete}
70
+ ```
71
+
72
+ ### 5. Session Continuity (lines 32-35)
73
+ ```
74
+ ## Session Continuity
75
+ Last session: {ISO timestamp}
76
+ Stopped at: {brief description of last action}
77
+ Resume file: {path or "None"}
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Size Limit Enforcement
83
+
84
+ **Hard limit: 150 lines.** After every STATE.md write, check the line count. If over 150 lines, compact:
85
+
86
+ 1. **Collapse completed phase entries** to one-liners:
87
+ ```
88
+ Phase 1: verified 2026-02-08
89
+ Phase 2: verified 2026-02-09
90
+ ```
91
+ 2. **Remove decisions already captured in CONTEXT.md** — avoid duplication between STATE.md and phase CONTEXT.md files
92
+ 3. **Remove old session entries** — keep only the current session's continuity data
93
+ 4. **Keep these always:** current phase detail, active blockers, core value statement, milestone info
94
+
95
+ If still over 150 lines after compaction, the Accumulated Context section has grown too large. Move non-critical decisions to the phase's CONTEXT.md file.
96
+
97
+ ---
98
+
99
+ ## HISTORY.md Archival
100
+
101
+ When a milestone completes or a phase is verified, archive historical context to `.planning/HISTORY.md` to keep STATE.md lean:
102
+
103
+ ### What to Archive
104
+
105
+ | Trigger | What moves to HISTORY.md |
106
+ |---------|-------------------------|
107
+ | Phase verified | One-liner summary: "Phase {N} ({name}): verified {date}" |
108
+ | Milestone complete | Full milestone record: name, phases covered, key decisions |
109
+ | Accumulated Context > 20 lines | Decisions from completed phases (keep only current-phase decisions in STATE.md) |
110
+
111
+ ### How to Archive
112
+
113
+ Use `pbr-tools.js history append`:
114
+ ```
115
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history append phase "Phase 3 (Auth)" "Verified 2026-02-10. Key decisions: JWT + httpOnly cookies, Discord OAuth."
116
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history append milestone "v1.0 User Auth" "Phases 1-4. All verified. Core auth flow complete."
117
+ ```
118
+
119
+ ### After Archiving
120
+
121
+ Remove the archived content from STATE.md. The Accumulated Context section should contain ONLY:
122
+ - Decisions relevant to the **current** phase
123
+ - Active (unresolved) blockers
124
+ - Pending todos for the current milestone
125
+
126
+ Historical decisions live in HISTORY.md and per-phase SUMMARY.md files.
127
+
128
+ ---
129
+
130
+ ## Common Update Scenarios
131
+
132
+ ### After build completes
133
+ ```
134
+ Plan: {N} of {total} in current phase
135
+ Status: Building → Reviewing (if all plans done) or Building (if more plans remain)
136
+ Last activity: {date} -- Built plan {plan_id}
137
+ ```
138
+
139
+ ### After review/verification passes
140
+ ```
141
+ Status: Verified
142
+ Last activity: {date} -- Phase {N} verified
143
+ Progress: [{updated bar}] {new percent}%
144
+ ```
145
+ Also update **Current focus** to point to the next phase.
146
+
147
+ ### After pause
148
+ ```
149
+ ## Session Continuity
150
+ Last session: {timestamp}
151
+ Stopped at: {what was in progress}
152
+ Resume file: .planning/.pause-state.json
153
+ ```
154
+
155
+ ### After milestone completion
156
+ ```
157
+ ## Milestone
158
+ Current: {project_name} {next_version}
159
+ Phases: {new_start}-{new_end}
160
+ Status: In progress
161
+ ```
@@ -0,0 +1,33 @@
1
+ # Universal Anti-Patterns
2
+
3
+ Rules that apply to ALL skills. Individual skills may have additional skill-specific anti-patterns listed in their own SKILL.md.
4
+
5
+ > Referenced by: all skills with Context Budget or Anti-Patterns sections
6
+
7
+ ---
8
+
9
+ ## Context Budget Rules (apply to every skill)
10
+
11
+ These rules prevent context rot -- quality degradation as the context window fills up.
12
+
13
+ 1. **Never** read agent definition files (`agents/*.md`) -- `subagent_type` auto-loads them. Reading agent definitions into the orchestrator wastes main context for content that is automatically injected into subagent sessions.
14
+ 2. **Never** inline large files into Task() prompts -- tell agents to read files from disk instead. Agents have their own 200k token context windows.
15
+ 3. **Minimize** reading subagent output into main context -- read only frontmatter, status fields, or summaries. Never read full SUMMARY.md, VERIFICATION.md, or RESEARCH.md bodies into the orchestrator unless specifically needed for inline presentation.
16
+ 4. **Delegate** heavy work to Task() subagents -- the orchestrator routes, it does not build, analyze, research, investigate, or verify.
17
+ 5. **Proactive pause warning**: If you have 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.
18
+
19
+ ## File Reading Rules (apply to every skill)
20
+
21
+ 6. **Never** read full SUMMARY.md bodies from prior phases -- read frontmatter only (unless the skill specifically requires body content for presentation).
22
+ 7. **Never** read full PLAN.md files from other phases -- only current phase plans.
23
+ 8. **Never** read `.planning/logs/` files -- only the health skill reads these.
24
+ 9. **Do not** re-read full file contents when frontmatter is sufficient -- frontmatter contains status, key_files, commits, and provides fields.
25
+
26
+ ## Behavioral Rules (apply to every skill)
27
+
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.
@@ -0,0 +1,353 @@
1
+ ---
2
+ name: status
3
+ description: "Show current project status and suggest what to do next."
4
+ allowed-tools: Read, Glob, Grep, AskUserQuestion
5
+ ---
6
+
7
+ # /pbr:status — Project Status Dashboard
8
+
9
+ You are running the **status** skill. Your job is to read the project state and present a clear, actionable status dashboard. You suggest the most logical next action based on where the project is.
10
+
11
+ This skill runs **inline** and is **read-only** — it never modifies any files.
12
+
13
+ ---
14
+
15
+ ## Core Principle
16
+
17
+ **Show the user where they are and what to do next.** The status display should be a quick glance, not a wall of text. Surface problems and route to the right action.
18
+
19
+ ---
20
+
21
+ ## Flow
22
+
23
+ ### Step 1: Read Project State
24
+
25
+ **Tooling shortcut**: Instead of parsing multiple files manually, you can run:
26
+ ```bash
27
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state load
28
+ ```
29
+ and
30
+ ```bash
31
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state check-progress
32
+ ```
33
+ These return structured JSON with config, state, roadmap, and filesystem-verified progress. Falls back gracefully if the script is missing — parse files manually in that case.
34
+
35
+ Read the following files (skip any that don't exist):
36
+
37
+ 1. **`.planning/config.json`** — Project settings
38
+ - If this doesn't exist, display:
39
+ ```
40
+ ╔══════════════════════════════════════════════════════════════╗
41
+ ║ ERROR ║
42
+ ╚══════════════════════════════════════════════════════════════╝
43
+
44
+ No Plan-Build-Run project found.
45
+
46
+ **To fix:** Run `/pbr:begin` to start a new project, or `/pbr:scan` to analyze an existing codebase.
47
+ ```
48
+ - Stop here if no project found.
49
+
50
+ 2. **`.planning/STATE.md`** — Current position, progress, blockers
51
+ - Extract: current phase, current plan, overall progress, blockers, session info
52
+
53
+ 3. **`.planning/ROADMAP.md`** — Phase overview
54
+ - Extract: all phases with names, descriptions, status indicators
55
+
56
+ 4. **`.planning/PROJECT.md`** — Project metadata (if exists)
57
+ - Extract: project name, milestone info
58
+
59
+ 5. **`.planning/REQUIREMENTS.md`** — Requirements (if exists)
60
+ - Extract: requirement completion status if tracked
61
+
62
+ ### Step 2: Scan Phase Directories
63
+
64
+ For each phase listed in ROADMAP.md:
65
+
66
+ 1. Check if the phase directory exists in `.planning/phases/`
67
+ 2. If exists, scan for:
68
+ - `CONTEXT.md` — discussion happened
69
+ - `PLAN-*.md` or plan files — plans exist
70
+ - `SUMMARY-*.md` or summary files — plans were executed
71
+ - `VERIFICATION.md` — phase was reviewed
72
+ - `.continue-here.md` — paused work
73
+
74
+ 3. Calculate phase status:
75
+
76
+ | Condition | Status |
77
+ |-----------|--------|
78
+ | No directory | Not started |
79
+ | Directory exists, no plans | Discussed only |
80
+ | Plans exist, no summaries | Planned (ready to build) |
81
+ | Some summaries, not all | Building (in progress) |
82
+ | All summaries exist | Built (ready to review) |
83
+ | VERIFICATION.md exists, status=passed | Verified (complete) |
84
+ | VERIFICATION.md exists, status=gaps_found | Needs fixes |
85
+
86
+ 4. Calculate progress percentage:
87
+ - Count total plans across all phases
88
+ - Count plans with SUMMARY.md (status=completed)
89
+ - Progress = completed / total * 100
90
+
91
+ ### Step 2b: Check STATE.md Size and Consistency
92
+
93
+ Count lines in `.planning/STATE.md`. If over 150 lines, add a warning to the dashboard:
94
+ ```
95
+ Warning: STATE.md is {N} lines (limit: 150). Run any build/review command to auto-compact it.
96
+ ```
97
+
98
+ **Discrepancy check:** Compare STATE.md phase/plan/status claims against the filesystem:
99
+ - Does the phase directory exist? If not: `Warning: STATE.md references Phase {N} but no directory exists.`
100
+ - Does the plan count match? If not: `Warning: STATE.md says {X} plans but filesystem has {Y}.`
101
+ - Does the status match? If STATE.md says "verified" but no `VERIFICATION.md` exists: `Warning: STATE.md says "verified" but no VERIFICATION.md found.`
102
+
103
+ If any discrepancy found, add: `Run /pbr:resume to auto-reconcile STATE.md.`
104
+
105
+ ### Step 3: Check for Special Conditions
106
+
107
+ #### Paused Work
108
+ - Search for `.continue-here.md` files in `.planning/phases/`
109
+ - If found: note the phase and brief description of where work stopped
110
+
111
+ #### Verification Gaps
112
+ - Search for `VERIFICATION.md` files with `gaps_found` status
113
+ - If found: note which phases have gaps
114
+
115
+ #### Cross-Phase Re-Planning Check
116
+ - For each planned phase, check if its dependency phases have been built yet
117
+ - Logic:
118
+ 1. Read ROADMAP.md to find phase dependencies (phases that come before)
119
+ 2. If Phase N has plans but Phase N-1 doesn't have summaries (wasn't built yet):
120
+ - This means Phase N was planned without knowledge of what Phase N-1 actually produced
121
+ - Flag for re-planning
122
+ - **Dependency fingerprint check**: For each planned phase with `dependency_fingerprints` in plan frontmatter:
123
+ 1. Compare the fingerprints against current dependency SUMMARY.md files
124
+ 2. If any fingerprint is stale (dependency was re-built after the plan was created):
125
+ - Flag: "WARN: Phase {N} plans may be stale — dependency phase {M} was re-built since planning. Consider re-planning with `/pbr:plan {N}`."
126
+
127
+ #### Active Debug Sessions
128
+ - Check `.planning/debug/` for files with `status: active`
129
+ - Note any active debug sessions
130
+
131
+ #### Pending Todos
132
+ - Check `.planning/todos/pending/` for pending todo files
133
+ - Count and summarize if any exist
134
+
135
+ #### Quick Notes
136
+ - Check `.planning/NOTES.md` for active note entries
137
+ - Count active notes (lines matching `^- \[` that don't contain `[promoted]`)
138
+ - Also check `~/.claude/notes.md` for global notes
139
+
140
+ #### Quick Tasks
141
+ - Check `.planning/quick/` for recent quick tasks
142
+ - Note any failed or partial quick tasks
143
+
144
+ ### Step 4: Display Status Dashboard
145
+
146
+ Present the status in this format:
147
+
148
+ ```
149
+ Project: {name from PROJECT.md or config.json}
150
+ Phase: {current} of {total} -- {current phase name}
151
+ Progress: [{progress bar}] {percentage}%
152
+
153
+ Phase Status:
154
+ | Phase | Status | Plans | Progress |
155
+ |-------|--------|-------|----------|
156
+ | 1. {name} | {status indicator} {status text} | {completed}/{total} | {percentage}% |
157
+ | 2. {name} | {status indicator} {status text} | {completed}/{total} | {percentage}% |
158
+ | ...
159
+
160
+ {If blockers exist:}
161
+ Blockers:
162
+ - {blocker 1}
163
+ - {blocker 2}
164
+
165
+ {If no blockers:}
166
+ Blockers: None
167
+
168
+ {If paused work:}
169
+ Paused: Phase {N} has a checkpoint at plan {M}. Run `/pbr:resume` to continue.
170
+
171
+ {If verification gaps:}
172
+ Gaps: Phase {N} verification found {count} gaps. Run `/pbr:plan {N} --gaps` to address.
173
+
174
+ {If cross-phase re-planning needed:}
175
+ Warning: Phase {N} was planned before Phase {M} was built. Consider re-planning with `/pbr:plan {N}`.
176
+
177
+ {If active debug sessions:}
178
+ Debug: {count} active session(s). Run `/pbr:debug` to continue.
179
+
180
+ {If pending todos:}
181
+ Todos: {count} pending. Run `/pbr:todo list` to see them.
182
+
183
+ {If notes exist:}
184
+ Notes: {count} quick capture(s). `/pbr:note list` to review.
185
+ ```
186
+
187
+ ### Progress Bar
188
+
189
+ Generate a 20-character progress bar:
190
+
191
+ ```
192
+ [####################] 100% (all filled)
193
+ [################....] 80% (16 filled, 4 empty)
194
+ [########............] 40% (8 filled, 12 empty)
195
+ [....................] 0% (all empty)
196
+ ```
197
+
198
+ Use the Unicode block characters from the UI formatting reference:
199
+ - Filled: block character
200
+ - Empty: light shade
201
+
202
+ ### Status Indicators
203
+
204
+ Use indicators from `references/ui-formatting.md`:
205
+
206
+ | Status | Indicator |
207
+ |--------|-----------|
208
+ | Complete/Verified | checkmark |
209
+ | In Progress | half-filled circle |
210
+ | Not started | empty circle |
211
+ | Needs fixes | warning triangle |
212
+ | Blocked | blocked symbol |
213
+
214
+ ### Step 5: Smart Routing
215
+
216
+ Based on the project state, suggest the single most logical next action:
217
+
218
+ **Decision tree:**
219
+
220
+ ```
221
+ 1. Is there paused work (.continue-here.md)?
222
+ YES → "Resume your work: `/pbr:resume`"
223
+
224
+ 2. Is there a verification with gaps?
225
+ YES → "Fix verification gaps: `/pbr:plan {N} --gaps`"
226
+
227
+ 3. Is the current phase planned but not built?
228
+ YES → "Build the current phase: `/pbr:build {N}`"
229
+
230
+ 4. Is the current phase built but not reviewed?
231
+ YES → "Review what was built: `/pbr:review {N}`"
232
+
233
+ 5. Is the current phase verified (complete)?
234
+ YES → Is there a next phase?
235
+ YES → Was next phase already planned?
236
+ YES → Does it need re-planning? (dependency phase changed)
237
+ YES → "Re-plan with updated context: `/pbr:plan {N+1}`"
238
+ NO → "Build the next phase: `/pbr:build {N+1}`"
239
+ NO → "Plan the next phase: `/pbr:plan {N+1}`"
240
+ NO → "All phases complete! Your next steps:\n -> /pbr:milestone audit — verify cross-phase integration (recommended)\n -> /pbr:milestone complete — archive this milestone and create a git tag\n -> /pbr:milestone new — start planning the next set of features"
241
+
242
+ 6. Is the current phase not started?
243
+ YES → Has it been discussed?
244
+ YES → "Plan this phase: `/pbr:plan {N}`"
245
+ NO → "Start with a discussion: `/pbr:discuss {N}` or jump to `/pbr:plan {N}`"
246
+
247
+ 7. Active debug sessions?
248
+ YES → "Continue debugging: `/pbr:debug`"
249
+
250
+ 8. Nothing active?
251
+ → "Start your project: `/pbr:begin`"
252
+ ```
253
+
254
+ **If only one reasonable next action exists**, present it with branded routing:
255
+
256
+ ```
257
+ ───────────────────────────────────────────────────────────────
258
+
259
+ ## ▶ Next Up
260
+
261
+ **{brief explanation}**
262
+
263
+ `{suggested command}`
264
+
265
+ <sub>`/clear` first → fresh context window</sub>
266
+
267
+ ───────────────────────────────────────────────────────────────
268
+ ```
269
+
270
+ **If multiple reasonable next actions exist** (2-3 alternatives), use the **action-routing** pattern (see `skills/shared/gate-prompts.md`):
271
+
272
+ Use AskUserQuestion:
273
+ question: "What would you like to do next?"
274
+ header: "Next Step"
275
+ options:
276
+ - label: "{primary action}" description: "{brief explanation}"
277
+ - label: "{alternative 1}" description: "{brief explanation}"
278
+ - label: "{alternative 2}" description: "{brief explanation}"
279
+ - label: "Something else" description: "Enter a different command"
280
+ multiSelect: false
281
+
282
+ Build options dynamically from the decision tree results. Always include "Something else" as the last option. Generate 1-3 real options based on the state analysis.
283
+
284
+ **After user selects an option:**
285
+ - If they selected a real action: display "Run: `/dev:{action} {args}`" so they can execute it
286
+ - If they selected "Something else": ask what they'd like to do (freeform text)
287
+ - This skill remains read-only — display the command, do not execute it
288
+
289
+ ---
290
+
291
+ ## Edge Cases
292
+
293
+ ### No `.planning/` directory at all
294
+ - Display: "No Plan-Build-Run project found."
295
+ - Suggest: `/pbr:begin` to start a new project
296
+ - Also mention: `/pbr:scan` if there's an existing codebase to analyze first
297
+
298
+ ### STATE.md exists but is outdated
299
+ - STATE.md may not reflect the actual file system state
300
+ - Always verify by scanning phase directories
301
+ - If STATE.md disagrees with the file system, note the discrepancy:
302
+ "Note: STATE.md says Phase 2 is in progress, but all plans have summaries. Status may need updating."
303
+
304
+ ### All phases complete
305
+ - Celebrate briefly: "All phases complete!"
306
+ - Suggest: `/pbr:milestone audit` to verify cross-phase integration (recommended first)
307
+ - Then: `/pbr:milestone complete` to archive the milestone and tag it
308
+ - Or: `/pbr:milestone new` to start the next set of features
309
+
310
+ ### ROADMAP.md has phases but no phase directories
311
+ - This is normal for future phases
312
+ - Show them as "Not started" with no plan counts
313
+
314
+ ### Multiple milestones
315
+ - If PROJECT.md shows multiple milestones, display the current one
316
+ - Show completed milestones as collapsed summary
317
+
318
+ ### Large project (many phases)
319
+ - If more than 8 phases, consider grouping:
320
+ - Completed phases: collapsed summary
321
+ - Current phase: full detail
322
+ - Upcoming phases: brief list
323
+
324
+ ---
325
+
326
+ ## Performance
327
+
328
+ This skill should be fast. It's a status check, not an analysis.
329
+
330
+ **DO:**
331
+ - Read files quickly (frontmatter only where possible)
332
+ - Use Glob to find files efficiently
333
+ - Cache nothing (always read fresh state)
334
+
335
+ **DO NOT:**
336
+ - Read full SUMMARY.md contents (frontmatter is enough)
337
+ - Read plan file contents (just check existence)
338
+ - Run any Bash commands
339
+ - Modify any files
340
+ - Spawn any Task agents
341
+
342
+ ---
343
+
344
+ ## Anti-Patterns
345
+
346
+ 1. **DO NOT** modify any files — this is read-only
347
+ 2. **DO NOT** run Bash commands — use Read and Glob only
348
+ 3. **DO NOT** show overwhelming detail — keep it scannable
349
+ 4. **DO NOT** hide problems — surface blockers, gaps, and warnings prominently
350
+ 5. **DO NOT** suggest multiple actions without prioritizing — the primary suggestion should be clear
351
+ 6. **DO NOT** re-read full file contents when frontmatter is sufficient
352
+ 7. **DO NOT** show completed phases in full detail unless specifically relevant
353
+ 8. **DO NOT** execute the suggested action — present it for the user to run manually. Use /pbr:continue for auto-execution.