@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,48 @@
1
+ import chokidar from 'chokidar';
2
+ import { join, relative } from 'node:path';
3
+
4
+ /**
5
+ * Create a chokidar file watcher for the .planning/ directory.
6
+ *
7
+ * Watches **\/*.md files with awaitWriteFinish to debounce editor saves.
8
+ * Calls onChange with a normalized event object on add, change, and unlink.
9
+ *
10
+ * @param {string} watchPath - Absolute path to the project directory
11
+ * @param {(event: {path: string, type: string, timestamp: number}) => void} onChange
12
+ * @returns {import('chokidar').FSWatcher}
13
+ */
14
+ export function createWatcher(watchPath, onChange) {
15
+ const planningDir = join(watchPath, '.planning');
16
+
17
+ const watcher = chokidar.watch(join(planningDir, '**/*.md'), {
18
+ ignored: [
19
+ '**/node_modules/**',
20
+ '**/.git/**'
21
+ ],
22
+ persistent: true,
23
+ ignoreInitial: true,
24
+ awaitWriteFinish: {
25
+ stabilityThreshold: 2000,
26
+ pollInterval: 100
27
+ }
28
+ });
29
+
30
+ const handleEvent = (type) => (filePath) => {
31
+ const relativePath = relative(watchPath, filePath);
32
+ onChange({
33
+ path: relativePath,
34
+ type,
35
+ timestamp: Date.now()
36
+ });
37
+ };
38
+
39
+ watcher.on('add', handleEvent('add'));
40
+ watcher.on('change', handleEvent('change'));
41
+ watcher.on('unlink', handleEvent('unlink'));
42
+
43
+ watcher.on('error', (error) => {
44
+ console.error('Watcher error:', error.message);
45
+ });
46
+
47
+ return watcher;
48
+ }
@@ -0,0 +1,11 @@
1
+ <%- include('partials/layout-top', { title: title, activePage: activePage }) %>
2
+
3
+ <h1><%= featureName %></h1>
4
+ <p>This feature is coming soon.</p>
5
+ <p>
6
+ The <strong><%= featureName %></strong> view is planned but not yet implemented.
7
+ Check back in a future phase.
8
+ </p>
9
+ <p><a href="/">Back to Dashboard</a></p>
10
+
11
+ <%- include('partials/layout-bottom') %>
@@ -0,0 +1,13 @@
1
+ <%- include('partials/layout-top', { title: typeof title !== 'undefined' ? title : 'Error', activePage: '' }) %>
2
+
3
+ <h1>Error <%= status %></h1>
4
+ <p><%= message %></p>
5
+ <% if (typeof stack !== 'undefined' && stack) { %>
6
+ <details>
7
+ <summary>Stack Trace (Development Only)</summary>
8
+ <pre><code><%= stack %></code></pre>
9
+ </details>
10
+ <% } %>
11
+ <p><a href="/">Return to Dashboard</a></p>
12
+
13
+ <%- include('partials/layout-bottom') %>
@@ -0,0 +1,5 @@
1
+ <%- include('partials/layout-top', { title: title, activePage: 'dashboard' }) %>
2
+
3
+ <%- include('partials/dashboard-content') %>
4
+
5
+ <%- include('partials/layout-bottom') %>
@@ -0,0 +1 @@
1
+ <%# This file is deprecated. See partials/layout-top.ejs and partials/layout-bottom.ejs %>
@@ -0,0 +1,77 @@
1
+ <h1><%= projectName %></h1>
2
+
3
+ <!-- Project Overview Card -->
4
+ <article>
5
+ <header>
6
+ <strong>Current Phase</strong>
7
+ </header>
8
+ <% if (currentPhase.id > 0) { %>
9
+ <p>
10
+ <span class="status-badge" data-status="in-progress">Phase <%= currentPhase.id %></span>
11
+ <%= currentPhase.name %>
12
+ </p>
13
+ <p><small><%= currentPhase.planStatus %></small></p>
14
+ <% } else { %>
15
+ <p>No active phase. Project has not started yet.</p>
16
+ <% } %>
17
+
18
+ <% if (lastActivity.date) { %>
19
+ <p><small>Last activity: <%= lastActivity.date %> &mdash; <%= lastActivity.description %></small></p>
20
+ <% } %>
21
+ </article>
22
+
23
+ <!-- Overall Progress -->
24
+ <article>
25
+ <header>
26
+ <strong>Overall Progress</strong>
27
+ </header>
28
+ <progress value="<%= progress %>" max="100"></progress>
29
+ <p><%= progress %>% complete (<%= phases.filter(p => p.status === 'complete').length %> of <%= phases.length %> phases)</p>
30
+ </article>
31
+
32
+ <!-- Phase List -->
33
+ <article>
34
+ <header>
35
+ <strong>All Phases</strong>
36
+ </header>
37
+ <% if (phases.length > 0) { %>
38
+ <div class="table-wrap">
39
+ <table>
40
+ <thead>
41
+ <tr>
42
+ <th scope="col">Phase</th>
43
+ <th scope="col">Name</th>
44
+ <th scope="col">Description</th>
45
+ <th scope="col">Status</th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <% phases.forEach(function(phase) { %>
50
+ <tr>
51
+ <td><%= String(phase.id).padStart(2, '0') %></td>
52
+ <td><a href="/phases/<%= String(phase.id).padStart(2, '0') %>"><%= phase.name %></a></td>
53
+ <td><%= phase.description %></td>
54
+ <td>
55
+ <span class="status-badge" data-status="<%= phase.status %>">
56
+ <%= phase.status.replace('-', ' ') %>
57
+ </span>
58
+ </td>
59
+ </tr>
60
+ <% }); %>
61
+ </tbody>
62
+ </table>
63
+ </div>
64
+ <% } else { %>
65
+ <p>No phases found. Add a ROADMAP.md file to your .planning/ directory to see phases here.</p>
66
+ <% } %>
67
+ </article>
68
+
69
+ <!-- README Content (if available) -->
70
+ <% if (content && content !== '<p>No project README found.</p>') { %>
71
+ <article>
72
+ <header>
73
+ <strong>Project Notes</strong>
74
+ </header>
75
+ <%- content %>
76
+ </article>
77
+ <% } %>
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <small>PBR Dashboard v0.1.0</small>
3
+ </footer>
@@ -0,0 +1,21 @@
1
+ <head>
2
+ <meta charset="UTF-8">
3
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
4
+ <title><%= typeof title !== 'undefined' ? title : 'Plan-Build-Run' %> - Plan-Build-Run</title>
5
+ <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
6
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
7
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-400-normal.min.css">
8
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-600-normal.min.css">
9
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/fontsource/fonts/inter@latest/latin-700-normal.min.css">
10
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/fontsource/fonts/jetbrains-mono@latest/latin-400-normal.min.css">
11
+ <link rel="stylesheet" href="/css/layout.css">
12
+ <link rel="stylesheet" href="/css/status-colors.css">
13
+ <script
14
+ src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js"
15
+ integrity="sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz"
16
+ crossorigin="anonymous">
17
+ </script>
18
+ <script src="https://cdn.jsdelivr.net/npm/htmx-ext-sse@2.2.2/sse.js"></script>
19
+ <script src="/js/htmx-title.js"></script>
20
+ <script src="/js/sidebar-toggle.js"></script>
21
+ </head>
@@ -0,0 +1,12 @@
1
+ <header>
2
+ <nav>
3
+ <ul>
4
+ <li><strong>PBR Dashboard</strong></li>
5
+ </ul>
6
+ <ul>
7
+ <li>
8
+ <button class="sidebar-toggle" aria-label="Toggle navigation">&#9776;</button>
9
+ </li>
10
+ </ul>
11
+ </nav>
12
+ </header>
@@ -0,0 +1,15 @@
1
+ </main>
2
+ <%- include('footer') %>
3
+ </div>
4
+ <div hx-ext="sse"
5
+ sse-connect="/api/events/stream"
6
+ sse-close="close">
7
+ <div hx-trigger="sse:file-change"
8
+ hx-get="<%= typeof currentPath !== 'undefined' ? currentPath : '/' %>"
9
+ hx-target="#main-content"
10
+ hx-swap="innerHTML"
11
+ style="display:none;">
12
+ </div>
13
+ </div>
14
+ </body>
15
+ </html>
@@ -0,0 +1,8 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <%- include('head', { title: typeof title !== 'undefined' ? title : 'PBR Dashboard' }) %>
4
+ <body>
5
+ <div class="page-wrapper">
6
+ <%- include('header') %>
7
+ <%- include('sidebar', { activePage: typeof activePage !== 'undefined' ? activePage : '' }) %>
8
+ <main id="main-content">
@@ -0,0 +1,181 @@
1
+ <h1>Phase <%= phaseId %>: <%= phaseName %></h1>
2
+
3
+ <p><a href="/">&larr; Back to Dashboard</a></p>
4
+
5
+ <% if (verification) { %>
6
+ <!-- Verification Summary Card -->
7
+ <article>
8
+ <header>
9
+ <strong>Verification Status</strong>
10
+ </header>
11
+ <%
12
+ // Map verification status to CSS status-badge data-status values
13
+ var verificationCssStatus = 'not-started';
14
+ if (verification.status === 'passed') verificationCssStatus = 'complete';
15
+ else if (verification.status === 'failed') verificationCssStatus = 'blocked';
16
+ else if (verification.status === 'partial') verificationCssStatus = 'in-progress';
17
+ %>
18
+ <p>
19
+ <span class="status-badge" data-status="<%= verificationCssStatus %>">
20
+ <%= verification.status.toUpperCase() %>
21
+ </span>
22
+ <% if (verification.verified) { %>
23
+ &nbsp; Verified: <%= new Date(verification.verified).toLocaleString() %>
24
+ <% } %>
25
+ </p>
26
+ <% if (verification.score) { %>
27
+ <p>
28
+ Score: <%= verification.score.verified %>/<%= verification.score.total_must_haves %> must-haves verified
29
+ </p>
30
+ <% if (verification.score.failed > 0) { %>
31
+ <p><strong><%= verification.score.failed %> must-haves FAILED</strong></p>
32
+ <% } %>
33
+ <% } %>
34
+ <% if (verification.gaps && verification.gaps.length > 0) { %>
35
+ <details>
36
+ <summary>Verification Gaps (<%= verification.gaps.length %>)</summary>
37
+ <ul>
38
+ <% verification.gaps.forEach(function(gap) { %>
39
+ <li><%= gap %></li>
40
+ <% }); %>
41
+ </ul>
42
+ </details>
43
+ <% } %>
44
+ </article>
45
+ <% } %>
46
+
47
+ <% if (plans.length === 0) { %>
48
+ <!-- Empty State -->
49
+ <article>
50
+ <p>No plans found for this phase. This phase may not have been planned yet.</p>
51
+ </article>
52
+ <% } else { %>
53
+
54
+ <h2>Plans (<%= plans.length %>)</h2>
55
+
56
+ <!-- Plan Cards -->
57
+ <% plans.forEach(function(plan) { %>
58
+ <article>
59
+ <header>
60
+ <strong>Plan <%= plan.planId %></strong>
61
+ <% if (plan.summary && plan.summary.status) { %>
62
+ &nbsp;
63
+ <span class="status-badge" data-status="<%= plan.summary.status %>">
64
+ <%= plan.summary.status.replace('-', ' ') %>
65
+ </span>
66
+ <% } %>
67
+ </header>
68
+
69
+ <% if (plan.summary) { %>
70
+
71
+ <% if (plan.summary.subsystem) { %>
72
+ <p><strong>Subsystem:</strong> <%= plan.summary.subsystem %></p>
73
+ <% } %>
74
+
75
+ <% if (plan.summary.key_decisions && plan.summary.key_decisions.length > 0) { %>
76
+ <details>
77
+ <summary>Key Decisions (<%= plan.summary.key_decisions.length %>)</summary>
78
+ <ul>
79
+ <% plan.summary.key_decisions.forEach(function(decision) { %>
80
+ <li><%= decision %></li>
81
+ <% }); %>
82
+ </ul>
83
+ </details>
84
+ <% } %>
85
+
86
+ <% if (plan.summary.key_files && plan.summary.key_files.length > 0) { %>
87
+ <details>
88
+ <summary>Key Files (<%= plan.summary.key_files.length %>)</summary>
89
+ <ul>
90
+ <% plan.summary.key_files.forEach(function(file) { %>
91
+ <li><code><%= file %></code></li>
92
+ <% }); %>
93
+ </ul>
94
+ </details>
95
+ <% } %>
96
+
97
+ <% if (plan.summary.deferred && plan.summary.deferred.length > 0) { %>
98
+ <details>
99
+ <summary>Deferred Items (<%= plan.summary.deferred.length %>)</summary>
100
+ <ul>
101
+ <% plan.summary.deferred.forEach(function(item) { %>
102
+ <li><%= item %></li>
103
+ <% }); %>
104
+ </ul>
105
+ </details>
106
+ <% } %>
107
+
108
+ <% if (plan.summary.metrics) { %>
109
+ <p>
110
+ <small>
111
+ <% if (plan.summary.metrics.duration_minutes != null) { %>
112
+ Duration: <%= plan.summary.metrics.duration_minutes %> min
113
+ <% } %>
114
+ <% if (plan.summary.metrics.commits != null) { %>
115
+ | Commits: <%= plan.summary.metrics.commits %>
116
+ <% } %>
117
+ <% if (plan.summary.metrics.files_created != null || plan.summary.metrics.files_modified != null) { %>
118
+ | Files: <%= plan.summary.metrics.files_created || 0 %> created, <%= plan.summary.metrics.files_modified || 0 %> modified
119
+ <% } %>
120
+ </small>
121
+ </p>
122
+ <% } %>
123
+
124
+ <% } else { %>
125
+ <!-- Plan exists but not executed yet -->
126
+ <p><em>Plan file exists but has not been executed yet. No summary available.</em></p>
127
+ <% } %>
128
+ </article>
129
+ <% }); %>
130
+
131
+ <% } %>
132
+
133
+ <!-- Commit History Section -->
134
+ <%
135
+ // Collect all commits across all plans, tagged with their planId
136
+ var allCommits = [];
137
+ plans.forEach(function(plan) {
138
+ if (plan.commits && plan.commits.length > 0) {
139
+ plan.commits.forEach(function(commit) {
140
+ allCommits.push({ planId: plan.planId, commit: commit });
141
+ });
142
+ }
143
+ });
144
+ %>
145
+
146
+ <h2>Commit History (<%= allCommits.length %>)</h2>
147
+
148
+ <% if (allCommits.length === 0) { %>
149
+ <article>
150
+ <p><em>No commits yet for this phase.</em></p>
151
+ </article>
152
+ <% } else { %>
153
+ <div class="table-wrap">
154
+ <table>
155
+ <thead>
156
+ <tr>
157
+ <th>Commit</th>
158
+ <th>Task</th>
159
+ <th>Plan</th>
160
+ <th>Files</th>
161
+ <th>Status</th>
162
+ </tr>
163
+ </thead>
164
+ <tbody>
165
+ <% allCommits.forEach(function(entry) { %>
166
+ <tr>
167
+ <td><code><%= entry.commit.hash %></code></td>
168
+ <td><%= entry.commit.task %></td>
169
+ <td><%= entry.planId %></td>
170
+ <td><%= entry.commit.files %></td>
171
+ <td>
172
+ <span class="status-badge" data-status="<%= entry.commit.verify === 'passed' ? 'complete' : (entry.commit.verify === 'failed' ? 'blocked' : 'in-progress') %>">
173
+ <%= entry.commit.verify %>
174
+ </span>
175
+ </td>
176
+ </tr>
177
+ <% }); %>
178
+ </tbody>
179
+ </table>
180
+ </div>
181
+ <% } %>
@@ -0,0 +1,117 @@
1
+ <h1>Phases</h1>
2
+
3
+ <% if (phases.length === 0) { %>
4
+ <article>
5
+ <p>No phases found. Add a ROADMAP.md file to your .planning/ directory to see phases here.</p>
6
+ </article>
7
+ <% } else { %>
8
+
9
+ <%
10
+ // Build milestone-to-phases mapping
11
+ const milestoneGroups = milestones.map(m => ({
12
+ ...m,
13
+ phases: phases.filter(p => p.id >= m.startPhase && p.id <= m.endPhase)
14
+ })).filter(g => g.phases.length > 0);
15
+
16
+ // Collect any phases not covered by a milestone
17
+ const coveredIds = new Set(milestoneGroups.flatMap(g => g.phases.map(p => p.id)));
18
+ const ungrouped = phases.filter(p => !coveredIds.has(p.id));
19
+ %>
20
+
21
+ <!-- Summary -->
22
+ <article>
23
+ <header><strong>Summary</strong></header>
24
+ <p>
25
+ <%= phases.filter(p => p.status === 'complete').length %> of <%= phases.length %> phases complete
26
+ across <%= milestoneGroups.length %> milestone<%= milestoneGroups.length !== 1 ? 's' : '' %>.
27
+ </p>
28
+ <progress value="<%= phases.filter(p => p.status === 'complete').length %>" max="<%= phases.length %>"></progress>
29
+ </article>
30
+
31
+ <% milestoneGroups.forEach(function(group) { %>
32
+ <article>
33
+ <header>
34
+ <strong><%= group.name %></strong>
35
+ <small>(Phases <%= String(group.startPhase).padStart(2, '0') %>&ndash;<%= String(group.endPhase).padStart(2, '0') %>)</small>
36
+ &mdash;
37
+ <%
38
+ const groupComplete = group.phases.filter(p => p.status === 'complete').length;
39
+ const groupTotal = group.phases.length;
40
+ %>
41
+ <span class="status-badge" data-status="<%= groupComplete === groupTotal ? 'complete' : (groupComplete > 0 ? 'in-progress' : 'not-started') %>">
42
+ <%= groupComplete %>/<%= groupTotal %>
43
+ </span>
44
+ </header>
45
+ <% if (group.goal) { %>
46
+ <p><small><%= group.goal %></small></p>
47
+ <% } %>
48
+ <div class="table-wrap">
49
+ <table>
50
+ <thead>
51
+ <tr>
52
+ <th scope="col">Phase</th>
53
+ <th scope="col">Name</th>
54
+ <th scope="col">Plans</th>
55
+ <th scope="col">Status</th>
56
+ </tr>
57
+ </thead>
58
+ <tbody>
59
+ <% group.phases.forEach(function(phase) { %>
60
+ <tr>
61
+ <td><%= String(phase.id).padStart(2, '0') %></td>
62
+ <td>
63
+ <a href="/phases/<%= String(phase.id).padStart(2, '0') %>">
64
+ <%= phase.name %>
65
+ </a>
66
+ </td>
67
+ <td><%= phase.planCount %></td>
68
+ <td>
69
+ <span class="status-badge" data-status="<%= phase.status %>">
70
+ <%= phase.status.replace('-', ' ') %>
71
+ </span>
72
+ </td>
73
+ </tr>
74
+ <% }); %>
75
+ </tbody>
76
+ </table>
77
+ </div>
78
+ </article>
79
+ <% }); %>
80
+
81
+ <% if (ungrouped.length > 0) { %>
82
+ <article>
83
+ <header><strong>Other Phases</strong></header>
84
+ <div class="table-wrap">
85
+ <table>
86
+ <thead>
87
+ <tr>
88
+ <th scope="col">Phase</th>
89
+ <th scope="col">Name</th>
90
+ <th scope="col">Plans</th>
91
+ <th scope="col">Status</th>
92
+ </tr>
93
+ </thead>
94
+ <tbody>
95
+ <% ungrouped.forEach(function(phase) { %>
96
+ <tr>
97
+ <td><%= String(phase.id).padStart(2, '0') %></td>
98
+ <td>
99
+ <a href="/phases/<%= String(phase.id).padStart(2, '0') %>">
100
+ <%= phase.name %>
101
+ </a>
102
+ </td>
103
+ <td><%= phase.planCount %></td>
104
+ <td>
105
+ <span class="status-badge" data-status="<%= phase.status %>">
106
+ <%= phase.status.replace('-', ' ') %>
107
+ </span>
108
+ </td>
109
+ </tr>
110
+ <% }); %>
111
+ </tbody>
112
+ </table>
113
+ </div>
114
+ </article>
115
+ <% } %>
116
+
117
+ <% } %>
@@ -0,0 +1,142 @@
1
+ <h1>Project Roadmap</h1>
2
+
3
+ <% if (phases.length === 0) { %>
4
+ <article>
5
+ <p>No phases found. Add a ROADMAP.md file to your .planning/ directory to see the roadmap here.</p>
6
+ </article>
7
+ <% } else { %>
8
+
9
+ <%
10
+ // Group phases by milestone
11
+ const msGroups = (typeof milestones !== 'undefined' && milestones.length > 0)
12
+ ? milestones.map(m => ({
13
+ ...m,
14
+ phases: phases.filter(p => p.id >= m.startPhase && p.id <= m.endPhase)
15
+ })).filter(g => g.phases.length > 0)
16
+ : [{ name: 'All Phases', goal: '', startPhase: 1, endPhase: 9999, phases: phases }];
17
+
18
+ const coveredIds = new Set(msGroups.flatMap(g => g.phases.map(p => p.id)));
19
+ const ungroupedPhases = phases.filter(p => !coveredIds.has(p.id));
20
+ %>
21
+
22
+ <!-- Overall Progress -->
23
+ <article>
24
+ <header><strong>Overall Progress</strong></header>
25
+ <%
26
+ const totalComplete = phases.filter(p => p.status === 'complete').length;
27
+ const totalPhases = phases.length;
28
+ const pct = totalPhases > 0 ? Math.round((totalComplete / totalPhases) * 100) : 0;
29
+ %>
30
+ <progress value="<%= totalComplete %>" max="<%= totalPhases %>"></progress>
31
+ <p><%= pct %>% complete (<%= totalComplete %> of <%= totalPhases %> phases)</p>
32
+ </article>
33
+
34
+ <% msGroups.forEach(function(group) { %>
35
+ <article>
36
+ <header>
37
+ <strong><%= group.name %></strong>
38
+ <% if (group.startPhase && group.endPhase < 9999) { %>
39
+ <small>(Phases <%= String(group.startPhase).padStart(2, '0') %>&ndash;<%= String(group.endPhase).padStart(2, '0') %>)</small>
40
+ <% } %>
41
+ &mdash;
42
+ <%
43
+ const gc = group.phases.filter(p => p.status === 'complete').length;
44
+ const gt = group.phases.length;
45
+ %>
46
+ <span class="status-badge" data-status="<%= gc === gt ? 'complete' : (gc > 0 ? 'in-progress' : 'not-started') %>">
47
+ <%= gc %>/<%= gt %>
48
+ </span>
49
+ </header>
50
+ <% if (group.goal) { %>
51
+ <p><small><%= group.goal %></small></p>
52
+ <% } %>
53
+ <div class="table-wrap">
54
+ <table>
55
+ <thead>
56
+ <tr>
57
+ <th scope="col">Phase</th>
58
+ <th scope="col">Name</th>
59
+ <th scope="col">Plans</th>
60
+ <th scope="col">Status</th>
61
+ <th scope="col">Depends On</th>
62
+ </tr>
63
+ </thead>
64
+ <tbody>
65
+ <% group.phases.forEach(function(phase) { %>
66
+ <tr>
67
+ <td><%= String(phase.id).padStart(2, '0') %></td>
68
+ <td>
69
+ <a href="/phases/<%= String(phase.id).padStart(2, '0') %>">
70
+ <%= phase.name %>
71
+ </a>
72
+ </td>
73
+ <td><%= phase.planCount %></td>
74
+ <td>
75
+ <span class="status-badge" data-status="<%= phase.status %>">
76
+ <%= phase.status.replace('-', ' ') %>
77
+ </span>
78
+ </td>
79
+ <td>
80
+ <% if (phase.dependencies && phase.dependencies.length > 0) { %>
81
+ <% phase.dependencies.forEach(function(dep, idx) { %>
82
+ <a href="/phases/<%= String(dep).padStart(2, '0') %>"><%= String(dep).padStart(2, '0') %></a><% if (idx < phase.dependencies.length - 1) { %>, <% } %>
83
+ <% }); %>
84
+ <% } else { %>
85
+ <small>None</small>
86
+ <% } %>
87
+ </td>
88
+ </tr>
89
+ <% }); %>
90
+ </tbody>
91
+ </table>
92
+ </div>
93
+ </article>
94
+ <% }); %>
95
+
96
+ <% if (ungroupedPhases.length > 0) { %>
97
+ <article>
98
+ <header><strong>Other Phases</strong></header>
99
+ <div class="table-wrap">
100
+ <table>
101
+ <thead>
102
+ <tr>
103
+ <th scope="col">Phase</th>
104
+ <th scope="col">Name</th>
105
+ <th scope="col">Plans</th>
106
+ <th scope="col">Status</th>
107
+ <th scope="col">Depends On</th>
108
+ </tr>
109
+ </thead>
110
+ <tbody>
111
+ <% ungroupedPhases.forEach(function(phase) { %>
112
+ <tr>
113
+ <td><%= String(phase.id).padStart(2, '0') %></td>
114
+ <td>
115
+ <a href="/phases/<%= String(phase.id).padStart(2, '0') %>">
116
+ <%= phase.name %>
117
+ </a>
118
+ </td>
119
+ <td><%= phase.planCount %></td>
120
+ <td>
121
+ <span class="status-badge" data-status="<%= phase.status %>">
122
+ <%= phase.status.replace('-', ' ') %>
123
+ </span>
124
+ </td>
125
+ <td>
126
+ <% if (phase.dependencies && phase.dependencies.length > 0) { %>
127
+ <% phase.dependencies.forEach(function(dep, idx) { %>
128
+ <a href="/phases/<%= String(dep).padStart(2, '0') %>"><%= String(dep).padStart(2, '0') %></a><% if (idx < phase.dependencies.length - 1) { %>, <% } %>
129
+ <% }); %>
130
+ <% } else { %>
131
+ <small>None</small>
132
+ <% } %>
133
+ </td>
134
+ </tr>
135
+ <% }); %>
136
+ </tbody>
137
+ </table>
138
+ </div>
139
+ </article>
140
+ <% } %>
141
+
142
+ <% } %>