orbital-command 0.1.4 → 0.3.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.
- package/bin/orbital.js +676 -53
- package/dist/assets/PrimitivesConfig-CrmQXYh4.js +32 -0
- package/dist/assets/QualityGates-BbasOsF3.js +21 -0
- package/dist/assets/SessionTimeline-CGeJsVvy.js +1 -0
- package/dist/assets/Settings-oiM496mc.js +12 -0
- package/dist/assets/SourceControl-B1fP2nJL.js +41 -0
- package/dist/assets/WorkflowVisualizer-CWLYf-f0.js +74 -0
- package/dist/assets/arrow-down-CPy85_J6.js +6 -0
- package/dist/assets/charts-DbDg0Psc.js +68 -0
- package/dist/assets/circle-x-Cwz6ZQDV.js +6 -0
- package/dist/assets/file-text-C46Xr65c.js +6 -0
- package/dist/assets/formatDistanceToNow-BMqsSP44.js +1 -0
- package/dist/assets/globe-Cn2yNZUD.js +6 -0
- package/dist/assets/index-Aj4sV8Al.css +1 -0
- package/dist/assets/index-Bc9dK3MW.js +354 -0
- package/dist/assets/key-OPaNTWJ5.js +6 -0
- package/dist/assets/minus-GMsbpKym.js +6 -0
- package/dist/assets/shield-DwAFkDYI.js +6 -0
- package/dist/assets/ui-BmsSg9jU.js +53 -0
- package/dist/assets/useWorkflowEditor-BJkTX_NR.js +16 -0
- package/dist/assets/{vendor-Dzv9lrRc.js → vendor-Bqt8AJn2.js} +1 -1
- package/dist/assets/zap-DfbUoOty.js +11 -0
- package/dist/favicon.svg +1 -0
- package/dist/index.html +6 -5
- package/dist/server/server/__tests__/data-routes.test.js +124 -0
- package/dist/server/server/__tests__/helpers/db.js +17 -0
- package/dist/server/server/__tests__/helpers/mock-emitter.js +8 -0
- package/dist/server/server/__tests__/scope-routes.test.js +137 -0
- package/dist/server/server/__tests__/sprint-routes.test.js +102 -0
- package/dist/server/server/__tests__/workflow-routes.test.js +107 -0
- package/dist/server/server/config-migrator.js +138 -0
- package/dist/server/server/config.js +17 -2
- package/dist/server/server/database.js +27 -12
- package/dist/server/server/global-config.js +143 -0
- package/dist/server/server/index.js +882 -252
- package/dist/server/server/init.js +579 -194
- package/dist/server/server/launch.js +29 -0
- package/dist/server/server/manifest-types.js +8 -0
- package/dist/server/server/manifest.js +454 -0
- package/dist/server/server/migrate-legacy.js +229 -0
- package/dist/server/server/parsers/event-parser.test.js +117 -0
- package/dist/server/server/parsers/scope-parser.js +74 -28
- package/dist/server/server/parsers/scope-parser.test.js +230 -0
- package/dist/server/server/project-context.js +255 -0
- package/dist/server/server/project-emitter.js +41 -0
- package/dist/server/server/project-manager.js +297 -0
- package/dist/server/server/routes/config-routes.js +1 -3
- package/dist/server/server/routes/data-routes.js +22 -110
- package/dist/server/server/routes/dispatch-routes.js +15 -9
- package/dist/server/server/routes/git-routes.js +74 -0
- package/dist/server/server/routes/manifest-routes.js +319 -0
- package/dist/server/server/routes/scope-routes.js +37 -23
- package/dist/server/server/routes/sync-routes.js +134 -0
- package/dist/server/server/routes/version-routes.js +1 -15
- package/dist/server/server/routes/workflow-routes.js +9 -3
- package/dist/server/server/schema.js +2 -0
- package/dist/server/server/services/batch-orchestrator.js +26 -16
- package/dist/server/server/services/claude-session-service.js +17 -14
- package/dist/server/server/services/deploy-service.test.js +119 -0
- package/dist/server/server/services/event-service.js +64 -1
- package/dist/server/server/services/event-service.test.js +191 -0
- package/dist/server/server/services/gate-service.test.js +105 -0
- package/dist/server/server/services/git-service.js +108 -4
- package/dist/server/server/services/github-service.js +110 -2
- package/dist/server/server/services/readiness-service.test.js +190 -0
- package/dist/server/server/services/scope-cache.js +5 -1
- package/dist/server/server/services/scope-cache.test.js +142 -0
- package/dist/server/server/services/scope-service.js +217 -126
- package/dist/server/server/services/scope-service.test.js +137 -0
- package/dist/server/server/services/sprint-orchestrator.js +7 -6
- package/dist/server/server/services/sprint-service.js +21 -1
- package/dist/server/server/services/sprint-service.test.js +238 -0
- package/dist/server/server/services/sync-service.js +434 -0
- package/dist/server/server/services/sync-types.js +2 -0
- package/dist/server/server/services/telemetry-service.js +143 -0
- package/dist/server/server/services/workflow-service.js +26 -5
- package/dist/server/server/services/workflow-service.test.js +159 -0
- package/dist/server/server/settings-sync.js +284 -0
- package/dist/server/server/update-planner.js +279 -0
- package/dist/server/server/utils/cc-hooks-parser.js +3 -0
- package/dist/server/server/utils/cc-hooks-parser.test.js +86 -0
- package/dist/server/server/utils/dispatch-utils.js +77 -20
- package/dist/server/server/utils/dispatch-utils.test.js +182 -0
- package/dist/server/server/utils/logger.js +37 -3
- package/dist/server/server/utils/package-info.js +30 -0
- package/dist/server/server/utils/route-helpers.js +10 -0
- package/dist/server/server/utils/terminal-launcher.js +79 -25
- package/dist/server/server/utils/worktree-manager.js +13 -4
- package/dist/server/server/validator.js +230 -0
- package/dist/server/server/watchers/global-watcher.js +63 -0
- package/dist/server/server/watchers/scope-watcher.js +27 -12
- package/dist/server/server/wizard/config-editor.js +237 -0
- package/dist/server/server/wizard/detect.js +96 -0
- package/dist/server/server/wizard/doctor.js +115 -0
- package/dist/server/server/wizard/index.js +155 -0
- package/dist/server/server/wizard/phases/confirm.js +39 -0
- package/dist/server/server/wizard/phases/project-setup.js +90 -0
- package/dist/server/server/wizard/phases/setup-wizard.js +66 -0
- package/dist/server/server/wizard/phases/welcome.js +35 -0
- package/dist/server/server/wizard/phases/workflow-setup.js +22 -0
- package/dist/server/server/wizard/types.js +29 -0
- package/dist/server/server/wizard/ui.js +74 -0
- package/dist/server/shared/__fixtures__/workflow-configs.js +75 -0
- package/dist/server/shared/default-workflow.json +65 -0
- package/dist/server/shared/onboarding-tour.test.js +81 -0
- package/dist/server/shared/project-colors.js +24 -0
- package/dist/server/shared/workflow-config.test.js +84 -0
- package/dist/server/shared/workflow-engine.test.js +302 -0
- package/dist/server/shared/workflow-normalizer.js +101 -0
- package/dist/server/shared/workflow-normalizer.test.js +100 -0
- package/dist/server/src/components/onboarding/tour-steps.js +84 -0
- package/package.json +20 -15
- package/schemas/orbital.config.schema.json +16 -1
- package/scripts/postinstall.js +55 -7
- package/server/__tests__/data-routes.test.ts +149 -0
- package/server/__tests__/helpers/db.ts +19 -0
- package/server/__tests__/helpers/mock-emitter.ts +10 -0
- package/server/__tests__/scope-routes.test.ts +157 -0
- package/server/__tests__/sprint-routes.test.ts +118 -0
- package/server/__tests__/workflow-routes.test.ts +120 -0
- package/server/config-migrator.ts +163 -0
- package/server/config.ts +26 -2
- package/server/database.ts +35 -18
- package/server/global-config.ts +200 -0
- package/server/index.ts +975 -287
- package/server/init.ts +625 -182
- package/server/launch.ts +32 -0
- package/server/manifest-types.ts +145 -0
- package/server/manifest.ts +494 -0
- package/server/migrate-legacy.ts +290 -0
- package/server/parsers/event-parser.test.ts +135 -0
- package/server/parsers/scope-parser.test.ts +270 -0
- package/server/parsers/scope-parser.ts +79 -31
- package/server/project-context.ts +309 -0
- package/server/project-emitter.ts +50 -0
- package/server/project-manager.ts +369 -0
- package/server/routes/config-routes.ts +3 -5
- package/server/routes/data-routes.ts +28 -141
- package/server/routes/dispatch-routes.ts +19 -11
- package/server/routes/git-routes.ts +77 -0
- package/server/routes/manifest-routes.ts +388 -0
- package/server/routes/scope-routes.ts +29 -25
- package/server/routes/sync-routes.ts +175 -0
- package/server/routes/version-routes.ts +1 -16
- package/server/routes/workflow-routes.ts +9 -3
- package/server/schema.ts +2 -0
- package/server/services/batch-orchestrator.ts +24 -16
- package/server/services/claude-session-service.ts +16 -14
- package/server/services/deploy-service.test.ts +145 -0
- package/server/services/deploy-service.ts +2 -2
- package/server/services/event-service.test.ts +242 -0
- package/server/services/event-service.ts +92 -3
- package/server/services/gate-service.test.ts +131 -0
- package/server/services/gate-service.ts +2 -2
- package/server/services/git-service.ts +137 -4
- package/server/services/github-service.ts +120 -2
- package/server/services/readiness-service.test.ts +217 -0
- package/server/services/scope-cache.test.ts +167 -0
- package/server/services/scope-cache.ts +4 -1
- package/server/services/scope-service.test.ts +169 -0
- package/server/services/scope-service.ts +220 -126
- package/server/services/sprint-orchestrator.ts +7 -7
- package/server/services/sprint-service.test.ts +271 -0
- package/server/services/sprint-service.ts +27 -3
- package/server/services/sync-service.ts +482 -0
- package/server/services/sync-types.ts +77 -0
- package/server/services/telemetry-service.ts +195 -0
- package/server/services/workflow-service.test.ts +190 -0
- package/server/services/workflow-service.ts +29 -9
- package/server/settings-sync.ts +359 -0
- package/server/update-planner.ts +346 -0
- package/server/utils/cc-hooks-parser.test.ts +96 -0
- package/server/utils/cc-hooks-parser.ts +4 -0
- package/server/utils/dispatch-utils.test.ts +245 -0
- package/server/utils/dispatch-utils.ts +97 -27
- package/server/utils/logger.ts +40 -3
- package/server/utils/package-info.ts +32 -0
- package/server/utils/route-helpers.ts +12 -0
- package/server/utils/terminal-launcher.ts +85 -25
- package/server/utils/worktree-manager.ts +9 -4
- package/server/validator.ts +270 -0
- package/server/watchers/global-watcher.ts +77 -0
- package/server/watchers/scope-watcher.ts +21 -9
- package/server/wizard/config-editor.ts +248 -0
- package/server/wizard/detect.ts +104 -0
- package/server/wizard/doctor.ts +114 -0
- package/server/wizard/index.ts +187 -0
- package/server/wizard/phases/confirm.ts +45 -0
- package/server/wizard/phases/project-setup.ts +106 -0
- package/server/wizard/phases/setup-wizard.ts +78 -0
- package/server/wizard/phases/welcome.ts +43 -0
- package/server/wizard/phases/workflow-setup.ts +28 -0
- package/server/wizard/types.ts +56 -0
- package/server/wizard/ui.ts +93 -0
- package/shared/__fixtures__/workflow-configs.ts +80 -0
- package/shared/default-workflow.json +65 -0
- package/shared/onboarding-tour.test.ts +94 -0
- package/shared/project-colors.ts +24 -0
- package/shared/workflow-config.test.ts +111 -0
- package/shared/workflow-config.ts +7 -0
- package/shared/workflow-engine.test.ts +388 -0
- package/shared/workflow-normalizer.test.ts +119 -0
- package/shared/workflow-normalizer.ts +118 -0
- package/templates/hooks/end-session.sh +3 -1
- package/templates/hooks/orbital-emit.sh +2 -2
- package/templates/hooks/orbital-report-deploy.sh +4 -4
- package/templates/hooks/orbital-report-gates.sh +4 -4
- package/templates/hooks/orbital-scope-update.sh +1 -1
- package/templates/hooks/scope-create-cleanup.sh +2 -2
- package/templates/hooks/scope-create-gate.sh +0 -1
- package/templates/hooks/scope-helpers.sh +18 -0
- package/templates/hooks/scope-prepare.sh +66 -11
- package/templates/migrations/renames.json +1 -0
- package/templates/orbital.config.json +7 -2
- package/templates/settings-hooks.json +1 -1
- package/templates/skills/git-commit/SKILL.md +9 -4
- package/templates/skills/git-dev/SKILL.md +8 -3
- package/templates/skills/git-main/SKILL.md +8 -2
- package/templates/skills/git-production/SKILL.md +6 -2
- package/templates/skills/git-staging/SKILL.md +8 -3
- package/templates/skills/scope-create/SKILL.md +17 -3
- package/templates/skills/scope-fix-review/SKILL.md +6 -3
- package/templates/skills/scope-implement/SKILL.md +4 -1
- package/templates/skills/scope-post-review/SKILL.md +63 -5
- package/templates/skills/scope-pre-review/SKILL.md +5 -2
- package/templates/skills/scope-verify/SKILL.md +5 -3
- package/templates/skills/test-code-review/SKILL.md +41 -33
- package/templates/skills/test-scaffold/SKILL.md +222 -0
- package/dist/assets/WorkflowVisualizer-BZ21PIIF.js +0 -84
- package/dist/assets/charts-D__PA1zp.js +0 -72
- package/dist/assets/index-D1G6i0nS.css +0 -1
- package/dist/assets/index-DpItvKpf.js +0 -419
- package/dist/assets/ui-BvF022GT.js +0 -53
- package/index.html +0 -15
- package/postcss.config.js +0 -6
- package/src/App.tsx +0 -33
- package/src/components/AgentBadge.tsx +0 -40
- package/src/components/BatchPreflightModal.tsx +0 -115
- package/src/components/CardDisplayToggle.tsx +0 -74
- package/src/components/ColumnHeaderActions.tsx +0 -55
- package/src/components/ColumnMenu.tsx +0 -99
- package/src/components/DeployHistory.tsx +0 -141
- package/src/components/DispatchModal.tsx +0 -164
- package/src/components/DispatchPopover.tsx +0 -139
- package/src/components/DragOverlay.tsx +0 -25
- package/src/components/DriftSidebar.tsx +0 -140
- package/src/components/EnvironmentStrip.tsx +0 -88
- package/src/components/ErrorBoundary.tsx +0 -62
- package/src/components/FilterChip.tsx +0 -105
- package/src/components/GateIndicator.tsx +0 -33
- package/src/components/IdeaDetailModal.tsx +0 -190
- package/src/components/IdeaFormDialog.tsx +0 -113
- package/src/components/KanbanColumn.tsx +0 -201
- package/src/components/MarkdownRenderer.tsx +0 -114
- package/src/components/NeonGrid.tsx +0 -128
- package/src/components/PromotionQueue.tsx +0 -89
- package/src/components/ScopeCard.tsx +0 -234
- package/src/components/ScopeDetailModal.tsx +0 -255
- package/src/components/ScopeFilterBar.tsx +0 -152
- package/src/components/SearchInput.tsx +0 -102
- package/src/components/SessionPanel.tsx +0 -335
- package/src/components/SprintContainer.tsx +0 -303
- package/src/components/SprintDependencyDialog.tsx +0 -78
- package/src/components/SprintPreflightModal.tsx +0 -138
- package/src/components/StatusBar.tsx +0 -168
- package/src/components/SwimCell.tsx +0 -67
- package/src/components/SwimLaneRow.tsx +0 -94
- package/src/components/SwimlaneBoardView.tsx +0 -108
- package/src/components/VersionBadge.tsx +0 -139
- package/src/components/ViewModeSelector.tsx +0 -114
- package/src/components/config/AgentChip.tsx +0 -53
- package/src/components/config/AgentCreateDialog.tsx +0 -321
- package/src/components/config/AgentEditor.tsx +0 -175
- package/src/components/config/DirectoryTree.tsx +0 -582
- package/src/components/config/FileEditor.tsx +0 -550
- package/src/components/config/HookChip.tsx +0 -50
- package/src/components/config/StageCard.tsx +0 -198
- package/src/components/config/TransitionZone.tsx +0 -173
- package/src/components/config/UnifiedWorkflowPipeline.tsx +0 -216
- package/src/components/config/WorkflowPipeline.tsx +0 -161
- package/src/components/source-control/BranchList.tsx +0 -93
- package/src/components/source-control/BranchPanel.tsx +0 -105
- package/src/components/source-control/CommitLog.tsx +0 -100
- package/src/components/source-control/CommitRow.tsx +0 -47
- package/src/components/source-control/GitHubPanel.tsx +0 -110
- package/src/components/source-control/GitHubSetupGuide.tsx +0 -52
- package/src/components/source-control/GitOverviewBar.tsx +0 -101
- package/src/components/source-control/PullRequestList.tsx +0 -69
- package/src/components/source-control/WorktreeList.tsx +0 -80
- package/src/components/ui/badge.tsx +0 -41
- package/src/components/ui/button.tsx +0 -55
- package/src/components/ui/card.tsx +0 -78
- package/src/components/ui/dialog.tsx +0 -94
- package/src/components/ui/popover.tsx +0 -33
- package/src/components/ui/scroll-area.tsx +0 -54
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -52
- package/src/components/ui/toggle-switch.tsx +0 -35
- package/src/components/ui/tooltip.tsx +0 -27
- package/src/components/workflow/AddEdgeDialog.tsx +0 -217
- package/src/components/workflow/AddListDialog.tsx +0 -201
- package/src/components/workflow/ChecklistEditor.tsx +0 -239
- package/src/components/workflow/CommandPrefixManager.tsx +0 -118
- package/src/components/workflow/ConfigSettingsPanel.tsx +0 -189
- package/src/components/workflow/DirectionSelector.tsx +0 -133
- package/src/components/workflow/DispatchConfigPanel.tsx +0 -180
- package/src/components/workflow/EdgeDetailPanel.tsx +0 -236
- package/src/components/workflow/EdgePropertyEditor.tsx +0 -251
- package/src/components/workflow/EditToolbar.tsx +0 -138
- package/src/components/workflow/HookDetailPanel.tsx +0 -250
- package/src/components/workflow/HookExecutionLog.tsx +0 -24
- package/src/components/workflow/HookSourceModal.tsx +0 -129
- package/src/components/workflow/HooksDashboard.tsx +0 -363
- package/src/components/workflow/ListPropertyEditor.tsx +0 -251
- package/src/components/workflow/MigrationPreviewDialog.tsx +0 -237
- package/src/components/workflow/MovementRulesPanel.tsx +0 -188
- package/src/components/workflow/NodeDetailPanel.tsx +0 -245
- package/src/components/workflow/PresetSelector.tsx +0 -414
- package/src/components/workflow/SkillCommandBuilder.tsx +0 -174
- package/src/components/workflow/WorkflowEdgeComponent.tsx +0 -145
- package/src/components/workflow/WorkflowNode.tsx +0 -147
- package/src/components/workflow/graphLayout.ts +0 -186
- package/src/components/workflow/mergeHooks.ts +0 -85
- package/src/components/workflow/useEditHistory.ts +0 -88
- package/src/components/workflow/useWorkflowEditor.ts +0 -262
- package/src/components/workflow/validateConfig.ts +0 -70
- package/src/hooks/useActiveDispatches.ts +0 -198
- package/src/hooks/useBoardSettings.ts +0 -170
- package/src/hooks/useCardDisplay.ts +0 -57
- package/src/hooks/useCcHooks.ts +0 -24
- package/src/hooks/useConfigTree.ts +0 -51
- package/src/hooks/useEnforcementRules.ts +0 -46
- package/src/hooks/useEvents.ts +0 -59
- package/src/hooks/useFileEditor.ts +0 -165
- package/src/hooks/useGates.ts +0 -57
- package/src/hooks/useIdeaActions.ts +0 -53
- package/src/hooks/useKanbanDnd.ts +0 -410
- package/src/hooks/useOrbitalConfig.ts +0 -54
- package/src/hooks/usePipeline.ts +0 -47
- package/src/hooks/usePipelineData.ts +0 -338
- package/src/hooks/useReconnect.ts +0 -25
- package/src/hooks/useScopeFilters.ts +0 -125
- package/src/hooks/useScopeSessions.ts +0 -44
- package/src/hooks/useScopes.ts +0 -67
- package/src/hooks/useSearch.ts +0 -67
- package/src/hooks/useSettings.tsx +0 -187
- package/src/hooks/useSocket.ts +0 -25
- package/src/hooks/useSourceControl.ts +0 -105
- package/src/hooks/useSprintPreflight.ts +0 -55
- package/src/hooks/useSprints.ts +0 -154
- package/src/hooks/useStatusBarHighlight.ts +0 -18
- package/src/hooks/useSwimlaneBoardSettings.ts +0 -104
- package/src/hooks/useTheme.ts +0 -9
- package/src/hooks/useTransitionReadiness.ts +0 -53
- package/src/hooks/useVersion.ts +0 -155
- package/src/hooks/useViolations.ts +0 -65
- package/src/hooks/useWorkflow.tsx +0 -125
- package/src/hooks/useZoomModifier.ts +0 -19
- package/src/index.css +0 -797
- package/src/layouts/DashboardLayout.tsx +0 -113
- package/src/lib/collisionDetection.ts +0 -20
- package/src/lib/scope-fields.ts +0 -61
- package/src/lib/swimlane.ts +0 -146
- package/src/lib/utils.ts +0 -15
- package/src/main.tsx +0 -19
- package/src/socket.ts +0 -11
- package/src/types/index.ts +0 -497
- package/src/views/AgentFeed.tsx +0 -339
- package/src/views/DeployPipeline.tsx +0 -59
- package/src/views/EnforcementView.tsx +0 -378
- package/src/views/PrimitivesConfig.tsx +0 -500
- package/src/views/QualityGates.tsx +0 -1012
- package/src/views/ScopeBoard.tsx +0 -454
- package/src/views/SessionTimeline.tsx +0 -516
- package/src/views/Settings.tsx +0 -183
- package/src/views/SourceControl.tsx +0 -95
- package/src/views/WorkflowVisualizer.tsx +0 -382
- package/tailwind.config.js +0 -161
- package/tsconfig.json +0 -25
- package/vite.config.ts +0 -49
|
@@ -63,10 +63,16 @@ For each completed scope being pushed:
|
|
|
63
63
|
bash .claude/hooks/scope-transition.sh --from completed --to main --scope NNN
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
### Step 5: Signal Completion
|
|
66
|
+
### Step 5: Signal Completion (REQUIRED)
|
|
67
|
+
|
|
68
|
+
**Always emit after a successful push/PR** — this is not optional:
|
|
67
69
|
|
|
68
70
|
```bash
|
|
69
|
-
|
|
71
|
+
# With a scope:
|
|
72
|
+
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_main"}' --scope "{NNN}"
|
|
73
|
+
|
|
74
|
+
# Without a scope:
|
|
75
|
+
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_main"}'
|
|
70
76
|
```
|
|
71
77
|
|
|
72
78
|
## Batch Support
|
|
@@ -96,12 +96,16 @@ 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
|
-
|
|
101
|
+
**Always emit after a successful merge** — this is not optional:
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
+
# With a scope:
|
|
104
105
|
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_production"}' --scope "{NNN}"
|
|
106
|
+
|
|
107
|
+
# Without a scope:
|
|
108
|
+
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_production"}'
|
|
105
109
|
```
|
|
106
110
|
|
|
107
111
|
### 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
|
-
- `
|
|
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,16 @@ 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 after a successful PR creation** — this is not optional:
|
|
63
64
|
|
|
64
65
|
```bash
|
|
66
|
+
# With a scope:
|
|
65
67
|
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_staging"}' --scope "{NNN}"
|
|
68
|
+
|
|
69
|
+
# Without a scope:
|
|
70
|
+
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"pr_staging"}'
|
|
66
71
|
```
|
|
67
72
|
|
|
68
73
|
### 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:
|
|
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
|
|
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
|
|
16
|
-
- Code review findings must
|
|
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.
|
|
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
|
|
|
@@ -26,7 +26,10 @@ user-invocable: true
|
|
|
26
26
|
|
|
27
27
|
### 2. Implement
|
|
28
28
|
|
|
29
|
-
**Before starting Phase 1**:
|
|
29
|
+
**Before starting Phase 1**: Transition the scope and update the DASHBOARD to `🔄 **Status**: Implementing`:
|
|
30
|
+
```bash
|
|
31
|
+
bash .claude/hooks/scope-transition.sh --from backlog --to implementing --scope {NNN}
|
|
32
|
+
```
|
|
30
33
|
|
|
31
34
|
For each phase:
|
|
32
35
|
|
|
@@ -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,49 @@ Orchestrates the full post-implementation review pipeline for a scope. Runs up t
|
|
|
41
46
|
└─────────────────────────────────────────────────────────────────┘
|
|
42
47
|
```
|
|
43
48
|
|
|
44
|
-
**Rationale**: Quality gates run
|
|
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
|
+
**STOP** — do not proceed to Phase 1 with broken tests.
|
|
90
|
+
- **If tests pass** → continue to Phase 1.
|
|
91
|
+
|
|
48
92
|
### Phase 1: Quality Gates (`/test-checks`)
|
|
49
93
|
|
|
50
94
|
Run the 13 quality gates. This is the cheapest and fastest check.
|
|
@@ -83,8 +127,12 @@ Run the 6 parallel code review agents on the verified code.
|
|
|
83
127
|
|
|
84
128
|
1. Invoke: `Skill(skill: "test-code-review")`
|
|
85
129
|
2. Collect all findings — count BLOCKERS, WARNINGS, and SUGGESTIONS.
|
|
86
|
-
3.
|
|
87
|
-
|
|
130
|
+
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:
|
|
131
|
+
```json
|
|
132
|
+
{ "scopeId": NNN, "timestamp": "<ISO>", "blockers": [...], "warnings": [...], "suggestions": [...] }
|
|
133
|
+
```
|
|
134
|
+
4. If there are **any findings** (blockers, warnings, or suggestions), proceed to Phase 4.
|
|
135
|
+
5. If there are **zero findings**, skip Phase 4 and go to Final Report.
|
|
88
136
|
|
|
89
137
|
### Phase 4: Fix Review Findings (`/scope-fix-review NNN`)
|
|
90
138
|
|
|
@@ -95,9 +143,14 @@ Execute all Phase 3 findings using a coordinated agent team. **This phase requir
|
|
|
95
143
|
echo "${CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS:-not set}"
|
|
96
144
|
```
|
|
97
145
|
2. If **enabled** (`1`) and Phase 3 produced findings:
|
|
146
|
+
- If `.claude/review-findings/NNN.json` exists, load findings from there (enables standalone `/scope-fix-review` without re-running Phase 3)
|
|
98
147
|
- Invoke: `Skill(skill: "scope-fix-review", args: "NNN")`
|
|
99
148
|
- This spawns an agent team that fixes all findings in parallel across non-overlapping file domains
|
|
100
|
-
-
|
|
149
|
+
- After fixes complete, **re-run quality gates** to catch regressions:
|
|
150
|
+
```
|
|
151
|
+
Skill(skill: "test-checks")
|
|
152
|
+
```
|
|
153
|
+
If any gate fails, report which gates regressed and **STOP**.
|
|
101
154
|
3. If **not enabled**:
|
|
102
155
|
- Read `~/.claude/settings.json`
|
|
103
156
|
- Merge `"env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" }` into the existing JSON (preserve all other settings)
|
|
@@ -120,6 +173,11 @@ Execute all Phase 3 findings using a coordinated agent team. **This phase requir
|
|
|
120
173
|
|
|
121
174
|
### Final Report
|
|
122
175
|
|
|
176
|
+
Emit the completion event so the dispatch resolves and the dashboard card stops showing the active animation:
|
|
177
|
+
```bash
|
|
178
|
+
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"post_review"}' --scope "{NNN}"
|
|
179
|
+
```
|
|
180
|
+
|
|
123
181
|
```
|
|
124
182
|
╔═══════════════════════════════════════════════════════════════╗
|
|
125
183
|
║ /scope-post-review COMPLETE — Scope NNN ║
|
|
@@ -188,8 +188,11 @@ 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
|
-
-
|
|
192
|
-
|
|
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
|
|
|
@@ -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.
|
|
150
|
-
|
|
151
|
-
|
|
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 (
|
|
25
|
-
│ ├── TypeScript,
|
|
26
|
-
│ └──
|
|
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
|
|
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
|
|
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
|
-
║
|
|
137
|
+
║ /test-code-review RESULTS ║
|
|
128
138
|
╠═══════════════════════════════════════════════════════════════════════╣
|
|
129
139
|
║ ║
|
|
130
|
-
║ PHASE 1: Pre-Commit [
|
|
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
|
-
║
|
|
136
|
-
║
|
|
137
|
-
║
|
|
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
|
|
203
|
-
|
|
204
|
-
echo "✅ Moved scope XXX to completed
|
|
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 |
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-scaffold
|
|
3
|
+
description: Analyzes any project, scaffolds test infrastructure, writes real unit and integration tests, and configures orbital.config.json. Use when a project has no test suite or when commands.test is null.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /test-scaffold - Scaffold Test Infrastructure & Write Tests
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
tokens: ~1200
|
|
11
|
+
trigger: /test-scaffold
|
|
12
|
+
purpose: Detect, install, configure, and write a complete test suite for any project
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## What This Does
|
|
16
|
+
|
|
17
|
+
Analyzes the current project, picks the right test framework, installs it, writes real unit and integration tests for the most testable code, and configures `orbital.config.json` so the test gate runs automatically in future quality checks.
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
### Step 1: Detect Existing Test Infrastructure
|
|
22
|
+
|
|
23
|
+
Check if the project already has tests.
|
|
24
|
+
|
|
25
|
+
1. Read `.claude/orbital.config.json` — check if `commands.test` is non-null
|
|
26
|
+
2. Check `package.json` (or equivalent) for a `test` script
|
|
27
|
+
3. Search for existing test files: `*.test.*`, `*.spec.*`, `__tests__/` directories
|
|
28
|
+
4. Search for test config files: `vitest.config.*`, `jest.config.*`, `pytest.ini`, `pyproject.toml [tool.pytest]`, `*_test.go`
|
|
29
|
+
|
|
30
|
+
If tests exist AND `commands.test` is non-null, **verify they actually pass** by running the test command:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
<commands.test value> # e.g., npm run test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- **If tests pass** → print "Tests already configured and passing" and **EXIT**.
|
|
37
|
+
- **If tests fail** → print "Tests exist but are failing — proceeding to diagnose and fix." Continue to Step 2, but focus on fixing the existing tests rather than scaffolding from scratch.
|
|
38
|
+
|
|
39
|
+
If no test infrastructure exists at all, continue to Step 2.
|
|
40
|
+
|
|
41
|
+
### Step 2: Analyze the Project
|
|
42
|
+
|
|
43
|
+
Read the project's configuration and source code to determine the stack:
|
|
44
|
+
|
|
45
|
+
**2a. Identify language and runtime:**
|
|
46
|
+
- Read `package.json` → Node.js/TypeScript project
|
|
47
|
+
- Read `pyproject.toml` or `setup.py` or `requirements.txt` → Python project
|
|
48
|
+
- Read `go.mod` → Go project
|
|
49
|
+
- Read `Cargo.toml` → Rust project
|
|
50
|
+
- Read `pom.xml` or `build.gradle` → Java/Kotlin project
|
|
51
|
+
|
|
52
|
+
**2b. Identify build tooling (for framework selection):**
|
|
53
|
+
- Check for `vite.config.*` → Vite-based (use Vitest)
|
|
54
|
+
- Check for `webpack.config.*` → Webpack-based
|
|
55
|
+
- Check for `tsconfig.json` → TypeScript project
|
|
56
|
+
- Check for `next.config.*` → Next.js
|
|
57
|
+
|
|
58
|
+
**2c. Identify code structure:**
|
|
59
|
+
- List top-level directories (e.g., `src/`, `server/`, `shared/`, `lib/`, `app/`)
|
|
60
|
+
- Note path aliases (from tsconfig `paths`, webpack aliases, etc.)
|
|
61
|
+
- **Monorepo detection:** Check for `pnpm-workspace.yaml`, `lerna.json`, `rush.json`, or `workspaces` field in `package.json`. If detected, scope test scaffolding to the current package (the directory containing the nearest `package.json`), not the workspace root.
|
|
62
|
+
|
|
63
|
+
**2d. Find the most testable code — prioritize in this order:**
|
|
64
|
+
|
|
65
|
+
1. **Pure functions and classes** — no I/O, no side effects. Look for:
|
|
66
|
+
- Utility modules, parsers, validators, transformers
|
|
67
|
+
- Engine/logic classes that take config and return computed results
|
|
68
|
+
- Type guard functions, normalizers, formatters
|
|
69
|
+
|
|
70
|
+
2. **Services with injectable dependencies** — constructor takes DB, event emitter, or other services:
|
|
71
|
+
- Database services (CRUD operations)
|
|
72
|
+
- Business logic services
|
|
73
|
+
- Cache/store classes
|
|
74
|
+
|
|
75
|
+
3. **API routes** — if the project uses Express, Fastify, Flask, etc.:
|
|
76
|
+
- Route handlers with dependency injection
|
|
77
|
+
- REST endpoints that can be tested with HTTP assertions
|
|
78
|
+
|
|
79
|
+
For each candidate, note: file path, exported functions/classes, whether it has side effects, and what test data it would need.
|
|
80
|
+
|
|
81
|
+
### Step 3: Choose Test Framework
|
|
82
|
+
|
|
83
|
+
Based on the analysis in Step 2, select the appropriate test framework:
|
|
84
|
+
|
|
85
|
+
| Project Type | Framework | HTTP Testing | Why |
|
|
86
|
+
|---|---|---|---|
|
|
87
|
+
| Vite / React / Vue | **Vitest** | supertest | Shares Vite transform pipeline, native ESM |
|
|
88
|
+
| Node.js (no Vite) | **Vitest** | supertest | Fast, modern, good ESM support |
|
|
89
|
+
| Next.js | **Vitest** or **Jest** | supertest | Check if Jest is already a dependency |
|
|
90
|
+
| Python | **pytest** | pytest + httpx/requests | De facto standard |
|
|
91
|
+
| Go | **built-in testing** | net/http/httptest | No external framework needed |
|
|
92
|
+
| Rust | **built-in #[test]** | actix-test / axum::test | No external framework needed |
|
|
93
|
+
|
|
94
|
+
**Do not install a framework the project already has** — check existing dependencies first.
|
|
95
|
+
|
|
96
|
+
### Step 4: Install and Configure
|
|
97
|
+
|
|
98
|
+
**4a. Install the framework and test utilities:**
|
|
99
|
+
|
|
100
|
+
For Node.js projects:
|
|
101
|
+
```bash
|
|
102
|
+
npm install -D vitest # (or chosen framework)
|
|
103
|
+
# Add HTTP testing if the project has API routes:
|
|
104
|
+
npm install -D supertest @types/supertest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For Python projects:
|
|
108
|
+
```bash
|
|
109
|
+
pip install pytest # or add to dev dependencies
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**4b. Create the test configuration file:**
|
|
113
|
+
|
|
114
|
+
For Vitest — create `vitest.config.ts` (separate from `vite.config.ts`):
|
|
115
|
+
- Configure `test.environment: 'node'` for server/pure logic tests
|
|
116
|
+
- Configure path aliases to match the project's tsconfig
|
|
117
|
+
- If the project has both pure logic and I/O-dependent code, configure two projects:
|
|
118
|
+
- `unit` — pure logic tests (fast, no setup)
|
|
119
|
+
- `integration` — tests requiring DB, filesystem, or network (may need setup/teardown)
|
|
120
|
+
|
|
121
|
+
**4c. Add test scripts** to `package.json` (or equivalent):
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
"test": "<framework> run",
|
|
125
|
+
"test:unit": "<framework> run --project unit",
|
|
126
|
+
"test:integration": "<framework> run --project integration",
|
|
127
|
+
"test:watch": "<framework>",
|
|
128
|
+
"test:coverage": "<framework> run --coverage"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**4d. Add `coverage/` to `.gitignore`** if not already present.
|
|
132
|
+
|
|
133
|
+
### Step 5: Create Test Helpers
|
|
134
|
+
|
|
135
|
+
Based on what the project needs, create shared test utilities:
|
|
136
|
+
|
|
137
|
+
**If the project uses a database (SQLite, Postgres, etc.):**
|
|
138
|
+
- Create a DB test helper that sets up an isolated test database (in-memory SQLite, test schema, etc.)
|
|
139
|
+
- Helper should return `{ db, cleanup }` for use in `beforeEach`/`afterEach`
|
|
140
|
+
- **Finding the schema:** Search for `schema.*` files (`.ts`, `.js`, `.sql`), `schema/` directories, or migration files. For TypeScript projects, look for exported DDL constants (e.g., `export const SCHEMA_DDL`). For SQL files, import them directly. Apply the discovered schema to the test database.
|
|
141
|
+
|
|
142
|
+
**If services depend on event emitters, websockets, or message buses:**
|
|
143
|
+
- Create a mock factory (e.g., `createMockEmitter()`) that returns a spy-instrumented object matching the real interface
|
|
144
|
+
|
|
145
|
+
**If tests need fixture data (config objects, sample records, etc.):**
|
|
146
|
+
- Create a `__fixtures__/` directory with reusable test data
|
|
147
|
+
- Export named constants: `MINIMAL_CONFIG`, `DEFAULT_CONFIG`, `INVALID_CONFIGS`, etc.
|
|
148
|
+
- Build fixtures from the project's actual config schemas, not invented formats
|
|
149
|
+
|
|
150
|
+
### Step 6: Write Real Test Cases
|
|
151
|
+
|
|
152
|
+
Write actual, meaningful test cases for the code identified in Step 2. **Do not write stubs or placeholder tests.**
|
|
153
|
+
|
|
154
|
+
**For each testable module, write tests that cover:**
|
|
155
|
+
|
|
156
|
+
1. **Happy path** — normal inputs produce expected outputs
|
|
157
|
+
2. **Edge cases** — empty inputs, boundary values, null/undefined
|
|
158
|
+
3. **Error cases** — invalid inputs throw or return error results
|
|
159
|
+
4. **Constructor/initialization** — validation logic, required params
|
|
160
|
+
|
|
161
|
+
**Organize tests by module:**
|
|
162
|
+
- Co-locate test files next to source files: `foo.ts` → `foo.test.ts`
|
|
163
|
+
- Exception: integration tests spanning multiple modules go in `__tests__/` directories
|
|
164
|
+
|
|
165
|
+
**Naming convention:**
|
|
166
|
+
```
|
|
167
|
+
describe('ClassName', () => {
|
|
168
|
+
describe('methodName()', () => {
|
|
169
|
+
it('returns X when given Y', () => { ... });
|
|
170
|
+
it('throws when given invalid input', () => { ... });
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Prioritize coverage by test value:**
|
|
176
|
+
1. Pure logic with complex branching (highest value)
|
|
177
|
+
2. Services that write/read data (catches data bugs)
|
|
178
|
+
3. API routes (catches contract breaks)
|
|
179
|
+
4. Simple getters/setters (lowest value — skip if time-constrained)
|
|
180
|
+
|
|
181
|
+
### Step 7: Verify
|
|
182
|
+
|
|
183
|
+
Run the complete test suite and confirm all tests pass:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm run test # or equivalent
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
If any tests fail:
|
|
190
|
+
1. Read the failure output
|
|
191
|
+
2. Fix the test or the test helper (not the source code — tests should match existing behavior)
|
|
192
|
+
3. Re-run until all pass
|
|
193
|
+
|
|
194
|
+
Also verify the project still builds:
|
|
195
|
+
```bash
|
|
196
|
+
npm run typecheck # if TypeScript
|
|
197
|
+
npm run build # if applicable
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Step 8: Update orbital.config.json
|
|
201
|
+
|
|
202
|
+
Set `commands.test` so the test gate (#13 in `/test-checks`) runs automatically:
|
|
203
|
+
|
|
204
|
+
Read `.claude/orbital.config.json`, update the `commands.test` field:
|
|
205
|
+
|
|
206
|
+
```json
|
|
207
|
+
{
|
|
208
|
+
"commands": {
|
|
209
|
+
"test": "npm run test"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Use the appropriate command for the project's package manager and framework.
|
|
215
|
+
|
|
216
|
+
## Notes
|
|
217
|
+
|
|
218
|
+
- This skill is framework-agnostic — the framework choice emerges from project analysis
|
|
219
|
+
- For projects with both frontend and backend, focus tests on backend/shared logic first (higher value per test)
|
|
220
|
+
- Do not add component tests (React Testing Library, etc.) unless the project specifically needs them — they require additional setup (jsdom, etc.) and are lower priority than logic tests
|
|
221
|
+
- Do not modify source code to make it testable — tests should work with the existing API surface
|
|
222
|
+
- If the project already has _some_ tests but `commands.test` is null, configure the command without rewriting existing tests
|