@polymorphism-tech/morph-spec 4.22.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +57 -71
- package/README.md +2 -2
- package/bin/morph-spec.js +224 -491
- package/claude-plugin.json +1 -1
- package/docs/CHEATSHEET.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/framework/CLAUDE.md +55 -38
- package/framework/MORPH.md +244 -0
- package/framework/agents.json +127 -1198
- package/framework/commands/morph-apply.md +56 -240
- package/framework/commands/morph-archive.md +48 -85
- package/framework/commands/morph-preflight.md +7 -7
- package/framework/commands/morph-proposal.md +35 -191
- package/framework/commands/morph-status.md +19 -50
- package/framework/commands/morph-troubleshoot.md +2 -2
- package/framework/evals/rubrics/README.md +44 -0
- package/framework/evals/rubrics/architecture.md +46 -0
- package/framework/evals/rubrics/code-quality.md +50 -0
- package/framework/evals/rubrics/contracts.md +47 -0
- package/framework/evals/rubrics/test-coverage.md +50 -0
- package/framework/evals/scenarios/dotnet-crud.yaml +42 -0
- package/framework/evals/scenarios/nextjs-auth.yaml +38 -0
- package/framework/evals/suites/standard.yaml +5 -0
- package/framework/evals/trace-schema.md +67 -0
- package/framework/hooks/claude-code/core/README.md +3 -0
- package/framework/hooks/claude-code/core/denylist.json +14 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/enforce-phase-writes.js +5 -5
- package/framework/hooks/claude-code/core/post-edit-typecheck.js +69 -0
- package/framework/hooks/claude-code/core/pre-bash-denylist.js +29 -0
- package/framework/hooks/claude-code/{pre-tool-use → core}/protect-spec-files.js +4 -6
- package/framework/hooks/claude-code/{stop → core}/validate-completion.js +13 -82
- package/framework/hooks/shared/phase-utils.js +20 -31
- package/framework/hooks/shared/state-reader.js +4 -5
- package/framework/{skills/level-0-meta/mcp-registry.json → mcp/registry.json} +254 -243
- package/framework/phases.json +41 -115
- package/framework/rubrics/eval-rubric.json +66 -0
- package/framework/skills/README.md +39 -64
- package/framework/skills/core/README.md +3 -0
- package/framework/skills/core/morph-brainstorming/SKILL.md +102 -0
- package/framework/skills/core/morph-eval/SKILL.md +57 -0
- package/framework/skills/core/morph-implement/SKILL.md +83 -0
- package/framework/skills/core/morph-plan/SKILL.md +64 -0
- package/framework/skills/core/morph-review/SKILL.md +62 -0
- package/framework/skills/core/morph-stack-scan/SKILL.md +109 -0
- package/framework/skills/core/morph-standards/SKILL.md +49 -0
- package/framework/templates/CLAUDE.md.core.guide.md +29 -0
- package/framework/templates/CLAUDE.md.core.template +22 -0
- package/framework/templates/REGISTRY.json +4 -4
- package/framework/workflows/configs/fast-track.json +5 -10
- package/framework/workflows/configs/full.json +4 -8
- package/framework/workflows/configs/quick.json +32 -0
- package/framework/workflows/configs/standard.json +57 -64
- package/package.json +7 -6
- package/src/commands/mcp/mcp-setup.js +58 -31
- package/src/commands/project/doctor.js +69 -70
- package/src/commands/project/init.js +26 -5
- package/src/commands/project/status.js +18 -19
- package/src/commands/state/approve.js +1 -1
- package/src/commands/validation/validate-feature.js +18 -112
- package/src/core/paths/output-schema.js +133 -152
- package/src/core/state/phase-state-machine.js +10 -24
- package/src/core/state/state-manager.js +17 -17
- package/src/core/workflows/workflow-detector.js +214 -31
- package/src/core/workflows/workflow-router.js +204 -0
- package/src/dashboard/app/pages/AgentMap.jsx +32 -33
- package/src/dashboard/app/pages/LiveState.jsx +1 -1
- package/src/dashboard/app/pages/PhasePipeline.jsx +2 -4
- package/src/dashboard/app/pages/SkillsLibrary.jsx +2 -3
- package/src/dashboard/app/pages/Workflows.jsx +2 -2
- package/src/dashboard/scanner/agents-scanner.js +30 -35
- package/src/lib/agents/metrics-aggregator.js +1 -1
- package/src/lib/agents/output-collector.js +7 -9
- package/src/lib/context/context-builder.js +289 -0
- package/src/lib/detectors/claude-config-detector.js +19 -3
- package/src/lib/generators/context-generator.js +20 -42
- package/src/lib/generators/index.js +1 -0
- package/src/lib/generators/mandate-generator.js +512 -0
- package/src/lib/generators/metadata-extractor.js +1 -1
- package/src/lib/generators/recap-generator.js +3 -4
- package/src/lib/installers/mcp-installer.js +300 -92
- package/src/lib/phase-chain/phase-validator.js +36 -40
- package/src/lib/stack/stack-profile.js +74 -91
- package/src/lib/tasks/task-parser.js +1 -1
- package/src/lib/tasks/wave-resolver.js +353 -0
- package/src/lib/validators/checkpoint-persistence.js +2 -2
- package/src/lib/validators/content/cross-phase-validator.js +281 -0
- package/src/lib/validators/content/index.js +1 -0
- package/src/lib/validators/shared/emit-validator-dispatch.js +6 -56
- package/src/scripts/global-install.js +2 -27
- package/src/utils/agents-installer.js +224 -447
- package/src/utils/claude-settings-manager.js +57 -15
- package/src/utils/file-copier.js +1 -0
- package/src/utils/hooks-installer.js +15 -117
- package/src/utils/skills-installer.js +12 -18
- package/bin/detect-agents.js +0 -226
- package/bin/task-manager.js +0 -1036
- package/framework/agents/README.md +0 -13
- package/framework/agents/ai-agents/ai-system-architect.md +0 -194
- package/framework/agents/ai-agents/vector-search-expert.md +0 -247
- package/framework/agents/architecture/architecture-expert.md +0 -98
- package/framework/agents/architecture/morph-spec-architect.md +0 -66
- package/framework/agents/architecture/packages-validator.md +0 -89
- package/framework/agents/architecture/security-expert.md +0 -79
- package/framework/agents/architecture/seo-growth-hacker.md +0 -168
- package/framework/agents/architecture/standards-architect.md +0 -153
- package/framework/agents/backend/dotnet-senior.md +0 -163
- package/framework/agents/backend/ef-modeler.md +0 -119
- package/framework/agents/backend/hangfire-orchestrator.md +0 -133
- package/framework/agents/backend/ms-agent-expert.md +0 -55
- package/framework/agents/backend/neon-expert.md +0 -379
- package/framework/agents/frontend/css-specialist.md +0 -89
- package/framework/agents/frontend/design-system-validator.md +0 -100
- package/framework/agents/frontend/gsap-animator.md +0 -131
- package/framework/agents/frontend/nextjs-component-validator.md +0 -97
- package/framework/agents/frontend/nextjs-expert.md +0 -201
- package/framework/agents/frontend/ui-designer.md +0 -259
- package/framework/agents/infrastructure/infra-architect.md +0 -215
- package/framework/agents/integrations/asaas-financial.md +0 -138
- package/framework/agents/integrations/neon-auth.md +0 -151
- package/framework/agents/integrations/resend-email.md +0 -127
- package/framework/hooks/claude-code/post-tool-use/agent-complete.js +0 -122
- package/framework/hooks/claude-code/post-tool-use/dispatch.js +0 -363
- package/framework/hooks/claude-code/post-tool-use/handle-tool-failure.js +0 -78
- package/framework/hooks/claude-code/post-tool-use/validator-feedback.js +0 -194
- package/framework/hooks/claude-code/pre-compact/save-morph-context.js +0 -199
- package/framework/hooks/claude-code/pre-tool-use/task-tracking-guard.js +0 -55
- package/framework/hooks/claude-code/session-start/inject-morph-context.js +0 -323
- package/framework/hooks/claude-code/session-start/post-compact-restore.js +0 -41
- package/framework/hooks/claude-code/session-start/resume-context.js +0 -77
- package/framework/hooks/claude-code/teammate-idle/teammate-idle.js +0 -90
- package/framework/hooks/claude-code/user-prompt/enrich-prompt.js +0 -114
- package/framework/hooks/shared/compact-restore.js +0 -123
- package/framework/hooks/shared/dispatch-helpers.js +0 -147
- package/framework/hooks/shared/skill-reminder-helpers.js +0 -79
- package/framework/hooks/shared/stale-task-reset.js +0 -57
- package/framework/hooks/shared/worktree-helpers.js +0 -75
- package/framework/skills/level-0-meta/README.md +0 -7
- package/framework/skills/level-0-meta/morph-agent-teams/SKILL.md +0 -472
- package/framework/skills/level-0-meta/morph-brainstorming/SKILL.md +0 -174
- package/framework/skills/level-0-meta/morph-brainstorming/references/proposal-example.md +0 -138
- package/framework/skills/level-0-meta/morph-checklist/SKILL.md +0 -145
- package/framework/skills/level-0-meta/morph-code-review/SKILL.md +0 -250
- package/framework/skills/level-0-meta/morph-code-review/references/review-example.md +0 -164
- package/framework/skills/level-0-meta/morph-code-review/references/review-guidelines.md +0 -100
- package/framework/skills/level-0-meta/morph-code-review/scripts/scan-csharp.mjs +0 -151
- package/framework/skills/level-0-meta/morph-code-review-nextjs/SKILL.md +0 -165
- package/framework/skills/level-0-meta/morph-code-review-nextjs/references/review-example-nextjs.md +0 -254
- package/framework/skills/level-0-meta/morph-code-review-nextjs/scripts/scan-nextjs.mjs +0 -189
- package/framework/skills/level-0-meta/morph-frontend-review/SKILL.md +0 -344
- package/framework/skills/level-0-meta/morph-frontend-review/scripts/scan-accessibility.mjs +0 -376
- package/framework/skills/level-0-meta/morph-gemini-image/SKILL.md +0 -290
- package/framework/skills/level-0-meta/morph-init/SKILL.md +0 -537
- package/framework/skills/level-0-meta/morph-parallel-dispatch/SKILL.md +0 -225
- package/framework/skills/level-0-meta/morph-post-implementation/SKILL.md +0 -401
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-dev-server.mjs +0 -153
- package/framework/skills/level-0-meta/morph-post-implementation/scripts/detect-stack.mjs +0 -234
- package/framework/skills/level-0-meta/morph-simulation-checklist/SKILL.md +0 -106
- package/framework/skills/level-0-meta/morph-tool-usage-guide/SKILL.md +0 -243
- package/framework/skills/level-0-meta/morph-tool-usage-guide/references/tools-per-phase.md +0 -169
- package/framework/skills/level-0-meta/morph-verification-before-completion/SKILL.md +0 -148
- package/framework/skills/level-0-meta/morph-verification-before-completion/scripts/check-phase-outputs.mjs +0 -110
- package/framework/skills/level-1-workflows/README.md +0 -7
- package/framework/skills/level-1-workflows/morph-phase-codebase-analysis/SKILL.md +0 -269
- package/framework/skills/level-1-workflows/morph-phase-design/SKILL.md +0 -453
- package/framework/skills/level-1-workflows/morph-phase-design/references/architecture-analysis-guide.md +0 -44
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-authoring-guide.md +0 -55
- package/framework/skills/level-1-workflows/morph-phase-design/references/spec-example.md +0 -253
- package/framework/skills/level-1-workflows/morph-phase-implement/.morph/logs/activity.json +0 -38
- package/framework/skills/level-1-workflows/morph-phase-implement/SKILL.md +0 -634
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/code-quality-reviewer-prompt.md +0 -50
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/implementer-prompt.md +0 -54
- package/framework/skills/level-1-workflows/morph-phase-implement/prompts/spec-reviewer-prompt.md +0 -47
- package/framework/skills/level-1-workflows/morph-phase-implement/references/recap-example.md +0 -132
- package/framework/skills/level-1-workflows/morph-phase-implement/references/vsa-implementation-guide.md +0 -92
- package/framework/skills/level-1-workflows/morph-phase-plan/SKILL.md +0 -257
- package/framework/skills/level-1-workflows/morph-phase-tasks/.morph/logs/activity.json +0 -14
- package/framework/skills/level-1-workflows/morph-phase-tasks/SKILL.md +0 -291
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/task-planning-patterns.md +0 -143
- package/framework/skills/level-1-workflows/morph-phase-tasks/references/tasks-example.md +0 -404
- package/framework/skills/level-1-workflows/morph-phase-tasks/scripts/validate-tasks.mjs +0 -112
- package/framework/skills/level-1-workflows/morph-phase-uiux/SKILL.md +0 -995
- package/framework/skills/level-1-workflows/morph-scope-escalation/SKILL.md +0 -147
- package/framework/squad-templates/backend-only.json +0 -47
- package/framework/squad-templates/frontend-only.json +0 -56
- package/framework/squad-templates/full-stack.json +0 -74
- package/src/commands/agents/agent-metrics.js +0 -174
- package/src/commands/agents/audit-dispatch.js +0 -82
- package/src/commands/agents/detect-agents.js +0 -275
- package/src/commands/agents/dispatch-agents.js +0 -461
- package/src/commands/agents/index.js +0 -13
- package/src/commands/agents/manage-agents.js +0 -352
- package/src/commands/agents/project-metrics.js +0 -74
- package/src/commands/phase/phase-reset.js +0 -74
- package/src/commands/scope/escalate.js +0 -217
- package/src/commands/state/advance-phase.js +0 -600
- package/src/commands/state/phase-runner.js +0 -215
- package/src/commands/state/state.js +0 -444
- package/src/commands/task/expand.js +0 -100
- package/src/commands/tasks/index.js +0 -4
- package/src/commands/tasks/task.js +0 -105
- package/src/commands/templates/index.js +0 -5
- package/src/commands/templates/template-render.js +0 -93
- package/src/commands/trust/trust.js +0 -118
- package/src/lib/agents/agents-manager.js +0 -349
- package/src/lib/build/build-runner.js +0 -99
- package/src/lib/checkpoints/checkpoint-hooks.js +0 -111
- package/src/lib/contracts/sprint-contract-generator.js +0 -137
- package/src/lib/scope/impact-analyzer.js +0 -106
- package/src/lib/trust/trust-manager.js +0 -157
- package/src/utils/tier-helpers.js +0 -24
- /package/framework/hooks/claude-code/{post-tool-use → core}/loop-detect.js +0 -0
package/bin/morph-spec.js
CHANGED
|
@@ -1,491 +1,224 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} from '../src/commands/
|
|
39
|
-
|
|
40
|
-
//
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
.
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.
|
|
97
|
-
.
|
|
98
|
-
.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
program
|
|
113
|
-
.command('
|
|
114
|
-
.description('
|
|
115
|
-
.option('--
|
|
116
|
-
.option('--
|
|
117
|
-
.action(
|
|
118
|
-
|
|
119
|
-
program
|
|
120
|
-
.command('
|
|
121
|
-
.description('
|
|
122
|
-
.option('--
|
|
123
|
-
.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
.
|
|
129
|
-
.
|
|
130
|
-
.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
.
|
|
137
|
-
.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
.
|
|
151
|
-
.
|
|
152
|
-
.
|
|
153
|
-
.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
.
|
|
165
|
-
.
|
|
166
|
-
.option('--
|
|
167
|
-
.option('--
|
|
168
|
-
.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.
|
|
177
|
-
.
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
.command('
|
|
183
|
-
.description('
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
.
|
|
187
|
-
.
|
|
188
|
-
.option('--
|
|
189
|
-
.option('--
|
|
190
|
-
.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
.
|
|
199
|
-
.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
.command('
|
|
208
|
-
.description('
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
.
|
|
219
|
-
.
|
|
220
|
-
.option('
|
|
221
|
-
.option('--no-
|
|
222
|
-
.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (options.verbose) args.push('--verbose');
|
|
226
|
-
if (options.autoFix) args.push('--auto-fix');
|
|
227
|
-
if (options.noFail) args.push('--no-fail');
|
|
228
|
-
if (options.wcagAaa) args.push('--wcag-aaa');
|
|
229
|
-
validateCommand(args);
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// Phase management commands
|
|
233
|
-
const phaseCommand = program
|
|
234
|
-
.command('phase')
|
|
235
|
-
.description('Phase management (advance | validate)');
|
|
236
|
-
|
|
237
|
-
phaseCommand
|
|
238
|
-
.command('advance <feature>')
|
|
239
|
-
.description('Validate current phase and advance to next')
|
|
240
|
-
.option('--skip-optional', 'Skip optional phases (uiux, sync)')
|
|
241
|
-
.option('--skip-approval', 'Skip approval gate checks')
|
|
242
|
-
.option('--force', 'Force phase transition even if state machine rejects it')
|
|
243
|
-
.action((feature, options) => advancePhaseCommand(feature, options));
|
|
244
|
-
|
|
245
|
-
phaseCommand
|
|
246
|
-
.command('run <feature>')
|
|
247
|
-
.description('Automated phase chain runner — advances phases until blocker or max reached')
|
|
248
|
-
.option('--dry-run', 'Show decision tree without executing')
|
|
249
|
-
.option('--max-phases <n>', 'Max phases to auto-advance (default: 6)', parseInt)
|
|
250
|
-
.option('--skip-approval', 'Skip approval gate checks')
|
|
251
|
-
.action((feature, options) => phaseRunCommand(feature, options));
|
|
252
|
-
|
|
253
|
-
phaseCommand
|
|
254
|
-
.command('reset <feature> <phase>')
|
|
255
|
-
.description('Reset feature phase (recovery tool — bypasses approval gates)')
|
|
256
|
-
.action((feature, phase) => phaseResetCommand(feature, phase));
|
|
257
|
-
|
|
258
|
-
// Feature validation command (content-aware)
|
|
259
|
-
program
|
|
260
|
-
.command('validate-feature <feature>')
|
|
261
|
-
.alias('vf')
|
|
262
|
-
.description('Content-aware validation of feature outputs (sections, schema, contracts)')
|
|
263
|
-
.option('--phase <phase>', 'Validate outputs for a specific phase')
|
|
264
|
-
.option('--json', 'Output as JSON')
|
|
265
|
-
.option('-v, --verbose', 'Show detailed output')
|
|
266
|
-
.action(validateFeatureCommand);
|
|
267
|
-
|
|
268
|
-
// Checkpoint save/restore commands
|
|
269
|
-
program
|
|
270
|
-
.command('checkpoint-save <feature>')
|
|
271
|
-
.description('Save full context at current phase boundary')
|
|
272
|
-
.option('--label <label>', 'Custom label for checkpoint')
|
|
273
|
-
.action(checkpointSaveCommand);
|
|
274
|
-
|
|
275
|
-
// Approval workflow commands
|
|
276
|
-
program
|
|
277
|
-
.command('approve <feature> <gate>')
|
|
278
|
-
.description('Approve a phase gate (design, tasks, uiux, proposal)')
|
|
279
|
-
.option('--approver <name>', 'Name of approver (default: current user)')
|
|
280
|
-
.option('--notes <notes>', 'Approval notes')
|
|
281
|
-
.action((feature, gate, options) => approveCommand(feature, gate, options));
|
|
282
|
-
|
|
283
|
-
program
|
|
284
|
-
.command('approval-status <feature>')
|
|
285
|
-
.description('Show approval status for all gates')
|
|
286
|
-
.option('--json', 'Output as JSON')
|
|
287
|
-
.action((feature, options) => approvalStatusCommand(feature, options));
|
|
288
|
-
|
|
289
|
-
program
|
|
290
|
-
.command('unapprove <feature> <gate>')
|
|
291
|
-
.description('Revoke a phase gate approval (proposal, design, tasks, uiux)')
|
|
292
|
-
.option('--revoker <name>', 'Name of person revoking (default: current user)')
|
|
293
|
-
.option('--reason <reason>', 'Reason for revocation')
|
|
294
|
-
.action((feature, gate, options) => unapproveCommand(feature, gate, options));
|
|
295
|
-
|
|
296
|
-
// Template management commands
|
|
297
|
-
const templateCommand = program
|
|
298
|
-
.command('template')
|
|
299
|
-
.description('Template management (render)');
|
|
300
|
-
|
|
301
|
-
templateCommand
|
|
302
|
-
.command('render <template-id> <output-path> <variables-json>')
|
|
303
|
-
.description('Render a template with variables')
|
|
304
|
-
.option('--dry-run', 'Preview without writing file')
|
|
305
|
-
.option('--project-path <path>', 'Project path (default: current directory)')
|
|
306
|
-
.option('-v, --verbose', 'Show detailed output')
|
|
307
|
-
.action(templateRenderCommand);
|
|
308
|
-
|
|
309
|
-
// Scaffold commands (code generation from templates)
|
|
310
|
-
const scaffoldCmd = program
|
|
311
|
-
.command('scaffold')
|
|
312
|
-
.description('Generate feature files from templates');
|
|
313
|
-
|
|
314
|
-
scaffoldCmd
|
|
315
|
-
.command('dotnet <feature> <slice-name>')
|
|
316
|
-
.description('Generate VSA feature slice (.NET)')
|
|
317
|
-
.option('--dry-run', 'Preview files without writing')
|
|
318
|
-
.option('--namespace <ns>', 'Root namespace (auto-detected from .csproj)')
|
|
319
|
-
.option('--output-dir <path>', 'Output directory (default: cwd)')
|
|
320
|
-
.option('-v, --verbose', 'Show detailed output')
|
|
321
|
-
.action(scaffoldDotnetCommand);
|
|
322
|
-
|
|
323
|
-
scaffoldCmd
|
|
324
|
-
.command('nextjs <feature>')
|
|
325
|
-
.description('Generate feature page + components (Next.js)')
|
|
326
|
-
.option('--dry-run', 'Preview files without writing')
|
|
327
|
-
.option('--output-dir <path>', 'Output directory (default: cwd)')
|
|
328
|
-
.option('-v, --verbose', 'Show detailed output')
|
|
329
|
-
.action(scaffoldNextjsCommand);
|
|
330
|
-
|
|
331
|
-
// Trust commands
|
|
332
|
-
const trustCommand = program
|
|
333
|
-
.command('trust')
|
|
334
|
-
.description('Trust level management for zero-touch execution');
|
|
335
|
-
|
|
336
|
-
trustCommand
|
|
337
|
-
.command('status [feature]')
|
|
338
|
-
.description('Show trust level and auto-approval status')
|
|
339
|
-
.action(trustStatusCommand);
|
|
340
|
-
|
|
341
|
-
trustCommand
|
|
342
|
-
.command('set <feature> <level> [reason]')
|
|
343
|
-
.description('Manually set trust level (manual|high|auto)')
|
|
344
|
-
.action(trustSetCommand);
|
|
345
|
-
|
|
346
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
347
|
-
// MCP Setup
|
|
348
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
349
|
-
const mcpCommand = program
|
|
350
|
-
.command('mcp')
|
|
351
|
-
.description('MCP server setup and configuration');
|
|
352
|
-
|
|
353
|
-
mcpCommand
|
|
354
|
-
.command('setup [name]')
|
|
355
|
-
.description('Install and configure MCP servers')
|
|
356
|
-
.option('--list', 'Show MCP install status')
|
|
357
|
-
.option('--auto', 'Auto-install credential-free MCPs without prompts')
|
|
358
|
-
.action((name, options) => mcpSetupCommand(name, options));
|
|
359
|
-
|
|
360
|
-
// Agent orchestration commands
|
|
361
|
-
program
|
|
362
|
-
.command('dispatch-agents <feature> <phase>')
|
|
363
|
-
.description('Build dispatch config for parallel agent orchestration (design | tasks | implement)')
|
|
364
|
-
.option('--table', 'Human-readable table output instead of JSON')
|
|
365
|
-
.option('--mode <mode>', 'Dispatch mode: validate (includes Tier-4 validators as read-only)')
|
|
366
|
-
.option('--preflight', 'Exit with code 1 if any agent files are missing')
|
|
367
|
-
.option('-v, --verbose', 'Show stack trace on error')
|
|
368
|
-
.action((feature, phase, options) => dispatchAgentsCommand(feature, phase, options));
|
|
369
|
-
|
|
370
|
-
program
|
|
371
|
-
.command('audit-dispatch <feature>')
|
|
372
|
-
.description('Display dispatch audit log for a feature')
|
|
373
|
-
.option('--json', 'Output as JSON instead of table')
|
|
374
|
-
.action((feature, options) => auditDispatchCommand(feature, options));
|
|
375
|
-
|
|
376
|
-
program
|
|
377
|
-
.command('agent-metrics [feature]')
|
|
378
|
-
.description('Display agent performance metrics for a feature')
|
|
379
|
-
.option('--json', 'Output as JSON instead of table')
|
|
380
|
-
.option('--all', 'Aggregate metrics across all features')
|
|
381
|
-
.action((feature, options) => agentMetricsCommand(feature, options));
|
|
382
|
-
|
|
383
|
-
program
|
|
384
|
-
.command('detect-agents <feature>')
|
|
385
|
-
.description('Detect relevant agents for a feature based on proposal keywords')
|
|
386
|
-
.option('--proposal <path>', 'Path to proposal file (default: .morph/features/{feature}/0-proposal/proposal.md)')
|
|
387
|
-
.option('--json', 'Output as JSON (default)')
|
|
388
|
-
.option('--table', 'Human-readable table output')
|
|
389
|
-
.option('--exclude <ids>', 'Comma-separated agent IDs to exclude')
|
|
390
|
-
.option('--refresh', 'Refresh detection using all phase outputs (additive, mutates state)')
|
|
391
|
-
.action((feature, options) => detectAgentsCommand(feature, options));
|
|
392
|
-
|
|
393
|
-
// Scope escalation commands
|
|
394
|
-
const scopeCommand = program
|
|
395
|
-
.command('scope')
|
|
396
|
-
.description('Scope management (escalate)');
|
|
397
|
-
|
|
398
|
-
scopeCommand
|
|
399
|
-
.command('escalate <feature>')
|
|
400
|
-
.description('Escalate scope when implementation reveals unexpected complexity')
|
|
401
|
-
.option('--task <id>', 'Trigger task ID (required)')
|
|
402
|
-
.option('--reason <text>', 'Reason for escalation (required)')
|
|
403
|
-
.option('--target <phase>', 'Override target phase (tasks | design)')
|
|
404
|
-
.option('--dry-run', 'Show recommendation without executing')
|
|
405
|
-
.action((feature, options) => scopeEscalateCommand(feature, options));
|
|
406
|
-
|
|
407
|
-
// Agent management commands (CRUD)
|
|
408
|
-
const agentCommand = program
|
|
409
|
-
.command('agent')
|
|
410
|
-
.description('Manage agents in agents.json (list, show, add, edit, remove)');
|
|
411
|
-
|
|
412
|
-
agentCommand
|
|
413
|
-
.command('list')
|
|
414
|
-
.description('List all agents with optional filters')
|
|
415
|
-
.option('--group <name>', 'Filter by group')
|
|
416
|
-
.option('--tier <n>', 'Filter by tier (1-4)')
|
|
417
|
-
.option('--json', 'Output as JSON')
|
|
418
|
-
.action((options) => agentListCommand(options));
|
|
419
|
-
|
|
420
|
-
agentCommand
|
|
421
|
-
.command('show <id>')
|
|
422
|
-
.description('Show detailed info for an agent')
|
|
423
|
-
.option('--json', 'Output as JSON')
|
|
424
|
-
.option('--full', 'Show full spawn_prompt (no truncation)')
|
|
425
|
-
.action((id, options) => agentShowCommand(id, options));
|
|
426
|
-
|
|
427
|
-
agentCommand
|
|
428
|
-
.command('add <id>')
|
|
429
|
-
.description('Add a new agent via interactive wizard')
|
|
430
|
-
.option('--non-interactive', 'Use flags instead of prompts')
|
|
431
|
-
.option('--tier <n>', 'Tier (1-4)')
|
|
432
|
-
.option('--title <title>', 'Agent title')
|
|
433
|
-
.option('--group <group>', 'Agent group')
|
|
434
|
-
.option('--active-phases <phases>', 'Comma-separated phases or *')
|
|
435
|
-
.option('--reports-to <id>', 'Parent agent ID or "user"')
|
|
436
|
-
.option('--domains <domains>', 'Comma-separated domains')
|
|
437
|
-
.option('--keywords <keywords>', 'Comma-separated keywords')
|
|
438
|
-
.option('--spawn-prompt <prompt>', 'Teammate spawn prompt')
|
|
439
|
-
.option('--role <role>', 'Teammate role')
|
|
440
|
-
.option('--icon <emoji>', 'Teammate icon')
|
|
441
|
-
.action((id, options) => agentAddCommand(id, options));
|
|
442
|
-
|
|
443
|
-
agentCommand
|
|
444
|
-
.command('edit <id>')
|
|
445
|
-
.description('Edit agent fields via flags')
|
|
446
|
-
.option('--tier <n>', 'New tier')
|
|
447
|
-
.option('--title <title>', 'New title')
|
|
448
|
-
.option('--group <group>', 'New group')
|
|
449
|
-
.option('--active-phases <phases>', 'New phases (comma-sep)')
|
|
450
|
-
.option('--reports-to <id>', 'New reports_to')
|
|
451
|
-
.option('--keywords <keywords>', 'New keywords (comma-sep)')
|
|
452
|
-
.option('--domains <domains>', 'New domains (comma-sep)')
|
|
453
|
-
.option('--spawn-prompt <prompt>', 'New spawn prompt')
|
|
454
|
-
.action((id, options) => agentEditCommand(id, options));
|
|
455
|
-
|
|
456
|
-
agentCommand
|
|
457
|
-
.command('remove <id>')
|
|
458
|
-
.description('Remove an agent from agents.json')
|
|
459
|
-
.option('--force', 'Skip confirmation prompt')
|
|
460
|
-
.action((id, options) => agentRemoveCommand(id, options));
|
|
461
|
-
|
|
462
|
-
// Project-level metrics
|
|
463
|
-
program
|
|
464
|
-
.command('project-metrics')
|
|
465
|
-
.description('Aggregate project-level metrics from state.json')
|
|
466
|
-
.option('--json', 'Output as JSON')
|
|
467
|
-
.option('--save', 'Save metrics to .morph/metrics.json')
|
|
468
|
-
.action((options) => projectMetricsCommand(options));
|
|
469
|
-
|
|
470
|
-
// Context management commands
|
|
471
|
-
const contextCommand = program
|
|
472
|
-
.command('context')
|
|
473
|
-
.description('Project context management (refresh)');
|
|
474
|
-
|
|
475
|
-
contextCommand
|
|
476
|
-
.command('refresh')
|
|
477
|
-
.description('Scan project architecture and generate .morph/context/README.md')
|
|
478
|
-
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
479
|
-
.option('-v, --verbose', 'Show detailed scan output')
|
|
480
|
-
.option('--json', 'Output scan result as JSON')
|
|
481
|
-
.action((options) => contextRefreshCommand(options));
|
|
482
|
-
|
|
483
|
-
// Dashboard / Inspector
|
|
484
|
-
program
|
|
485
|
-
.command('dashboard')
|
|
486
|
-
.description('Open the morph-spec inspector dashboard')
|
|
487
|
-
.option('-p, --port <port>', 'Port number', '3200')
|
|
488
|
-
.option('--no-open', 'Don\'t auto-open browser')
|
|
489
|
-
.action(dashboardCommand);
|
|
490
|
-
|
|
491
|
-
program.parse();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* morph-spec CLI v5
|
|
5
|
+
*
|
|
6
|
+
* In v5 the CLI is the *installer* — Claude executes everything else
|
|
7
|
+
* autonomously based on MORPH.md and the core skills. Commands here are
|
|
8
|
+
* limited to actions that humans take or operations Claude needs help with
|
|
9
|
+
* (scaffolding, validation, context refresh).
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { program } from 'commander';
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
import { dirname, join } from 'path';
|
|
16
|
+
import { readFileSync } from 'fs';
|
|
17
|
+
|
|
18
|
+
// === Project / install ===
|
|
19
|
+
import { initCommand } from '../src/commands/project/init.js';
|
|
20
|
+
import { setupInfraCommand } from '../src/commands/project/setup-infra-cmd.js';
|
|
21
|
+
import { installPluginCommand } from '../src/commands/project/install-plugin-cmd.js';
|
|
22
|
+
import { updateCommand } from '../src/commands/project/update.js';
|
|
23
|
+
import { doctorCommand } from '../src/commands/project/doctor.js';
|
|
24
|
+
import { statusCommand } from '../src/commands/project/status.js';
|
|
25
|
+
import { worktreeSetupCommand } from '../src/commands/project/worktree.js';
|
|
26
|
+
|
|
27
|
+
// === Approval gates (human-only) ===
|
|
28
|
+
import { approveCommand, approvalStatusCommand, unapproveCommand } from '../src/commands/state/approve.js';
|
|
29
|
+
|
|
30
|
+
// === Validation ===
|
|
31
|
+
import { validateCommand } from './validate.js';
|
|
32
|
+
import { validateFeatureCommand } from '../src/commands/validation/validate-feature.js';
|
|
33
|
+
|
|
34
|
+
// === Scaffolding ===
|
|
35
|
+
import { scaffoldDotnetCommand, scaffoldNextjsCommand } from '../src/commands/scaffold/scaffold.js';
|
|
36
|
+
|
|
37
|
+
// === MCP setup ===
|
|
38
|
+
import { mcpSetupCommand } from '../src/commands/mcp/mcp-setup.js';
|
|
39
|
+
|
|
40
|
+
// === Context refresh ===
|
|
41
|
+
import { contextRefreshCommand } from '../src/commands/context/context-refresh.js';
|
|
42
|
+
|
|
43
|
+
// === Dashboard ===
|
|
44
|
+
import { dashboardCommand } from '../src/commands/dashboard/dashboard.js';
|
|
45
|
+
|
|
46
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
47
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
48
|
+
|
|
49
|
+
const banner = chalk.cyan(`
|
|
50
|
+
███╗ ███╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗
|
|
51
|
+
████╗ ████║██╔═══██╗██╔══██╗██╔══██╗██║ ██║
|
|
52
|
+
██╔████╔██║██║ ██║██████╔╝██████╔╝███████║
|
|
53
|
+
██║╚██╔╝██║██║ ██║██╔══██╗██╔═══╝ ██╔══██║
|
|
54
|
+
██║ ╚═╝ ██║╚██████╔╝██║ ██║██║ ██║ ██║
|
|
55
|
+
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
|
|
56
|
+
|
|
57
|
+
Spec-driven development harness for Claude Code
|
|
58
|
+
by Polymorphism Tech | v${pkg.version}
|
|
59
|
+
`);
|
|
60
|
+
|
|
61
|
+
program
|
|
62
|
+
.name('morph-spec')
|
|
63
|
+
.description('MORPH-SPEC Framework CLI')
|
|
64
|
+
.version(pkg.version)
|
|
65
|
+
.addHelpText('beforeAll', banner);
|
|
66
|
+
|
|
67
|
+
// ─── Install ──────────────────────────────────────────────────────────────
|
|
68
|
+
program
|
|
69
|
+
.command('init')
|
|
70
|
+
.description('Initialize MORPH-SPEC in current directory')
|
|
71
|
+
.option('-f, --force', 'Overwrite existing MORPH installation')
|
|
72
|
+
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
73
|
+
.option('--skip-mcp', 'Skip MCP server auto-setup')
|
|
74
|
+
.action(initCommand);
|
|
75
|
+
|
|
76
|
+
program
|
|
77
|
+
.command('setup-infra')
|
|
78
|
+
.description('Install MORPH-SPEC infrastructure (headless, no prompts)')
|
|
79
|
+
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
80
|
+
.option('--reinstall', 'Re-install only stack-aware assets (rules, skills, agents)')
|
|
81
|
+
.action(setupInfraCommand);
|
|
82
|
+
|
|
83
|
+
program
|
|
84
|
+
.command('install-plugin <name>')
|
|
85
|
+
.description('Install a Claude Code plugin (superpowers, context7)')
|
|
86
|
+
.action(installPluginCommand);
|
|
87
|
+
|
|
88
|
+
program
|
|
89
|
+
.command('update')
|
|
90
|
+
.description('Update MORPH templates and standards to latest version')
|
|
91
|
+
.option('--templates', 'Update only templates')
|
|
92
|
+
.option('--standards', 'Update only standards')
|
|
93
|
+
.action(updateCommand);
|
|
94
|
+
|
|
95
|
+
program
|
|
96
|
+
.command('doctor')
|
|
97
|
+
.description('Check MORPH installation health')
|
|
98
|
+
.option('--full', 'Run full health check')
|
|
99
|
+
.option('--mcp', 'Check MCP server configuration')
|
|
100
|
+
.option('--reset', 'Remove morph-managed entries from .claude/settings.local.json')
|
|
101
|
+
.action(doctorCommand);
|
|
102
|
+
|
|
103
|
+
// ─── Status / inspection ──────────────────────────────────────────────────
|
|
104
|
+
program
|
|
105
|
+
.command('status <feature>')
|
|
106
|
+
.description('Show feature status (phase, gate state, task counts)')
|
|
107
|
+
.option('--json', 'Output as JSON')
|
|
108
|
+
.option('-v, --verbose', 'Show detailed output')
|
|
109
|
+
.action(statusCommand);
|
|
110
|
+
|
|
111
|
+
// ─── Approval gates (dev-only) ────────────────────────────────────────────
|
|
112
|
+
program
|
|
113
|
+
.command('approve <feature> <gate>')
|
|
114
|
+
.description('Approve a phase gate (proposal, plan, review)')
|
|
115
|
+
.option('--approver <name>', 'Name of approver (default: current user)')
|
|
116
|
+
.option('--notes <notes>', 'Approval notes')
|
|
117
|
+
.action((feature, gate, options) => approveCommand(feature, gate, options));
|
|
118
|
+
|
|
119
|
+
program
|
|
120
|
+
.command('approval-status <feature>')
|
|
121
|
+
.description('Show approval status for all gates')
|
|
122
|
+
.option('--json', 'Output as JSON')
|
|
123
|
+
.action((feature, options) => approvalStatusCommand(feature, options));
|
|
124
|
+
|
|
125
|
+
program
|
|
126
|
+
.command('unapprove <feature> <gate>')
|
|
127
|
+
.description('Revoke a phase gate approval (recovery only)')
|
|
128
|
+
.option('--revoker <name>', 'Name of person revoking')
|
|
129
|
+
.option('--reason <reason>', 'Reason for revocation')
|
|
130
|
+
.action((feature, gate, options) => unapproveCommand(feature, gate, options));
|
|
131
|
+
|
|
132
|
+
// ─── Validation ───────────────────────────────────────────────────────────
|
|
133
|
+
program
|
|
134
|
+
.command('validate [validator]')
|
|
135
|
+
.description('Run project validations (all | packages | architecture | contrast)')
|
|
136
|
+
.option('-v, --verbose', 'Show detailed output')
|
|
137
|
+
.option('--auto-fix, --fix', 'Auto-fix issues where possible')
|
|
138
|
+
.option('--no-fail', 'Don\'t exit with error code')
|
|
139
|
+
.option('--wcag-aaa', 'Use WCAG AAA standard (stricter)')
|
|
140
|
+
.action((validator, options) => {
|
|
141
|
+
const args = validator ? [validator] : ['all'];
|
|
142
|
+
if (options.verbose) args.push('--verbose');
|
|
143
|
+
if (options.autoFix) args.push('--auto-fix');
|
|
144
|
+
if (options.noFail) args.push('--no-fail');
|
|
145
|
+
if (options.wcagAaa) args.push('--wcag-aaa');
|
|
146
|
+
validateCommand(args);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
program
|
|
150
|
+
.command('validate-feature <feature>')
|
|
151
|
+
.alias('vf')
|
|
152
|
+
.description('Content-aware validation of feature outputs (sections, schema, contracts)')
|
|
153
|
+
.option('--phase <phase>', 'Validate outputs for a specific phase')
|
|
154
|
+
.option('--json', 'Output as JSON')
|
|
155
|
+
.option('-v, --verbose', 'Show detailed output')
|
|
156
|
+
.action(validateFeatureCommand);
|
|
157
|
+
|
|
158
|
+
// ─── Scaffolding ──────────────────────────────────────────────────────────
|
|
159
|
+
const scaffoldCmd = program
|
|
160
|
+
.command('scaffold')
|
|
161
|
+
.description('Generate feature files from templates');
|
|
162
|
+
|
|
163
|
+
scaffoldCmd
|
|
164
|
+
.command('dotnet <feature> <slice-name>')
|
|
165
|
+
.description('Generate VSA feature slice (.NET)')
|
|
166
|
+
.option('--dry-run', 'Preview files without writing')
|
|
167
|
+
.option('--namespace <ns>', 'Root namespace (auto-detected from .csproj)')
|
|
168
|
+
.option('--output-dir <path>', 'Output directory (default: cwd)')
|
|
169
|
+
.option('-v, --verbose', 'Show detailed output')
|
|
170
|
+
.action(scaffoldDotnetCommand);
|
|
171
|
+
|
|
172
|
+
scaffoldCmd
|
|
173
|
+
.command('nextjs <feature>')
|
|
174
|
+
.description('Generate feature page + components (Next.js)')
|
|
175
|
+
.option('--dry-run', 'Preview files without writing')
|
|
176
|
+
.option('--output-dir <path>', 'Output directory (default: cwd)')
|
|
177
|
+
.option('-v, --verbose', 'Show detailed output')
|
|
178
|
+
.action(scaffoldNextjsCommand);
|
|
179
|
+
|
|
180
|
+
// ─── MCP setup ────────────────────────────────────────────────────────────
|
|
181
|
+
const mcpCommand = program
|
|
182
|
+
.command('mcp')
|
|
183
|
+
.description('MCP server setup and configuration');
|
|
184
|
+
|
|
185
|
+
mcpCommand
|
|
186
|
+
.command('setup [name]')
|
|
187
|
+
.description('Install and configure MCP servers')
|
|
188
|
+
.option('--list', 'Show MCP install status')
|
|
189
|
+
.option('--auto', 'Auto-install credential-free MCPs without prompts')
|
|
190
|
+
.action((name, options) => mcpSetupCommand(name, options));
|
|
191
|
+
|
|
192
|
+
// ─── Context refresh ──────────────────────────────────────────────────────
|
|
193
|
+
const contextCommand = program
|
|
194
|
+
.command('context')
|
|
195
|
+
.description('Project context management (refresh)');
|
|
196
|
+
|
|
197
|
+
contextCommand
|
|
198
|
+
.command('refresh')
|
|
199
|
+
.description('Scan project architecture and generate .morph/context/README.md')
|
|
200
|
+
.option('-p, --path <path>', 'Target path (default: current directory)')
|
|
201
|
+
.option('-v, --verbose', 'Show detailed scan output')
|
|
202
|
+
.option('--json', 'Output scan result as JSON')
|
|
203
|
+
.action((options) => contextRefreshCommand(options));
|
|
204
|
+
|
|
205
|
+
// ─── Worktree (optional, isolation) ───────────────────────────────────────
|
|
206
|
+
const worktreeCommand = program
|
|
207
|
+
.command('worktree')
|
|
208
|
+
.description('Manage git worktrees for feature isolation');
|
|
209
|
+
|
|
210
|
+
worktreeCommand
|
|
211
|
+
.command('setup <feature>')
|
|
212
|
+
.description('Create a worktree at .worktrees/{feature}/ on branch morph/{feature}')
|
|
213
|
+
.option('--fresh', 'Create a new dated branch even if one already exists')
|
|
214
|
+
.action((feature, options) => worktreeSetupCommand(feature, options));
|
|
215
|
+
|
|
216
|
+
// ─── Dashboard ────────────────────────────────────────────────────────────
|
|
217
|
+
program
|
|
218
|
+
.command('dashboard')
|
|
219
|
+
.description('Open the morph-spec inspector dashboard')
|
|
220
|
+
.option('-p, --port <port>', 'Port number', '3200')
|
|
221
|
+
.option('--no-open', 'Don\'t auto-open browser')
|
|
222
|
+
.action(dashboardCommand);
|
|
223
|
+
|
|
224
|
+
program.parse();
|