orbital-command 0.1.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/LICENSE +21 -0
- package/README.md +396 -0
- package/bin/orbital.js +362 -0
- package/dist/assets/WorkflowVisualizer-BZ21PIIF.js +84 -0
- package/dist/assets/WorkflowVisualizer-BZV40eAE.css +1 -0
- package/dist/assets/charts-D__PA1zp.js +72 -0
- package/dist/assets/index-D1G6i0nS.css +1 -0
- package/dist/assets/index-DpItvKpf.js +419 -0
- package/dist/assets/ui-BvF022GT.js +53 -0
- package/dist/assets/vendor-Dzv9lrRc.js +59 -0
- package/dist/index.html +19 -0
- package/dist/scanner-sweep.png +0 -0
- package/dist/server/server/adapters/index.js +34 -0
- package/dist/server/server/adapters/iterm2-adapter.js +29 -0
- package/dist/server/server/adapters/subprocess-adapter.js +21 -0
- package/dist/server/server/adapters/terminal-adapter.js +1 -0
- package/dist/server/server/config.js +156 -0
- package/dist/server/server/database.js +90 -0
- package/dist/server/server/index.js +372 -0
- package/dist/server/server/init.js +811 -0
- package/dist/server/server/parsers/event-parser.js +64 -0
- package/dist/server/server/parsers/scope-parser.js +188 -0
- package/dist/server/server/routes/config-routes.js +163 -0
- package/dist/server/server/routes/data-routes.js +461 -0
- package/dist/server/server/routes/dispatch-routes.js +215 -0
- package/dist/server/server/routes/git-routes.js +92 -0
- package/dist/server/server/routes/scope-routes.js +215 -0
- package/dist/server/server/routes/sprint-routes.js +116 -0
- package/dist/server/server/routes/version-routes.js +130 -0
- package/dist/server/server/routes/workflow-routes.js +185 -0
- package/dist/server/server/schema.js +90 -0
- package/dist/server/server/services/batch-orchestrator.js +253 -0
- package/dist/server/server/services/claude-session-service.js +352 -0
- package/dist/server/server/services/config-service.js +132 -0
- package/dist/server/server/services/deploy-service.js +51 -0
- package/dist/server/server/services/event-service.js +63 -0
- package/dist/server/server/services/gate-service.js +83 -0
- package/dist/server/server/services/git-service.js +309 -0
- package/dist/server/server/services/github-service.js +145 -0
- package/dist/server/server/services/readiness-service.js +184 -0
- package/dist/server/server/services/scope-cache.js +72 -0
- package/dist/server/server/services/scope-service.js +424 -0
- package/dist/server/server/services/sprint-orchestrator.js +312 -0
- package/dist/server/server/services/sprint-service.js +293 -0
- package/dist/server/server/services/workflow-service.js +397 -0
- package/dist/server/server/utils/cc-hooks-parser.js +49 -0
- package/dist/server/server/utils/dispatch-utils.js +305 -0
- package/dist/server/server/utils/logger.js +86 -0
- package/dist/server/server/utils/terminal-launcher.js +388 -0
- package/dist/server/server/utils/worktree-manager.js +98 -0
- package/dist/server/server/watchers/event-watcher.js +81 -0
- package/dist/server/server/watchers/scope-watcher.js +33 -0
- package/dist/server/shared/api-types.js +5 -0
- package/dist/server/shared/default-workflow.json +616 -0
- package/dist/server/shared/workflow-config.js +44 -0
- package/dist/server/shared/workflow-engine.js +353 -0
- package/index.html +15 -0
- package/package.json +110 -0
- package/postcss.config.js +6 -0
- package/schemas/orbital.config.schema.json +83 -0
- package/scripts/postinstall.js +24 -0
- package/scripts/start.sh +20 -0
- package/server/adapters/index.ts +41 -0
- package/server/adapters/iterm2-adapter.ts +37 -0
- package/server/adapters/subprocess-adapter.ts +25 -0
- package/server/adapters/terminal-adapter.ts +24 -0
- package/server/config.ts +234 -0
- package/server/database.ts +107 -0
- package/server/index.ts +452 -0
- package/server/init.ts +891 -0
- package/server/parsers/event-parser.ts +74 -0
- package/server/parsers/scope-parser.ts +240 -0
- package/server/routes/config-routes.ts +182 -0
- package/server/routes/data-routes.ts +548 -0
- package/server/routes/dispatch-routes.ts +275 -0
- package/server/routes/git-routes.ts +112 -0
- package/server/routes/scope-routes.ts +262 -0
- package/server/routes/sprint-routes.ts +142 -0
- package/server/routes/version-routes.ts +156 -0
- package/server/routes/workflow-routes.ts +198 -0
- package/server/schema.ts +90 -0
- package/server/services/batch-orchestrator.ts +286 -0
- package/server/services/claude-session-service.ts +441 -0
- package/server/services/config-service.ts +151 -0
- package/server/services/deploy-service.ts +98 -0
- package/server/services/event-service.ts +98 -0
- package/server/services/gate-service.ts +126 -0
- package/server/services/git-service.ts +391 -0
- package/server/services/github-service.ts +183 -0
- package/server/services/readiness-service.ts +250 -0
- package/server/services/scope-cache.ts +81 -0
- package/server/services/scope-service.ts +476 -0
- package/server/services/sprint-orchestrator.ts +361 -0
- package/server/services/sprint-service.ts +415 -0
- package/server/services/workflow-service.ts +461 -0
- package/server/utils/cc-hooks-parser.ts +70 -0
- package/server/utils/dispatch-utils.ts +395 -0
- package/server/utils/logger.ts +109 -0
- package/server/utils/terminal-launcher.ts +462 -0
- package/server/utils/worktree-manager.ts +104 -0
- package/server/watchers/event-watcher.ts +100 -0
- package/server/watchers/scope-watcher.ts +38 -0
- package/shared/api-types.ts +20 -0
- package/shared/default-workflow.json +616 -0
- package/shared/workflow-config.ts +170 -0
- package/shared/workflow-engine.ts +427 -0
- package/src/App.tsx +33 -0
- package/src/components/AgentBadge.tsx +40 -0
- package/src/components/BatchPreflightModal.tsx +115 -0
- package/src/components/CardDisplayToggle.tsx +74 -0
- package/src/components/ColumnHeaderActions.tsx +55 -0
- package/src/components/ColumnMenu.tsx +99 -0
- package/src/components/DeployHistory.tsx +141 -0
- package/src/components/DispatchModal.tsx +164 -0
- package/src/components/DispatchPopover.tsx +139 -0
- package/src/components/DragOverlay.tsx +25 -0
- package/src/components/DriftSidebar.tsx +140 -0
- package/src/components/EnvironmentStrip.tsx +88 -0
- package/src/components/ErrorBoundary.tsx +62 -0
- package/src/components/FilterChip.tsx +105 -0
- package/src/components/GateIndicator.tsx +33 -0
- package/src/components/IdeaDetailModal.tsx +190 -0
- package/src/components/IdeaFormDialog.tsx +113 -0
- package/src/components/KanbanColumn.tsx +201 -0
- package/src/components/MarkdownRenderer.tsx +114 -0
- package/src/components/NeonGrid.tsx +128 -0
- package/src/components/PromotionQueue.tsx +89 -0
- package/src/components/ScopeCard.tsx +234 -0
- package/src/components/ScopeDetailModal.tsx +255 -0
- package/src/components/ScopeFilterBar.tsx +152 -0
- package/src/components/SearchInput.tsx +102 -0
- package/src/components/SessionPanel.tsx +335 -0
- package/src/components/SprintContainer.tsx +303 -0
- package/src/components/SprintDependencyDialog.tsx +78 -0
- package/src/components/SprintPreflightModal.tsx +138 -0
- package/src/components/StatusBar.tsx +168 -0
- package/src/components/SwimCell.tsx +67 -0
- package/src/components/SwimLaneRow.tsx +94 -0
- package/src/components/SwimlaneBoardView.tsx +108 -0
- package/src/components/VersionBadge.tsx +139 -0
- package/src/components/ViewModeSelector.tsx +114 -0
- package/src/components/config/AgentChip.tsx +53 -0
- package/src/components/config/AgentCreateDialog.tsx +321 -0
- package/src/components/config/AgentEditor.tsx +175 -0
- package/src/components/config/DirectoryTree.tsx +582 -0
- package/src/components/config/FileEditor.tsx +550 -0
- package/src/components/config/HookChip.tsx +50 -0
- package/src/components/config/StageCard.tsx +198 -0
- package/src/components/config/TransitionZone.tsx +173 -0
- package/src/components/config/UnifiedWorkflowPipeline.tsx +216 -0
- package/src/components/config/WorkflowPipeline.tsx +161 -0
- package/src/components/source-control/BranchList.tsx +93 -0
- package/src/components/source-control/BranchPanel.tsx +105 -0
- package/src/components/source-control/CommitLog.tsx +100 -0
- package/src/components/source-control/CommitRow.tsx +47 -0
- package/src/components/source-control/GitHubPanel.tsx +110 -0
- package/src/components/source-control/GitHubSetupGuide.tsx +52 -0
- package/src/components/source-control/GitOverviewBar.tsx +101 -0
- package/src/components/source-control/PullRequestList.tsx +69 -0
- package/src/components/source-control/WorktreeList.tsx +80 -0
- package/src/components/ui/badge.tsx +41 -0
- package/src/components/ui/button.tsx +55 -0
- package/src/components/ui/card.tsx +78 -0
- package/src/components/ui/dialog.tsx +94 -0
- package/src/components/ui/popover.tsx +33 -0
- package/src/components/ui/scroll-area.tsx +54 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/tabs.tsx +52 -0
- package/src/components/ui/toggle-switch.tsx +35 -0
- package/src/components/ui/tooltip.tsx +27 -0
- package/src/components/workflow/AddEdgeDialog.tsx +217 -0
- package/src/components/workflow/AddListDialog.tsx +201 -0
- package/src/components/workflow/ChecklistEditor.tsx +239 -0
- package/src/components/workflow/CommandPrefixManager.tsx +118 -0
- package/src/components/workflow/ConfigSettingsPanel.tsx +189 -0
- package/src/components/workflow/DirectionSelector.tsx +133 -0
- package/src/components/workflow/DispatchConfigPanel.tsx +180 -0
- package/src/components/workflow/EdgeDetailPanel.tsx +236 -0
- package/src/components/workflow/EdgePropertyEditor.tsx +251 -0
- package/src/components/workflow/EditToolbar.tsx +138 -0
- package/src/components/workflow/HookDetailPanel.tsx +250 -0
- package/src/components/workflow/HookExecutionLog.tsx +24 -0
- package/src/components/workflow/HookSourceModal.tsx +129 -0
- package/src/components/workflow/HooksDashboard.tsx +363 -0
- package/src/components/workflow/ListPropertyEditor.tsx +251 -0
- package/src/components/workflow/MigrationPreviewDialog.tsx +237 -0
- package/src/components/workflow/MovementRulesPanel.tsx +188 -0
- package/src/components/workflow/NodeDetailPanel.tsx +245 -0
- package/src/components/workflow/PresetSelector.tsx +414 -0
- package/src/components/workflow/SkillCommandBuilder.tsx +174 -0
- package/src/components/workflow/WorkflowEdgeComponent.tsx +145 -0
- package/src/components/workflow/WorkflowNode.tsx +147 -0
- package/src/components/workflow/graphLayout.ts +186 -0
- package/src/components/workflow/mergeHooks.ts +85 -0
- package/src/components/workflow/useEditHistory.ts +88 -0
- package/src/components/workflow/useWorkflowEditor.ts +262 -0
- package/src/components/workflow/validateConfig.ts +70 -0
- package/src/hooks/useActiveDispatches.ts +198 -0
- package/src/hooks/useBoardSettings.ts +170 -0
- package/src/hooks/useCardDisplay.ts +57 -0
- package/src/hooks/useCcHooks.ts +24 -0
- package/src/hooks/useConfigTree.ts +51 -0
- package/src/hooks/useEnforcementRules.ts +46 -0
- package/src/hooks/useEvents.ts +59 -0
- package/src/hooks/useFileEditor.ts +165 -0
- package/src/hooks/useGates.ts +57 -0
- package/src/hooks/useIdeaActions.ts +53 -0
- package/src/hooks/useKanbanDnd.ts +410 -0
- package/src/hooks/useOrbitalConfig.ts +54 -0
- package/src/hooks/usePipeline.ts +47 -0
- package/src/hooks/usePipelineData.ts +338 -0
- package/src/hooks/useReconnect.ts +25 -0
- package/src/hooks/useScopeFilters.ts +125 -0
- package/src/hooks/useScopeSessions.ts +44 -0
- package/src/hooks/useScopes.ts +67 -0
- package/src/hooks/useSearch.ts +67 -0
- package/src/hooks/useSettings.tsx +187 -0
- package/src/hooks/useSocket.ts +25 -0
- package/src/hooks/useSourceControl.ts +105 -0
- package/src/hooks/useSprintPreflight.ts +55 -0
- package/src/hooks/useSprints.ts +154 -0
- package/src/hooks/useStatusBarHighlight.ts +18 -0
- package/src/hooks/useSwimlaneBoardSettings.ts +104 -0
- package/src/hooks/useTheme.ts +9 -0
- package/src/hooks/useTransitionReadiness.ts +53 -0
- package/src/hooks/useVersion.ts +155 -0
- package/src/hooks/useViolations.ts +65 -0
- package/src/hooks/useWorkflow.tsx +125 -0
- package/src/hooks/useZoomModifier.ts +19 -0
- package/src/index.css +797 -0
- package/src/layouts/DashboardLayout.tsx +113 -0
- package/src/lib/collisionDetection.ts +20 -0
- package/src/lib/scope-fields.ts +61 -0
- package/src/lib/swimlane.ts +146 -0
- package/src/lib/utils.ts +15 -0
- package/src/main.tsx +19 -0
- package/src/socket.ts +11 -0
- package/src/types/index.ts +497 -0
- package/src/views/AgentFeed.tsx +339 -0
- package/src/views/DeployPipeline.tsx +59 -0
- package/src/views/EnforcementView.tsx +378 -0
- package/src/views/PrimitivesConfig.tsx +500 -0
- package/src/views/QualityGates.tsx +1012 -0
- package/src/views/ScopeBoard.tsx +454 -0
- package/src/views/SessionTimeline.tsx +516 -0
- package/src/views/Settings.tsx +183 -0
- package/src/views/SourceControl.tsx +95 -0
- package/src/views/WorkflowVisualizer.tsx +382 -0
- package/tailwind.config.js +161 -0
- package/templates/agents/AUTO-INVOKE.md +180 -0
- package/templates/agents/CONFLICT-RESOLUTION.md +128 -0
- package/templates/agents/QUICK-REFERENCE.md +122 -0
- package/templates/agents/README.md +188 -0
- package/templates/agents/SKILL-TRIGGERS.md +100 -0
- package/templates/agents/blue-team/frontend-designer.md +424 -0
- package/templates/agents/green-team/architect.md +526 -0
- package/templates/agents/green-team/rules-enforcer.md +131 -0
- package/templates/agents/red-team/attacker-learned.md +24 -0
- package/templates/agents/red-team/attacker.md +486 -0
- package/templates/agents/red-team/chaos.md +548 -0
- package/templates/agents/reference/component-registry.md +82 -0
- package/templates/agents/workflows/full-mode.md +218 -0
- package/templates/agents/workflows/quick-mode.md +118 -0
- package/templates/agents/workflows/security-mode.md +283 -0
- package/templates/anti-patterns/dangerous-shortcuts.md +427 -0
- package/templates/config/agent-triggers.json +92 -0
- package/templates/hooks/agent-team-gate.sh +31 -0
- package/templates/hooks/agent-trigger.sh +97 -0
- package/templates/hooks/block-push.sh +66 -0
- package/templates/hooks/block-workarounds.sh +61 -0
- package/templates/hooks/blocker-check.sh +28 -0
- package/templates/hooks/completion-checklist.sh +28 -0
- package/templates/hooks/decision-capture.sh +15 -0
- package/templates/hooks/dependency-check.sh +27 -0
- package/templates/hooks/end-session.sh +31 -0
- package/templates/hooks/exploration-logger.sh +37 -0
- package/templates/hooks/files-changed-summary.sh +37 -0
- package/templates/hooks/get-session-id.sh +49 -0
- package/templates/hooks/git-commit-guard.sh +34 -0
- package/templates/hooks/init-session.sh +93 -0
- package/templates/hooks/orbital-emit.sh +79 -0
- package/templates/hooks/orbital-report-deploy.sh +78 -0
- package/templates/hooks/orbital-report-gates.sh +40 -0
- package/templates/hooks/orbital-report-violation.sh +36 -0
- package/templates/hooks/orbital-scope-update.sh +53 -0
- package/templates/hooks/phase-verify-reminder.sh +26 -0
- package/templates/hooks/review-gate-check.sh +82 -0
- package/templates/hooks/scope-commit-logger.sh +37 -0
- package/templates/hooks/scope-create-cleanup.sh +36 -0
- package/templates/hooks/scope-create-gate.sh +80 -0
- package/templates/hooks/scope-create-tracker.sh +17 -0
- package/templates/hooks/scope-file-sync.sh +53 -0
- package/templates/hooks/scope-gate.sh +35 -0
- package/templates/hooks/scope-helpers.sh +188 -0
- package/templates/hooks/scope-lifecycle-gate.sh +139 -0
- package/templates/hooks/scope-prepare.sh +244 -0
- package/templates/hooks/scope-transition.sh +172 -0
- package/templates/hooks/session-enforcer.sh +143 -0
- package/templates/hooks/time-tracker.sh +33 -0
- package/templates/lessons-learned.md +15 -0
- package/templates/orbital.config.json +35 -0
- package/templates/presets/development.json +42 -0
- package/templates/presets/gitflow.json +712 -0
- package/templates/presets/minimal.json +23 -0
- package/templates/quick/rules.md +218 -0
- package/templates/scopes/_template.md +255 -0
- package/templates/settings-hooks.json +98 -0
- package/templates/skills/git-commit/SKILL.md +85 -0
- package/templates/skills/git-dev/SKILL.md +99 -0
- package/templates/skills/git-hotfix/SKILL.md +223 -0
- package/templates/skills/git-main/SKILL.md +84 -0
- package/templates/skills/git-production/SKILL.md +165 -0
- package/templates/skills/git-staging/SKILL.md +112 -0
- package/templates/skills/scope-create/SKILL.md +81 -0
- package/templates/skills/scope-fix-review/SKILL.md +168 -0
- package/templates/skills/scope-implement/SKILL.md +110 -0
- package/templates/skills/scope-post-review/SKILL.md +144 -0
- package/templates/skills/scope-pre-review/SKILL.md +211 -0
- package/templates/skills/scope-verify/SKILL.md +201 -0
- package/templates/skills/session-init/SKILL.md +62 -0
- package/templates/skills/session-resume/SKILL.md +201 -0
- package/templates/skills/test-checks/SKILL.md +171 -0
- package/templates/skills/test-code-review/SKILL.md +252 -0
- package/tsconfig.json +25 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Minimal",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"branchingMode": "trunk",
|
|
5
|
+
"lists": [
|
|
6
|
+
{ "id": "todo", "label": "To Do", "order": 0, "group": "planning", "color": "230 99% 67%", "hex": "#536dfe", "hasDirectory": true, "isEntryPoint": true },
|
|
7
|
+
{ "id": "in-progress", "label": "In Progress", "order": 1, "group": "active", "color": "40 100% 50%", "hex": "#ffaa00", "hasDirectory": true },
|
|
8
|
+
{ "id": "done", "label": "Done", "order": 2, "group": "active", "color": "153 100% 39%", "hex": "#00c76d", "hasDirectory": true }
|
|
9
|
+
],
|
|
10
|
+
"edges": [
|
|
11
|
+
{ "from": "todo", "to": "in-progress", "direction": "forward", "command": null, "confirmLevel": "quick", "label": "Start", "description": "Move to in progress.", "dispatchOnly": false },
|
|
12
|
+
{ "from": "in-progress", "to": "done", "direction": "forward", "command": null, "confirmLevel": "quick", "label": "Complete", "description": "Mark as done.", "dispatchOnly": false }
|
|
13
|
+
],
|
|
14
|
+
"hooks": [],
|
|
15
|
+
"groups": [
|
|
16
|
+
{ "id": "planning", "label": "Planning", "order": 0 },
|
|
17
|
+
{ "id": "active", "label": "Active", "order": 1 }
|
|
18
|
+
],
|
|
19
|
+
"eventInference": [],
|
|
20
|
+
"allowedCommandPrefixes": ["/scope-", "/git-", "/test-", "/session-"],
|
|
21
|
+
"terminalStatuses": ["done"],
|
|
22
|
+
"commitBranchPatterns": "^(main|feat/|fix/|chore/)"
|
|
23
|
+
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Non-Negotiable Rules
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
tokens: ~2K
|
|
5
|
+
load-when: Every coding session
|
|
6
|
+
last-verified: YYYY-MM-DD
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Every rule has a **Verify** command. Run it to check compliance.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Code Quality Rules
|
|
14
|
+
|
|
15
|
+
### Rule 1: No `any` Types
|
|
16
|
+
|
|
17
|
+
**Rule**: Never use `any` without explicit justification comment
|
|
18
|
+
**Why**: Type safety prevents runtime errors, helps AI understand code
|
|
19
|
+
**Verify**:
|
|
20
|
+
```bash
|
|
21
|
+
grep -r ": any" src --include="*.ts" --include="*.tsx" | grep -v "// justified:"
|
|
22
|
+
```
|
|
23
|
+
**Expected**: No output (or only justified cases)
|
|
24
|
+
**Fix**: Replace with proper type or add `// justified: [reason]`
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
// ❌ FORBIDDEN
|
|
28
|
+
const data: any = response;
|
|
29
|
+
|
|
30
|
+
// ✅ REQUIRED
|
|
31
|
+
const data: UserResponse = response;
|
|
32
|
+
|
|
33
|
+
// ✅ ALLOWED (with justification)
|
|
34
|
+
// justified: third-party SDK returns untyped data
|
|
35
|
+
const result = response as any;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### Rule 2: No console.log in Production Code
|
|
41
|
+
|
|
42
|
+
**Rule**: Never use `console.log`, `console.error`, `console.warn` in production code
|
|
43
|
+
**Why**: No context, leaks to production, unstructured
|
|
44
|
+
**Verify**:
|
|
45
|
+
```bash
|
|
46
|
+
grep -rE "console\.(log|error|warn|info)" src --include="*.ts" --include="*.tsx" | grep -v __tests__
|
|
47
|
+
```
|
|
48
|
+
**Expected**: No output
|
|
49
|
+
**Fix**: Use a structured logger
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Rule 3: File Size Limit (400 lines)
|
|
54
|
+
|
|
55
|
+
**Rule**: Production files must be < 400 lines, tests < 800 lines
|
|
56
|
+
**Why**: Maintainability, cognitive load
|
|
57
|
+
**Verify**:
|
|
58
|
+
```bash
|
|
59
|
+
find src -name "*.ts" -o -name "*.tsx" | xargs wc -l | awk '$1 > 400' | grep -v __tests__
|
|
60
|
+
```
|
|
61
|
+
**Expected**: No output
|
|
62
|
+
**Fix**: Split into focused modules
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Rule 4: Max 4 Function Parameters
|
|
67
|
+
|
|
68
|
+
**Rule**: Functions with >4 parameters must use options object
|
|
69
|
+
**Why**: Readability, maintainability
|
|
70
|
+
**Verify**: Manual review during PR
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
// ❌ FORBIDDEN
|
|
74
|
+
async function processItem(id: string, name: string, type: string, amount: number, options: object): Promise<Result>
|
|
75
|
+
|
|
76
|
+
// ✅ REQUIRED
|
|
77
|
+
async function processItem(options: {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
type: string;
|
|
81
|
+
amount: number;
|
|
82
|
+
options?: object;
|
|
83
|
+
}): Promise<Result>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### Rule 5: Import Ordering
|
|
89
|
+
|
|
90
|
+
**Rule**: Imports must be: External → Internal (@/) → Relative (./)
|
|
91
|
+
**Why**: Consistency, easier scanning
|
|
92
|
+
**Verify**: ESLint rule (automatic via linter)
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// 1. External packages (node_modules)
|
|
96
|
+
import { useState } from 'react';
|
|
97
|
+
import express from 'express';
|
|
98
|
+
|
|
99
|
+
// 2. Internal aliases (@/)
|
|
100
|
+
import { config } from '@/config';
|
|
101
|
+
import { UserService } from '@/services/user';
|
|
102
|
+
|
|
103
|
+
// 3. Relative imports (./)
|
|
104
|
+
import { helpers } from './utils';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Rule 6: Explicit Return Types
|
|
110
|
+
|
|
111
|
+
**Rule**: All exported functions must have explicit return types
|
|
112
|
+
**Why**: Contract clarity, catch errors early
|
|
113
|
+
**Verify**: TypeScript strict mode catches most cases
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
// ❌ FORBIDDEN
|
|
117
|
+
export async function getUser(id: string) { }
|
|
118
|
+
|
|
119
|
+
// ✅ REQUIRED
|
|
120
|
+
export async function getUser(id: string): Promise<User | null> { }
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Testing Rules
|
|
126
|
+
|
|
127
|
+
### Rule 7: Tests Required for New Code
|
|
128
|
+
|
|
129
|
+
**Rule**: All new service and business logic code must have tests
|
|
130
|
+
**Why**: Catch bugs early, documentation
|
|
131
|
+
**Fix**: Create corresponding test file for new modules
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### Rule 8: Test Structure (Arrange-Act-Assert)
|
|
136
|
+
|
|
137
|
+
**Rule**: Tests must follow AAA pattern
|
|
138
|
+
**Why**: Readability, maintainability
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
it('should return user by ID', async () => {
|
|
142
|
+
// Arrange
|
|
143
|
+
const userId = 'test-user';
|
|
144
|
+
|
|
145
|
+
// Act
|
|
146
|
+
const result = await getUser(userId);
|
|
147
|
+
|
|
148
|
+
// Assert
|
|
149
|
+
expect(result).toBeDefined();
|
|
150
|
+
expect(result.id).toBe(userId);
|
|
151
|
+
});
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Git Rules
|
|
157
|
+
|
|
158
|
+
### Rule 9: Quality Gates Before Commit
|
|
159
|
+
|
|
160
|
+
**Rule**: Configured checks must pass before committing
|
|
161
|
+
**Why**: Prevent broken code in repository
|
|
162
|
+
**Verify**: Run configured commands from orbital.config.json (typeCheck, lint, build, test)
|
|
163
|
+
**Expected**: All pass with exit code 0
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
### Rule 10: One Commit Per Phase
|
|
168
|
+
|
|
169
|
+
**Rule**: Commit after each phase completion
|
|
170
|
+
**Why**: Progress tracking, easy rollback
|
|
171
|
+
**Fix**: Follow phase-by-phase workflow
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Workflow Rules
|
|
176
|
+
|
|
177
|
+
### Rule 11: Verify Before Claiming Success
|
|
178
|
+
|
|
179
|
+
**Rule**: Run verification commands BEFORE claiming work is complete. Include output as evidence.
|
|
180
|
+
**Why**: "Should work" is not evidence. Past incidents where untested claims led to broken commits.
|
|
181
|
+
**Fix**: Always run quality gates and show the output before saying "done"
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
// FORBIDDEN
|
|
185
|
+
"I've fixed the bug, it should work now."
|
|
186
|
+
|
|
187
|
+
// REQUIRED
|
|
188
|
+
"I've fixed the bug. Here's the verification:
|
|
189
|
+
type-check: PASS
|
|
190
|
+
lint: PASS
|
|
191
|
+
build: PASS
|
|
192
|
+
tests: 47/47 passing"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### Rule 12: Verify Review Feedback Before Implementing
|
|
198
|
+
|
|
199
|
+
**Rule**: Verify code review feedback against the actual codebase before implementing suggestions.
|
|
200
|
+
**Why**: Review suggestions may be based on stale context or break existing patterns.
|
|
201
|
+
**Fix**: Read the relevant code, confirm the suggestion applies, then implement (or push back with reasoning)
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Quick Verification Checklist
|
|
206
|
+
|
|
207
|
+
Run before every commit:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# Run configured quality gates (commands from orbital.config.json)
|
|
211
|
+
# Typical setup:
|
|
212
|
+
# 1. Type check: npx tsc --noEmit
|
|
213
|
+
# 2. Lint: npx eslint src/
|
|
214
|
+
# 3. Build: npm run build
|
|
215
|
+
# 4. Tests: npm test
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
All must pass. No exceptions.
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: NNN
|
|
3
|
+
title: "Scope Title"
|
|
4
|
+
status: planning # planning | backlog | implementing | review | completed | dev | staging | production
|
|
5
|
+
priority: medium # critical | high | medium | low
|
|
6
|
+
effort_estimate: "TBD"
|
|
7
|
+
category: "TBD" # Configure categories in orbital.config.json
|
|
8
|
+
created: YYYY-MM-DD
|
|
9
|
+
updated: YYYY-MM-DD
|
|
10
|
+
spec_locked: false # true after status = backlog
|
|
11
|
+
blocked_by: [] # scope IDs this depends on
|
|
12
|
+
blocks: [] # scope IDs waiting on this
|
|
13
|
+
tags: []
|
|
14
|
+
sessions: {} # Auto-populated by skills: {implementScope: [], reviewGate: [], pushToDev: [], ...}
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# Scope NNN: Title
|
|
18
|
+
|
|
19
|
+
═══════════════════════════════════════════════════════════════════
|
|
20
|
+
## PART 1: DASHBOARD
|
|
21
|
+
═══════════════════════════════════════════════════════════════════
|
|
22
|
+
<!--
|
|
23
|
+
PURPOSE: Quick status for user scanning
|
|
24
|
+
UPDATES: Continuously as work progresses
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
### Quick Status
|
|
28
|
+
> ⏳ **Status**: Planning | **Phase**: 0 of N | **Spec Locked**: No
|
|
29
|
+
|
|
30
|
+
### Progress
|
|
31
|
+
| Phase | Description | Status |
|
|
32
|
+
|-------|-------------|--------|
|
|
33
|
+
| 1 | TBD | ⏳ Pending |
|
|
34
|
+
|
|
35
|
+
### Recent Activity
|
|
36
|
+
- **YYYY-MM-DD HH:MM** - Scope created
|
|
37
|
+
|
|
38
|
+
### Next Actions
|
|
39
|
+
- [ ] Complete exploration
|
|
40
|
+
- [ ] Draft specification
|
|
41
|
+
- [ ] Get spec approval
|
|
42
|
+
|
|
43
|
+
═══════════════════════════════════════════════════════════════════
|
|
44
|
+
## PART 2: SPECIFICATION
|
|
45
|
+
═══════════════════════════════════════════════════════════════════
|
|
46
|
+
<!--
|
|
47
|
+
⚠️ FEATURE LOCK: After status = "ready", this section is LOCKED.
|
|
48
|
+
Any agent should be able to implement from ONLY this section.
|
|
49
|
+
Changes after lock require explicit approval + deviation note.
|
|
50
|
+
|
|
51
|
+
PURPOSE: The authoritative contract for what we're building
|
|
52
|
+
UPDATES: During planning. Frozen after approval.
|
|
53
|
+
-->
|
|
54
|
+
|
|
55
|
+
### Overview
|
|
56
|
+
|
|
57
|
+
[Problem statement - what's broken or needed]
|
|
58
|
+
|
|
59
|
+
**Goal**: [One sentence describing the intended outcome]
|
|
60
|
+
|
|
61
|
+
### Requirements
|
|
62
|
+
|
|
63
|
+
#### Must Have
|
|
64
|
+
- [ ] Requirement 1
|
|
65
|
+
- [ ] Requirement 2
|
|
66
|
+
|
|
67
|
+
#### Nice to Have
|
|
68
|
+
- [ ] Optional enhancement
|
|
69
|
+
|
|
70
|
+
#### Out of Scope
|
|
71
|
+
- Excluded item 1
|
|
72
|
+
- Excluded item 2
|
|
73
|
+
|
|
74
|
+
### Technical Approach
|
|
75
|
+
|
|
76
|
+
[How we're solving it and why this approach was chosen]
|
|
77
|
+
|
|
78
|
+
**Why this approach**:
|
|
79
|
+
- Reason 1
|
|
80
|
+
- Reason 2
|
|
81
|
+
|
|
82
|
+
**Architecture** (if applicable):
|
|
83
|
+
```
|
|
84
|
+
[Diagram or structure description]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Implementation Phases
|
|
88
|
+
|
|
89
|
+
#### Phase 1: [Name] (estimated time)
|
|
90
|
+
**Objective**: [What this phase accomplishes]
|
|
91
|
+
**Files**: [Files to modify]
|
|
92
|
+
**Changes**: [What changes]
|
|
93
|
+
**Commit**: `type(scope): message`
|
|
94
|
+
**Verification**: [How to verify this phase succeeded]
|
|
95
|
+
|
|
96
|
+
#### Phase 2: [Name] (estimated time)
|
|
97
|
+
**Objective**: [What this phase accomplishes]
|
|
98
|
+
**Files**: [Files to modify]
|
|
99
|
+
**Changes**: [What changes]
|
|
100
|
+
**Commit**: `type(scope): message`
|
|
101
|
+
**Verification**: [How to verify this phase succeeded]
|
|
102
|
+
|
|
103
|
+
### Files Summary
|
|
104
|
+
|
|
105
|
+
| File | Change | Phase |
|
|
106
|
+
|------|--------|-------|
|
|
107
|
+
| `path/to/file.ts` | Description of change | 1 |
|
|
108
|
+
|
|
109
|
+
### Success Criteria
|
|
110
|
+
|
|
111
|
+
- [ ] Verifiable condition 1
|
|
112
|
+
- [ ] Verifiable condition 2
|
|
113
|
+
- [ ] Type-check passes
|
|
114
|
+
- [ ] Tests pass
|
|
115
|
+
|
|
116
|
+
### Risk Assessment
|
|
117
|
+
|
|
118
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
119
|
+
|------|------------|--------|------------|
|
|
120
|
+
| Risk description | Low/Med/High | Low/Med/High | How to prevent/handle |
|
|
121
|
+
|
|
122
|
+
### Definition of Done
|
|
123
|
+
|
|
124
|
+
- [ ] All phases completed
|
|
125
|
+
- [ ] All success criteria met
|
|
126
|
+
- [ ] All tests passing
|
|
127
|
+
- [ ] Code reviewed
|
|
128
|
+
- [ ] Documentation updated (if applicable)
|
|
129
|
+
|
|
130
|
+
═══════════════════════════════════════════════════════════════════
|
|
131
|
+
## PART 3: PROCESS
|
|
132
|
+
═══════════════════════════════════════════════════════════════════
|
|
133
|
+
<!--
|
|
134
|
+
PURPOSE: Claude's working memory - exploration, decisions, implementation
|
|
135
|
+
UPDATES: Continuously during work
|
|
136
|
+
DISPLAY: Collapsed by default (user can expand if curious)
|
|
137
|
+
-->
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary>📝 Exploration Log</summary>
|
|
141
|
+
|
|
142
|
+
<!--
|
|
143
|
+
Record your discovery process here. Each session should include:
|
|
144
|
+
- Trigger: What prompted this exploration
|
|
145
|
+
- Searches: What you looked for and how
|
|
146
|
+
- Findings: What you discovered
|
|
147
|
+
- Insights: What the findings mean
|
|
148
|
+
-->
|
|
149
|
+
|
|
150
|
+
### Session: YYYY-MM-DD HH:MM
|
|
151
|
+
|
|
152
|
+
**Trigger**: [What prompted this exploration]
|
|
153
|
+
|
|
154
|
+
**Search**: [Command or action taken]
|
|
155
|
+
```bash
|
|
156
|
+
# Example search command
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Findings**: [What was found]
|
|
160
|
+
|
|
161
|
+
**Insight**: [What this means for the solution]
|
|
162
|
+
|
|
163
|
+
</details>
|
|
164
|
+
|
|
165
|
+
<details>
|
|
166
|
+
<summary>🤔 Decisions & Reasoning</summary>
|
|
167
|
+
|
|
168
|
+
<!--
|
|
169
|
+
Capture decisions with alternatives and rationale.
|
|
170
|
+
This helps future sessions understand WHY choices were made.
|
|
171
|
+
-->
|
|
172
|
+
|
|
173
|
+
### Decisions Made
|
|
174
|
+
|
|
175
|
+
| # | Decision | Chosen | Rejected Alternatives | Confidence |
|
|
176
|
+
|---|----------|--------|----------------------|------------|
|
|
177
|
+
| 1 | [Decision description] | [What was chosen] | [Alt 1 (why rejected), Alt 2 (why rejected)] | NN% |
|
|
178
|
+
|
|
179
|
+
### Uncertainties
|
|
180
|
+
|
|
181
|
+
| Area | Confidence | Mitigation |
|
|
182
|
+
|------|------------|------------|
|
|
183
|
+
| [Area of uncertainty] | NN% | [How to address if wrong] |
|
|
184
|
+
|
|
185
|
+
### Resolved Questions
|
|
186
|
+
|
|
187
|
+
| Question | Resolution | Date |
|
|
188
|
+
|----------|------------|------|
|
|
189
|
+
| [Question asked] | [Answer/decision] | YYYY-MM-DD |
|
|
190
|
+
|
|
191
|
+
</details>
|
|
192
|
+
|
|
193
|
+
<details>
|
|
194
|
+
<summary>📜 Implementation Log</summary>
|
|
195
|
+
|
|
196
|
+
<!--
|
|
197
|
+
Updated during implementation. For each phase, record:
|
|
198
|
+
- What was actually done
|
|
199
|
+
- Any issues encountered
|
|
200
|
+
- Actual commit hash
|
|
201
|
+
- Time taken
|
|
202
|
+
- Deviations from spec (if any)
|
|
203
|
+
-->
|
|
204
|
+
|
|
205
|
+
### Phase 1: [Pending]
|
|
206
|
+
<!-- Example when complete:
|
|
207
|
+
### Phase 1: Completed YYYY-MM-DD HH:MM
|
|
208
|
+
- Added X to file Y
|
|
209
|
+
- Encountered issue with Z, resolved by...
|
|
210
|
+
- Commit: `abc1234`
|
|
211
|
+
- Time: 25 minutes (estimated 30 min)
|
|
212
|
+
-->
|
|
213
|
+
|
|
214
|
+
</details>
|
|
215
|
+
|
|
216
|
+
<details>
|
|
217
|
+
<summary>⚠️ Deviations from Spec</summary>
|
|
218
|
+
|
|
219
|
+
<!--
|
|
220
|
+
If implementation differs from SPECIFICATION, document here:
|
|
221
|
+
- What was specified
|
|
222
|
+
- What was actually done
|
|
223
|
+
- Why the deviation was necessary
|
|
224
|
+
-->
|
|
225
|
+
|
|
226
|
+
None.
|
|
227
|
+
|
|
228
|
+
</details>
|
|
229
|
+
|
|
230
|
+
═══════════════════════════════════════════════════════════════════
|
|
231
|
+
## AGENT REVIEW
|
|
232
|
+
═══════════════════════════════════════════════════════════════════
|
|
233
|
+
<!--
|
|
234
|
+
Populated by /scope-pre-review before implementation begins.
|
|
235
|
+
Contains synthesis of all agent findings.
|
|
236
|
+
-->
|
|
237
|
+
|
|
238
|
+
### Review Status
|
|
239
|
+
- **Requested**: [agent-list]
|
|
240
|
+
- **Completed**: [agent-list]
|
|
241
|
+
- **Date**: YYYY-MM-DD
|
|
242
|
+
|
|
243
|
+
### Synthesis
|
|
244
|
+
|
|
245
|
+
**BLOCKERS** (must fix before implementation):
|
|
246
|
+
- None
|
|
247
|
+
|
|
248
|
+
**WARNINGS** (should fix):
|
|
249
|
+
- None
|
|
250
|
+
|
|
251
|
+
**SUGGESTIONS** (nice to have):
|
|
252
|
+
- None
|
|
253
|
+
|
|
254
|
+
**VERIFIED OK**:
|
|
255
|
+
- None yet
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/init-session.sh", "_orbital": true }
|
|
7
|
+
]
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"SessionEnd": [
|
|
11
|
+
{
|
|
12
|
+
"hooks": [
|
|
13
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/end-session.sh", "_orbital": true }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"PreToolUse": [
|
|
18
|
+
{
|
|
19
|
+
"matcher": "Skill",
|
|
20
|
+
"hooks": [
|
|
21
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/git-commit-guard.sh", "_orbital": true },
|
|
22
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/agent-team-gate.sh", "_orbital": true }
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"matcher": "Bash",
|
|
27
|
+
"hooks": [
|
|
28
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-push.sh", "_orbital": true },
|
|
29
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-file-sync.sh", "_orbital": true },
|
|
30
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-lifecycle-gate.sh", "_orbital": true }
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"matcher": "Edit|Write",
|
|
35
|
+
"hooks": [
|
|
36
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-create-gate.sh", "_orbital": true },
|
|
37
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/agent-trigger.sh", "_orbital": true },
|
|
38
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-enforcer.sh", "_orbital": true }
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"matcher": "Edit",
|
|
43
|
+
"hooks": [
|
|
44
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/phase-verify-reminder.sh", "_orbital": true },
|
|
45
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/blocker-check.sh", "_orbital": true },
|
|
46
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/dependency-check.sh", "_orbital": true },
|
|
47
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/completion-checklist.sh", "_orbital": true },
|
|
48
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/review-gate-check.sh", "_orbital": true },
|
|
49
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/files-changed-summary.sh", "_orbital": true }
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"PostToolUse": [
|
|
54
|
+
{
|
|
55
|
+
"matcher": "Bash",
|
|
56
|
+
"hooks": [
|
|
57
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-commit-logger.sh", "_orbital": true }
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"matcher": "Grep|Glob",
|
|
62
|
+
"hooks": [
|
|
63
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/exploration-logger.sh", "_orbital": true }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"matcher": "AskUserQuestion",
|
|
68
|
+
"hooks": [
|
|
69
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/decision-capture.sh", "_orbital": true }
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"matcher": "Edit",
|
|
74
|
+
"hooks": [
|
|
75
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/time-tracker.sh", "_orbital": true }
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"matcher": "Write",
|
|
80
|
+
"hooks": [
|
|
81
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-create-cleanup.sh", "_orbital": true }
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"matcher": "Skill",
|
|
86
|
+
"hooks": [
|
|
87
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-create-tracker.sh", "_orbital": true }
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"matcher": "ExitPlanMode",
|
|
92
|
+
"hooks": [
|
|
93
|
+
{ "type": "command", "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/scope-gate.sh", "_orbital": true }
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-commit
|
|
3
|
+
description: Entry point for committing work that routes to the proper git workflow. Use when user says commit, save, or push to ensure correct branch handling.
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /git-commit - Commit Work to Feature Branch
|
|
8
|
+
|
|
9
|
+
**Use when the user asks to "commit", "save", or similar.**
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
### Step 0a: Detect Branching Mode
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
BRANCHING_MODE=$(grep '^WORKFLOW_BRANCHING_MODE=' .claude/config/workflow-manifest.sh 2>/dev/null | cut -d'"' -f2)
|
|
17
|
+
[ -z "$BRANCHING_MODE" ] && BRANCHING_MODE="trunk"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Step 0b: Record Session ID
|
|
21
|
+
|
|
22
|
+
1. Run: `bash .claude/hooks/get-session-id.sh`
|
|
23
|
+
2. For each scope in `scopes/review/` with a passing verdict:
|
|
24
|
+
- Append session UUID to `sessions.commit` in frontmatter
|
|
25
|
+
|
|
26
|
+
### Step 1: Check Branch
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git branch --show-current
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
- **Trunk mode**: Allow commits on any branch including `main`
|
|
33
|
+
- **Worktree mode**: Allow commits on the worktree's feature branch
|
|
34
|
+
- **Gitflow mode** (if `BRANCHING_MODE=worktree` and dev/staging/production lists exist): Block if on `main`, `staging`, or `dev` — must be on a feature branch
|
|
35
|
+
|
|
36
|
+
### Step 2: Scope Transition (local only)
|
|
37
|
+
|
|
38
|
+
Find scopes in `scopes/review/` that have a passing verdict:
|
|
39
|
+
|
|
40
|
+
1. List files in `scopes/review/*.md`
|
|
41
|
+
2. For each, extract the scope number and check `.claude/review-verdicts/{NNN}.json`
|
|
42
|
+
3. If verdict exists and `verdict === "PASS"`:
|
|
43
|
+
- `mv scopes/review/{file} scopes/completed/`
|
|
44
|
+
- Update frontmatter: `status: completed`
|
|
45
|
+
- Update DASHBOARD: `📦 **Status**: Committed`
|
|
46
|
+
4. If scope is in `scopes/review/` with **no** passing verdict:
|
|
47
|
+
- Warn: "Scope {NNN} is in review but hasn't passed the review gate."
|
|
48
|
+
- Suggest: "Run `/scope-verify {NNN}` before committing."
|
|
49
|
+
- **Advisory only** — don't block the commit (intermediate commits are fine)
|
|
50
|
+
|
|
51
|
+
### Step 3: Commit
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
git add <specific code files — scopes are gitignored>
|
|
55
|
+
git commit -m "type(scope): description"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- Stage only code files (scopes/ is gitignored, no need to worry about them)
|
|
59
|
+
- Follow conventional commit format
|
|
60
|
+
- Do NOT push or create PRs — those are separate skills
|
|
61
|
+
|
|
62
|
+
### Step 4: Signal Completion
|
|
63
|
+
|
|
64
|
+
If working on a dispatched scope, emit the agent completion event:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
bash .claude/hooks/orbital-emit.sh AGENT_COMPLETED '{"outcome":"success","action":"save"}' --scope "{NNN}"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Quick Reference
|
|
71
|
+
|
|
72
|
+
| User Says | Action |
|
|
73
|
+
|-----------|--------|
|
|
74
|
+
| "commit" | Check branch, then commit |
|
|
75
|
+
| "save" | Same as commit |
|
|
76
|
+
| "push" | Commit first, then advise: `/git-main` to push to main |
|
|
77
|
+
| "push to main" | Commit first, then use `/git-main` |
|
|
78
|
+
| "create PR" | Commit first, then advise: `/git-main` (or `/git-staging` if using Gitflow) |
|
|
79
|
+
| "emergency fix" | Use `/git-hotfix` |
|
|
80
|
+
|
|
81
|
+
## What This Skill Does NOT Do
|
|
82
|
+
|
|
83
|
+
- **No push** — use `/git-main` to push/PR to main (or `/git-dev` in Gitflow mode)
|
|
84
|
+
- **No PR creation** — use `/git-main`, `/git-dev`, `/git-staging`, or `/git-production` for PR workflows
|
|
85
|
+
- **No scope moves beyond review→completed** — each lifecycle step is its own skill
|