@polymorphism-tech/morph-spec 10.12.1 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/CLAUDE.md +27 -57
  2. package/README.md +51 -340
  3. package/bin/morph-spec.js +22 -373
  4. package/docs/CHEATSHEET.md +37 -166
  5. package/docs/QUICKSTART.md +14 -74
  6. package/framework/CLAUDE.md +15 -26
  7. package/framework/MORPH.md +34 -101
  8. package/framework/agents.json +8 -8
  9. package/framework/commands/morph-apply.md +5 -5
  10. package/framework/commands/morph-infra.md +1 -1
  11. package/framework/docs/CLI.md +74 -886
  12. package/framework/evals/review-checklist.md +14 -14
  13. package/framework/hooks/README.md +21 -189
  14. package/framework/hooks/claude-code/core/README.md +2 -5
  15. package/framework/hooks/claude-code/core/conventional-commit.js +2 -2
  16. package/framework/hooks/claude-code/core/denylist.json +3 -3
  17. package/framework/hooks/claude-code/core/graph-refresh-kick.js +2 -2
  18. package/framework/hooks/claude-code/core/masked-exit.js +6 -6
  19. package/framework/hooks/claude-code/core/pre-bash-denylist.js +2 -2
  20. package/framework/hooks/claude-code/core/protect-spec-files.js +17 -61
  21. package/framework/hooks/claude-code/core/stack-changed.js +35 -0
  22. package/framework/hooks/claude-code/core/validate-completion.js +32 -87
  23. package/framework/hooks/shared/{heavy-command.js → command-kind.js} +6 -79
  24. package/framework/hooks/shared/command-tokens.js +0 -139
  25. package/framework/hooks/shared/contract.js +14 -0
  26. package/framework/hooks/shared/feature-slug.js +21 -0
  27. package/framework/hooks/shared/frontend-locations.js +0 -1
  28. package/framework/hooks/shared/git-paths.js +0 -15
  29. package/framework/hooks/shared/graph-freshness.js +0 -19
  30. package/framework/hooks/shared/hook-response.js +0 -7
  31. package/framework/hooks/shared/morph-cli.js +2 -81
  32. package/framework/hooks/shared/owner-words.js +2 -120
  33. package/framework/hooks/shared/payload-utils.js +0 -39
  34. package/framework/hooks/shared/report-progress.js +7 -101
  35. package/framework/hooks/statusline.js +16 -60
  36. package/framework/mcp/registry.json +2 -2
  37. package/framework/rules/ai-agents-standards.md +1 -1
  38. package/framework/rules/asaas-standards.md +1 -1
  39. package/framework/rules/ef-standards.md +1 -1
  40. package/framework/rules/gsap-standards.md +1 -1
  41. package/framework/rules/hangfire-standards.md +1 -1
  42. package/framework/rules/implement-report.md +3 -3
  43. package/framework/rules/neon-auth-standards.md +1 -1
  44. package/framework/rules/nextjs-standards.md +1 -1
  45. package/framework/rules/plan-grammar.md +13 -11
  46. package/framework/rules/resend-standards.md +1 -1
  47. package/framework/rules/ui-design.md +4 -0
  48. package/framework/schemas/config.schema.json +95 -310
  49. package/framework/skills/README.md +12 -32
  50. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  51. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +1 -1
  52. package/framework/skills/core/morph-apply/SKILL.md +21 -46
  53. package/framework/skills/core/morph-plan/SKILL.md +28 -63
  54. package/framework/skills/core/morph-uiux/SKILL.md +23 -25
  55. package/framework/{templates/docs/ui-mockups.md → skills/core/morph-uiux/references/mockups.md} +4 -4
  56. package/framework/standards/STANDARDS.json +10 -11
  57. package/framework/standards/STANDARDS.meta.json +1 -1
  58. package/framework/standards/ai-agents/evals-with-cache.md +18 -32
  59. package/framework/standards/ai-agents/observability-patterns.md +2 -2
  60. package/framework/standards/architecture/code-comments.md +2 -5
  61. package/framework/standards/architecture/engineering-lens.md +1 -1
  62. package/framework/standards/backend/dotnet/testing.md +4 -4
  63. package/framework/standards/frontend/nextjs/lint.md +24 -10
  64. package/framework/standards/frontend/nextjs/testing.md +2 -2
  65. package/framework/standards/infrastructure/docker/local-compose-isolation.md +14 -30
  66. package/framework/templates/CLAUDE.md.core.guide.md +2 -2
  67. package/framework/templates/README.md +1 -1
  68. package/framework/templates/REGISTRY.json +3 -33
  69. package/framework/templates/docs/plan.md +3 -2
  70. package/framework/templates/dotnet/ai-kit/README.md +2 -4
  71. package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalCacheMissException.cs +1 -1
  72. package/framework/templates/dotnet/ai-kit/src/Morph.AiKit/Evals/EvalFixture.cs +1 -1
  73. package/package.json +1 -2
  74. package/src/commands/graph/explain.js +2 -1
  75. package/src/commands/graph/status.js +2 -1
  76. package/src/commands/mcp/mcp-setup.js +1 -2
  77. package/src/commands/project/doctor.js +5 -341
  78. package/src/commands/project/env.js +21 -52
  79. package/src/commands/project/init-contract.js +47 -0
  80. package/src/commands/project/init.js +36 -66
  81. package/src/commands/project/stack-scan.js +1 -1
  82. package/src/commands/project/update.js +15 -50
  83. package/src/commands/validation/check.js +128 -0
  84. package/src/commands/validation/plan-check.js +41 -64
  85. package/src/commands/validation/prove-red.js +1 -1
  86. package/src/core/paths/output-schema.js +0 -22
  87. package/src/core/templates/template-renderer.js +0 -14
  88. package/src/lib/ai/ai-project-scan.js +1 -6
  89. package/src/lib/check/attempts.js +38 -0
  90. package/src/lib/check/signals.js +145 -0
  91. package/src/lib/config/project-config.js +13 -0
  92. package/src/lib/contract/apply.js +62 -0
  93. package/src/lib/contract/defaults.js +96 -0
  94. package/src/lib/contract/merge.js +79 -0
  95. package/src/lib/contract/ports.js +43 -0
  96. package/src/lib/contract/scan.js +102 -0
  97. package/src/lib/detectors/claude-config-detector.js +7 -0
  98. package/src/lib/{procs → detectors}/mcp-config.js +1 -37
  99. package/src/lib/diff/diff-lines.js +64 -0
  100. package/src/lib/generators/architecture-scanner.js +1 -1
  101. package/src/lib/generators/scaffold-generator.js +0 -7
  102. package/src/lib/git/default-branch.js +0 -122
  103. package/src/lib/graph/diff-tree.js +2 -1
  104. package/src/lib/graph/god-nodes.js +2 -1
  105. package/src/lib/graph/graphify-runtime.js +0 -1
  106. package/src/lib/graph/graphifyignore.js +1 -1
  107. package/src/lib/graph/sanitize.js +2 -8
  108. package/src/lib/installers/memory-installer.js +15 -30
  109. package/src/lib/installers/stack-sync.js +16 -9
  110. package/src/lib/plan/checks.js +20 -64
  111. package/src/lib/plan/media.js +1 -1
  112. package/src/lib/plan/plan-parser.js +5 -5
  113. package/src/lib/review-reports.js +3 -77
  114. package/src/lib/scan/worktree-dirs.js +3 -0
  115. package/src/lib/specs/adr-index.js +2 -2
  116. package/src/lib/stack/dotnet-build-ignores.js +10 -2
  117. package/src/lib/stack/stack-scan.js +2 -2
  118. package/src/lib/stack-filter.js +3 -2
  119. package/src/lib/tests-audit/audit.js +1 -1
  120. package/src/scripts/setup-infra.js +6 -59
  121. package/src/utils/agents-installer.js +1 -34
  122. package/src/utils/atomic-json.js +27 -0
  123. package/src/utils/file-copier.js +4 -12
  124. package/src/utils/hooks-installer.js +9 -107
  125. package/claude-plugin.json +0 -14
  126. package/framework/commands/morph-archive.md +0 -46
  127. package/framework/commands/morph-hotfix.md +0 -17
  128. package/framework/commands/morph-preflight.md +0 -180
  129. package/framework/commands/morph-review.md +0 -15
  130. package/framework/commands/morph-status.md +0 -37
  131. package/framework/hooks/claude-code/core/block-destructive-worktree-removal.js +0 -80
  132. package/framework/hooks/claude-code/core/block-raw-worktree-add.js +0 -72
  133. package/framework/hooks/claude-code/core/enforce-phase-writes.js +0 -100
  134. package/framework/hooks/claude-code/core/gate-guard.js +0 -148
  135. package/framework/hooks/claude-code/core/heavy-gate.js +0 -78
  136. package/framework/hooks/claude-code/core/heavy-release.js +0 -23
  137. package/framework/hooks/claude-code/core/loop-detect.js +0 -79
  138. package/framework/hooks/claude-code/core/state-sync.js +0 -214
  139. package/framework/hooks/claude-code/core/telemetry-log.js +0 -259
  140. package/framework/hooks/claude-code/core/test-budget.js +0 -29
  141. package/framework/hooks/claude-code/core/worktree-context.js +0 -249
  142. package/framework/hooks/claude-code/core/worktree-create.js +0 -119
  143. package/framework/hooks/claude-code/core/worktree-env-inject.js +0 -68
  144. package/framework/hooks/claude-code/core/worktree-remove.js +0 -55
  145. package/framework/hooks/shared/build-check.js +0 -120
  146. package/framework/hooks/shared/claim-registry.js +0 -125
  147. package/framework/hooks/shared/e2e-check.js +0 -1022
  148. package/framework/hooks/shared/feature-locator.js +0 -82
  149. package/framework/hooks/shared/gate-event.js +0 -18
  150. package/framework/hooks/shared/gate-question.js +0 -20
  151. package/framework/hooks/shared/heavy-config.js +0 -113
  152. package/framework/hooks/shared/heavy-holders.js +0 -85
  153. package/framework/hooks/shared/heavy-slots.js +0 -280
  154. package/framework/hooks/shared/host-services.js +0 -440
  155. package/framework/hooks/shared/next-step.js +0 -181
  156. package/framework/hooks/shared/redact-secrets.js +0 -44
  157. package/framework/hooks/shared/reparse-scan.js +0 -40
  158. package/framework/hooks/shared/state-reader.js +0 -220
  159. package/framework/hooks/shared/state-writer.js +0 -112
  160. package/framework/hooks/shared/telemetry-logger.js +0 -101
  161. package/framework/hooks/shared/transcript-usage.js +0 -58
  162. package/framework/hooks/shared/worktree-root.js +0 -71
  163. package/framework/phases.json +0 -92
  164. package/framework/schemas/feature.schema.json +0 -242
  165. package/framework/skills/core/morph-apply/references/hotfix.md +0 -46
  166. package/framework/skills/core/morph-apply/references/machine.md +0 -30
  167. package/framework/skills/core/morph-apply/references/review.md +0 -77
  168. package/framework/skills/core/morph-plan/references/critique.md +0 -51
  169. package/framework/skills/core/morph-plan/references/interview.md +0 -37
  170. package/framework/templates/state.template.json +0 -17
  171. package/src/commands/dashboard/dashboard.js +0 -74
  172. package/src/commands/e2e/e2e.js +0 -400
  173. package/src/commands/observability/cost.js +0 -283
  174. package/src/commands/project/branch.js +0 -129
  175. package/src/commands/project/claim.js +0 -132
  176. package/src/commands/project/doctor-procs.js +0 -162
  177. package/src/commands/project/fleet.js +0 -66
  178. package/src/commands/project/heavy.js +0 -81
  179. package/src/commands/project/install-plugin-cmd.js +0 -27
  180. package/src/commands/project/status.js +0 -61
  181. package/src/commands/project/worktree.js +0 -1234
  182. package/src/commands/state/advance.js +0 -248
  183. package/src/commands/state/approve.js +0 -303
  184. package/src/commands/state/archive.js +0 -231
  185. package/src/commands/state/auto-approval.js +0 -67
  186. package/src/commands/state/create.js +0 -274
  187. package/src/commands/state/delete.js +0 -192
  188. package/src/commands/state/finish.js +0 -1247
  189. package/src/commands/state/gate-check.js +0 -244
  190. package/src/commands/state/gate-decision.js +0 -122
  191. package/src/commands/state/list.js +0 -244
  192. package/src/commands/state/next.js +0 -24
  193. package/src/commands/state/recap.js +0 -80
  194. package/src/commands/state/report-check.js +0 -244
  195. package/src/commands/state/retype.js +0 -110
  196. package/src/commands/validation/verify.js +0 -421
  197. package/src/core/state/feature-identity.js +0 -10
  198. package/src/core/state/gate-order.js +0 -23
  199. package/src/core/state/lifecycle-audit.js +0 -171
  200. package/src/core/state/state-manager.js +0 -523
  201. package/src/core/templates/template-seed.js +0 -21
  202. package/src/core/work-types.js +0 -44
  203. package/src/dashboard/app/App.jsx +0 -84
  204. package/src/dashboard/app/components/ActivityFeed.jsx +0 -166
  205. package/src/dashboard/app/components/CommandPalette.jsx +0 -144
  206. package/src/dashboard/app/components/DetailPanel.jsx +0 -43
  207. package/src/dashboard/app/components/EntityLink.jsx +0 -42
  208. package/src/dashboard/app/components/ErrorBoundary.jsx +0 -47
  209. package/src/dashboard/app/components/FlowGraph.jsx +0 -19
  210. package/src/dashboard/app/components/GatePauses.jsx +0 -116
  211. package/src/dashboard/app/components/KnowledgeMarkdown.jsx +0 -42
  212. package/src/dashboard/app/components/Markdown.jsx +0 -38
  213. package/src/dashboard/app/components/PhaseRail.jsx +0 -100
  214. package/src/dashboard/app/components/SearchFilter.jsx +0 -36
  215. package/src/dashboard/app/components/SessionMap.jsx +0 -77
  216. package/src/dashboard/app/components/Sidebar.jsx +0 -147
  217. package/src/dashboard/app/hooks/useMorphQuery.js +0 -44
  218. package/src/dashboard/app/hooks/usePref.js +0 -34
  219. package/src/dashboard/app/lib/format.js +0 -69
  220. package/src/dashboard/app/lib/phases.js +0 -75
  221. package/src/dashboard/app/lib/project.js +0 -38
  222. package/src/dashboard/app/main.jsx +0 -13
  223. package/src/dashboard/app/pages/Activity.jsx +0 -28
  224. package/src/dashboard/app/pages/AgentMap.jsx +0 -363
  225. package/src/dashboard/app/pages/FeatureDetail.jsx +0 -579
  226. package/src/dashboard/app/pages/Features.jsx +0 -393
  227. package/src/dashboard/app/pages/Guide.jsx +0 -145
  228. package/src/dashboard/app/pages/HookInspector.jsx +0 -444
  229. package/src/dashboard/app/pages/PhasePipeline.jsx +0 -273
  230. package/src/dashboard/app/pages/Portfolio.jsx +0 -190
  231. package/src/dashboard/app/pages/RulesMap.jsx +0 -285
  232. package/src/dashboard/app/pages/SkillsLibrary.jsx +0 -468
  233. package/src/dashboard/app/pages/Standards.jsx +0 -392
  234. package/src/dashboard/app/styles/index.css +0 -187
  235. package/src/dashboard/index.html +0 -14
  236. package/src/dashboard/package.json +0 -32
  237. package/src/dashboard/scanner/activity-scanner.js +0 -321
  238. package/src/dashboard/scanner/agents-scanner.js +0 -67
  239. package/src/dashboard/scanner/docs-scanner.js +0 -34
  240. package/src/dashboard/scanner/feature-status.js +0 -7
  241. package/src/dashboard/scanner/features-scanner.js +0 -397
  242. package/src/dashboard/scanner/hooks-scanner.js +0 -96
  243. package/src/dashboard/scanner/index.js +0 -21
  244. package/src/dashboard/scanner/phases-scanner.js +0 -14
  245. package/src/dashboard/scanner/portfolio.js +0 -129
  246. package/src/dashboard/scanner/project-api.js +0 -160
  247. package/src/dashboard/scanner/rules-scanner.js +0 -46
  248. package/src/dashboard/scanner/skills-scanner.js +0 -104
  249. package/src/dashboard/scanner/standards-scanner.js +0 -38
  250. package/src/dashboard/vite-plugin-morph-data.js +0 -120
  251. package/src/dashboard/vite.config.js +0 -26
  252. package/src/lib/ci/ci-verify.js +0 -30
  253. package/src/lib/ci/github-ci.js +0 -52
  254. package/src/lib/ci/pr-checks.js +0 -76
  255. package/src/lib/e2e/applicability.js +0 -39
  256. package/src/lib/e2e/compose-env.js +0 -80
  257. package/src/lib/e2e/stack-teardown.js +0 -96
  258. package/src/lib/git/branch-classifier.js +0 -104
  259. package/src/lib/git/evidence-staleness.js +0 -40
  260. package/src/lib/git/gh.js +0 -15
  261. package/src/lib/git/pending-prs.js +0 -58
  262. package/src/lib/git/pr-files.js +0 -31
  263. package/src/lib/git/pr-index.js +0 -39
  264. package/src/lib/git/tree-fingerprint.js +0 -58
  265. package/src/lib/git/tree-state.js +0 -125
  266. package/src/lib/heavy/cleanup.js +0 -72
  267. package/src/lib/heavy/gate.js +0 -168
  268. package/src/lib/heavy/live-stacks.js +0 -64
  269. package/src/lib/heavy/reclaim.js +0 -107
  270. package/src/lib/heavy/watchdog.js +0 -46
  271. package/src/lib/next-step.js +0 -12
  272. package/src/lib/plan/critique.js +0 -67
  273. package/src/lib/plan/plan-template.js +0 -18
  274. package/src/lib/procs/classify.js +0 -91
  275. package/src/lib/procs/list.js +0 -124
  276. package/src/lib/procs/prune.js +0 -47
  277. package/src/lib/procs/wslconfig.js +0 -70
  278. package/src/lib/projects/registry.js +0 -121
  279. package/src/lib/recap/piper.js +0 -36
  280. package/src/lib/recap/recap.js +0 -259
  281. package/src/lib/review-confirmation.js +0 -66
  282. package/src/lib/risk/diff-risk.js +0 -137
  283. package/src/lib/risk-detector.js +0 -638
  284. package/src/lib/specs/design-seed.js +0 -18
  285. package/src/lib/specs/screen-checklist.js +0 -315
  286. package/src/lib/stack/stack-profile.js +0 -69
  287. package/src/lib/tasks/eval-node.js +0 -293
  288. package/src/lib/tasks/linux-runner.js +0 -200
  289. package/src/lib/tasks/test-nodes.js +0 -414
  290. package/src/lib/tasks/test-runner.js +0 -569
  291. package/src/lib/telemetry/metrics.js +0 -384
  292. package/src/lib/telemetry/telemetry-reader.js +0 -276
  293. package/src/lib/telemetry/verify-event.js +0 -57
  294. package/src/lib/validators/code-budget/code-budget-validator.js +0 -170
  295. package/src/lib/validators/contracts/contract-compliance-validator.js +0 -219
  296. package/src/lib/validators/nextjs/next-component-validator.js +0 -142
  297. package/src/lib/validators/packages/package-validator.js +0 -310
  298. package/src/lib/validators/reuse/reuse-validator.js +0 -202
  299. package/src/lib/validators/reuse/symbol-scanner.js +0 -64
  300. package/src/lib/validators/validation-runner.js +0 -188
  301. package/src/lib/validators/verify-cache.js +0 -63
  302. package/src/lib/validators/verify-runner.js +0 -971
  303. package/src/lib/verify/affected.js +0 -143
  304. package/src/lib/verify/detached.js +0 -159
  305. package/src/lib/view/feature-html.js +0 -480
  306. package/src/lib/view/feature-page.client.js +0 -109
  307. package/src/lib/view/feature-page.css +0 -278
  308. package/src/lib/view/feature-view.js +0 -113
  309. package/src/lib/view/flow-layers.js +0 -79
  310. package/src/lib/view/flow-svg.js +0 -63
  311. package/src/lib/view/tokens.css +0 -18
  312. package/src/lib/work-type-detector.js +0 -81
  313. package/src/lib/worktree/dirs.js +0 -3
  314. package/src/lib/worktree/docker-audit.js +0 -175
  315. package/src/lib/worktree/env-allocator.js +0 -177
  316. package/src/lib/worktree/feature-truth.js +0 -145
  317. package/src/lib/worktree/finish-backup.js +0 -529
  318. package/src/lib/worktree/fleet-scanner.js +0 -223
  319. package/src/lib/worktree/ignored-triage.js +0 -136
  320. package/src/lib/worktree/vscode-settings.js +0 -112
  321. package/src/lib/worktree/worktree-audit.js +0 -323
  322. package/src/lib/worktree/worktree-include.js +0 -44
  323. package/src/scripts/install-plugin.js +0 -114
@@ -1,6 +1,7 @@
1
1
  import { existsSync, readFileSync, readdirSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { homedir } from 'os';
4
+ import { readMcpConfig } from './mcp-config.js';
4
5
 
5
6
  // User settings first, then the project's: a later file overrides, and `false` turns a plugin off.
6
7
  export function readEnabledPlugins(targetPath, home = homedir()) {
@@ -82,6 +83,12 @@ export function detectClaudeConfig(targetPath) {
82
83
  }
83
84
  }
84
85
 
86
+ // User and local scopes live in ~/.claude.json: missing them rewrites a server the user already has into .mcp.json.
87
+ for (const s of readMcpConfig({ projectDir: targetPath }).servers) {
88
+ if (s.scope === 'project' || result.mcpServers.some(m => m.name === s.name)) continue;
89
+ result.mcpServers.push({ name: s.name, config: { command: s.command, args: s.args, url: s.url }, source: s.scope });
90
+ }
91
+
85
92
  const pluginsPath = join(homedir(), '.claude', 'plugins', 'installed_plugins.json');
86
93
  if (existsSync(pluginsPath)) {
87
94
  try {
@@ -2,14 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
2
2
  import { join, resolve } from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { jsoncToJson } from '../../../framework/hooks/shared/comment-stripper.js';
5
- import { readEnabledPlugins } from '../detectors/claude-config-detector.js';
6
-
7
- const GENERIC_TOKENS = new Set([
8
- 'cmd', 'cmd.exe', 'npx', 'npx.cmd', 'npm', 'node', 'node.exe', 'python', 'python3', 'uv', 'uvx',
9
- 'dotnet', 'docker', 'run', 'exec', 'bash', 'sh', 'powershell', 'pwsh',
10
- ]);
11
-
12
- const toolNamePart = (s) => String(s).replace(/[^A-Za-z0-9_-]/g, '_');
5
+ import { readEnabledPlugins } from './claude-config-detector.js';
13
6
 
14
7
  function readJsonc(file, unreadable) {
15
8
  if (!existsSync(file)) return null;
@@ -72,32 +65,3 @@ export function readMcpConfig({ projectDir, home = homedir() }) {
72
65
 
73
66
  return { servers, pluginServers, enabledPlugins, unreadable };
74
67
  }
75
-
76
- export function findDuplicateMcps({ servers, pluginServers }) {
77
- const duplicates = [];
78
- for (const ps of pluginServers) {
79
- const declared = servers.filter((s) => s.name === ps.name);
80
- if (!declared.length) continue;
81
- duplicates.push({
82
- server: ps.name,
83
- plugin: ps.plugin,
84
- declaredIn: [...new Set(declared.map((s) => s.scope))],
85
- toolNames: [`mcp__${ps.name}`, `mcp__plugin_${toolNamePart(ps.plugin)}_${toolNamePart(ps.name)}`],
86
- });
87
- }
88
- return duplicates;
89
- }
90
-
91
- export function mcpCommandTokens({ servers, pluginServers }) {
92
- const tokens = new Set();
93
- for (const s of [...servers, ...pluginServers]) {
94
- if (s.url && !s.command) continue;
95
- for (const raw of [s.command, ...s.args]) {
96
- if (typeof raw !== 'string') continue;
97
- const token = raw.toLowerCase().replace(/\\/g, '/');
98
- if (token.length < 4 || /^[-/]/.test(token) || token.includes('${') || GENERIC_TOKENS.has(token)) continue;
99
- tokens.add(token);
100
- }
101
- }
102
- return [...tokens];
103
- }
@@ -0,0 +1,64 @@
1
+ import { execFileSync } from 'child_process';
2
+ import { minimatch } from 'minimatch';
3
+
4
+ // O predicado único de teste do grafo e do validador de reuso. Só três formas de pasta, porque
5
+ // `[^/]*[Tt]ests?/` genérico também casaria `latest/` e `contests/`.
6
+ const TEST_PATH = /(^|\/)__tests__\/|\.(test|spec)\.[jt]sx?$|(^|\/)(?:[Tt]ests?|[^/]*\.[Tt]ests?|[^/]*[a-z0-9_]Tests?)\//;
7
+
8
+ export function isTestPath(sourceFile) {
9
+ return TEST_PATH.test(String(sourceFile || '').replace(/\\/g, '/'));
10
+ }
11
+
12
+ const DOC_PATH = /(^|\/)docs\/|\.(md|mdx|txt|rst|adoc|png|jpe?g|gif|svg|webp|ico)$/i;
13
+ const CONFIG_PATH = /\.(json|jsonc|ya?ml|toml|ini|xml|editorconfig|env\.example)$|(^|\/)\.(gitignore|gitattributes|npmrc|nvmrc|prettierrc|eslintignore)$|(^|\/)\.env(\.[^/]+)?$/i;
14
+ // Resolves or compiles everything: a change here reaches code the diff does not name.
15
+ export const WIDE_PATH = /(^|\/)(package(-lock)?\.json|pnpm-lock\.yaml|yarn\.lock|global\.json|Directory\.(Build|Packages)\.(props|targets)|tsconfig[^/]*\.json|[^/]+\.(csproj|sln|slnx|props|targets))$/i;
16
+
17
+ export function git(cwd, args) {
18
+ return execFileSync('git', args, { cwd, stdio: 'pipe', maxBuffer: 256 * 1024 * 1024 }).toString();
19
+ }
20
+
21
+ // An agent reads these as instructions: a changed sentence is changed behaviour, whatever the extension.
22
+ const PROMPT_PATH = /(^|\/)(prompts?|agents?|skills?|playbooks?|personas?|instructions?|\.claude)\/|(^|\/)(CLAUDE|AGENTS|GEMINI|MORPH|SKILL|copilot-instructions)\.md$|prompt[^/]*$/i;
23
+
24
+ export function isPromptPath(path, promptGlobs = []) {
25
+ return PROMPT_PATH.test(path) || promptGlobs.some((g) => minimatch(path, g));
26
+ }
27
+
28
+ export function fileClass(path, promptGlobs = []) {
29
+ if (path.startsWith('.morph/')) return 'state';
30
+ if (isPromptPath(path, promptGlobs)) return 'code';
31
+ if (DOC_PATH.test(path)) return 'doc';
32
+ if (CONFIG_PATH.test(path) && !WIDE_PATH.test(path)) return 'config';
33
+ return isTestPath(path) || /(^|\/)e2e\//.test(path) ? 'test' : 'code';
34
+ }
35
+
36
+ /** Per file: `added`/`removed` lines and `deleted` (the whole file went away). */
37
+ export function diffLines(cwd, from, to = null) {
38
+ const range = to ? [from, to] : [from];
39
+ const text = git(cwd, ['-c', 'core.quotepath=off', 'diff', '-U0', '--no-color', '--no-ext-diff', '--no-renames', ...range, '--', '.']);
40
+ const files = new Map();
41
+ let current = null;
42
+ for (const line of text.split('\n')) {
43
+ if (line.startsWith('diff --git ')) {
44
+ const path = line.split(' b/').pop();
45
+ current = { path, added: [], removed: [], deleted: false };
46
+ files.set(path, current);
47
+ } else if (!current) {
48
+ continue;
49
+ } else if (line.startsWith('deleted file mode')) {
50
+ current.deleted = true;
51
+ } else if (line.startsWith('+') && !line.startsWith('+++')) {
52
+ current.added.push(line.slice(1));
53
+ } else if (line.startsWith('-') && !line.startsWith('---')) {
54
+ current.removed.push(line.slice(1));
55
+ }
56
+ }
57
+ if (!to) {
58
+ for (const path of git(cwd, ['ls-files', '--others', '--exclude-standard']).split('\n').filter(Boolean)) {
59
+ files.set(path, { path, added: [''], removed: [], deleted: false, untracked: true });
60
+ }
61
+ }
62
+ return [...files.values()];
63
+ }
64
+
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'url';
4
4
  import { existsSync, readFileSync } from 'fs';
5
5
  import { scanGraph } from '../graph/god-nodes.js';
6
6
  import { renderTemplate } from '../../core/templates/template-renderer.js';
7
- import { WORKTREE_DIR_NAMES } from '../worktree/dirs.js';
7
+ import { WORKTREE_DIR_NAMES } from '../scan/worktree-dirs.js';
8
8
 
9
9
  export const SKIP_DIRS = new Set(['node_modules', 'bin', 'obj', '.git', '.morph', '.next', 'dist', 'out', ...WORKTREE_DIR_NAMES]);
10
10
  const MAX_FILES_PER_SCANNER = 200;
@@ -10,13 +10,6 @@ function toPascalCase(str) {
10
10
  .join('');
11
11
  }
12
12
 
13
- function toCamelCase(str) {
14
- return str
15
- .split('-')
16
- .map((word, i) => i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
17
- .join('');
18
- }
19
-
20
13
  /** Kebab-case so Handlebars {{pascalCase}} reconstructs it: "MyBookStore" → "my-book-store", "My.App" → "my-app". */
21
14
  export function normalizeNamespaceToKebab(ns) {
22
15
  return ns
@@ -52,42 +52,6 @@ export function detectDefaultBranch(cwd = process.cwd()) {
52
52
  return null;
53
53
  }
54
54
 
55
- /**
56
- * Where a new feature branch starts: origin's default after a best-effort fetch, so a local default that
57
- * was never pulled does not hand the feature an old base. Falls back to the local default.
58
- */
59
- export function freshDefaultRef(cwd = process.cwd()) {
60
- const branch = detectDefaultBranch(cwd);
61
- if (!branch) return null;
62
- try {
63
- execFileSync('git', ['fetch', '-q', 'origin', branch], { cwd, stdio: 'pipe', timeout: 30_000 });
64
- } catch { /* offline or no origin: the local default */ }
65
- try {
66
- execFileSync('git', ['show-ref', '--verify', '--quiet', `refs/remotes/origin/${branch}`], { cwd, stdio: 'pipe' });
67
- return `origin/${branch}`;
68
- } catch {
69
- return branch;
70
- }
71
- }
72
-
73
- export function hasOriginRemote(cwd = process.cwd()) {
74
- try {
75
- const url = execFileSync('git', ['remote', 'get-url', 'origin'], { cwd, stdio: 'pipe' }).toString().trim();
76
- return url.length > 0;
77
- } catch {
78
- return false;
79
- }
80
- }
81
-
82
- /** @returns {string|null} null outside a repo or on an unborn HEAD; never throws. */
83
- export function getHeadSha(cwd = process.cwd()) {
84
- try {
85
- return execFileSync('git', ['rev-parse', 'HEAD'], { cwd, stdio: 'pipe' }).toString().trim();
86
- } catch {
87
- return null;
88
- }
89
- }
90
-
91
55
  function parseShortstat(text) {
92
56
  const files = /(\d+) files? changed/.exec(text || '');
93
57
  const ins = /(\d+) insertions?\(\+\)/.exec(text || '');
@@ -122,89 +86,3 @@ function listUntrackedFiles(cwd) {
122
86
  }
123
87
  }
124
88
 
125
- /**
126
- * Diff against the WORKING TREE (not `baseRef...HEAD`), so uncommitted work counts.
127
- * `filesChanged` includes untracked files; `untrackedFiles` breaks them out.
128
- * @returns {{ filesChanged: number, insertions: number, deletions: number, untrackedFiles: number }|null}
129
- */
130
- export function getDiffStat(baseRef, cwd = process.cwd()) {
131
- if (!baseRef) return null;
132
- try {
133
- const out = execFileSync('git', ['diff', '--shortstat', baseRef], { cwd, stdio: 'pipe' }).toString().trim();
134
- const stat = parseShortstat(out);
135
- const untrackedFiles = countUntrackedFiles(cwd);
136
- return { ...stat, filesChanged: stat.filesChanged + untrackedFiles, untrackedFiles };
137
- } catch {
138
- return null;
139
- }
140
- }
141
-
142
- /**
143
- * Paths changed in the working tree against `baseRef`, untracked included, sorted.
144
- * `[]` means both "nothing changed" and "ref did not resolve".
145
- * @returns {string[]}
146
- */
147
- export function changedPathsAgainst(baseRef, cwd = process.cwd()) {
148
- if (!baseRef) return [];
149
-
150
- let tracked;
151
- try {
152
- // From the merge-base: what the default gained after the branch point is not this feature's.
153
- // origin's copy first: a local default that was never pulled holds the merge-base back.
154
- let base = baseRef;
155
- for (const ref of [`origin/${baseRef}`, baseRef]) {
156
- try {
157
- base = execFileSync('git', ['merge-base', 'HEAD', ref], { cwd, stdio: 'pipe' }).toString().trim() || baseRef;
158
- break;
159
- } catch { /* next ref */ }
160
- }
161
- tracked = splitLines(
162
- execFileSync('git', ['diff', '--name-only', base], { cwd, stdio: 'pipe' }).toString()
163
- );
164
- } catch {
165
- return [];
166
- }
167
-
168
- return [...new Set([...tracked, ...listUntrackedFiles(cwd)])].sort();
169
- }
170
-
171
- /**
172
- * Added lines per file, measured from the merge-base so a moved-on default branch
173
- * lends nothing; paths relative to `cwd` (`--relative`), like the untracked listing.
174
- * @returns {Map<string, number[]|null>|null} `null` value = whole untracked file;
175
- * `null` result = cannot tell.
176
- */
177
- export function addedLinesAgainst(baseRef, cwd = process.cwd()) {
178
- if (!baseRef) return null;
179
- const git = (args) => execFileSync('git', args, { cwd, stdio: 'pipe', maxBuffer: 256 * 1024 * 1024 }).toString();
180
-
181
- let diff;
182
- try {
183
- let base = baseRef;
184
- try { base = git(['merge-base', 'HEAD', baseRef]).trim() || baseRef; } catch { /* diff against the ref itself */ }
185
- diff = git(['-c', 'core.quotepath=off', 'diff', '-U0', '--no-color', '--no-ext-diff', '-M', '--relative',
186
- '--src-prefix=a/', '--dst-prefix=b/', base]);
187
- } catch {
188
- return null;
189
- }
190
-
191
- const added = new Map();
192
- let current = null;
193
- for (const line of diff.split('\n')) {
194
- if (line.startsWith('+++ ')) {
195
- const target = line.slice(4).trim().replace(/^"|"$/g, '');
196
- current = target.startsWith('b/') ? target.slice(2) : null;
197
- continue;
198
- }
199
- const hunk = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(line);
200
- if (!hunk || !current) continue;
201
- const start = Number(hunk[1]);
202
- const count = hunk[2] === undefined ? 1 : Number(hunk[2]);
203
- if (count === 0) continue;
204
- const lines = added.get(current) ?? [];
205
- for (let n = start; n < start + count; n++) lines.push(n);
206
- added.set(current, lines);
207
- }
208
- for (const path of listUntrackedFiles(cwd)) added.set(path, null);
209
- return added;
210
- }
@@ -1,4 +1,5 @@
1
- import { buildIndex, linksOf, resolveEdgeTarget, isTestPath } from './sanitize.js';
1
+ import { buildIndex, linksOf, resolveEdgeTarget } from './sanitize.js';
2
+ import { isTestPath } from '../diff/diff-lines.js';
2
3
 
3
4
  const CALL_RELATIONS = new Set(['calls', 'indirect_call', 'dispatches_to']);
4
5
  const HUNK_RE = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/;
@@ -1,7 +1,8 @@
1
1
  // Só nós com source_file, e nada de teste: dublês e fixtures estão no grafo para serem achados, não para
2
2
  // disputar centralidade. Aresta com uma ponta em teste não conta, e comunidade só de teste some.
3
3
  import { loadGraph } from './graph-loader.js';
4
- import { buildIndex, resolveEdgeTarget, linksOf, isTestPath } from './sanitize.js';
4
+ import { buildIndex, resolveEdgeTarget, linksOf } from './sanitize.js';
5
+ import { isTestPath } from '../diff/diff-lines.js';
5
6
 
6
7
  /** Sem `graphify label`, as comunidades se chamam Community_N — ruído puro. */
7
8
  const PLACEHOLDER_LABEL = /^Community[_ ]?\d+$/i;
@@ -8,7 +8,6 @@ export { GRAPHIFY_PACKAGE };
8
8
  // Pin exato: o graphify é pré-1.0 com release quase diária e semver não garante nada; subir é decisão
9
9
  // consciente, com o fixture de regressão regerado.
10
10
  export const GRAPHIFY_VERSION = '0.9.50';
11
- export const GRAPHIFY_BIN = 'graphify';
12
11
 
13
12
  const PREFERENCE = ['uv', 'pipx', 'python3', 'python'];
14
13
 
@@ -4,7 +4,7 @@
4
4
  import { writeFileSync, existsSync, readFileSync } from 'node:fs';
5
5
  import { execFileSync } from 'node:child_process';
6
6
  import { join } from 'node:path';
7
- import { WORKTREE_DIR_NAMES } from '../worktree/dirs.js';
7
+ import { WORKTREE_DIR_NAMES } from '../scan/worktree-dirs.js';
8
8
  import { ignoreRules } from '../../../framework/hooks/shared/graph-freshness.js';
9
9
 
10
10
  export const ALWAYS_IGNORED = [
@@ -1,3 +1,5 @@
1
+ import { isTestPath } from '../diff/diff-lines.js';
2
+
1
3
  // O graphify não resolve escopo hierárquico de namespace em C#: tipo do namespace pai vira stub por arquivo.
2
4
  // Label com 1 nó real coalesce; 0 reais é externo; 2+ reais é ambíguo e são símbolos do projeto, por isso
3
5
  // externo é `real.length === 0`, nunca "o que sobrou".
@@ -17,14 +19,6 @@ const LANG_BY_EXT = {
17
19
  sql: 'sql', py: 'python', go: 'go', rs: 'rust', java: 'jvm', kt: 'jvm',
18
20
  };
19
21
 
20
- // O predicado único de teste do grafo e do validador de reuso. Só três formas de pasta, porque
21
- // `[^/]*[Tt]ests?/` genérico também casaria `latest/` e `contests/`.
22
- const TEST_PATH = /(^|\/)__tests__\/|\.(test|spec)\.[jt]sx?$|(^|\/)(?:[Tt]ests?|[^/]*\.[Tt]ests?|[^/]*[a-z0-9_]Tests?)\//;
23
-
24
- export function isTestPath(sourceFile) {
25
- return TEST_PATH.test(String(sourceFile || '').replace(/\\/g, '/'));
26
- }
27
-
28
22
  /** Família de linguagem do arquivo, ou '' quando desconhecida. */
29
23
  export function languageOf(sourceFile) {
30
24
  const m = /\.([a-z0-9]+)$/i.exec(sourceFile || '');
@@ -15,7 +15,7 @@ function getMemoryRoot(projectPath) {
15
15
  function projectMemoryContent(info) {
16
16
  return `---
17
17
  name: project-morph-spec
18
- description: morph-spec project configuration, paths, slash commands, and trust mode
18
+ description: morph-spec project configuration, paths and slash commands
19
19
  metadata:
20
20
  type: project
21
21
  ---
@@ -23,44 +23,31 @@ metadata:
23
23
  # ${info.projectName} — morph-spec project
24
24
 
25
25
  **Framework version:** ${info.frameworkVersion}
26
- **Stack:** ${info.stack ?? 'default (nextjs + dotnet + VSA + MAF + Neon)'}
27
- **Trust mode:** auto (gates auto-pass without risk signals)
26
+ **Stack:** ${info.stack ?? 'from the contract (.morph/config/config.json)'}
28
27
 
29
28
  ## Key paths
30
29
 
31
- - \`.morph/framework/MORPH.md\` — NLH charter (read once per session)
32
- - \`.morph/framework/agents.json\` — the 3 read-only Gate 3 agents (\`verifier\`, \`reviewer\`, \`security\`)
33
- - \`.morph/framework/standards/STANDARDS.json\` — standards index (load on demand)
34
- - \`.morph/features/{feature}/\` — feature artifacts: 2-plan / 1-design / 3-implement / 4-review
35
- - \`.morph/context/\` — long-lived architectural context (design-system, decisions)
36
- - \`.morph/state.json\` — feature state (managed by state-sync hook; Edit fallback allowed)
30
+ - \`.morph/framework/MORPH.md\` — the flow (read once per session)
31
+ - \`.morph/config/config.json\` — the repo contract: stack, test commands per tier, risk globs, limits
32
+ - \`.morph/features/<branch-slug>/\` — plan (2-plan), screens (1-design), report (3-implement), review (4-review)
33
+ - \`.morph/framework/agents.json\` — the 3 read-only review personas (\`verifier\`, \`reviewer\`, \`security\`)
34
+ - \`.morph/framework/standards/STANDARDS.json\` — standards index (\`morph-spec standards --find\`)
37
35
 
38
36
  ## Slash commands
39
37
 
40
38
  | Command | Skill invoked |
41
39
  |---------|---------------|
42
- | \`/morph-plan {feature}\` | \`Skill(morph-plan)\` — tese → plan.md → plan-check → gate do plano |
43
- | \`/morph-apply {feature}\` | \`Skill(morph-apply)\` — fatias do plano → verify → review → Gate 3 |
44
- | \`/morph-status [feature]\` | inspect state.json |
45
- | \`/morph-archive {feature}\` | move completed feature to .morph/archive/ |
46
- | \`/morph-preflight\` | pre-deploy validation |
40
+ | \`/morph-plan\` | \`Skill(morph-plan)\` — issue → plan.md with C1..Cn → plan-check |
41
+ | \`/morph-apply\` | \`Skill(morph-apply)\` — prove-red → implement → check → review personas → check --report |
47
42
  | \`/morph-troubleshoot [erro]\` | diagnose .NET/Next.js errors |
48
43
 
49
- ## Core skills
50
-
51
- \`morph-plan\`, \`morph-apply\`, \`morph-uiux\`, \`morph-review\`, \`morph-hotfix\`, \`morph-standards\`
52
-
53
- **Why:** This project is managed by morph-spec — spec-driven autonomous development with trust-aware gates.
54
-
55
- **How to apply:**
56
- - When user mentions a feature, check \`.morph/features/\` first.
57
- - In \`trust: "auto"\`, gates auto-pass; only AskUserQuestion on risk signals.
44
+ **How to apply:** the feature is the folder of the current branch; without a human (\`MORPH_AUTONOMOUS=1\`) nothing is asked and what is not the session's call ends as \`precisa-humano\`.
58
45
  `;
59
46
  }
60
47
 
61
48
  const REFERENCE_MEMORY_CONTENT = `---
62
49
  name: reference-morph-context
63
- description: where to find long-lived morph-spec project context and schema files
50
+ description: where to find long-lived morph-spec project context
64
51
  metadata:
65
52
  type: reference
66
53
  ---
@@ -69,11 +56,9 @@ metadata:
69
56
 
70
57
  - \`.morph/context/README.md\` — generated architecture overview
71
58
  - \`.morph/context/design-system.md\` — design tokens and components (source of truth)
72
- - \`.morph/framework/MORPH.md\` — NLH charter, Trust Mode rules, gates, skills table
73
- - \`.morph/framework/standards/STANDARDS.json\` — index; load specific standard via \`path\` field
74
- - \`.morph/framework/phases.json\` — phase folder mapping and skill associations
75
- - \`.morph/framework/agents.json\` — Gate 3 agent definitions (verifier, reviewer, security)
76
- - \`.morph/framework/evals/review-checklist.md\` — what the Gate 3 verifier, reviewer and security check (verdict SHIP/FIX + evidence-typed blockers)
59
+ - \`.morph/specs/adrs/\` — project-scope decisions, written by plan-check
60
+ - \`.morph/framework/CLI.md\` — the CLI reference, one section per command
61
+ - \`.morph/framework/evals/review-checklist.md\` — what the review personas check (SHIP/FIX + evidence-typed blockers)
77
62
  `;
78
63
 
79
64
  // Idempotent: memory files are overwritten, MEMORY.md entries appended only if missing.
@@ -95,7 +80,7 @@ export async function installProjectMemory(projectPath, info) {
95
80
  indexContent = '# Memory Index\n';
96
81
  }
97
82
 
98
- const projectLine = '- [morph-spec project](project_morph_spec.md) — stack, trust mode, slash commands, key paths';
83
+ const projectLine = '- [morph-spec project](project_morph_spec.md) — stack, slash commands, key paths';
99
84
  const refLine = '- [morph-spec context](reference_morph_context.md) — where to find long-lived context';
100
85
 
101
86
  if (!indexContent.includes('project_morph_spec.md')) {
@@ -1,14 +1,24 @@
1
1
  import { existsSync, readFileSync, readdirSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { detectProject } from '../detectors/index.js';
4
+ import { scanRepo } from '../contract/scan.js';
4
5
  import { getProjectTags, parseStacks, shouldInstall } from '../stack-filter.js';
5
- import { WORKTREE_DIR_NAMES } from '../worktree/dirs.js';
6
- import { resolveComposeFile } from '../../../framework/hooks/shared/e2e-check.js';
6
+ import { WORKTREE_DIR_NAMES } from '../scan/worktree-dirs.js';
7
7
  import { createEffects } from './effects.js';
8
8
  import { MAF_RULE, MAF_TAG, installRuleFile, ruleContentFor } from './rules-installer.js';
9
9
 
10
+ const COMPOSE_CANDIDATES = ['compose.yaml', 'compose.yml', 'docker-compose.yaml', 'docker-compose.yml'];
11
+
12
+ function resolveComposeFile(cwd, config) {
13
+ const configured = config?.e2e?.composeFile;
14
+ if (configured) return existsSync(join(cwd, configured)) ? configured : null;
15
+ return COMPOSE_CANDIDATES.find((name) => existsSync(join(cwd, name))) ?? null;
16
+ }
17
+
10
18
  const RULES_SRC = join(import.meta.dirname, '..', '..', '..', 'framework', 'rules');
11
- const STACK_TAGS = new Set(['nextjs', 'dotnet']);
19
+ const STACK_TAGS = new Set(['nextjs', 'dotnet', 'react', 'vue', 'node', 'python', 'static']);
20
+ // Tags only skills react to: no rule names them, so ruleTags() never lists them.
21
+ const SKILL_TAGS = ['umbraco'];
12
22
  const SKIP_DIRS = new Set(['node_modules', 'bin', 'obj', ...WORKTREE_DIR_NAMES]);
13
23
  const MAX_DEPTH = 5;
14
24
  const MAX_ENTRIES = 20000;
@@ -53,6 +63,7 @@ export function detectStackTags(projectDir, { config = null, rulesSrc = RULES_SR
53
63
  const { structure } = detectProject(projectDir);
54
64
  for (const t of String(structure.stack).split('+')) found.add(t);
55
65
  for (const t of structure.integrations) found.add(t);
66
+ for (const t of scanRepo(projectDir).tags) found.add(t);
56
67
 
57
68
  walk(projectDir, (name, path) => {
58
69
  if (name.endsWith('.csproj') || name.endsWith('.sln') || name.endsWith('.slnx')) found.add('dotnet');
@@ -121,11 +132,9 @@ const NOOP = Object.freeze({ added: [], updated: [], tags: [], configChanged: fa
121
132
  /**
122
133
  * Installs every stack rule (a `stacks:` other than `*`) the project needs and lacks, after adding to
123
134
  * config.json the stack tags its files show. Only an installed project (with config.json) is touched. Never throws.
124
- * `persistTags: false` leaves config.json alone: a check (`verify`) may write gitignored harness files, never a tracked one.
125
135
  */
126
136
  export function syncStackRules(projectDir, {
127
137
  dryRun = false, fx = createEffects({ dryRun }), log = (line) => console.log(line), rulesSrc = RULES_SRC,
128
- persistTags = true,
129
138
  } = {}) {
130
139
  try {
131
140
  const configPath = configPathOf(projectDir);
@@ -137,9 +146,7 @@ export function syncStackRules(projectDir, {
137
146
  }
138
147
 
139
148
  const detected = detectStackTags(projectDir, { config, rulesSrc });
140
- const merged = persistTags
141
- ? mergeDetectedTags(config, detected.persist)
142
- : { config, added: [], changed: false };
149
+ const merged = mergeDetectedTags(config, detected.persist);
143
150
  if (merged.changed) {
144
151
  fx.writeJson(configPath, merged.config);
145
152
  log(` + config.json: ${merged.added.join(', ')} (detectado nos arquivos)`);
@@ -161,7 +168,7 @@ export function syncStackRules(projectDir, {
161
168
 
162
169
  /** What `stack-set` accepts: the stack tags, and the integrations some rule (or the MAF rewrite) reacts to. */
163
170
  export function knownStackTags(rulesSrc = RULES_SRC) {
164
- const integrations = [...ruleTags(rulesSrc), MAF_TAG].filter((t) => !STACK_TAGS.has(t));
171
+ const integrations = [...ruleTags(rulesSrc), MAF_TAG, ...SKILL_TAGS].filter((t) => !STACK_TAGS.has(t));
165
172
  return { stacks: [...STACK_TAGS].sort(), integrations: [...new Set(integrations)].sort() };
166
173
  }
167
174