orbital-command 0.2.0 → 1.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 (431) hide show
  1. package/README.md +67 -42
  2. package/bin/commands/config.js +19 -0
  3. package/bin/commands/events.js +40 -0
  4. package/bin/commands/launch.js +126 -0
  5. package/bin/commands/manifest.js +283 -0
  6. package/bin/commands/registry.js +104 -0
  7. package/bin/commands/update.js +24 -0
  8. package/bin/lib/helpers.js +229 -0
  9. package/bin/orbital.js +147 -319
  10. package/dist/assets/Landing-CfQdHR0N.js +11 -0
  11. package/dist/assets/PrimitivesConfig-DThSipFy.js +32 -0
  12. package/dist/assets/QualityGates-B4kxM5UU.js +26 -0
  13. package/dist/assets/SessionTimeline-Bz1iZnmg.js +1 -0
  14. package/dist/assets/Settings-DLcZwbCT.js +12 -0
  15. package/dist/assets/SourceControl-BMNIz7Lt.js +36 -0
  16. package/dist/assets/WorkflowVisualizer-CxuSBOYu.js +69 -0
  17. package/dist/assets/arrow-down-DVPp6_qp.js +6 -0
  18. package/dist/assets/bot-NFaJBDn_.js +6 -0
  19. package/dist/assets/charts-LGLb8hyU.js +68 -0
  20. package/dist/assets/circle-x-IsFCkBZu.js +6 -0
  21. package/dist/assets/file-text-J1cebZXF.js +6 -0
  22. package/dist/assets/globe-WzeyHsUc.js +6 -0
  23. package/dist/assets/index-BdJ57EhC.css +1 -0
  24. package/dist/assets/index-o4ScMAuR.js +349 -0
  25. package/dist/assets/key-CKR8JJSj.js +6 -0
  26. package/dist/assets/minus-CHBsJyjp.js +6 -0
  27. package/dist/assets/radio-xqZaR-Uk.js +6 -0
  28. package/dist/assets/rocket-D_xvvNG6.js +6 -0
  29. package/dist/assets/shield-TdB1yv_a.js +6 -0
  30. package/dist/assets/ui-BmsSg9jU.js +53 -0
  31. package/dist/assets/useSocketListener-0L5yiN5i.js +1 -0
  32. package/dist/assets/useWorkflowEditor-CqeRWVQX.js +11 -0
  33. package/dist/assets/{vendor-Dzv9lrRc.js → vendor-Bqt8AJn2.js} +1 -1
  34. package/dist/assets/workflow-constants-Rw-GmgHZ.js +6 -0
  35. package/dist/assets/zap-C9wqYMpl.js +6 -0
  36. package/dist/favicon.svg +1 -0
  37. package/dist/index.html +6 -5
  38. package/dist/server/server/__tests__/data-routes.test.js +126 -0
  39. package/dist/server/server/__tests__/helpers/db.js +17 -0
  40. package/dist/server/server/__tests__/helpers/mock-emitter.js +8 -0
  41. package/dist/server/server/__tests__/scope-routes.test.js +138 -0
  42. package/dist/server/server/__tests__/sprint-routes.test.js +102 -0
  43. package/dist/server/server/__tests__/workflow-routes.test.js +107 -0
  44. package/dist/server/server/config-migrator.js +135 -0
  45. package/dist/server/server/config.js +51 -7
  46. package/dist/server/server/database.js +21 -28
  47. package/dist/server/server/global-config.js +143 -0
  48. package/dist/server/server/index.js +118 -276
  49. package/dist/server/server/init.js +243 -225
  50. package/dist/server/server/launch.js +29 -0
  51. package/dist/server/server/manifest-types.js +8 -0
  52. package/dist/server/server/manifest.js +454 -0
  53. package/dist/server/server/migrate-legacy.js +229 -0
  54. package/dist/server/server/parsers/event-parser.js +4 -1
  55. package/dist/server/server/parsers/event-parser.test.js +117 -0
  56. package/dist/server/server/parsers/scope-parser.js +74 -28
  57. package/dist/server/server/parsers/scope-parser.test.js +230 -0
  58. package/dist/server/server/project-context.js +265 -0
  59. package/dist/server/server/project-emitter.js +41 -0
  60. package/dist/server/server/project-manager.js +297 -0
  61. package/dist/server/server/routes/aggregate-routes.js +871 -0
  62. package/dist/server/server/routes/config-routes.js +41 -90
  63. package/dist/server/server/routes/data-routes.js +25 -123
  64. package/dist/server/server/routes/dispatch-routes.js +37 -15
  65. package/dist/server/server/routes/git-routes.js +74 -0
  66. package/dist/server/server/routes/manifest-routes.js +319 -0
  67. package/dist/server/server/routes/scope-routes.js +45 -28
  68. package/dist/server/server/routes/sync-routes.js +134 -0
  69. package/dist/server/server/routes/version-routes.js +1 -15
  70. package/dist/server/server/routes/workflow-routes.js +9 -3
  71. package/dist/server/server/schema.js +3 -0
  72. package/dist/server/server/services/batch-orchestrator.js +41 -17
  73. package/dist/server/server/services/claude-session-service.js +17 -14
  74. package/dist/server/server/services/config-service.js +10 -1
  75. package/dist/server/server/services/deploy-service.test.js +119 -0
  76. package/dist/server/server/services/event-service.js +64 -1
  77. package/dist/server/server/services/event-service.test.js +191 -0
  78. package/dist/server/server/services/gate-service.test.js +105 -0
  79. package/dist/server/server/services/git-service.js +108 -4
  80. package/dist/server/server/services/github-service.js +110 -2
  81. package/dist/server/server/services/readiness-service.test.js +190 -0
  82. package/dist/server/server/services/scope-cache.js +5 -1
  83. package/dist/server/server/services/scope-cache.test.js +142 -0
  84. package/dist/server/server/services/scope-service.js +222 -131
  85. package/dist/server/server/services/scope-service.test.js +137 -0
  86. package/dist/server/server/services/sprint-orchestrator.js +29 -15
  87. package/dist/server/server/services/sprint-service.js +23 -3
  88. package/dist/server/server/services/sprint-service.test.js +238 -0
  89. package/dist/server/server/services/sync-service.js +434 -0
  90. package/dist/server/server/services/sync-types.js +2 -0
  91. package/dist/server/server/services/workflow-service.js +26 -5
  92. package/dist/server/server/services/workflow-service.test.js +159 -0
  93. package/dist/server/server/settings-sync.js +284 -0
  94. package/dist/server/server/uninstall.js +195 -0
  95. package/dist/server/server/update-planner.js +279 -0
  96. package/dist/server/server/update.js +212 -0
  97. package/dist/server/server/utils/cc-hooks-parser.js +3 -0
  98. package/dist/server/server/utils/cc-hooks-parser.test.js +86 -0
  99. package/dist/server/server/utils/dispatch-utils.js +83 -24
  100. package/dist/server/server/utils/dispatch-utils.test.js +182 -0
  101. package/dist/server/server/utils/flag-builder.js +54 -0
  102. package/dist/server/server/utils/json-fields.js +14 -0
  103. package/dist/server/server/utils/json-fields.test.js +73 -0
  104. package/dist/server/server/utils/logger.js +37 -3
  105. package/dist/server/server/utils/package-info.js +30 -0
  106. package/dist/server/server/utils/route-helpers.js +47 -0
  107. package/dist/server/server/utils/route-helpers.test.js +115 -0
  108. package/dist/server/server/utils/terminal-launcher.js +79 -25
  109. package/dist/server/server/utils/worktree-manager.js +13 -4
  110. package/dist/server/server/validator.js +230 -0
  111. package/dist/server/server/watchers/event-watcher.js +28 -13
  112. package/dist/server/server/watchers/global-watcher.js +63 -0
  113. package/dist/server/server/watchers/scope-watcher.js +27 -12
  114. package/dist/server/server/wizard/config-editor.js +237 -0
  115. package/dist/server/server/wizard/detect.js +96 -0
  116. package/dist/server/server/wizard/doctor.js +115 -0
  117. package/dist/server/server/wizard/index.js +340 -0
  118. package/dist/server/server/wizard/phases/confirm.js +39 -0
  119. package/dist/server/server/wizard/phases/project-setup.js +90 -0
  120. package/dist/server/server/wizard/phases/setup-wizard.js +66 -0
  121. package/dist/server/server/wizard/phases/welcome.js +32 -0
  122. package/dist/server/server/wizard/phases/workflow-setup.js +22 -0
  123. package/dist/server/server/wizard/types.js +29 -0
  124. package/dist/server/server/wizard/ui.js +73 -0
  125. package/dist/server/shared/__fixtures__/workflow-configs.js +75 -0
  126. package/dist/server/shared/api-types.js +80 -1
  127. package/dist/server/shared/default-workflow.json +65 -0
  128. package/dist/server/shared/onboarding-tour.test.js +81 -0
  129. package/dist/server/shared/project-colors.js +24 -0
  130. package/dist/server/shared/workflow-config.test.js +84 -0
  131. package/dist/server/shared/workflow-engine.js +1 -1
  132. package/dist/server/shared/workflow-engine.test.js +302 -0
  133. package/dist/server/shared/workflow-normalizer.js +101 -0
  134. package/dist/server/shared/workflow-normalizer.test.js +100 -0
  135. package/dist/server/src/components/onboarding/tour-steps.js +84 -0
  136. package/package.json +34 -29
  137. package/schemas/orbital.config.schema.json +2 -5
  138. package/scripts/postinstall.js +18 -6
  139. package/scripts/release.sh +53 -0
  140. package/server/__tests__/data-routes.test.ts +151 -0
  141. package/server/__tests__/helpers/db.ts +19 -0
  142. package/server/__tests__/helpers/mock-emitter.ts +10 -0
  143. package/server/__tests__/scope-routes.test.ts +158 -0
  144. package/server/__tests__/sprint-routes.test.ts +118 -0
  145. package/server/__tests__/workflow-routes.test.ts +120 -0
  146. package/server/config-migrator.ts +160 -0
  147. package/server/config.ts +64 -12
  148. package/server/database.ts +22 -31
  149. package/server/global-config.ts +204 -0
  150. package/server/index.ts +139 -316
  151. package/server/init.ts +266 -234
  152. package/server/launch.ts +32 -0
  153. package/server/manifest-types.ts +145 -0
  154. package/server/manifest.ts +494 -0
  155. package/server/migrate-legacy.ts +290 -0
  156. package/server/parsers/event-parser.test.ts +135 -0
  157. package/server/parsers/event-parser.ts +4 -1
  158. package/server/parsers/scope-parser.test.ts +270 -0
  159. package/server/parsers/scope-parser.ts +79 -31
  160. package/server/project-context.ts +325 -0
  161. package/server/project-emitter.ts +50 -0
  162. package/server/project-manager.ts +368 -0
  163. package/server/routes/aggregate-routes.ts +968 -0
  164. package/server/routes/config-routes.ts +43 -85
  165. package/server/routes/data-routes.ts +34 -156
  166. package/server/routes/dispatch-routes.ts +46 -17
  167. package/server/routes/git-routes.ts +77 -0
  168. package/server/routes/manifest-routes.ts +388 -0
  169. package/server/routes/scope-routes.ts +39 -30
  170. package/server/routes/sync-routes.ts +175 -0
  171. package/server/routes/version-routes.ts +1 -16
  172. package/server/routes/workflow-routes.ts +9 -3
  173. package/server/schema.ts +3 -0
  174. package/server/services/batch-orchestrator.ts +41 -17
  175. package/server/services/claude-session-service.ts +16 -14
  176. package/server/services/config-service.ts +10 -1
  177. package/server/services/deploy-service.test.ts +145 -0
  178. package/server/services/deploy-service.ts +2 -2
  179. package/server/services/event-service.test.ts +242 -0
  180. package/server/services/event-service.ts +92 -3
  181. package/server/services/gate-service.test.ts +131 -0
  182. package/server/services/gate-service.ts +2 -2
  183. package/server/services/git-service.ts +137 -4
  184. package/server/services/github-service.ts +120 -2
  185. package/server/services/readiness-service.test.ts +217 -0
  186. package/server/services/scope-cache.test.ts +167 -0
  187. package/server/services/scope-cache.ts +4 -1
  188. package/server/services/scope-service.test.ts +169 -0
  189. package/server/services/scope-service.ts +224 -130
  190. package/server/services/sprint-orchestrator.ts +30 -15
  191. package/server/services/sprint-service.test.ts +271 -0
  192. package/server/services/sprint-service.ts +29 -5
  193. package/server/services/sync-service.ts +482 -0
  194. package/server/services/sync-types.ts +77 -0
  195. package/server/services/workflow-service.test.ts +190 -0
  196. package/server/services/workflow-service.ts +29 -9
  197. package/server/settings-sync.ts +359 -0
  198. package/server/uninstall.ts +214 -0
  199. package/server/update-planner.ts +346 -0
  200. package/server/update.ts +263 -0
  201. package/server/utils/cc-hooks-parser.test.ts +96 -0
  202. package/server/utils/cc-hooks-parser.ts +4 -0
  203. package/server/utils/dispatch-utils.test.ts +245 -0
  204. package/server/utils/dispatch-utils.ts +102 -30
  205. package/server/utils/flag-builder.ts +56 -0
  206. package/server/utils/json-fields.test.ts +83 -0
  207. package/server/utils/json-fields.ts +14 -0
  208. package/server/utils/logger.ts +40 -3
  209. package/server/utils/package-info.ts +32 -0
  210. package/server/utils/route-helpers.test.ts +144 -0
  211. package/server/utils/route-helpers.ts +50 -0
  212. package/server/utils/terminal-launcher.ts +85 -25
  213. package/server/utils/worktree-manager.ts +9 -4
  214. package/server/validator.ts +270 -0
  215. package/server/watchers/event-watcher.ts +24 -12
  216. package/server/watchers/global-watcher.ts +77 -0
  217. package/server/watchers/scope-watcher.ts +21 -9
  218. package/server/wizard/config-editor.ts +248 -0
  219. package/server/wizard/detect.ts +104 -0
  220. package/server/wizard/doctor.ts +114 -0
  221. package/server/wizard/index.ts +438 -0
  222. package/server/wizard/phases/confirm.ts +45 -0
  223. package/server/wizard/phases/project-setup.ts +106 -0
  224. package/server/wizard/phases/setup-wizard.ts +78 -0
  225. package/server/wizard/phases/welcome.ts +39 -0
  226. package/server/wizard/phases/workflow-setup.ts +28 -0
  227. package/server/wizard/types.ts +56 -0
  228. package/server/wizard/ui.ts +92 -0
  229. package/shared/__fixtures__/workflow-configs.ts +80 -0
  230. package/shared/api-types.ts +106 -0
  231. package/shared/onboarding-tour.test.ts +94 -0
  232. package/shared/project-colors.ts +24 -0
  233. package/shared/workflow-config.test.ts +111 -0
  234. package/shared/workflow-config.ts +7 -0
  235. package/shared/workflow-engine.test.ts +388 -0
  236. package/shared/workflow-engine.ts +1 -1
  237. package/shared/workflow-normalizer.test.ts +119 -0
  238. package/shared/workflow-normalizer.ts +118 -0
  239. package/templates/agents/QUICK-REFERENCE.md +1 -0
  240. package/templates/agents/README.md +1 -0
  241. package/templates/agents/SKILL-TRIGGERS.md +11 -0
  242. package/templates/agents/green-team/deep-dive.md +361 -0
  243. package/templates/hooks/end-session.sh +4 -1
  244. package/templates/hooks/init-session.sh +1 -0
  245. package/templates/hooks/orbital-emit.sh +2 -2
  246. package/templates/hooks/orbital-report-deploy.sh +4 -4
  247. package/templates/hooks/orbital-report-gates.sh +4 -4
  248. package/templates/hooks/orbital-scope-update.sh +1 -1
  249. package/templates/hooks/scope-commit-logger.sh +2 -2
  250. package/templates/hooks/scope-create-cleanup.sh +2 -2
  251. package/templates/hooks/scope-create-gate.sh +2 -5
  252. package/templates/hooks/scope-gate.sh +4 -6
  253. package/templates/hooks/scope-helpers.sh +28 -1
  254. package/templates/hooks/scope-lifecycle-gate.sh +14 -5
  255. package/templates/hooks/scope-prepare.sh +67 -12
  256. package/templates/hooks/scope-transition.sh +14 -6
  257. package/templates/hooks/time-tracker.sh +2 -5
  258. package/templates/migrations/renames.json +1 -0
  259. package/templates/orbital.config.json +8 -6
  260. package/{shared/default-workflow.json → templates/presets/default.json} +65 -0
  261. package/templates/presets/development.json +4 -4
  262. package/templates/presets/gitflow.json +7 -0
  263. package/templates/prompts/README.md +23 -0
  264. package/templates/prompts/deep-dive-audit.md +94 -0
  265. package/templates/quick/rules.md +56 -5
  266. package/templates/settings-hooks.json +1 -1
  267. package/templates/skills/git-commit/SKILL.md +27 -7
  268. package/templates/skills/git-dev/SKILL.md +13 -4
  269. package/templates/skills/git-main/SKILL.md +13 -3
  270. package/templates/skills/git-production/SKILL.md +9 -2
  271. package/templates/skills/git-staging/SKILL.md +11 -3
  272. package/templates/skills/scope-create/SKILL.md +17 -3
  273. package/templates/skills/scope-fix-review/SKILL.md +14 -7
  274. package/templates/skills/scope-implement/SKILL.md +15 -4
  275. package/templates/skills/scope-post-review/SKILL.md +77 -7
  276. package/templates/skills/scope-pre-review/SKILL.md +11 -4
  277. package/templates/skills/scope-verify/SKILL.md +5 -3
  278. package/templates/skills/test-code-review/SKILL.md +41 -33
  279. package/templates/skills/test-scaffold/SKILL.md +222 -0
  280. package/dist/assets/WorkflowVisualizer-BZ21PIIF.js +0 -84
  281. package/dist/assets/charts-D__PA1zp.js +0 -72
  282. package/dist/assets/index-D1G6i0nS.css +0 -1
  283. package/dist/assets/index-DpItvKpf.js +0 -419
  284. package/dist/assets/ui-BvF022GT.js +0 -53
  285. package/index.html +0 -15
  286. package/postcss.config.js +0 -6
  287. package/src/App.tsx +0 -33
  288. package/src/components/AgentBadge.tsx +0 -40
  289. package/src/components/BatchPreflightModal.tsx +0 -115
  290. package/src/components/CardDisplayToggle.tsx +0 -74
  291. package/src/components/ColumnHeaderActions.tsx +0 -55
  292. package/src/components/ColumnMenu.tsx +0 -99
  293. package/src/components/DeployHistory.tsx +0 -141
  294. package/src/components/DispatchModal.tsx +0 -164
  295. package/src/components/DispatchPopover.tsx +0 -139
  296. package/src/components/DragOverlay.tsx +0 -25
  297. package/src/components/DriftSidebar.tsx +0 -140
  298. package/src/components/EnvironmentStrip.tsx +0 -88
  299. package/src/components/ErrorBoundary.tsx +0 -62
  300. package/src/components/FilterChip.tsx +0 -105
  301. package/src/components/GateIndicator.tsx +0 -33
  302. package/src/components/IdeaDetailModal.tsx +0 -190
  303. package/src/components/IdeaFormDialog.tsx +0 -113
  304. package/src/components/KanbanColumn.tsx +0 -201
  305. package/src/components/MarkdownRenderer.tsx +0 -114
  306. package/src/components/NeonGrid.tsx +0 -128
  307. package/src/components/PromotionQueue.tsx +0 -89
  308. package/src/components/ScopeCard.tsx +0 -234
  309. package/src/components/ScopeDetailModal.tsx +0 -255
  310. package/src/components/ScopeFilterBar.tsx +0 -152
  311. package/src/components/SearchInput.tsx +0 -102
  312. package/src/components/SessionPanel.tsx +0 -335
  313. package/src/components/SprintContainer.tsx +0 -303
  314. package/src/components/SprintDependencyDialog.tsx +0 -78
  315. package/src/components/SprintPreflightModal.tsx +0 -138
  316. package/src/components/StatusBar.tsx +0 -168
  317. package/src/components/SwimCell.tsx +0 -67
  318. package/src/components/SwimLaneRow.tsx +0 -94
  319. package/src/components/SwimlaneBoardView.tsx +0 -108
  320. package/src/components/VersionBadge.tsx +0 -139
  321. package/src/components/ViewModeSelector.tsx +0 -114
  322. package/src/components/config/AgentChip.tsx +0 -53
  323. package/src/components/config/AgentCreateDialog.tsx +0 -321
  324. package/src/components/config/AgentEditor.tsx +0 -175
  325. package/src/components/config/DirectoryTree.tsx +0 -582
  326. package/src/components/config/FileEditor.tsx +0 -550
  327. package/src/components/config/HookChip.tsx +0 -50
  328. package/src/components/config/StageCard.tsx +0 -198
  329. package/src/components/config/TransitionZone.tsx +0 -173
  330. package/src/components/config/UnifiedWorkflowPipeline.tsx +0 -216
  331. package/src/components/config/WorkflowPipeline.tsx +0 -161
  332. package/src/components/source-control/BranchList.tsx +0 -93
  333. package/src/components/source-control/BranchPanel.tsx +0 -105
  334. package/src/components/source-control/CommitLog.tsx +0 -100
  335. package/src/components/source-control/CommitRow.tsx +0 -47
  336. package/src/components/source-control/GitHubPanel.tsx +0 -110
  337. package/src/components/source-control/GitHubSetupGuide.tsx +0 -52
  338. package/src/components/source-control/GitOverviewBar.tsx +0 -101
  339. package/src/components/source-control/PullRequestList.tsx +0 -69
  340. package/src/components/source-control/WorktreeList.tsx +0 -80
  341. package/src/components/ui/badge.tsx +0 -41
  342. package/src/components/ui/button.tsx +0 -55
  343. package/src/components/ui/card.tsx +0 -78
  344. package/src/components/ui/dialog.tsx +0 -94
  345. package/src/components/ui/popover.tsx +0 -33
  346. package/src/components/ui/scroll-area.tsx +0 -54
  347. package/src/components/ui/separator.tsx +0 -28
  348. package/src/components/ui/tabs.tsx +0 -52
  349. package/src/components/ui/toggle-switch.tsx +0 -35
  350. package/src/components/ui/tooltip.tsx +0 -27
  351. package/src/components/workflow/AddEdgeDialog.tsx +0 -217
  352. package/src/components/workflow/AddListDialog.tsx +0 -201
  353. package/src/components/workflow/ChecklistEditor.tsx +0 -239
  354. package/src/components/workflow/CommandPrefixManager.tsx +0 -118
  355. package/src/components/workflow/ConfigSettingsPanel.tsx +0 -189
  356. package/src/components/workflow/DirectionSelector.tsx +0 -133
  357. package/src/components/workflow/DispatchConfigPanel.tsx +0 -180
  358. package/src/components/workflow/EdgeDetailPanel.tsx +0 -236
  359. package/src/components/workflow/EdgePropertyEditor.tsx +0 -251
  360. package/src/components/workflow/EditToolbar.tsx +0 -138
  361. package/src/components/workflow/HookDetailPanel.tsx +0 -250
  362. package/src/components/workflow/HookExecutionLog.tsx +0 -24
  363. package/src/components/workflow/HookSourceModal.tsx +0 -129
  364. package/src/components/workflow/HooksDashboard.tsx +0 -363
  365. package/src/components/workflow/ListPropertyEditor.tsx +0 -251
  366. package/src/components/workflow/MigrationPreviewDialog.tsx +0 -237
  367. package/src/components/workflow/MovementRulesPanel.tsx +0 -188
  368. package/src/components/workflow/NodeDetailPanel.tsx +0 -245
  369. package/src/components/workflow/PresetSelector.tsx +0 -414
  370. package/src/components/workflow/SkillCommandBuilder.tsx +0 -174
  371. package/src/components/workflow/WorkflowEdgeComponent.tsx +0 -145
  372. package/src/components/workflow/WorkflowNode.tsx +0 -147
  373. package/src/components/workflow/graphLayout.ts +0 -186
  374. package/src/components/workflow/mergeHooks.ts +0 -85
  375. package/src/components/workflow/useEditHistory.ts +0 -88
  376. package/src/components/workflow/useWorkflowEditor.ts +0 -262
  377. package/src/components/workflow/validateConfig.ts +0 -70
  378. package/src/hooks/useActiveDispatches.ts +0 -198
  379. package/src/hooks/useBoardSettings.ts +0 -170
  380. package/src/hooks/useCardDisplay.ts +0 -57
  381. package/src/hooks/useCcHooks.ts +0 -24
  382. package/src/hooks/useConfigTree.ts +0 -51
  383. package/src/hooks/useEnforcementRules.ts +0 -46
  384. package/src/hooks/useEvents.ts +0 -59
  385. package/src/hooks/useFileEditor.ts +0 -165
  386. package/src/hooks/useGates.ts +0 -57
  387. package/src/hooks/useIdeaActions.ts +0 -53
  388. package/src/hooks/useKanbanDnd.ts +0 -410
  389. package/src/hooks/useOrbitalConfig.ts +0 -54
  390. package/src/hooks/usePipeline.ts +0 -47
  391. package/src/hooks/usePipelineData.ts +0 -338
  392. package/src/hooks/useReconnect.ts +0 -25
  393. package/src/hooks/useScopeFilters.ts +0 -125
  394. package/src/hooks/useScopeSessions.ts +0 -44
  395. package/src/hooks/useScopes.ts +0 -67
  396. package/src/hooks/useSearch.ts +0 -67
  397. package/src/hooks/useSettings.tsx +0 -187
  398. package/src/hooks/useSocket.ts +0 -25
  399. package/src/hooks/useSourceControl.ts +0 -105
  400. package/src/hooks/useSprintPreflight.ts +0 -55
  401. package/src/hooks/useSprints.ts +0 -154
  402. package/src/hooks/useStatusBarHighlight.ts +0 -18
  403. package/src/hooks/useSwimlaneBoardSettings.ts +0 -104
  404. package/src/hooks/useTheme.ts +0 -9
  405. package/src/hooks/useTransitionReadiness.ts +0 -53
  406. package/src/hooks/useVersion.ts +0 -155
  407. package/src/hooks/useViolations.ts +0 -65
  408. package/src/hooks/useWorkflow.tsx +0 -125
  409. package/src/hooks/useZoomModifier.ts +0 -19
  410. package/src/index.css +0 -797
  411. package/src/layouts/DashboardLayout.tsx +0 -113
  412. package/src/lib/collisionDetection.ts +0 -20
  413. package/src/lib/scope-fields.ts +0 -61
  414. package/src/lib/swimlane.ts +0 -146
  415. package/src/lib/utils.ts +0 -15
  416. package/src/main.tsx +0 -19
  417. package/src/socket.ts +0 -11
  418. package/src/types/index.ts +0 -497
  419. package/src/views/AgentFeed.tsx +0 -339
  420. package/src/views/DeployPipeline.tsx +0 -59
  421. package/src/views/EnforcementView.tsx +0 -378
  422. package/src/views/PrimitivesConfig.tsx +0 -500
  423. package/src/views/QualityGates.tsx +0 -1012
  424. package/src/views/ScopeBoard.tsx +0 -454
  425. package/src/views/SessionTimeline.tsx +0 -516
  426. package/src/views/Settings.tsx +0 -183
  427. package/src/views/SourceControl.tsx +0 -95
  428. package/src/views/WorkflowVisualizer.tsx +0 -382
  429. package/tailwind.config.js +0 -161
  430. package/tsconfig.json +0 -25
  431. package/vite.config.ts +0 -38
@@ -5,7 +5,7 @@
5
5
  # session recording, and gate cleanup into a single Bash call.
6
6
  #
7
7
  # Modes:
8
- # --promote ID Promote icebox idea to planning (renumber + move + scaffold)
8
+ # --promote SLUG|ID Promote icebox idea to planning (renumber + move + scaffold)
9
9
  # --scaffold ID Apply template to existing planning scope
10
10
  # --new Create brand new scope
11
11
  #
@@ -13,6 +13,7 @@
13
13
  # --title "..." Scope title (required for --new)
14
14
  # --desc "..." Description / problem statement
15
15
  # --category "..." Category tag (default: TBD)
16
+ # --effort "..." Effort estimate (default: TBD)
16
17
  #
17
18
  # Output: JSON to stdout
18
19
  # Errors: to stderr
@@ -28,6 +29,7 @@ SOURCE_ID=""
28
29
  TITLE=""
29
30
  DESCRIPTION=""
30
31
  CATEGORY="TBD"
32
+ EFFORT="TBD"
31
33
 
32
34
  while [[ $# -gt 0 ]]; do
33
35
  case "$1" in
@@ -37,12 +39,13 @@ while [[ $# -gt 0 ]]; do
37
39
  --title) TITLE="$2"; shift 2 ;;
38
40
  --desc) DESCRIPTION="$2"; shift 2 ;;
39
41
  --category) CATEGORY="$2"; shift 2 ;;
42
+ --effort) EFFORT="$2"; shift 2 ;;
40
43
  *) echo "Unknown argument: $1" >&2; exit 1 ;;
41
44
  esac
42
45
  done
43
46
 
44
47
  if [ -z "$MODE" ]; then
45
- echo "Usage: scope-prepare.sh --promote ID | --scaffold ID | --new --title \"...\"" >&2
48
+ echo "Usage: scope-prepare.sh --promote SLUG|ID | --scaffold ID | --new --title \"...\"" >&2
46
49
  exit 1
47
50
  fi
48
51
 
@@ -77,13 +80,18 @@ fi
77
80
 
78
81
  # ─── Resolve source file + extract metadata ─────────────────────
79
82
  OLD_FILE=""
83
+ FULL_BODY=""
80
84
  NOW_DATE=$(date +%Y-%m-%d)
81
85
  NOW_TIME=$(date +%H:%M)
82
86
  CREATED_DATE="$NOW_DATE"
83
87
 
84
88
  case "$MODE" in
85
89
  promote)
86
- OLD_FILE=$(find_scope_by_id "$SOURCE_ID")
90
+ # Try slug-based lookup first (new format), fall back to numeric ID (legacy)
91
+ OLD_FILE=$(find_scope_by_slug "$SOURCE_ID")
92
+ if [ -z "$OLD_FILE" ] || [ ! -f "$OLD_FILE" ]; then
93
+ OLD_FILE=$(find_scope_by_id "$SOURCE_ID")
94
+ fi
87
95
  if [ -z "$OLD_FILE" ] || [ ! -f "$OLD_FILE" ]; then
88
96
  echo "Error: Scope $SOURCE_ID not found" >&2
89
97
  exit 2
@@ -92,13 +100,18 @@ case "$MODE" in
92
100
  # Preserve original created date
93
101
  orig_created=$(get_frontmatter "$OLD_FILE" "created")
94
102
  [ -n "$orig_created" ] && CREATED_DATE="$orig_created"
95
- # Extract description from body (everything after frontmatter closing ---)
103
+ # Extract full body (everything after frontmatter closing ---) for template injection
104
+ FULL_BODY=$(awk 'BEGIN{fm=0} /^---$/{fm++; next} fm>=2{print}' "$OLD_FILE")
105
+ # Short description (first non-empty line) for JSON output
96
106
  if [ -z "$DESCRIPTION" ]; then
97
- DESCRIPTION=$(awk 'BEGIN{fm=0} /^---$/{fm++; next} fm>=2{print}' "$OLD_FILE" | head -20 | sed '/^$/d' | head -5)
107
+ DESCRIPTION=$(printf '%s' "$FULL_BODY" | sed '/^$/d' | head -1)
98
108
  fi
99
109
  # Get category if set
100
110
  orig_cat=$(get_frontmatter "$OLD_FILE" "category")
101
111
  [ -n "$orig_cat" ] && [ "$orig_cat" != "TBD" ] && CATEGORY="$orig_cat"
112
+ # Get effort if set
113
+ orig_effort=$(get_frontmatter "$OLD_FILE" "effort_estimate")
114
+ [ -n "$orig_effort" ] && [ "$orig_effort" != "TBD" ] && EFFORT="$orig_effort"
102
115
  ;;
103
116
 
104
117
  scaffold)
@@ -110,11 +123,15 @@ case "$MODE" in
110
123
  [ -z "$TITLE" ] && TITLE=$(get_frontmatter "$OLD_FILE" "title")
111
124
  orig_created=$(get_frontmatter "$OLD_FILE" "created")
112
125
  [ -n "$orig_created" ] && CREATED_DATE="$orig_created"
126
+ # Extract full body for template injection
127
+ FULL_BODY=$(awk 'BEGIN{fm=0} /^---$/{fm++; next} fm>=2{print}' "$OLD_FILE")
113
128
  if [ -z "$DESCRIPTION" ]; then
114
- DESCRIPTION=$(awk 'BEGIN{fm=0} /^---$/{fm++; next} fm>=2{print}' "$OLD_FILE" | head -20 | sed '/^$/d' | head -5)
129
+ DESCRIPTION=$(printf '%s' "$FULL_BODY" | sed '/^$/d' | head -1)
115
130
  fi
116
131
  orig_cat=$(get_frontmatter "$OLD_FILE" "category")
117
132
  [ -n "$orig_cat" ] && [ "$orig_cat" != "TBD" ] && CATEGORY="$orig_cat"
133
+ orig_effort=$(get_frontmatter "$OLD_FILE" "effort_estimate")
134
+ [ -n "$orig_effort" ] && [ "$orig_effort" != "TBD" ] && EFFORT="$orig_effort"
118
135
  ;;
119
136
  esac
120
137
 
@@ -130,6 +147,8 @@ compute_next_id() {
130
147
  local num
131
148
  num=$(basename "$f" | grep -oE '^[0-9]+' | sed 's/^0*//')
132
149
  [ -z "$num" ] && continue
150
+ # Skip legacy icebox-origin IDs (500+) to prevent namespace pollution
151
+ [ "$num" -ge 500 ] 2>/dev/null && continue
133
152
  [ "$num" -gt "$max_id" ] 2>/dev/null && max_id=$num
134
153
  done
135
154
  done
@@ -173,7 +192,7 @@ fi
173
192
  # ─── Template scaffolding ───────────────────────────────────────
174
193
  TEMPLATE="$SCOPE_PROJECT_DIR/scopes/_template.md"
175
194
  if [ ! -f "$TEMPLATE" ]; then
176
- echo "Error: Template not found: $TEMPLATE (run 'orbital init' first)" >&2
195
+ echo "Error: Template not found: $TEMPLATE (run 'orbital' first)" >&2
177
196
  exit 3
178
197
  fi
179
198
 
@@ -199,6 +218,7 @@ sed \
199
218
  -e "s/^id: NNN/id: $PADDED_ID/" \
200
219
  -e "s/^title: \"Scope Title\"/title: \"$ESCAPED_TITLE\"/" \
201
220
  -e "s/^category: \"TBD\".*/category: \"$CATEGORY\"/" \
221
+ -e "s/^effort_estimate: \"TBD\".*/effort_estimate: \"$EFFORT\"/" \
202
222
  -e "s/^created: YYYY-MM-DD/created: $CREATED_DATE/" \
203
223
  -e "s/^updated: YYYY-MM-DD/updated: $NOW_DATE/" \
204
224
  -e "s/^sessions: {}.*/$SESSIONS_REPLACEMENT/" \
@@ -209,6 +229,29 @@ sed \
209
229
  -e "s/\[What prompted this exploration\]/$ESCAPED_DESC/" \
210
230
  "$TEMPLATE" > "$NEW_FILE"
211
231
 
232
+ # ─── Inject full body into Overview section ────────────────────
233
+ # When promoting/scaffolding, preserve the original idea body in the
234
+ # SPECIFICATION > Overview section instead of losing it to the template.
235
+ if [ -n "$FULL_BODY" ] && [ "$(printf '%s' "$FULL_BODY" | sed '/^[[:space:]]*$/d' | wc -l)" -gt 0 ]; then
236
+ BODY_TMP=$(mktemp)
237
+ printf '%s\n' "$FULL_BODY" > "$BODY_TMP"
238
+
239
+ awk -v bodyfile="$BODY_TMP" '
240
+ /^### Overview/ {
241
+ print
242
+ print ""
243
+ while ((getline line < bodyfile) > 0) print line
244
+ # Skip the original placeholder lines (blank + [Problem statement...])
245
+ getline # blank line after ### Overview
246
+ getline # [Problem statement...] line
247
+ next
248
+ }
249
+ { print }
250
+ ' "$NEW_FILE" > "${NEW_FILE}.tmp" && mv "${NEW_FILE}.tmp" "$NEW_FILE"
251
+
252
+ rm -f "$BODY_TMP"
253
+ fi
254
+
212
255
  # ─── Cleanup old file (promote only) ────────────────────────────
213
256
  if [ "$MODE" = "promote" ] && [ -n "$OLD_FILE" ] && [ "$OLD_FILE" != "$NEW_FILE" ]; then
214
257
  rm -f "$OLD_FILE"
@@ -223,22 +266,34 @@ rm -f "$MARKER"
223
266
  "{\"scope_file\":\"$NEW_FILE\",\"id\":$SCOPE_ID,\"mode\":\"$MODE\"}" \
224
267
  --scope "$SCOPE_ID" --session "$SESSION_ID" 2>/dev/null &
225
268
 
269
+ # ─── Read available categories from config ─────────────────────
270
+ AVAILABLE_CATEGORIES=""
271
+ CONFIG_FILE="$SCOPE_PROJECT_DIR/.claude/orbital.config.json"
272
+ if command -v jq >/dev/null 2>&1 && [ -f "$CONFIG_FILE" ]; then
273
+ AVAILABLE_CATEGORIES=$(jq -r '.categories // [] | join(", ")' "$CONFIG_FILE" 2>/dev/null)
274
+ fi
275
+ EFFORT_BUCKETS="<1H, 1-4H, 4H+"
276
+
226
277
  # ─── JSON output ────────────────────────────────────────────────
227
278
  # Compute relative path
228
279
  REL_PATH="${NEW_FILE#"$SCOPE_PROJECT_DIR/"}"
229
280
 
230
281
  # Manual JSON construction (no jq dependency)
231
- printf '{"id":"%s","path":"%s","title":"%s","description":"%s","session_id":"%s","category":"%s","mode":"%s"}\n' \
282
+ printf '{"id":"%s","path":"%s","title":"%s","description":"%s","session_id":"%s","category":"%s","effort":"%s","mode":"%s","available_categories":"%s","effort_buckets":"%s"}\n' \
232
283
  "$PADDED_ID" \
233
284
  "$REL_PATH" \
234
285
  "$(printf '%s' "$TITLE" | sed 's/"/\\"/g')" \
235
- "$(printf '%s' "$DESCRIPTION" | head -1 | sed 's/"/\\"/g')" \
286
+ "$(printf '%s' "$DESCRIPTION" | sed 's/"/\\"/g')" \
236
287
  "$SESSION_ID" \
237
288
  "$CATEGORY" \
238
- "$MODE"
289
+ "$EFFORT" \
290
+ "$MODE" \
291
+ "$AVAILABLE_CATEGORIES" \
292
+ "$EFFORT_BUCKETS"
239
293
 
240
294
  # Print reminder to stderr (visible to Claude but not parsed as JSON)
241
295
  echo "" >&2
242
- echo "Scope document written. Write gate lifted." >&2
243
- echo "Remember: STOP here. Implementation is a separate session:" >&2
296
+ echo "Scope document scaffolded. Write gate lifted." >&2
297
+ echo "Now proceed to Step 2: categorize and estimate effort." >&2
298
+ echo "After specification is complete, STOP. Implementation is a separate session:" >&2
244
299
  echo " /scope-implement $PADDED_ID" >&2
@@ -92,13 +92,21 @@ else
92
92
  exit 1
93
93
  fi
94
94
 
95
- # ─── File lock (flock-based, no TOCTOU race) ───
96
- LOCK_FILE="/tmp/orbital-scope-${SCOPE_ID:-all}.flock"
97
- exec 200>"$LOCK_FILE"
98
- if ! flock -n -x 200 2>/dev/null; then
99
- echo "Scope ${SCOPE_ID:-all} locked by another process" >&2; exit 0
95
+ # ─── File lock (flock on Linux, mkdir fallback on macOS) ───
96
+ if command -v flock >/dev/null 2>&1; then
97
+ LOCK_FILE="/tmp/orbital-scope-${SCOPE_ID:-all}.flock"
98
+ exec 200>"$LOCK_FILE"
99
+ if ! flock -n -x 200 2>/dev/null; then
100
+ echo "Scope ${SCOPE_ID:-all} locked by another process" >&2; exit 0
101
+ fi
102
+ trap 'rm -f "$LOCK_FILE" 2>/dev/null' EXIT
103
+ else
104
+ LOCK_DIR="/tmp/orbital-scope-${SCOPE_ID:-all}.lock"
105
+ if ! mkdir "$LOCK_DIR" 2>/dev/null; then
106
+ echo "Scope ${SCOPE_ID:-all} locked by another process" >&2; exit 0
107
+ fi
108
+ trap 'rmdir "$LOCK_DIR" 2>/dev/null' EXIT
100
109
  fi
101
- trap 'rm -f "$LOCK_FILE" 2>/dev/null' EXIT
102
110
 
103
111
  SOURCE_DIR="$SCOPE_PROJECT_DIR/scopes/$SOURCE_STATUS"
104
112
  TARGET_DIR="$SCOPE_PROJECT_DIR/scopes/$TARGET_STATUS"
@@ -13,12 +13,9 @@ NEW_STRING=$(echo "$INPUT" | jq -r '.tool_input.new_string // empty')
13
13
  source "$(dirname "$0")/scope-helpers.sh"
14
14
  is_scope_file "$FILE_PATH" || exit 0
15
15
 
16
- # Detect status transitions
16
+ # Detect status transitions — match any status value, not a hardcoded list
17
17
  STATUS=""
18
- echo "$NEW_STRING" | grep -qiE "status:.*planning" && STATUS="planning"
19
- echo "$NEW_STRING" | grep -qiE "status:.*backlog" && STATUS="backlog"
20
- echo "$NEW_STRING" | grep -qiE "status:.*implementing" && STATUS="implementing"
21
- echo "$NEW_STRING" | grep -qiE "status:.*complete" && STATUS="complete"
18
+ STATUS=$(echo "$NEW_STRING" | grep -oE '^status:[[:space:]]*[a-z][-a-z]*' | sed 's/^status:[[:space:]]*//' | head -1)
22
19
  echo "$NEW_STRING" | grep -qiE "🔄.*In Progress" && STATUS="phase_started"
23
20
  echo "$NEW_STRING" | grep -qiE "✅.*Done" && STATUS="phase_done"
24
21
  [ -z "$STATUS" ] && exit 0
@@ -0,0 +1 @@
1
+ {}
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://orbital-command.dev/schemas/orbital.config.schema.json",
2
+ "$schema": "https://raw.githubusercontent.com/SakaraLabs/orbital-command/main/schemas/orbital.config.schema.json",
3
3
  "projectName": "My Project",
4
4
  "scopesDir": "scopes",
5
5
  "eventsDir": ".claude/orbital-events",
@@ -19,10 +19,7 @@
19
19
  "typeCheck": null,
20
20
  "lint": null,
21
21
  "build": null,
22
- "test": null,
23
- "validateTemplates": null,
24
- "validateDocs": null,
25
- "checkRules": null
22
+ "test": null
26
23
  },
27
24
  "categories": ["feature", "bugfix", "refactor", "infrastructure", "docs"],
28
25
  "agents": [
@@ -31,5 +28,10 @@
31
28
  { "id": "frontend-designer", "label": "Frontend Designer", "emoji": "\ud83c\udfa8", "color": "#EC4899" },
32
29
  { "id": "architect", "label": "Architect", "emoji": "\ud83c\udfd7\ufe0f", "color": "#536dfe" },
33
30
  { "id": "rules-enforcer", "label": "Rules Enforcer", "emoji": "\ud83d\udccb", "color": "#6B7280" }
34
- ]
31
+ ],
32
+ "telemetry": {
33
+ "enabled": true,
34
+ "url": "https://orbital-telemetry.mike-calle.workers.dev/ingest/a7f3x9k2m1",
35
+ "headers": {}
36
+ }
35
37
  }
@@ -100,6 +100,7 @@
100
100
  "label": "Team Review",
101
101
  "description": "Runs full agent team review, locks spec, moves to backlog.",
102
102
  "dispatchOnly": true,
103
+ "autoRevert": true,
103
104
  "hooks": ["session-enforcer", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
104
105
  },
105
106
  {
@@ -128,6 +129,7 @@
128
129
  "label": "Start Implementing",
129
130
  "description": "Opens a Claude session running /scope-implement.",
130
131
  "dispatchOnly": true,
132
+ "autoRevert": true,
131
133
  "hooks": ["session-enforcer", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
132
134
  },
133
135
  {
@@ -139,6 +141,7 @@
139
141
  "label": "Launch Post-Review",
140
142
  "description": "Runs quality gates, formal verification, and code review.",
141
143
  "dispatchOnly": true,
144
+ "autoRevert": true,
142
145
  "hooks": ["session-enforcer", "review-gate-check", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
143
146
  },
144
147
  {
@@ -179,6 +182,7 @@
179
182
  "label": "Commit",
180
183
  "description": "Commits scope work.",
181
184
  "dispatchOnly": true,
185
+ "autoRevert": true,
182
186
  "hooks": ["session-enforcer", "completion-checklist", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update", "scope-commit-logger"]
183
187
  },
184
188
  {
@@ -190,6 +194,7 @@
190
194
  "label": "Push to Main",
191
195
  "description": "Pushes or PRs scope work to the main branch.",
192
196
  "dispatchOnly": true,
197
+ "autoRevert": true,
193
198
  "hooks": ["session-enforcer", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update", "scope-commit-logger"]
194
199
  },
195
200
  {
@@ -248,6 +253,66 @@
248
253
  "dispatchOnly": false,
249
254
  "humanOnly": true,
250
255
  "hooks": ["session-enforcer", "scope-transition", "orbital-scope-update"]
256
+ },
257
+ {
258
+ "from": "backlog",
259
+ "to": "icebox",
260
+ "direction": "backward",
261
+ "command": null,
262
+ "confirmLevel": "quick",
263
+ "label": "Shelve to Icebox",
264
+ "description": "Shelves this scope back to the icebox for later consideration.",
265
+ "dispatchOnly": false,
266
+ "humanOnly": true,
267
+ "hooks": ["session-enforcer", "scope-transition", "orbital-scope-update"]
268
+ },
269
+ {
270
+ "from": "implementing",
271
+ "to": "icebox",
272
+ "direction": "backward",
273
+ "command": null,
274
+ "confirmLevel": "full",
275
+ "checklist": [
276
+ "No uncommitted work will be lost",
277
+ "This scope is being abandoned, not paused"
278
+ ],
279
+ "label": "Shelve to Icebox",
280
+ "description": "Abandons implementation and shelves this scope back to the icebox.",
281
+ "dispatchOnly": false,
282
+ "humanOnly": true,
283
+ "hooks": ["session-enforcer", "scope-transition", "orbital-scope-update"]
284
+ },
285
+ {
286
+ "from": "review",
287
+ "to": "icebox",
288
+ "direction": "backward",
289
+ "command": null,
290
+ "confirmLevel": "full",
291
+ "checklist": [
292
+ "No uncommitted work will be lost",
293
+ "This scope is being abandoned, not paused"
294
+ ],
295
+ "label": "Shelve to Icebox",
296
+ "description": "Abandons review and shelves this scope back to the icebox.",
297
+ "dispatchOnly": false,
298
+ "humanOnly": true,
299
+ "hooks": ["session-enforcer", "scope-transition", "orbital-scope-update"]
300
+ },
301
+ {
302
+ "from": "completed",
303
+ "to": "icebox",
304
+ "direction": "backward",
305
+ "command": null,
306
+ "confirmLevel": "full",
307
+ "checklist": [
308
+ "Committed work has been reverted or is acceptable to leave",
309
+ "This scope is being abandoned, not paused"
310
+ ],
311
+ "label": "Shelve to Icebox",
312
+ "description": "Shelves this completed scope back to the icebox.",
313
+ "dispatchOnly": false,
314
+ "humanOnly": true,
315
+ "hooks": ["session-enforcer", "scope-transition", "orbital-scope-update"]
251
316
  }
252
317
  ],
253
318
  "hooks": [
@@ -10,10 +10,10 @@
10
10
  { "id": "dev", "label": "Dev", "order": 4, "group": "deploy", "color": "197 100% 63%", "hex": "#42c3ff", "hasDirectory": true, "gitBranch": "dev" }
11
11
  ],
12
12
  "edges": [
13
- { "from": "backlog", "to": "implementing", "direction": "forward", "command": "/scope-implement {id}", "confirmLevel": "quick", "label": "Start Implementing", "description": "Opens a Claude session running /scope-implement.", "dispatchOnly": true },
14
- { "from": "implementing", "to": "review", "direction": "forward", "command": "/scope-post-review {id}", "confirmLevel": "full", "label": "Run Review Gate", "description": "Launches formal review gate.", "dispatchOnly": true },
15
- { "from": "review", "to": "completed", "direction": "forward", "command": "/git-commit", "confirmLevel": "full", "label": "Commit", "description": "Commits scope work to feature branch.", "dispatchOnly": true },
16
- { "from": "completed", "to": "dev", "direction": "forward", "command": "/git-dev", "confirmLevel": "full", "label": "Merge to Dev", "description": "Merges feature branch into dev.", "dispatchOnly": true },
13
+ { "from": "backlog", "to": "implementing", "direction": "forward", "command": "/scope-implement {id}", "confirmLevel": "quick", "label": "Start Implementing", "description": "Opens a Claude session running /scope-implement.", "dispatchOnly": true, "autoRevert": true },
14
+ { "from": "implementing", "to": "review", "direction": "forward", "command": "/scope-post-review {id}", "confirmLevel": "full", "label": "Run Review Gate", "description": "Launches formal review gate.", "dispatchOnly": true, "autoRevert": true },
15
+ { "from": "review", "to": "completed", "direction": "forward", "command": "/git-commit", "confirmLevel": "full", "label": "Commit", "description": "Commits scope work to feature branch.", "dispatchOnly": true, "autoRevert": true },
16
+ { "from": "completed", "to": "dev", "direction": "forward", "command": "/git-dev", "confirmLevel": "full", "label": "Merge to Dev", "description": "Merges feature branch into dev.", "dispatchOnly": true, "autoRevert": true },
17
17
  { "from": "review", "to": "implementing", "direction": "backward", "command": null, "confirmLevel": "quick", "label": "Back to Implementing", "description": "Re-opens implementation to address review findings.", "dispatchOnly": false },
18
18
  { "from": "completed", "to": "implementing", "direction": "backward", "command": null, "confirmLevel": "quick", "label": "Back to Implementing", "description": "Re-opens implementation to fix issues.", "dispatchOnly": false },
19
19
  { "from": "implementing", "to": "backlog", "direction": "backward", "command": null, "confirmLevel": "quick", "label": "Back to Backlog", "description": "Returns scope to backlog.", "dispatchOnly": false, "humanOnly": true }
@@ -123,6 +123,7 @@
123
123
  "label": "Team Review",
124
124
  "description": "Runs full agent team review, locks spec, moves to backlog.",
125
125
  "dispatchOnly": true,
126
+ "autoRevert": true,
126
127
  "hooks": ["session-enforcer", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
127
128
  },
128
129
  {
@@ -151,6 +152,7 @@
151
152
  "label": "Start Implementing",
152
153
  "description": "Opens a Claude session running /scope-implement.",
153
154
  "dispatchOnly": true,
155
+ "autoRevert": true,
154
156
  "hooks": ["session-enforcer", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
155
157
  },
156
158
  {
@@ -162,6 +164,7 @@
162
164
  "label": "Run Review Gate",
163
165
  "description": "Launches formal review gate. Moves to review only if all criteria pass.",
164
166
  "dispatchOnly": true,
167
+ "autoRevert": true,
165
168
  "hooks": ["session-enforcer", "review-gate-check", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
166
169
  },
167
170
  {
@@ -190,6 +193,7 @@
190
193
  "label": "Commit",
191
194
  "description": "Commits scope work to feature branch.",
192
195
  "dispatchOnly": true,
196
+ "autoRevert": true,
193
197
  "hooks": ["session-enforcer", "completion-checklist", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update", "scope-commit-logger"]
194
198
  },
195
199
  {
@@ -201,6 +205,7 @@
201
205
  "label": "Merge to Dev",
202
206
  "description": "Merges feature branch into dev. Batches multiple completed scopes.",
203
207
  "dispatchOnly": true,
208
+ "autoRevert": true,
204
209
  "hooks": ["session-enforcer", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update"]
205
210
  },
206
211
  {
@@ -212,6 +217,7 @@
212
217
  "label": "PR to Staging",
213
218
  "description": "Creates a GitHub PR from dev to staging.",
214
219
  "dispatchOnly": true,
220
+ "autoRevert": true,
215
221
  "hooks": ["session-enforcer", "lifecycle-gate", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update", "scope-commit-logger"]
216
222
  },
217
223
  {
@@ -228,6 +234,7 @@
228
234
  "label": "PR to Production",
229
235
  "description": "Creates a release PR from staging to main for production.",
230
236
  "dispatchOnly": true,
237
+ "autoRevert": true,
231
238
  "hooks": ["session-enforcer", "lifecycle-gate", "blocker-check", "dependency-check", "scope-transition", "orbital-scope-update", "scope-commit-logger"]
232
239
  },
233
240
  {
@@ -0,0 +1,23 @@
1
+ # Prompt Library
2
+
3
+ Tested, refined prompts for common high-stakes tasks. Each prompt encodes lessons learned from real sessions — the framing, constraints, and structure that produce the best results.
4
+
5
+ ## How to Use
6
+
7
+ Copy the prompt and paste it at the start of a new Claude Code session. Adjust the bracketed `[placeholders]` to your context.
8
+
9
+ ## Available Prompts
10
+
11
+ | Prompt | When to Use |
12
+ |--------|-------------|
13
+ | [deep-dive-audit.md](./deep-dive-audit.md) | Pre-launch codebase health review, major refactoring, tech debt assessment |
14
+
15
+ ## Prompt Design Principles
16
+
17
+ These prompts are optimized for Claude Code sessions. Key patterns:
18
+
19
+ 1. **Explicit permission to be thorough** — override the default pressure to be fast
20
+ 2. **Scope boundary upfront** — tell it whether analysis only or implementation included
21
+ 3. **Verification requirement built in** — don't add this as an afterthought
22
+ 4. **Output format defined** — what "done" looks like
23
+ 5. **Resource permission** — explicitly allow parallel agents, long context, high token usage
@@ -0,0 +1,94 @@
1
+ # Deep Dive Codebase Audit
2
+
3
+ **When to use:** Pre-launch reviews, major refactoring, tech debt assessment, periodic health checks.
4
+
5
+ **Session setup:** Start in plan mode (`/plan`), set effort to max (`/effort max`).
6
+
7
+ ---
8
+
9
+ ## The Prompt
10
+
11
+ ```
12
+ Conduct a deep, thorough audit of our codebase. This is a [pre-launch review / periodic health check / tech debt assessment] and we will implement all confirmed findings — not just analyze them.
13
+
14
+ SCOPE AND EXPECTATIONS:
15
+
16
+ - Leave no file untouched. We value thoroughness and 100% coverage over speed.
17
+ - Take as long as you need. Slow down. Resist the urge to start editing before you've finished reading.
18
+ - Use resources freely — launch parallel exploration agents, analysis agents, and implementation agents. Do not optimize for token cost; optimize for coverage and correctness.
19
+ - Every change must be independently verified before we consider it done. Build verification into your plan, not as an afterthought.
20
+
21
+ DELIVERABLES:
22
+
23
+ 1. Build a complete inventory of every section, service, and function. Track progress in the plan file.
24
+ 2. Create a brief summary of each — how they work and how they're architected.
25
+ 3. Conduct deep analysis: identify duplication, structural issues, dead code, and simplification opportunities. Quantify everything — "15 hooks duplicate this pattern" not "some hooks are duplicated."
26
+ 4. Produce a tiered recommendation plan: Tier 1 (high impact, low risk), Tier 2 (high impact, moderate effort), Tier 3 (discuss first), and explicitly state what you considered but don't recommend.
27
+ 5. After implementation, produce a before/after metrics table and a verification report with pass/fail counts.
28
+
29
+ WORKFLOW:
30
+
31
+ - Do NOT write any code until the plan is reviewed and confirmed together. The plan is a separate deliverable from the implementation.
32
+ - During exploration (plan mode): use subagents for parallel coverage. Create lists that track progress.
33
+ - During implementation (after plan approval): execute one tier at a time. Typecheck and test after every individual change. Use parallel agents only for independent file sets.
34
+ - After implementation: launch independent verification agents to prove each work item is correct. Run the full validation pipeline. Do UI testing if frontend was modified.
35
+
36
+ [ADDITIONAL CONTEXT: describe any specific concerns, recent feature work, or areas you suspect need attention]
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Why Each Section Exists
42
+
43
+ ### "Leave no file untouched" + "take as long as you need"
44
+ Overrides the default pressure to be fast and concise. Without this, the agent samples a few files and pattern-matches. With it, the agent inventories everything, which is what finds unexpected results like "zero dead code."
45
+
46
+ ### "Do not optimize for token cost"
47
+ Explicitly permits launching 3+ parallel agents per phase. Without this, the agent tries to do everything sequentially in one context window, which caps the achievable scope.
48
+
49
+ ### "Every change must be independently verified"
50
+ Knowing verification is coming makes the agent more careful during implementation. This instruction must be in the initial prompt, not added after implementation is done.
51
+
52
+ ### "Do NOT write any code until the plan is reviewed"
53
+ Forces the audit-then-plan-then-execute structure. Prevents the failure mode where the agent starts editing during exploration and introduces bugs while still forming its understanding.
54
+
55
+ ### "Quantify everything"
56
+ Prevents vague findings. "Some duplication" is not actionable. "15 hooks with identical fetch boilerplate across 500 lines" is actionable and lets you evaluate ROI.
57
+
58
+ ### "Explicitly state what you don't recommend"
59
+ Shows the agent considered and rejected options rather than missing them. The "Not recommended" section in a plan is often the most valuable — it prevents future sessions from re-investigating the same ideas.
60
+
61
+ ### Deliverable 5 (before/after + verification)
62
+ Defines what "done" looks like. Without this, the session ends with "I think everything is good" instead of "23/23 test files, 374/374 tests, 279 verification checks."
63
+
64
+ ---
65
+
66
+ ## Variations
67
+
68
+ ### Analysis Only (No Implementation)
69
+ Remove the "we will implement all confirmed findings" line and deliverable 5. Change the workflow section to end at plan delivery.
70
+
71
+ ### Targeted Audit (Specific Area)
72
+ Add to additional context:
73
+ ```
74
+ Focus on [server/hooks/frontend components]. The rest of the codebase is out of scope for this session.
75
+ ```
76
+
77
+ ### Post-Incident Review
78
+ Replace the scope section with:
79
+ ```
80
+ We just had [describe incident]. Audit the codebase for similar patterns that could cause the same class of problem. Don't fix unrelated issues — stay focused on this failure mode.
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Origin
86
+
87
+ Developed during the v0.3 pre-launch refactoring session (2026-04-10). That session achieved:
88
+ - 10 files decomposed (avg 832 → 291 lines, 65% reduction)
89
+ - 5 shared abstractions created (useFetch, useSocketListener, workflow-constants, json-fields, catchRoute)
90
+ - 40 new tests added
91
+ - 279 manual verification checks, all passing
92
+ - 23/23 UI checks across 4 views, zero console errors
93
+
94
+ The prompt structure — explicit permission to slow down, free resource usage, mandatory verification, plan-before-code discipline — was identified as the primary driver of the session's quality.
@@ -52,14 +52,14 @@ grep -rE "console\.(log|error|warn|info)" src --include="*.ts" --include="*.tsx"
52
52
 
53
53
  ### Rule 3: File Size Limit (400 lines)
54
54
 
55
- **Rule**: Production files must be < 400 lines, tests < 800 lines
56
- **Why**: Maintainability, cognitive load
55
+ **Rule**: Production files must be < 400 lines, tests < 800 lines. Applies to `src/`, `server/`, and `bin/`.
56
+ **Why**: The v0.3 refactor found 10 files over 500 lines. Large files mix concerns, resist review, and accumulate tech debt silently. The cleanup took a full session to unwind.
57
57
  **Verify**:
58
58
  ```bash
59
- find src -name "*.ts" -o -name "*.tsx" | xargs wc -l | awk '$1 > 400' | grep -v __tests__
59
+ find src server -name "*.ts" -o -name "*.tsx" | xargs wc -l | sort -rn | awk '$1 > 400 && !/test|__fixtures__/' | head -20
60
60
  ```
61
- **Expected**: No output
62
- **Fix**: Split into focused modules
61
+ **Expected**: No output (or only justified exceptions like types/index.ts, aggregate-routes.ts)
62
+ **Fix**: Extract sub-components, split into focused modules, move types to companion files
63
63
 
64
64
  ---
65
65
 
@@ -202,6 +202,57 @@ it('should return user by ID', async () => {
202
202
 
203
203
  ---
204
204
 
205
+ ## Duplication Prevention Rules
206
+
207
+ ### Rule 13: Single Source of Truth for Constants
208
+
209
+ **Rule**: Color maps, config objects, icon maps, and display constants must be defined once and imported everywhere. Never define inline.
210
+ **Why**: The v0.3 audit found ENFORCEMENT_COLORS defined 3x, CATEGORY_CONFIG 4x, and CATEGORY_HEX 2x across the codebase. Each copy drifted slightly (singular vs plural labels, different lifecycle colors).
211
+ **Verify**:
212
+ ```bash
213
+ grep -rn "const.*COLORS.*Record\|const.*CONFIG.*Record.*icon\|const.*HEX.*Record" src/components src/views --include="*.tsx" --include="*.ts" | grep -v "import "
214
+ ```
215
+ **Expected**: No output — all constants come from `src/lib/workflow-constants.ts` or similar shared modules
216
+ **Fix**: Move to `src/lib/workflow-constants.ts` and import
217
+
218
+ ---
219
+
220
+ ### Rule 14: Use Shared Hook Primitives
221
+
222
+ **Rule**: Data-fetching hooks must use `useFetch()`. Socket listeners must use `useSocketListener()`. Never duplicate the fetch lifecycle or socket.on/off pattern manually.
223
+ **Why**: The v0.3 audit found 15+ hooks with identical fetch boilerplate (useState triple, AbortController, useReconnect) and 86 manual socket.on/off calls. This was ~500 lines of pure duplication.
224
+ **Verify**:
225
+ ```bash
226
+ # Check no hook manually manages AbortController (should be in useFetch)
227
+ grep -rn "new AbortController" src/hooks --include="*.ts" | grep -v useFetch | grep -v test
228
+ ```
229
+ **Expected**: No output (only useFetch.ts should create AbortControllers)
230
+ **Fix**: Use `useFetch(fetchFn)` for data fetching, `useSocketListener(event, handler, deps)` for socket events
231
+
232
+ ---
233
+
234
+ ### Rule 15: Use catchRoute for Express Handlers
235
+
236
+ **Rule**: Route handlers that can throw must use `catchRoute()` from `server/utils/route-helpers.ts` instead of inline try-catch.
237
+ **Why**: The v0.3 audit found identical try-catch + errMsg + status-inference blocks in 7+ route handlers. The pattern is mechanical and should be centralized.
238
+ **Verify**:
239
+ ```bash
240
+ grep -rn "try {" server/routes --include="*.ts" | grep -v test | grep -v node_modules
241
+ ```
242
+ **Expected**: Minimal matches — most routes should use catchRoute
243
+ **Fix**: Wrap handler with `catchRoute(fn)` or `catchRoute(fn, inferErrorStatus)`
244
+
245
+ ---
246
+
247
+ ### Rule 16: No Inline Utility Functions in Large Files
248
+
249
+ **Rule**: Pure functions (parsers, formatters, validators) that don't close over component/hook state must live in companion `*-utils.ts` files, not inline in the consuming file.
250
+ **Why**: The v0.3 audit found `parseJsonFields` copied verbatim between two files, and `parseDragId` + `checkActiveDispatch` buried inside a 490-line hook. Extracting them enabled testing and reuse.
251
+ **Verify**: Manual review — if a function doesn't reference `useState`, `useCallback`, or local state, it belongs in a utils file
252
+ **Fix**: Extract to a companion file (e.g., `useKanbanDnd.ts` → `kanban-dnd-utils.ts`)
253
+
254
+ ---
255
+
205
256
  ## Quick Verification Checklist
206
257
 
207
258
  Run before every commit: