@polymorphism-tech/morph-spec 11.2.0 → 11.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +3 -2
  2. package/bin/morph-spec.js +7 -7
  3. package/docs/CHEATSHEET.md +1 -1
  4. package/docs/QUICKSTART.md +1 -1
  5. package/framework/CLAUDE.md +1 -1
  6. package/framework/MORPH.md +2 -2
  7. package/framework/agents.json +4 -4
  8. package/framework/docs/CLI.md +19 -11
  9. package/framework/evals/review-checklist.md +26 -2
  10. package/framework/hooks/README.md +3 -2
  11. package/framework/hooks/claude-code/core/graph-refresh-kick.js +2 -2
  12. package/framework/mcp/registry.json +15 -15
  13. package/framework/rules/ai-agents-standards.md +9 -1
  14. package/framework/rules/gsap-standards.md +8 -0
  15. package/framework/rules/mcp-standards.md +10 -0
  16. package/framework/schemas/config.schema.json +7 -0
  17. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  18. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
  19. package/framework/skills/core/morph-apply/SKILL.md +4 -3
  20. package/framework/skills/core/morph-plan/SKILL.md +1 -1
  21. package/framework/skills/core/morph-uiux/SKILL.md +1 -1
  22. package/framework/standards/STANDARDS.json +8 -4
  23. package/framework/standards/STANDARDS.meta.json +1 -1
  24. package/framework/standards/ai-agents/agent-archetypes.md +1 -1
  25. package/framework/standards/ai-agents/middleware-patterns.md +0 -2
  26. package/framework/standards/ai-agents/prompt-sources.md +2 -2
  27. package/framework/standards/ai-agents/providers/model-registry.md +9 -12
  28. package/framework/standards/ai-agents/rag-custom-pgvector.md +2 -9
  29. package/framework/standards/frontend/design-system/ai-image-generation.md +1 -1
  30. package/framework/standards/infrastructure/docker/local-compose-isolation.md +2 -2
  31. package/framework/standards/integration/mcp/mcp-tools.md +124 -266
  32. package/framework/templates/README.md +52 -82
  33. package/framework/templates/REGISTRY.json +0 -206
  34. package/framework/templates/code/sql/ai-agents/agent-prompts-migration.sql.template +3 -4
  35. package/framework/templates/context/design-system.md +1 -1
  36. package/framework/templates/docs/plan.md +1 -1
  37. package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Providers/model-registry.v2.json +1 -1
  38. package/framework/templates/dotnet/ai-kit/tests/Morph.AiKit.Tests/MediaDisclosureTests.cs +1 -1
  39. package/framework/templates/dotnet/ai-kit/tests/Morph.AiKit.Tests/Morph.AiKit.Tests.csproj +2 -4
  40. package/framework/templates/frontend/nextjs/gsap-scroll-section.tsx.hbs +13 -17
  41. package/framework/templates/infrastructure/github/README.md +10 -13
  42. package/package.json +9 -3
  43. package/src/commands/mcp/manual-setup.js +95 -0
  44. package/src/commands/mcp/mcp-setup.js +23 -191
  45. package/src/commands/project/doctor.js +6 -16
  46. package/src/commands/project/init-contract.js +2 -2
  47. package/src/commands/project/init.js +15 -133
  48. package/src/commands/project/stack-scan.js +6 -14
  49. package/src/commands/project/stack-set.js +1 -1
  50. package/src/commands/project/standards.js +1 -2
  51. package/src/commands/project/update.js +52 -66
  52. package/src/commands/scaffold/scaffold.js +28 -7
  53. package/src/lib/ai/ai-project-scan.js +1 -4
  54. package/src/lib/ai/code-audit.js +1 -6
  55. package/src/lib/ai/registry-audit.js +2 -1
  56. package/src/lib/config/project-config.js +3 -2
  57. package/src/lib/contract/apply.js +2 -1
  58. package/src/lib/contract/merge.js +1 -0
  59. package/src/lib/contract/scan.js +5 -5
  60. package/src/lib/detectors/claude-config-detector.js +45 -47
  61. package/src/lib/detectors/mcp-config.js +2 -1
  62. package/src/lib/diff/diff-lines.js +2 -7
  63. package/src/lib/graph/graph-loader.js +2 -1
  64. package/src/lib/graph/graphifyignore.js +2 -1
  65. package/src/lib/installers/install-manifest.js +56 -0
  66. package/src/lib/installers/mcp-installer.js +14 -5
  67. package/src/lib/installers/rules-installer.js +9 -15
  68. package/src/lib/installers/stack-assets.js +42 -21
  69. package/src/lib/installers/stack-sync.js +12 -12
  70. package/src/lib/installers/stack-tooling.js +4 -3
  71. package/src/lib/json-file.js +9 -0
  72. package/src/lib/plan/artifact-vocabulary.js +1 -1
  73. package/src/lib/plan/checks.js +3 -2
  74. package/src/lib/plan/media.js +3 -3
  75. package/src/lib/plan/plan-parser.js +5 -10
  76. package/src/lib/review-reports.js +5 -4
  77. package/src/lib/stack/stack-scan.js +1 -1
  78. package/src/lib/standards/verified-against.js +1 -1
  79. package/src/lib/tests-audit/audit.js +1 -1
  80. package/src/lib/text.js +5 -0
  81. package/src/scripts/setup-infra.js +22 -33
  82. package/src/utils/agents-installer.js +13 -30
  83. package/src/utils/claude-md-injector.js +16 -50
  84. package/src/utils/claude-settings-manager.js +2 -2
  85. package/src/utils/file-copier.js +3 -4
  86. package/src/utils/hooks-installer.js +55 -20
  87. package/src/utils/skills-installer.js +18 -78
  88. package/framework/templates/IDE-SNIPPETS.md +0 -262
  89. package/framework/templates/code/dotnet/ai-agents/AgentBootstrap.cs.template +0 -26
  90. package/framework/templates/code/dotnet/ai-agents/EmbeddingService.cs.template +0 -28
  91. package/framework/templates/code/dotnet/ai-agents/ModelRegistry.cs.template +0 -99
  92. package/framework/templates/code/dotnet/ai-agents/ResilientToolMiddleware.cs.template +0 -40
  93. package/framework/templates/code/dotnet/ai-agents/VectorSearchTool.cs.template +0 -54
  94. package/framework/templates/code/dotnet/ai-agents/model-registry.json.template +0 -53
  95. package/framework/templates/code/dotnet/contracts/README.md +0 -74
  96. package/framework/templates/code/dotnet/database/vector-entity.cs +0 -49
  97. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +0 -91
  98. package/framework/templates/code/sql/postgresql-migration.template.sql +0 -108
  99. package/framework/templates/code/typescript/contracts.ts +0 -140
  100. package/framework/templates/examples/design-system-examples.md +0 -354
  101. package/framework/templates/infrastructure/docker/Dockerfile.template +0 -58
  102. package/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +0 -45
  103. package/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +0 -27
  104. package/framework/templates/integrations/asaas-client.cs +0 -332
  105. package/framework/templates/integrations/asaas-webhook.cs +0 -290
  106. package/framework/templates/integrations/neon-auth-config.cs +0 -170
  107. package/framework/templates/ui/design-system.css +0 -226
  108. package/src/lib/detectors/index.js +0 -153
  109. package/src/lib/installers/templates-reconcile.js +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymorphism-tech/morph-spec",
3
- "version": "11.2.0",
3
+ "version": "11.3.1",
4
4
  "description": "MORPH-SPEC: NLH (Natural Language Harness) for spec-driven development with Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -56,9 +56,9 @@
56
56
  "chalk": "^5.3.0",
57
57
  "commander": "^12.0.0",
58
58
  "fs-extra": "^11.2.0",
59
- "handlebars": "^4.7.8",
59
+ "handlebars": "^4.7.10",
60
60
  "inquirer": "^9.2.0",
61
- "minimatch": "^9.0.5",
61
+ "minimatch": "^11.0.9",
62
62
  "ora": "^8.0.0"
63
63
  },
64
64
  "repository": {
@@ -77,5 +77,11 @@
77
77
  },
78
78
  "devDependencies": {
79
79
  "c8": "^11.0.0"
80
+ },
81
+ "overrides": {
82
+ "test-exclude": {
83
+ "glob": "^14.0.6",
84
+ "minimatch": "^11.0.9"
85
+ }
80
86
  }
81
87
  }
@@ -0,0 +1,95 @@
1
+ import chalk from 'chalk';
2
+ import inquirer from 'inquirer';
3
+ import ora from 'ora';
4
+ import { execSync } from 'child_process';
5
+ import {
6
+ installMcpWithCredentials,
7
+ generateSetupInstructions,
8
+ isRemoteMcp,
9
+ } from '../../lib/installers/mcp-installer.js';
10
+
11
+ const STATUS_ICONS = {
12
+ installed: chalk.green('✓'),
13
+ available: chalk.cyan('○'),
14
+ already_configured: chalk.green('✓'),
15
+ needs_setup: chalk.yellow('⚠'),
16
+ prereq_missing: chalk.red('✗'),
17
+ not_relevant: chalk.gray('─'),
18
+ };
19
+
20
+ export function printMcpStatusTable(rows) {
21
+ for (const row of rows) {
22
+ const icon = STATUS_ICONS[row.status] || '?';
23
+ const statusLabel = row.status.replace(/_/g, ' ');
24
+ console.log(` ${icon} ${row.name.padEnd(15)} ${statusLabel.padEnd(20)} ${chalk.gray(row.detail)}`);
25
+ }
26
+ }
27
+
28
+ // The project scope writes `.mcp.json`, where every other MCP of this setup lives. The default
29
+ // scope (local) is keyed to this checkout's path in `~/.claude.json`: a worktree never gets it.
30
+ export function remoteAddCommand(name, url) {
31
+ return `claude mcp add --transport http --scope project ${name} ${url}`;
32
+ }
33
+
34
+ function printLater(name, entry) {
35
+ if (isRemoteMcp(entry.install.config)) {
36
+ console.log(chalk.gray(` Run later: ${remoteAddCommand(name, entry.install.config.url)}`));
37
+ return;
38
+ }
39
+ const instructions = generateSetupInstructions(name, entry);
40
+ console.log(chalk.gray(' Add to .mcp.json → mcpServers:'));
41
+ console.log(chalk.gray(' ' + '─'.repeat(55)));
42
+ for (const line of instructions.configSnippet.split('\n')) console.log(chalk.gray(` ${line}`));
43
+ console.log(chalk.gray(' ' + '─'.repeat(55)));
44
+ for (const cred of instructions.credentialUrls) console.log(chalk.gray(` Get ${cred.name}: ${cred.helpUrl}`));
45
+ console.log(chalk.gray(` Or run later: ${instructions.cliCommand}`));
46
+ }
47
+
48
+ async function askCredentials(credentials, prompt) {
49
+ const values = {};
50
+ for (const cred of credentials) {
51
+ const { value } = await prompt([{
52
+ type: cred.secret ? 'password' : 'input',
53
+ name: 'value',
54
+ message: `${cred.name}:`,
55
+ mask: cred.secret ? '*' : undefined,
56
+ }]);
57
+ values[cred.envVar] = value;
58
+ }
59
+ return values;
60
+ }
61
+
62
+ /**
63
+ * One MCP that cannot install by itself: asks, then registers a remote one through `claude mcp add`
64
+ * or writes a credentialed one into `.mcp.json`; a "no" prints how to do it later.
65
+ * @returns {Promise<boolean>} whether the MCP ended up configured
66
+ */
67
+ export async function setupManualMcp(targetPath, name, entry, {
68
+ prompt = inquirer.prompt, exec = execSync, message = `Set up ${name} MCP now? (${entry.usage})`, defaultYes = false,
69
+ } = {}) {
70
+ for (const warning of entry.install.warnings || []) console.log(chalk.yellow(` ⚠ ${warning}`));
71
+
72
+ const { setupNow } = await prompt([{ type: 'confirm', name: 'setupNow', message, default: defaultYes }]);
73
+ if (!setupNow) {
74
+ printLater(name, entry);
75
+ return false;
76
+ }
77
+
78
+ if (isRemoteMcp(entry.install.config)) {
79
+ const command = remoteAddCommand(name, entry.install.config.url);
80
+ try {
81
+ exec(command, { stdio: 'inherit', timeout: 120000, cwd: targetPath });
82
+ } catch {
83
+ console.log(chalk.yellow(` ${name} not configured. Run later: ${command}`));
84
+ return false;
85
+ }
86
+ console.log(chalk.green(` ✓ ${name} MCP added to .mcp.json (a server with OAuth authenticates through /mcp in the Claude Code session)`));
87
+ return true;
88
+ }
89
+
90
+ const credentialValues = await askCredentials(entry.install.credentials || [], prompt);
91
+ const spinner = ora(`Configuring ${name}...`).start();
92
+ await installMcpWithCredentials(targetPath, name, entry, credentialValues);
93
+ spinner.succeed(`${name} MCP configured`);
94
+ return true;
95
+ }
@@ -2,63 +2,34 @@ import chalk from 'chalk';
2
2
  import inquirer from 'inquirer';
3
3
  import ora from 'ora';
4
4
  import { readFileSync, existsSync } from 'fs';
5
+ import { execSync } from 'child_process';
5
6
  import { join } from 'path';
6
7
  import {
7
8
  orchestrateMcpSetup,
8
9
  installAutoMcps,
9
10
  installCompanionSkills,
10
- installMcpWithCredentials,
11
- generateSetupInstructions,
12
11
  formatMcpStatusTable,
13
12
  loadMcpRegistry,
14
13
  isRemoteMcp
15
14
  } from '../../lib/installers/mcp-installer.js';
16
15
  import { detectClaudeConfig } from '../../lib/detectors/claude-config-detector.js';
17
- import { detectProject } from '../../lib/detectors/index.js';
16
+ import { printMcpStatusTable, remoteAddCommand, setupManualMcp } from './manual-setup.js';
17
+ import { scanRepo } from '../../lib/contract/scan.js';
18
+ import { readMorphConfig } from '../../lib/config/project-config.js';
18
19
 
19
- // config.json is the only place a compound stack (`dotnet-nextjs`) survives: filesystem
20
- // re-detection collapses it to whichever half it notices first.
20
+ // The declared stack wins; without a contract, the same scan `init` runs.
21
21
  export async function detectStack(targetPath) {
22
- try {
23
- const configPath = join(targetPath, '.morph', 'config', 'config.json');
24
- if (existsSync(configPath)) {
25
- const config = JSON.parse(readFileSync(configPath, 'utf-8'));
26
- const configStack = config.project?.stack;
27
- if (configStack && configStack !== 'unknown') {
28
- return configStack;
29
- }
30
- }
31
- } catch {
32
- // Fall through to filesystem detection
33
- }
34
-
35
- try {
36
- const results = await detectProject(targetPath);
37
- return results.structure?.stack || 'unknown';
38
- } catch {
39
- return 'unknown';
40
- }
22
+ const configStack = readMorphConfig(targetPath)?.project?.stack;
23
+ if (configStack && configStack !== 'unknown') return configStack;
24
+ return scanRepo(targetPath).stack ?? 'unknown';
41
25
  }
42
26
 
43
- // The detectors never fold integrations into the stack string: without this, an MCP scoped
44
- // to an integration (neon, asaas) is never offered.
27
+ // An MCP scoped to an integration (neon, asaas) is only offered through these: the stack string never
28
+ // carries them. `integrations` is what `stack-set` declares, `tags` what the `init` scan found.
45
29
  export async function detectIntegrations(targetPath) {
46
- try {
47
- const configPath = join(targetPath, '.morph', 'config', 'config.json');
48
- if (existsSync(configPath)) {
49
- const integrations = JSON.parse(readFileSync(configPath, 'utf-8')).project?.integrations;
50
- if (Array.isArray(integrations)) return integrations;
51
- }
52
- } catch {
53
- // Fall through to filesystem detection
54
- }
55
-
56
- try {
57
- const results = await detectProject(targetPath);
58
- return results.structure?.integrations ?? [];
59
- } catch {
60
- return [];
61
- }
30
+ const { integrations, tags } = readMorphConfig(targetPath)?.project ?? {};
31
+ if (Array.isArray(integrations) || Array.isArray(tags)) return [...new Set([...(integrations ?? []), ...(tags ?? [])])];
32
+ return scanRepo(targetPath).tags;
62
33
  }
63
34
 
64
35
  export async function mcpSetupCommand(name, options) {
@@ -80,7 +51,7 @@ export async function mcpSetupCommand(name, options) {
80
51
  }
81
52
 
82
53
  if (name) {
83
- return setupSpecificMcp(targetPath, name, stack, existingMcps);
54
+ return setupSpecificMcp(targetPath, name, existingMcps);
84
55
  }
85
56
 
86
57
  return interactiveWizard(targetPath, stack, existingMcps, integrations, enabledPlugins);
@@ -98,25 +69,12 @@ async function showStatusList(targetPath, stack, existingMcps, integrations, ena
98
69
  console.log(` Stack: ${chalk.bold(stack)}`);
99
70
  console.log(' ' + '─'.repeat(60));
100
71
 
101
- const STATUS_ICONS = {
102
- installed: chalk.green('✓'),
103
- available: chalk.cyan('○'),
104
- already_configured: chalk.green('✓'),
105
- needs_setup: chalk.yellow('⚠'),
106
- prereq_missing: chalk.red('✗'),
107
- not_relevant: chalk.gray('─')
108
- };
109
-
110
72
  if (statusRows.length === 0) {
111
73
  console.log(chalk.gray('\n No MCPs in registry.\n'));
112
74
  return;
113
75
  }
114
76
 
115
- for (const row of statusRows) {
116
- const icon = STATUS_ICONS[row.status] || '?';
117
- const statusLabel = row.status.replace(/_/g, ' ');
118
- console.log(` ${icon} ${row.name.padEnd(15)} ${statusLabel.padEnd(20)} ${chalk.gray(row.detail)}`);
119
- }
77
+ printMcpStatusTable(statusRows);
120
78
 
121
79
  console.log('');
122
80
  }
@@ -150,7 +108,7 @@ async function autoInstall(targetPath, stack, existingMcps, integrations, enable
150
108
  console.log('');
151
109
  }
152
110
 
153
- async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
111
+ async function setupSpecificMcp(targetPath, name, existingMcps) {
154
112
  const registry = loadMcpRegistry();
155
113
  const mcpEntry = registry.mcps[name];
156
114
 
@@ -182,7 +140,6 @@ async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
182
140
  const prereqs = mcpEntry.install.prerequisites || [];
183
141
  for (const prereq of prereqs) {
184
142
  try {
185
- const { execSync } = await import('child_process');
186
143
  execSync(prereq.checkCommand, { stdio: 'ignore', timeout: 5000 });
187
144
  } catch {
188
145
  console.log(chalk.red(`\n Missing prerequisite: ${prereq.name}`));
@@ -192,12 +149,6 @@ async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
192
149
  }
193
150
  }
194
151
 
195
- for (const warning of mcpEntry.install.warnings || []) {
196
- console.log(chalk.yellow(`\n ⚠ ${warning}`));
197
- }
198
-
199
- const credentials = mcpEntry.install.credentials || [];
200
-
201
152
  if (mcpEntry.install.autoInstall) {
202
153
  const spinner = ora(`Installing ${name}...`).start();
203
154
  const result = await installAutoMcps(targetPath, { [name]: mcpEntry });
@@ -215,86 +166,14 @@ async function setupSpecificMcp(targetPath, name, stack, existingMcps) {
215
166
  return;
216
167
  }
217
168
 
218
- if (isRemoteMcp(mcpEntry.install.config)) {
219
- console.log(chalk.cyan(`\n Setting up ${name} MCP (remote)\n`));
220
- console.log(chalk.gray(` Usage: ${mcpEntry.usage}`));
221
- console.log('');
222
-
223
- const instructions = generateSetupInstructions(name, mcpEntry);
224
- console.log(chalk.white(` Run this command to add the MCP:`));
225
- console.log(chalk.cyan(` ${instructions.cliCommand}`));
226
- console.log('');
227
-
228
- for (const warning of mcpEntry.install.warnings || []) {
229
- console.log(chalk.yellow(` ⚠ ${warning}`));
230
- }
231
-
232
- const { installNow } = await inquirer.prompt([{
233
- type: 'confirm',
234
- name: 'installNow',
235
- message: 'Run it now (claude mcp add)?',
236
- default: true
237
- }]);
238
-
239
- if (installNow) {
240
- console.log(chalk.cyan(` Launching ${name} OAuth authentication...`));
241
- try {
242
- const { execSync } = await import('child_process');
243
- execSync(`claude mcp add --transport http ${name} ${mcpEntry.install.config.url}`, {
244
- stdio: 'inherit',
245
- timeout: 120000
246
- });
247
- console.log(chalk.green(` ✓ ${name} MCP configured via OAuth`));
248
- } catch {
249
- const instructions = generateSetupInstructions(name, mcpEntry);
250
- console.log(chalk.yellow(` Setup cancelled. Run later: ${instructions.cliCommand}`));
251
- }
252
- }
253
-
254
- console.log('');
255
- return;
256
- }
257
-
258
- console.log(chalk.cyan(`\n Setting up ${name} MCP\n`));
169
+ const remote = isRemoteMcp(mcpEntry.install.config);
170
+ console.log(chalk.cyan(`\n Setting up ${name} MCP${remote ? ' (remote)' : ''}\n`));
259
171
  console.log(chalk.gray(` Usage: ${mcpEntry.usage}`));
260
172
  console.log('');
261
-
262
- const { enterCredentials } = await inquirer.prompt([{
263
- type: 'confirm',
264
- name: 'enterCredentials',
265
- message: 'Enter credentials now?',
266
- default: true
267
- }]);
268
-
269
- if (enterCredentials) {
270
- const credentialValues = {};
271
- for (const cred of credentials) {
272
- const { value } = await inquirer.prompt([{
273
- type: cred.secret ? 'password' : 'input',
274
- name: 'value',
275
- message: `${cred.name}:`,
276
- mask: cred.secret ? '*' : undefined
277
- }]);
278
- credentialValues[cred.envVar] = value;
279
- }
280
-
281
- const spinner = ora(`Configuring ${name}...`).start();
282
- await installMcpWithCredentials(targetPath, name, mcpEntry, credentialValues);
283
- spinner.succeed(`${name} MCP configured`);
284
- } else {
285
- const instructions = generateSetupInstructions(name, mcpEntry);
286
- console.log(chalk.gray('\n Add to .mcp.json → mcpServers:'));
287
- console.log(chalk.gray(' ' + '─'.repeat(55)));
288
- for (const line of instructions.configSnippet.split('\n')) {
289
- console.log(chalk.gray(` ${line}`));
290
- }
291
- console.log(chalk.gray(' ' + '─'.repeat(55)));
292
-
293
- for (const cred of instructions.credentialUrls) {
294
- console.log(chalk.gray(` Get ${cred.name}: ${cred.helpUrl}`));
295
- }
296
- }
297
-
173
+ await setupManualMcp(targetPath, name, mcpEntry, {
174
+ message: remote ? `Run it now (${remoteAddCommand(name, mcpEntry.install.config.url)})?` : 'Enter credentials now?',
175
+ defaultYes: true,
176
+ });
298
177
  console.log('');
299
178
  }
300
179
 
@@ -342,54 +221,7 @@ async function interactiveWizard(targetPath, stack, existingMcps, integrations,
342
221
 
343
222
  for (const name of manualNames) {
344
223
  const entry = orchestration.needsManualSetup[name];
345
-
346
- for (const warning of entry.install.warnings || []) {
347
- console.log(chalk.yellow(` ⚠ ${warning}`));
348
- }
349
-
350
- const capitalizedName = name.charAt(0).toUpperCase() + name.slice(1);
351
- const { setupNow } = await inquirer.prompt([{
352
- type: 'confirm',
353
- name: 'setupNow',
354
- message: `Set up ${capitalizedName}? (${entry.usage})`,
355
- default: false
356
- }]);
357
-
358
- if (setupNow) {
359
- if (isRemoteMcp(entry.install.config)) {
360
- console.log(chalk.cyan(` Launching ${capitalizedName} OAuth...`));
361
- try {
362
- const { execSync } = await import('child_process');
363
- execSync(`claude mcp add --transport http ${name} ${entry.install.config.url}`, {
364
- stdio: 'inherit',
365
- timeout: 120000
366
- });
367
- console.log(chalk.green(` ✓ ${capitalizedName} configured via OAuth`));
368
- } catch {
369
- const instructions = generateSetupInstructions(name, entry);
370
- console.log(chalk.yellow(` Setup cancelled. Run later: ${instructions.cliCommand}`));
371
- }
372
- continue;
373
- }
374
-
375
- const credentialValues = {};
376
- for (const cred of entry.install.credentials) {
377
- const { value } = await inquirer.prompt([{
378
- type: cred.secret ? 'password' : 'input',
379
- name: 'value',
380
- message: `${cred.name}:`,
381
- mask: cred.secret ? '*' : undefined
382
- }]);
383
- credentialValues[cred.envVar] = value;
384
- }
385
-
386
- const spinner = ora(`Configuring ${name}...`).start();
387
- await installMcpWithCredentials(targetPath, name, entry, credentialValues);
388
- spinner.succeed(`${capitalizedName} configured`);
389
- } else {
390
- const instructions = generateSetupInstructions(name, entry);
391
- console.log(chalk.gray(` Run later: ${instructions.cliCommand}`));
392
- }
224
+ await setupManualMcp(targetPath, name, entry, { message: `Set up ${name}? (${entry.usage})` });
393
225
  }
394
226
  }
395
227
 
@@ -5,7 +5,6 @@ import fs from 'fs-extra';
5
5
  import chalk from 'chalk';
6
6
  import { logger } from '../../utils/logger.js';
7
7
  import { pathExists, readJson } from '../../utils/file-copier.js';
8
- import { checkClaudeMdImport } from '../../utils/claude-md-injector.js';
9
8
  import {
10
9
  checkCLIOutdated,
11
10
  checkProjectOutdated,
@@ -602,15 +601,10 @@ export async function doctorCommand(options = {}) {
602
601
  hasWarnings = true;
603
602
  }
604
603
 
605
- const claudeMd = join(targetPath, 'CLAUDE.md');
606
- const claudeMdStatus = await checkClaudeMdImport(claudeMd);
607
- if (claudeMdStatus === 'ok') {
608
- checks.push({ name: 'CLAUDE.md', status: 'ok' });
609
- } else if (claudeMdStatus === 'missing-import') {
610
- checks.push({ name: 'CLAUDE.md', status: 'warn', msg: 'missing @.claude/CLAUDE.md import — run morph-spec update' });
611
- hasWarnings = true;
604
+ if (await pathExists(join(targetPath, '.claude', 'CLAUDE.md'))) {
605
+ checks.push({ name: '.claude/CLAUDE.md', status: 'ok' });
612
606
  } else {
613
- checks.push({ name: 'CLAUDE.md', status: 'missing' });
607
+ checks.push({ name: '.claude/CLAUDE.md', status: 'missing' });
614
608
  hasErrors = true;
615
609
  }
616
610
 
@@ -676,13 +670,9 @@ export async function doctorCommand(options = {}) {
676
670
  hasErrors = true;
677
671
  }
678
672
 
679
- // A missing project-local templates copy is the default (resolution falls back to the package's
680
- // framework/templates/); a local copy is a supported override.
681
- const templatesPath = join(morphPath, 'framework', 'templates');
682
- if (await pathExists(templatesPath)) {
683
- checks.push({ name: 'templates/', status: 'ok', msg: 'local override present' });
684
- } else {
685
- checks.push({ name: 'templates/', status: 'ok', msg: 'resolved from package (no local override)' });
673
+ if (await pathExists(join(morphPath, 'framework', 'templates'))) {
674
+ checks.push({ name: 'templates/', status: 'warn', msg: 'not read: templates come from the package (morph-spec scaffold show <id>) — delete .morph/framework/templates/' });
675
+ hasWarnings = true;
686
676
  }
687
677
 
688
678
  const claudePath = join(targetPath, '.claude');
@@ -4,7 +4,7 @@ import { installStackAssets } from '../../lib/installers/stack-assets.js';
4
4
 
5
5
  const ACTION = { added: 'novo', updated: 'atualizado pelo scan', kept: 'mantido (editado à mão)', removed: 'removido (o scan não gera mais)' };
6
6
 
7
- export function contractLines(plan) {
7
+ function contractLines(plan) {
8
8
  const p = plan.config.project ?? {};
9
9
  const lines = [];
10
10
  lines.push(`Stack: ${p.stack ?? 'não detectada (repo vazio: o init pergunta; sem terminal, use --stack)'}${p.tags?.length ? ` · tags: ${p.tags.join(', ')}` : ''}`);
@@ -19,7 +19,7 @@ export function contractLines(plan) {
19
19
  return lines;
20
20
  }
21
21
 
22
- export function previewLines(tags) {
22
+ function previewLines(tags) {
23
23
  const preview = installPreview(tags);
24
24
  return Object.entries(preview).map(([kind, list]) => `Instala ${kind}: ${list.length ? list.join(', ') : '—'}`);
25
25
  }