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
@@ -76,7 +76,7 @@
76
76
  ]
77
77
  },
78
78
  {
79
- "matcher": "Write",
79
+ "matcher": "Write|Edit",
80
80
  "hooks": [
81
81
  { "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-create-cleanup.sh", "_orbital": true }
82
82
  ]
@@ -20,7 +20,8 @@ BRANCHING_MODE=$(grep '^WORKFLOW_BRANCHING_MODE=' .claude/config/workflow-manife
20
20
  ### Step 0b: Record Session ID
21
21
 
22
22
  1. Run: `bash .claude/hooks/get-session-id.sh`
23
- 2. For each scope in `scopes/review/` with a passing verdict:
23
+ 2. For each scope in `scopes/review/` with a passing verdict
24
+ (if BATCH_SCOPE_IDS is set, only record on those specific scopes):
24
25
  - Append session UUID to `sessions.commit` in frontmatter
25
26
 
26
27
  ### Step 1: Check Branch
@@ -39,9 +40,11 @@ Find scopes in `scopes/review/` that have a passing verdict:
39
40
 
40
41
  1. List files in `scopes/review/*.md`
41
42
  2. For each, extract the scope number and check `.claude/review-verdicts/{NNN}.json`
43
+
44
+ If BATCH_SCOPE_IDS is set, only process those specific scopes (skip any not in the list).
45
+
42
46
  3. If verdict exists and `verdict === "PASS"`:
43
- - `mv scopes/review/{file} scopes/completed/`
44
- - Update frontmatter: `status: completed`
47
+ - Transition: `bash .claude/hooks/scope-transition.sh --from review --to completed --scope {NNN}`
45
48
  - Update DASHBOARD: `📦 **Status**: Committed`
46
49
  4. If scope is in `scopes/review/` with **no** passing verdict:
47
50
  - Warn: "Scope {NNN} is in review but hasn't passed the review gate."
@@ -50,23 +53,40 @@ Find scopes in `scopes/review/` that have a passing verdict:
50
53
 
51
54
  ### Step 3: Commit
52
55
 
56
+ **Determine which files to stage** — scope-aware, not a blanket `git add .`:
57
+
58
+ 1. For each scope being committed (from Step 2), read its **Files Summary** table from the scope document (`scopes/review/{NNN}*.md` or `scopes/completed/{NNN}*.md`)
59
+ 2. Also check `.claude/review-findings/{NNN}.json` — each finding has a `file` field listing reviewed files
60
+ 3. Cross-reference against `git status` — only stage files that appear in the scope's Files Summary or review findings
61
+ 4. If files exist in `git status` that don't belong to any scope being committed, leave them unstaged
62
+
53
63
  ```bash
54
- git add <specific code files scopes are gitignored>
64
+ git add <files from scope Files Summary + review findings>
55
65
  git commit -m "type(scope): description"
56
66
  ```
57
67
 
58
- - Stage only code files (scopes/ is gitignored, no need to worry about them)
68
+ - Stage only scope-owned code files (scopes/ is gitignored, no need to worry about them)
69
+ - If multiple scopes are being committed (batch), include files from ALL scopes in the batch
59
70
  - Follow conventional commit format
60
71
  - Do NOT push or create PRs — those are separate skills
61
72
 
62
- ### Step 4: Signal Completion
73
+ ### Step 4: Signal Completion (REQUIRED)
63
74
 
64
- If working on a dispatched scope, emit the agent completion event:
75
+ **Always emit when finished** this is not optional. Emit success or failure so the dispatch resolves immediately:
65
76
 
66
77
  ```bash
78
+ # On success — with a scope:
67
79
  bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"save"}' --scope "{NNN}"
80
+
81
+ # On success — without a scope (general commit):
82
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"save"}'
83
+
84
+ # On failure (commit failed, no files to stage, etc.):
85
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"save"}' --scope "{NNN}"
68
86
  ```
69
87
 
88
+ The `--scope` flag is optional. Omit it when committing work that isn't tied to a specific scope.
89
+
70
90
  ## Quick Reference
71
91
 
72
92
  | User Says | Action |
@@ -19,7 +19,8 @@ Direct merge from feature branch into dev. The review gate already provides the
19
19
  ### Step 0: Record Session ID
20
20
 
21
21
  1. Run: `bash .claude/hooks/get-session-id.sh`
22
- 2. For each scope in `scopes/completed/`:
22
+ 2. For each scope in `scopes/completed/`
23
+ (if BATCH_SCOPE_IDS is set, only record on those specific scopes):
23
24
  - Append session UUID to `sessions.prDev` in frontmatter
24
25
 
25
26
  ### Step 1: Verify Ready State
@@ -42,8 +43,7 @@ git status --porcelain
42
43
 
43
44
  Find scopes in `scopes/completed/`:
44
45
  1. For each scope file in `scopes/completed/*.md`:
45
- - `mv scopes/completed/{file} scopes/dev/`
46
- - Update frontmatter: `status: dev`
46
+ - Transition: `bash .claude/hooks/scope-transition.sh --from completed --to dev --scope {NNN}`
47
47
  - Update DASHBOARD: `🔀 **Status**: Merged to Dev`
48
48
 
49
49
  If BATCH_SCOPE_IDS is set, only transition those specific scopes.
@@ -68,10 +68,19 @@ git checkout "$FEATURE_BRANCH"
68
68
 
69
69
  If merge conflicts occur, resolve them before continuing.
70
70
 
71
- ### Step 4: Signal Completion
71
+ ### Step 4: Signal Completion (REQUIRED)
72
+
73
+ **Always emit when finished** — this is not optional. Emit success or failure so the dispatch resolves immediately:
72
74
 
73
75
  ```bash
76
+ # On success — with a scope:
74
77
  bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_dev"}' --scope "{NNN}"
78
+
79
+ # On success — without a scope:
80
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_dev"}'
81
+
82
+ # On failure (merge conflicts, push rejected, etc.):
83
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"pr_dev"}' --scope "{NNN}"
75
84
  ```
76
85
 
77
86
  ## Output
@@ -20,7 +20,8 @@ BRANCHING_MODE=$(grep '^WORKFLOW_BRANCHING_MODE=' .claude/config/workflow-manife
20
20
  ### Step 1: Record Session ID
21
21
 
22
22
  1. Run: `bash .claude/hooks/get-session-id.sh` — capture the UUID output
23
- 2. For each scope in `scopes/completed/`:
23
+ 2. For each scope in `scopes/completed/`
24
+ (if BATCH_SCOPE_IDS is set, only record on those specific scopes):
24
25
  - Append session UUID to `sessions.pushToMain` in frontmatter
25
26
 
26
27
  ### Step 2: Check Current Branch
@@ -63,10 +64,19 @@ For each completed scope being pushed:
63
64
  bash .claude/hooks/scope-transition.sh --from completed --to main --scope NNN
64
65
  ```
65
66
 
66
- ### Step 5: Signal Completion
67
+ ### Step 5: Signal Completion (REQUIRED)
68
+
69
+ **Always emit when finished** — this is not optional. Emit success or failure so the dispatch resolves immediately:
67
70
 
68
71
  ```bash
69
- bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_main"}' --scope "NNN"
72
+ # On success — with a scope:
73
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_main"}' --scope "{NNN}"
74
+
75
+ # On success — without a scope:
76
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_main"}'
77
+
78
+ # On failure (push rejected, PR failed, merge conflicts, etc.):
79
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"pr_main"}' --scope "{NNN}"
70
80
  ```
71
81
 
72
82
  ## Batch Support
@@ -96,12 +96,19 @@ gh pr merge --merge
96
96
  # Your CI/CD pipeline auto-deploys main to production (if configured)
97
97
  ```
98
98
 
99
- ### Step 6: Signal Completion
99
+ ### Step 6: Signal Completion (REQUIRED)
100
100
 
101
- After the merge succeeds, emit the agent completion event if working on a dispatched scope:
101
+ **Always emit when finished** this is not optional. Emit success or failure so the dispatch resolves immediately:
102
102
 
103
103
  ```bash
104
+ # On success — with a scope:
104
105
  bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_production"}' --scope "{NNN}"
106
+
107
+ # On success — without a scope:
108
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_production"}'
109
+
110
+ # On failure (PR failed, merge conflicts, health check failed, etc.):
111
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"pr_production"}' --scope "{NNN}"
105
112
  ```
106
113
 
107
114
  ### Step 7: Verify Production
@@ -20,8 +20,7 @@ Creates a GitHub PR from dev to staging. Staging is a release candidate — the
20
20
 
21
21
  Find scopes in `scopes/dev/`:
22
22
  1. For each scope file in `scopes/dev/*.md`:
23
- - `mv scopes/dev/{file} scopes/staging/`
24
- - Update frontmatter: `status: staging`
23
+ - Transition: `bash .claude/hooks/scope-transition.sh --from dev --to staging --scope {NNN}`
25
24
  - Update DASHBOARD: `🚀 **Status**: Staging PR Created`
26
25
 
27
26
  If BATCH_SCOPE_IDS is set, only transition those specific scopes.
@@ -59,10 +58,19 @@ gh pr create --base staging --head dev \
59
58
  - [ ] Files under 400 lines"
60
59
  ```
61
60
 
62
- ### Step 4: Signal Completion
61
+ ### Step 4: Signal Completion (REQUIRED)
62
+
63
+ **Always emit when finished** — this is not optional. Emit success or failure so the dispatch resolves immediately:
63
64
 
64
65
  ```bash
66
+ # On success — with a scope:
65
67
  bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_staging"}' --scope "{NNN}"
68
+
69
+ # On success — without a scope:
70
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_staging"}'
71
+
72
+ # On failure (PR creation failed, push rejected, etc.):
73
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"pr_staging"}' --scope "{NNN}"
66
74
  ```
67
75
 
68
76
  ### Step 5: Monitor CI
@@ -46,10 +46,24 @@ Then run:
46
46
  bash .claude/hooks/scope-prepare.sh --new --title "Feature Name" --desc "Description" --category "Backend"
47
47
  ```
48
48
 
49
- The script outputs JSON: `{"id", "path", "title", "description", "session_id", "category", "mode"}`.
49
+ The script outputs JSON: `{"id", "path", "title", "description", "session_id", "category", "effort", "mode", "available_categories", "effort_buckets"}`.
50
50
  The scope file is fully scaffolded with template, frontmatter, dashboard, and process log.
51
51
 
52
- ### Step 2: Fill Specification
52
+ ### Step 2: Categorize and Estimate
53
+
54
+ Read the JSON output from Step 1. Using the title, description, and any preserved idea body
55
+ in the scope file, update the frontmatter:
56
+
57
+ 1. **Category**: Select the best match from `available_categories` in the JSON output.
58
+ Match semantically — "feature" for new capabilities, "bugfix" for fixes, "refactor" for
59
+ restructuring, "infrastructure" for tooling/CI/config, "docs" for documentation.
60
+ If the category is still "TBD", update it in the scope file's frontmatter.
61
+
62
+ 2. **Effort**: Estimate using the bucket system from `effort_buckets` in the JSON output
63
+ (typically: `<1H`, `1-4H`, or `4H+`). Consider the scope of changes implied by the
64
+ title and description. If effort is still "TBD", update it in the scope file's frontmatter.
65
+
66
+ ### Step 3: Fill Specification
53
67
 
54
68
  Edit the scope file to replace the placeholder in **SPECIFICATION > Overview** with the
55
69
  actual problem statement and goal. If coming from a plan, also populate:
@@ -57,7 +71,7 @@ actual problem statement and goal. If coming from a plan, also populate:
57
71
  - **Technical Approach** and rationale
58
72
  - **Implementation Phases** with files, changes, and verification steps
59
73
 
60
- ### Step 3: Report
74
+ ### Step 4: Report
61
75
 
62
76
  ```
63
77
  Created: scopes/planning/NNN-feature-name.md
@@ -12,8 +12,8 @@ Takes ALL findings from the Phase 3 code review (`/test-code-review`) and execut
12
12
 
13
13
  ## Prerequisites
14
14
 
15
- - Phase 3 (`/test-code-review`) must have been run in the current post-review pipeline
16
- - Code review findings must exist in the conversation context
15
+ - Phase 3 (`/test-code-review`) must have been run — either in the current pipeline or in a prior session
16
+ - Code review findings must be available (conversation context OR `.claude/review-findings/NNN.json` on disk)
17
17
  - `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` must be enabled (a hook will block this skill otherwise)
18
18
 
19
19
  ## Steps
@@ -42,7 +42,10 @@ Takes ALL findings from the Phase 3 code review (`/test-code-review`) and execut
42
42
 
43
43
  ### Step 2: Collect and Organize Findings
44
44
 
45
- 1. Gather ALL findings from the Phase 3 code review (from conversation context)
45
+ 1. **Load findings** check both sources in order:
46
+ - **Disk first:** Read `.claude/review-findings/NNN.json` (where NNN is the scope ID). This file is written by `/test-code-review` Phase 4 and enables standalone `/scope-fix-review` without re-running Phase 3.
47
+ - **Conversation fallback:** If the file doesn't exist, gather findings from the Phase 3 code review conversation context.
48
+ - If neither source has findings, report "No findings to fix" and **EXIT**.
46
49
  2. Deduplicate findings across the 6 review agents
47
50
  3. Group findings by **file ownership domain**:
48
51
 
@@ -142,12 +145,16 @@ Agent(
142
145
  ╚═══════════════════════════════════════════════════════════════╝
143
146
  ```
144
147
 
145
- ### Step 8: Emit Completion Event
148
+ ### Step 8: Signal Completion (REQUIRED)
149
+
150
+ **Always emit when finished** — this is not optional. Emit success or failure so the dispatch resolves immediately:
146
151
 
147
152
  ```bash
148
- bash .claude/hooks/orbital-emit.sh REVIEW_FIXES_COMPLETED \
149
- '{"scope_id":"NNN","findings_total":YY,"findings_fixed":XX,"agents_used":N}' \
150
- --scope "NNN"
153
+ # On success:
154
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"fix_review","findings_total":YY,"findings_fixed":XX}' --scope "{NNN}"
155
+
156
+ # On failure (agents couldn't resolve, verification failed, etc.):
157
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"fix_review","findings_total":YY,"findings_fixed":XX}' --scope "{NNN}"
151
158
  ```
152
159
 
153
160
  ## Important Rules
@@ -26,7 +26,14 @@ user-invocable: true
26
26
 
27
27
  ### 2. Implement
28
28
 
29
- **Before starting Phase 1**: Update scope frontmatter to `status: implementing` and DASHBOARD to `🔄 **Status**: Implementing`. Move file: `mv scopes/backlog/{file} scopes/implementing/`.
29
+ **Before starting Phase 1**: Read the scope's frontmatter `status` field. If the scope is not already in `implementing`, transition it and update the DASHBOARD to `🔄 **Status**: Implementing`:
30
+
31
+ ```bash
32
+ # Use the scope's CURRENT status as the source (backlog, planning, review, completed, etc.)
33
+ bash .claude/hooks/scope-transition.sh --from <current-status> --to implementing --scope {NNN}
34
+ ```
35
+
36
+ If the scope is already `status: implementing` (resuming), skip the transition.
30
37
 
31
38
  For each phase:
32
39
 
@@ -89,12 +96,16 @@ After Step 3, the scope remains in `scopes/implementing/` with `status: implemen
89
96
 
90
97
  **Do NOT proceed to review in this session.** The review gate enforces session separation to ensure the implementing agent doesn't approve its own work.
91
98
 
92
- ### 4. Signal Completion
99
+ ### 4. Signal Completion (REQUIRED)
93
100
 
94
- Emit the agent completion event so the Orbital Command dashboard turns off the progress indicator:
101
+ **Always emit when finished** this is not optional. Emit success or failure so the dispatch resolves immediately:
95
102
 
96
103
  ```bash
97
- bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success"}' --scope "{NNN}"
104
+ # On success:
105
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"implement"}' --scope "{NNN}"
106
+
107
+ # On failure (build errors, blocked, etc.):
108
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"implement"}' --scope "{NNN}"
98
109
  ```
99
110
 
100
111
  ## Resuming After Compaction
@@ -2,7 +2,7 @@
2
2
  name: scope-post-review
3
3
  description: Orchestrates post-implementation review — runs quality gates, formal verification, code review, and optional agent-team fix execution. Use when a scope is ready to move from implementing to review.
4
4
  user-invocable: true
5
- orchestrates: [test-checks, scope-verify, test-code-review, scope-fix-review]
5
+ orchestrates: [test-scaffold, test-checks, scope-verify, test-code-review, scope-fix-review]
6
6
  ---
7
7
 
8
8
  # /scope-post-review NNN — Post-Implementation Review
@@ -16,6 +16,11 @@ Orchestrates the full post-implementation review pipeline for a scope. Runs up t
16
16
  │ /scope-post-review NNN │
17
17
  ├─────────────────────────────────────────────────────────────────┤
18
18
  │ │
19
+ │ Phase 0: Test infrastructure check │
20
+ │ └── If commands.test is null → /test-scaffold │
21
+ │ Analyzes project, installs framework, writes tests. │
22
+ │ SKIPPED if tests already configured. │
23
+ │ │
19
24
  │ Phase 1: /test-checks │
20
25
  │ └── 13 machine-verifiable quality gates │
21
26
  │ Types, lint, build, templates, docs, enforcement, etc. │
@@ -41,10 +46,52 @@ Orchestrates the full post-implementation review pipeline for a scope. Runs up t
41
46
  └─────────────────────────────────────────────────────────────────┘
42
47
  ```
43
48
 
44
- **Rationale**: Quality gates run first to catch obvious issues cheaply. Spec verification runs second to confirm the implementation is actually complete before spending tokens on AI code review. Code review runs third on verified, passing code. Fix execution runs last, using an agent team to address all findings in parallel across non-overlapping file domains.
49
+ **Rationale**: Test infrastructure is checked first so that gate #13 (tests) has something to run. Quality gates run next to catch obvious issues cheaply. Spec verification runs third to confirm the implementation is actually complete before spending tokens on AI code review. Code review runs fourth on verified, passing code. Fix execution runs last, using an agent team to address all findings in parallel across non-overlapping file domains.
45
50
 
46
51
  ## Steps
47
52
 
53
+ ### Phase 0: Test Infrastructure Check
54
+
55
+ Ensure the project has a test suite before running quality gates. This runs in a subagent to keep the main post-review context clean — the scaffolding work (codebase analysis, package installs, writing test files) can be extensive and is not relevant to the review phases that follow.
56
+
57
+ 1. Read `.claude/orbital.config.json`
58
+ 2. Check `commands.test`:
59
+ - **If non-null** → tests are configured. Print:
60
+ ```
61
+ Phase 0: Tests configured (commands.test = "<value>") — skipping.
62
+ ```
63
+ **Skip** to Phase 1.
64
+ - **If null** → no test suite configured. Print:
65
+ ```
66
+ Phase 0: No test suite configured — scaffolding tests via subagent...
67
+ ```
68
+ Launch a subagent to scaffold the test suite:
69
+ ```
70
+ Agent(
71
+ description: "Scaffold test infrastructure",
72
+ prompt: "Run the /test-scaffold skill for this project. The project has no test suite configured (commands.test is null in .claude/orbital.config.json). Follow the skill instructions to: detect the project stack, choose a test framework, install it, write real tests, verify they pass, and update commands.test in .claude/orbital.config.json. Report what you did when finished.",
73
+ mode: "auto"
74
+ )
75
+ ```
76
+ 3. After the subagent completes:
77
+ - Re-read `.claude/orbital.config.json` and confirm `commands.test` is now non-null
78
+ - Run the configured test command to verify tests actually pass:
79
+ ```bash
80
+ <commands.test value> # e.g., npm run test
81
+ ```
82
+ - **If `commands.test` is still null or tests fail:**
83
+ ```
84
+ ╔═══════════════════════════════════════════════════════════════╗
85
+ ║ Phase 0 FAILED — Test scaffolding did not produce passing ║
86
+ ║ tests. Fix manually and re-run: /scope-post-review NNN ║
87
+ ╚═══════════════════════════════════════════════════════════════╝
88
+ ```
89
+ Emit failure and **STOP** — do not proceed to Phase 1 with broken tests:
90
+ ```bash
91
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"post_review","phase":0}' --scope "{NNN}"
92
+ ```
93
+ - **If tests pass** → continue to Phase 1.
94
+
48
95
  ### Phase 1: Quality Gates (`/test-checks`)
49
96
 
50
97
  Run the 13 quality gates. This is the cheapest and fastest check.
@@ -58,7 +105,10 @@ Run the 13 quality gates. This is the cheapest and fastest check.
58
105
  ║ Fix the failing gates and re-run: /scope-post-review NNN ║
59
106
  ╚═══════════════════════════════════════════════════════════════╝
60
107
  ```
61
- **STOP** — do not proceed to Phase 2.
108
+ Emit failure and **STOP** — do not proceed to Phase 2:
109
+ ```bash
110
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"post_review","phase":1}' --scope "{NNN}"
111
+ ```
62
112
  3. If all gates PASS → continue to Phase 2.
63
113
 
64
114
  ### Phase 2: Formal Verification (`/scope-verify NNN`)
@@ -74,7 +124,10 @@ Run the scope-specific formal review gate.
74
124
  ║ Fix the issues and re-run: /scope-post-review NNN ║
75
125
  ╚═══════════════════════════════════════════════════════════════╝
76
126
  ```
77
- **STOP** — do not proceed to Phase 3.
127
+ Emit failure and **STOP** — do not proceed to Phase 3:
128
+ ```bash
129
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"post_review","phase":2}' --scope "{NNN}"
130
+ ```
78
131
  3. If verdict is PASS → continue to Phase 3.
79
132
 
80
133
  ### Phase 3: AI Code Review (`/test-code-review`)
@@ -83,8 +136,12 @@ Run the 6 parallel code review agents on the verified code.
83
136
 
84
137
  1. Invoke: `Skill(skill: "test-code-review")`
85
138
  2. Collect all findings — count BLOCKERS, WARNINGS, and SUGGESTIONS.
86
- 3. If there are **any findings** (blockers, warnings, or suggestions), proceed to Phase 4.
87
- 4. If there are **zero findings**, skip Phase 4 and go to Final Report.
139
+ 3. **Persist findings** write all findings to `.claude/review-findings/NNN.json` so Phase 4 can read them even if run standalone in a separate session:
140
+ ```json
141
+ { "scopeId": NNN, "timestamp": "<ISO>", "blockers": [...], "warnings": [...], "suggestions": [...] }
142
+ ```
143
+ 4. If there are **any findings** (blockers, warnings, or suggestions), proceed to Phase 4.
144
+ 5. If there are **zero findings**, skip Phase 4 and go to Final Report.
88
145
 
89
146
  ### Phase 4: Fix Review Findings (`/scope-fix-review NNN`)
90
147
 
@@ -95,9 +152,17 @@ Execute all Phase 3 findings using a coordinated agent team. **This phase requir
95
152
  echo "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-not set}"
96
153
  ```
97
154
  2. If **enabled** (`1`) and Phase 3 produced findings:
155
+ - If `.claude/review-findings/NNN.json` exists, load findings from there (enables standalone `/scope-fix-review` without re-running Phase 3)
98
156
  - Invoke: `Skill(skill: "scope-fix-review", args: "NNN")`
99
157
  - This spawns an agent team that fixes all findings in parallel across non-overlapping file domains
100
- - Includes a verification step (typecheck + build) at the end
158
+ - After fixes complete, **re-run quality gates** to catch regressions:
159
+ ```
160
+ Skill(skill: "test-checks")
161
+ ```
162
+ If any gate fails, report which gates regressed, emit failure and **STOP**:
163
+ ```bash
164
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"post_review","phase":4}' --scope "{NNN}"
165
+ ```
101
166
  3. If **not enabled**:
102
167
  - Read `~/.claude/settings.json`
103
168
  - Merge `"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }` into the existing JSON (preserve all other settings)
@@ -120,6 +185,11 @@ Execute all Phase 3 findings using a coordinated agent team. **This phase requir
120
185
 
121
186
  ### Final Report
122
187
 
188
+ Emit the completion event so the dispatch resolves and the dashboard card stops showing the active animation:
189
+ ```bash
190
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"post_review"}' --scope "{NNN}"
191
+ ```
192
+
123
193
  ```
124
194
  ╔═══════════════════════════════════════════════════════════════╗
125
195
  ║ /scope-post-review COMPLETE — Scope NNN ║
@@ -188,17 +188,24 @@ J items are implementation notes (no spec change).
188
188
  ### Step 8: Update Scope Status
189
189
 
190
190
  After applying spec fixes and writing the AGENT REVIEW:
191
- - Update frontmatter: `status: backlog`, `spec_locked: true`
192
- - Move file: `mv scopes/planning/{file} scopes/backlog/`
191
+ - Transition the scope (handles frontmatter + file move atomically):
192
+ ```bash
193
+ bash .claude/hooks/scope-transition.sh --from planning --to backlog --scope {NNN}
194
+ ```
195
+ - Update frontmatter: `spec_locked: true` (scope-transition.sh handles status, this is the extra field)
193
196
  - Update DASHBOARD Quick Status: `🟢 **Status**: Backlog | **Spec Locked**: Yes`
194
197
  - Add to Recent Activity: `Review completed — N blockers, M warnings. X items applied to spec, K clarifications resolved.`
195
198
 
196
- ### Step 9: Signal Completion
199
+ ### Step 9: Signal Completion (REQUIRED)
197
200
 
198
- Emit the agent completion event so the Orbital Command dashboard turns off the progress indicator:
201
+ **Always emit when finished** this is not optional. Emit success or failure so the dispatch resolves immediately:
199
202
 
200
203
  ```bash
204
+ # On success:
201
205
  bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"team_review"}' --scope "{NNN}"
206
+
207
+ # On failure (agent launch failed, unrecoverable error, etc.):
208
+ bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"failure","action":"team_review"}' --scope "{NNN}"
202
209
  ```
203
210
 
204
211
  ## Modes
@@ -146,9 +146,11 @@ Overall verdict is PASS only if ALL 4 criteria are PASS.
146
146
  ### Step 6: Scope Transition (on PASS only)
147
147
 
148
148
  If all criteria passed:
149
- 1. Move scope file: `mv scopes/implementing/{file} scopes/review/` (or leave in place if already in `scopes/review/`)
150
- 2. Update frontmatter: `status: review`
151
- 3. Update DASHBOARD: `✅ **Status**: Reviewed | Ready to Commit`
149
+ 1. Transition the scope (handles frontmatter + file move atomically):
150
+ ```bash
151
+ bash .claude/hooks/scope-transition.sh --from implementing --to review --scope {NNN}
152
+ ```
153
+ 2. Update DASHBOARD: `✅ **Status**: Reviewed | Ready to Commit`
152
154
 
153
155
  ### Step 7: Report & Next Steps
154
156
 
@@ -21,9 +21,9 @@ Combines all validation layers into one comprehensive check:
21
21
  │ /test-code-review │
22
22
  ├─────────────────────────────────────────────────────────────────────────┤
23
23
  │ │
24
- │ Phase 1: /test-checks (8 checks)
25
- │ ├── TypeScript, ESLint, Build, Templates
26
- │ └── Doc links, Doc freshness, Enforcement, Workarounds
24
+ │ Phase 1: /test-checks (13 quality gates)
25
+ │ ├── TypeScript, Lint, Build, Templates, Docs, Enforcement
26
+ │ └── Placeholders, Mock data, Shortcuts, Secrets, Stale scopes, Tests
27
27
  │ │
28
28
  │ Phase 2: pre-push (3 checks) │
29
29
  │ ├── Documentation sync │
@@ -50,26 +50,13 @@ Combines all validation layers into one comprehensive check:
50
50
 
51
51
  ### Phase 1: Pre-Commit Checks
52
52
 
53
- Run all 8 quality gates. Read commands from `.claude/orbital.config.json` — skip any that are null:
53
+ Run all 13 quality gates via `/test-checks`:
54
54
 
55
- ```bash
56
- echo "═══ PHASE 1: PRE-COMMIT ═══"
57
- # Run commands.typeCheck from orbital.config.json (skip if null)
58
- echo "[1/8] TypeScript..."
59
- # Run commands.lint from orbital.config.json (skip if null)
60
- echo "[2/8] Lint..."
61
- # Run commands.build from orbital.config.json (skip if null)
62
- echo "[3/8] Build..."
63
- # Run commands.validateTemplates from orbital.config.json (skip if null)
64
- echo "[4/8] Templates..."
65
- # Run commands.validateDocs from orbital.config.json (skip if null)
66
- echo "[5/8] Doc links..."
67
- # Run commands.docFreshness from orbital.config.json (skip if null)
68
- echo "[6/8] Doc freshness..."
69
- # Run commands.checkRules from orbital.config.json (skip if null)
70
- echo "[7/8] Enforcement..."
71
- echo "[8/8] Workarounds..." && echo "✅ Check staged files manually"
72
55
  ```
56
+ Skill(skill: "test-checks")
57
+ ```
58
+
59
+ This runs the full pipeline: typecheck, lint, build, templates, docs, enforcement, placeholders, mock data, shortcuts, secrets, stale scopes, and tests (13 gates total). See `/test-checks` for details.
73
60
 
74
61
  **Stop here if any check fails. Fix before proceeding.**
75
62
 
@@ -120,21 +107,44 @@ Prompt: "Review type design quality"
120
107
 
121
108
  ### Phase 4: Synthesize Results
122
109
 
123
- Collect all findings and report:
110
+ Collect all findings, categorize by severity, and **persist to disk** so `/scope-fix-review` can load them in a standalone session.
111
+
112
+ **4a. Categorize findings** from all 6 agents into BLOCKERS, WARNINGS, and SUGGESTIONS.
113
+
114
+ **4b. Write findings to disk** — if running in a scope context (scope NNN is known from the pipeline), write:
115
+
116
+ ```bash
117
+ mkdir -p .claude/review-findings
118
+ ```
119
+
120
+ Write `.claude/review-findings/NNN.json`:
121
+ ```json
122
+ {
123
+ "scopeId": NNN,
124
+ "timestamp": "<ISO timestamp>",
125
+ "blockers": [{ "agent": "...", "file": "...", "line": N, "message": "...", "fix": "..." }],
126
+ "warnings": [{ "agent": "...", "file": "...", "line": N, "message": "...", "fix": "..." }],
127
+ "suggestions": [{ "agent": "...", "file": "...", "line": N, "message": "...", "fix": "..." }]
128
+ }
129
+ ```
130
+
131
+ If no scope context is available (standalone `/test-code-review` outside post-review), skip the file write — findings remain in conversation context only.
132
+
133
+ **4c. Display summary:**
124
134
 
125
135
  ```
126
136
  ╔═══════════════════════════════════════════════════════════════════════╗
127
- /test-code-review RESULTS
137
+ /test-code-review RESULTS
128
138
  ╠═══════════════════════════════════════════════════════════════════════╣
129
139
  ║ ║
130
- ║ PHASE 1: Pre-Commit [8/8 passed]
131
- ║ PHASE 2: Pre-Push [3/3 passed]
140
+ ║ PHASE 1: Pre-Commit [13/13 passed]
141
+ ║ PHASE 2: Pre-Push [3/3 passed]
132
142
  ║ PHASE 3: Code Review [findings below] ║
133
143
  ║ ║
134
144
  ║ ───────────────────────────────────────────────────────────────── ║
135
- 🚫 BLOCKERS (must fix): 0
136
- ⚠️ WARNINGS (should fix): 2
137
- 💡 SUGGESTIONS (consider): 5
145
+ ║ BLOCKERS (must fix): 0
146
+ ║ WARNINGS (should fix): 2
147
+ ║ SUGGESTIONS (consider): 5
138
148
  ║ ║
139
149
  ╚═══════════════════════════════════════════════════════════════════════╝
140
150
  ```
@@ -199,13 +209,11 @@ If matching scope files are found and all tests passed:
199
209
  #### Step 4: Move Completed Scopes (If User Confirms)
200
210
 
201
211
  ```bash
202
- # Only after user confirmation (scopes are gitignored, use plain mv)
203
- mv scopes/XXX-scope-name.md scopes/completed/
204
- echo "✅ Moved scope XXX to completed folder"
212
+ # Only after user confirmation uses atomic transition (frontmatter + move)
213
+ bash .claude/hooks/scope-transition.sh --from review --to completed --scope XXX
214
+ echo "✅ Moved scope XXX to completed"
205
215
  ```
206
216
 
207
- **Note:** Scopes are gitignored — use plain `mv`, not `git mv`.
208
-
209
217
  ## Modes
210
218
 
211
219
  | Command | What Runs |