@polymorphism-tech/morph-spec 11.2.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +2 -2
  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
@@ -1,134 +1,104 @@
1
1
  # MORPH-SPEC Template System
2
2
 
3
- > Handlebars templates organized by **technology**, indexed by `REGISTRY.json`.
3
+ > Templates organized by **technology**, indexed by `REGISTRY.json`.
4
4
 
5
- ## Overview
6
-
7
- **89 templates**, grouped by the technology they target (dotnet, typescript, sql, docker,
8
- nextjs) rather than by stack. A template for a .NET slice serves every stack with a .NET
9
- backend, so a new stack reuses what exists instead of copying it.
5
+ Templates are grouped by the technology they target (dotnet, sql, docker, nextjs)
6
+ rather than by stack: a .NET slice template serves every stack with a .NET backend.
10
7
 
11
8
  `REGISTRY.json` is the source of truth: it maps each template `id` to its `kind`, `path` and
12
- `category` (the shape per kind is in its `kinds` block). Nothing resolves a template by hardcoded path — code goes
13
- through the registry, and this README never repeats a path the registry already owns.
9
+ `category` (the shape per kind is in its `kinds` block). Code resolves a template by id through
10
+ the registry, never by a hardcoded path, and this README repeats no path the registry owns.
11
+
12
+ | Kind | What it is |
13
+ |------|------------|
14
+ | `template` | Rendered to an output file |
15
+ | `fragment` | A reference snippet read as an example, never rendered |
16
+ | `project` | A whole compilable project registered as one unit (`ai-kit`) |
14
17
 
15
18
  ---
16
19
 
17
- ## 📁 Directory Structure
20
+ ## Directory structure
18
21
 
19
22
  ```
20
23
  framework/templates/
21
- ├── docs/ # plan.md (the plan's single source)
22
- ├── context/ # ARCHITECTURE.md, design-system.md
23
- │
24
- ├── code/ # Code templates, by technology
24
+ ├── docs/ # plan.md — the grammar `morph-spec plan-check` parses
25
+ ├── context/ # design-system.md
26
+ ├── code/
25
27
  │ ├── dotnet/ # abstractions, ai-agents, constants, contracts, database,
26
28
  │ │ # exceptions, extensions, feature, jobs, pipelines
27
- │ ├── typescript/ # contracts.ts
28
- │ └── sql/ # postgresql migrations, RLS policy, ai-agents
29
- │
30
- ├── frontend/
31
- │ └── nextjs/ # page, client-component, feature-form, use-feature, env, tsconfig…
32
- │
29
+ │ └── sql/ # postgresql migration, RLS policy, ai-agents
30
+ ├── dotnet/ai-kit/ # Morph.AiKit — the compilable .NET solution behind the ai-agents standards
31
+ ├── frontend/nextjs/ # page, client-component, feature-form, use-feature, env, tsconfig…
33
32
  ├── infrastructure/
34
33
  │ ├── docker/ # Dockerfiles, compose, Coolify config
35
- │ └── github/ # Actions workflows + composite actions (.hbs)
36
- │
37
- ├── integrations/ # asaas-client, asaas-webhook, neon-auth-config
38
- ├── ui/ # design-system.css
39
- ├── examples/ # design-system-examples.md
40
- └── REGISTRY.json # template metadata — the index every consumer reads
34
+ │ └── github/ # Actions workflows (.hbs)
35
+ └── REGISTRY.json
41
36
  ```
42
37
 
43
38
  ---
44
39
 
45
- ## ⚙️ Template Engine: Handlebars
46
-
47
- All templates render through Handlebars with custom helpers registered in
48
- `src/core/templates/template-renderer.js`.
49
-
50
- ```handlebars
51
- # Feature: {{titleCase FEATURE_NAME}}
52
-
53
- namespace {{pascalCase FEATURE_NAME}};
40
+ ## Template engine: Handlebars
54
41
 
55
- Created: {{now}}
56
- ```
57
-
58
- ### Available helpers
42
+ Templates render through Handlebars with the helpers registered in
43
+ `src/core/templates/template-renderer.js`:
59
44
 
60
45
  | Group | Helpers |
61
46
  |-------|---------|
62
- | **Case** | `pascalCase` `camelCase` `snakeCase` `upperSnakeCase` `kebabCase` `titleCase` `uppercase` `lowercase` `capitalize` |
63
- | **Words** | `pluralize` `singularize` |
64
- | **Comparison** | `eq` `ne` `lt` `gt` `lte` `gte` |
65
- | **Logic** | `and` `or` `not` `default` |
66
- | **String** | `trim` `replace` `concat` `substr` `startsWith` `endsWith` `contains` `length` |
67
- | **Math** | `add` `subtract` `multiply` `divide` `mod` `round` |
68
- | **Array** | `join` `first` `last` `slice` |
69
- | **Misc** | `json` `now` `year` `formatDate` |
47
+ | **Case** | `pascalCase` `camelCase` `snakeCase` `upperSnakeCase` `kebabCase` `titleCase` |
48
+ | **Words** | `pluralize` |
49
+ | **Logic** | `eq` `and` `or` `default` |
50
+ | **Misc** | `now` `add` |
70
51
 
71
52
  ```handlebars
72
- {{#if (eq STACK "nextjs-neon")}}
73
- // Neon-specific code
74
- {{else}}
75
- // Generic code
53
+ namespace {{pascalCase FEATURE_NAME}};
54
+
55
+ {{#if (eq STACK "nextjs")}}
56
+ // Next.js only
76
57
  {{/if}}
77
58
  ```
78
59
 
79
- ---
60
+ A helper that is not in the table does not exist: Handlebars throws on it at render time.
80
61
 
81
- ## 🔗 How templates are consumed
62
+ ---
82
63
 
83
- Templates are **resolved from the installed npm package**, not copied into projects.
84
- `morph-spec setup-infra` deliberately skips copying `framework/templates/` — a target project
85
- gets the package's templates for free and stays current on every upgrade.
64
+ ## How templates are consumed
86
65
 
87
- **The consumer is the scaffolder**, which pairs a REGISTRY `id` with an output shape:
66
+ Templates are **resolved from the installed npm package**, never copied into a project: a
67
+ target project gets the package's templates and stays current on every upgrade.
88
68
 
89
69
  ```bash
90
70
  morph-spec scaffold dotnet <feature> <slice-name> # VSA slice (endpoint, handler, request,
91
71
  # response, validator, errors, entity)
92
72
  morph-spec scaffold nextjs <feature> # page, client component, form, hook
73
+ morph-spec scaffold show <template-id> # print one template by its registry id
93
74
  ```
94
75
 
95
- There is **no `morph-spec template` command** — the v4 CLI surface (`list`/`show`/`render`/
96
- `customize`) was removed in the v4→v5 migration. To use a template by hand, read the file and
97
- follow its pattern, or call `renderTemplate()` from the renderer module.
98
-
99
- ### Local override
100
-
101
- A project may shadow any packaged template by placing a file at the same relative path under
102
- `.morph/framework/templates/{path}`. The local copy wins, and **stops receiving framework
103
- updates** — only override when the packaged template genuinely does not fit.
76
+ `scaffold show` is how a session reads a template or a fragment; the ids are listed in the stack
77
+ rules (`*-templates`, `infrastructure-standards`, `neon-standards`, `ai-agents-standards`,
78
+ `gsap-standards`). A `project` is not printed:
79
+ read its files in the package.
104
80
 
105
81
  ---
106
82
 
107
- ## ➕ Adding a template
83
+ ## Adding a template
108
84
 
109
- 1. Create the file under the right technology directory:
110
- `framework/templates/code/{technology}/...` (Handlebars syntax, `.hbs` when the extension
111
- would otherwise confuse tooling).
85
+ 1. Create the file under the right technology directory (Handlebars syntax, `.hbs` when the
86
+ extension would otherwise confuse tooling).
112
87
  2. Register it in `REGISTRY.json` with a unique `id`, its `kind`, `path` and `category`, plus
113
- the fields its kind requires (`kinds` block; `scripts/validate-framework.js` checks them).
114
- 3. If a generator should emit it, add the `id` to the relevant list in
88
+ the fields its kind requires. `npm run validate` checks the shape, the path, the
89
+ placeholders of an entry with `validatePlaceholders: true`, and that every tracked file
90
+ under `templates/` is registered.
91
+ 3. Cite the `id` in the stack rule that should offer it; a template no rule names is never found.
92
+ 4. If the scaffolder should emit it, add the `id` to the list in
115
93
  `src/lib/generators/scaffold-generator.js`.
116
94
 
117
- ### Deprecating a template
118
-
119
- Add `"deprecated": true` plus `"deprecationReason"` to its `REGISTRY.json` entry. Keep the
120
- file until a major version bump.
95
+ Removing a template is removing the file and its registry entry in the same change.
121
96
 
122
97
  ---
123
98
 
124
- ## 📚 References
99
+ ## References
125
100
 
126
- - **Registry API:** [`src/core/templates/template-registry.js`](../../src/core/templates/template-registry.js)
101
+ - **Registry:** [`src/core/templates/template-registry.js`](../../src/core/templates/template-registry.js)
127
102
  - **Renderer + helpers:** [`src/core/templates/template-renderer.js`](../../src/core/templates/template-renderer.js)
128
103
  - **Scaffold generator:** [`src/lib/generators/scaffold-generator.js`](../../src/lib/generators/scaffold-generator.js)
129
- - **Stack filtering:** [`src/lib/stack-filter.js`](../../src/lib/stack-filter.js)
130
104
  - **Handlebars docs:** https://handlebarsjs.com/
131
-
132
- ---
133
-
134
- **MORPH-SPEC Template System** — technology-based, registry-indexed, resolved from the package.
@@ -22,18 +22,6 @@
22
22
  "deprecated": false,
23
23
  "validatePlaceholders": true
24
24
  },
25
- {
26
- "id": "design-system-examples",
27
- "kind": "template",
28
- "name": "Design System Examples",
29
- "path": "examples/design-system-examples.md",
30
- "category": "examples",
31
- "description": "Example design system definitions",
32
- "outputName": null,
33
- "placeholders": [],
34
- "deprecated": false,
35
- "validatePlaceholders": true
36
- },
37
25
  {
38
26
  "id": "dotnet-backend-test",
39
27
  "kind": "template",
@@ -86,18 +74,6 @@
86
74
  "deprecated": false,
87
75
  "validatePlaceholders": true
88
76
  },
89
- {
90
- "id": "dotnet-contracts-readme",
91
- "kind": "template",
92
- "name": "Contracts README",
93
- "path": "code/dotnet/contracts/README.md",
94
- "category": "documentation",
95
- "description": "Documentation for contract patterns and usage",
96
- "outputName": "README.md",
97
- "placeholders": [],
98
- "deprecated": false,
99
- "validatePlaceholders": true
100
- },
101
77
  {
102
78
  "id": "dotnet-contracts-vsa",
103
79
  "kind": "template",
@@ -114,21 +90,6 @@
114
90
  "deprecated": false,
115
91
  "validatePlaceholders": true
116
92
  },
117
- {
118
- "id": "typescript-contracts",
119
- "kind": "template",
120
- "name": "TypeScript Contracts",
121
- "path": "code/typescript/contracts.ts",
122
- "category": "code",
123
- "description": "TypeScript type definitions and interfaces",
124
- "outputName": "contracts.ts",
125
- "placeholders": [
126
- "DATE",
127
- "FEATURE_NAME"
128
- ],
129
- "deprecated": false,
130
- "validatePlaceholders": true
131
- },
132
93
  {
133
94
  "id": "sql-postgresql-migration",
134
95
  "kind": "template",
@@ -144,23 +105,6 @@
144
105
  "deprecated": false,
145
106
  "validatePlaceholders": true
146
107
  },
147
- {
148
- "id": "sql-postgresql-migration-enhanced",
149
- "kind": "template",
150
- "name": "PostgreSQL Migration (Enhanced)",
151
- "path": "code/sql/postgresql-migration.template.sql",
152
- "category": "code",
153
- "description": "Enhanced PostgreSQL migration with RLS and indexes",
154
- "outputName": "{timestamp}_{feature_name}_enhanced.sql",
155
- "placeholders": [
156
- "DATE",
157
- "DESCRIPTION",
158
- "FEATURE_NAME_HUMAN",
159
- "TABLE_NAME"
160
- ],
161
- "deprecated": false,
162
- "validatePlaceholders": true
163
- },
164
108
  {
165
109
  "id": "sql-rls-policy",
166
110
  "kind": "template",
@@ -204,18 +148,6 @@
204
148
  "deprecated": false,
205
149
  "validatePlaceholders": true
206
150
  },
207
- {
208
- "id": "docker-dockerfile-generic",
209
- "kind": "template",
210
- "name": "Dockerfile (Generic)",
211
- "path": "infrastructure/docker/Dockerfile.template",
212
- "category": "infrastructure",
213
- "description": "Generic multi-stage Dockerfile template",
214
- "outputName": "Dockerfile",
215
- "placeholders": [],
216
- "deprecated": false,
217
- "validatePlaceholders": true
218
- },
219
151
  {
220
152
  "id": "docker-compose",
221
153
  "kind": "template",
@@ -243,56 +175,6 @@
243
175
  "deprecated": false,
244
176
  "validatePlaceholders": true
245
177
  },
246
- {
247
- "id": "integration-asaas-client",
248
- "kind": "template",
249
- "name": "Asaas Financial Client",
250
- "path": "integrations/asaas-client.cs",
251
- "category": "integration",
252
- "description": "Asaas financial API client implementation",
253
- "outputName": "AsaasClient.cs",
254
- "placeholders": [],
255
- "deprecated": false,
256
- "validatePlaceholders": true
257
- },
258
- {
259
- "id": "integration-asaas-webhook",
260
- "kind": "template",
261
- "name": "Asaas Webhook Handler",
262
- "path": "integrations/asaas-webhook.cs",
263
- "category": "integration",
264
- "description": "Asaas webhook handler for payment events",
265
- "outputName": "AsaasWebhookHandler.cs",
266
- "placeholders": [],
267
- "deprecated": false,
268
- "validatePlaceholders": true
269
- },
270
- {
271
- "id": "integration-neon-auth",
272
- "kind": "template",
273
- "name": "Neon Auth Configuration",
274
- "path": "integrations/neon-auth-config.cs",
275
- "category": "integration",
276
- "description": "Neon Auth (Better Auth) EdDSA/Ed25519 JWT validation for .NET via BouncyCastle — cached JWKS provider + manual SignatureValidator (no OIDC discovery available)",
277
- "outputName": "NeonAuthConfig.cs",
278
- "placeholders": [
279
- "Namespace"
280
- ],
281
- "deprecated": false,
282
- "validatePlaceholders": true
283
- },
284
- {
285
- "id": "ui-design-system-css",
286
- "kind": "template",
287
- "name": "Design System CSS",
288
- "path": "ui/design-system.css",
289
- "category": "ui",
290
- "description": "CSS design tokens and variables (colors, spacing, typography)",
291
- "outputName": "design-system.css",
292
- "placeholders": [],
293
- "deprecated": false,
294
- "validatePlaceholders": true
295
- },
296
178
  {
297
179
  "id": "github-workflow-dotnet-build",
298
180
  "kind": "template",
@@ -331,30 +213,6 @@
331
213
  "deprecated": false,
332
214
  "validatePlaceholders": true
333
215
  },
334
- {
335
- "id": "github-action-docker-build-push",
336
- "kind": "template",
337
- "name": "GitHub Composite Action - Docker Build & Push",
338
- "path": "infrastructure/github/actions/docker-build-push/action.yml.hbs",
339
- "category": "infrastructure",
340
- "description": "Composite action for building and pushing Docker images",
341
- "outputName": "action.yml",
342
- "placeholders": [],
343
- "deprecated": false,
344
- "validatePlaceholders": true
345
- },
346
- {
347
- "id": "github-action-health-check",
348
- "kind": "template",
349
- "name": "GitHub Composite Action - Health Check",
350
- "path": "infrastructure/github/actions/health-check/action.yml.hbs",
351
- "category": "infrastructure",
352
- "description": "Composite action for polling health endpoint until ready",
353
- "outputName": "action.yml",
354
- "placeholders": [],
355
- "deprecated": false,
356
- "validatePlaceholders": true
357
- },
358
216
  {
359
217
  "id": "dotnet-abstractions-handler",
360
218
  "kind": "fragment",
@@ -528,30 +386,6 @@
528
386
  "placeholders": [],
529
387
  "validatePlaceholders": true
530
388
  },
531
- {
532
- "id": "maf-agent-bootstrap",
533
- "kind": "fragment",
534
- "path": "code/dotnet/ai-agents/AgentBootstrap.cs.template",
535
- "category": "ai-agents",
536
- "stack": "dotnet",
537
- "description": "DI extension method to register ModelRegistry + a default MAF agent"
538
- },
539
- {
540
- "id": "maf-embedding-service",
541
- "kind": "fragment",
542
- "path": "code/dotnet/ai-agents/EmbeddingService.cs.template",
543
- "category": "ai-agents",
544
- "stack": "dotnet",
545
- "description": "Generates embeddings for RAG indexing and query via IEmbeddingGenerator"
546
- },
547
- {
548
- "id": "maf-model-registry",
549
- "kind": "fragment",
550
- "path": "code/dotnet/ai-agents/ModelRegistry.cs.template",
551
- "category": "ai-agents",
552
- "stack": "dotnet",
553
- "description": "Reads config/model-registry.json at startup, exposes IChatClient by alias"
554
- },
555
389
  {
556
390
  "id": "maf-prompt-repository",
557
391
  "kind": "fragment",
@@ -560,22 +394,6 @@
560
394
  "stack": "dotnet",
561
395
  "description": "Loads agent system prompts from the agent_prompts table, with caching"
562
396
  },
563
- {
564
- "id": "maf-resilient-tool-middleware",
565
- "kind": "fragment",
566
- "path": "code/dotnet/ai-agents/ResilientToolMiddleware.cs.template",
567
- "category": "ai-agents",
568
- "stack": "dotnet",
569
- "description": "Function-calling middleware: retry/rate-limit resilience + arg validation"
570
- },
571
- {
572
- "id": "maf-vector-search-tool",
573
- "kind": "fragment",
574
- "path": "code/dotnet/ai-agents/VectorSearchTool.cs.template",
575
- "category": "ai-agents",
576
- "stack": "dotnet",
577
- "description": "Typed MAF tool retrieving relevant chunks from the pgvector knowledge base"
578
- },
579
397
  {
580
398
  "id": "ai-kit",
581
399
  "kind": "project",
@@ -584,14 +402,6 @@
584
402
  "stack": "dotnet",
585
403
  "description": "Morph.AiKit — solucao .NET compilavel que prova os standards ai-agents contra framework/ai-pin.json"
586
404
  },
587
- {
588
- "id": "maf-model-registry-config",
589
- "kind": "fragment",
590
- "path": "code/dotnet/ai-agents/model-registry.json.template",
591
- "category": "ai-agents",
592
- "stack": "dotnet",
593
- "description": "config/model-registry.json — single source of truth for model selection"
594
- },
595
405
  {
596
406
  "id": "maf-agent-prompts-migration",
597
407
  "kind": "fragment",
@@ -600,22 +410,6 @@
600
410
  "stack": "dotnet",
601
411
  "description": "SQL migration: agent_prompts table for versioned, runtime-editable prompts"
602
412
  },
603
- {
604
- "id": "maf-pgvector-embeddings-migration",
605
- "kind": "fragment",
606
- "path": "code/sql/ai-agents/pgvector-embeddings-migration.sql.template",
607
- "category": "code",
608
- "stack": "dotnet",
609
- "description": "SQL migration: kb_embeddings table for custom RAG chunk storage with pgvector"
610
- },
611
- {
612
- "id": "dotnet-database-vector-entity",
613
- "kind": "fragment",
614
- "path": "code/dotnet/database/vector-entity.cs",
615
- "category": "code",
616
- "stack": "dotnet",
617
- "description": "pgvector entity + EF Core configuration template"
618
- },
619
413
  {
620
414
  "id": "nextjs-page",
621
415
  "kind": "template",
@@ -3,14 +3,13 @@
3
3
  -- READS STANDARD: ai-agents-prompt-sources
4
4
  -- PLACEHOLDERS:
5
5
  -- {{SCHEMA}} — target schema (default: public)
6
- -- LAST-VERIFIED: 2026-05-19
7
6
 
8
7
  -- ============================================================
9
8
  -- 1. TABLE
10
9
  -- ============================================================
11
10
 
12
11
  CREATE TABLE {{SCHEMA}}.agent_prompts (
13
- id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
12
+ id uuid PRIMARY KEY, -- set by the app (Guid.CreateVersion7()), never a column default
14
13
  agent_key text NOT NULL,
15
14
  version int NOT NULL,
16
15
  content text NOT NULL,
@@ -48,8 +47,8 @@ CREATE UNIQUE INDEX ix_agent_prompts_agent_key_version
48
47
  -- 3. SEED (optional — remove if managed via backoffice)
49
48
  -- ============================================================
50
49
 
51
- -- INSERT INTO {{SCHEMA}}.agent_prompts (agent_key, version, content, is_active)
52
- -- VALUES ('my-agent', 1, 'You are a helpful assistant.', true);
50
+ -- INSERT INTO {{SCHEMA}}.agent_prompts (id, agent_key, version, content, is_active)
51
+ -- VALUES (:'new_id', 'my-agent', 1, 'You are a helpful assistant.', true);
53
52
 
54
53
  -- ============================================================
55
54
  -- ROLLBACK
@@ -16,7 +16,7 @@ Living document. All agents read this before any UI work. All design decisions l
16
16
  - **Motion Personality**: spring-based, purposeful /* CUSTOMIZE */
17
17
  - **Visual Density**: balanced /* CUSTOMIZE */
18
18
  - **Composition**: [TODO: Layout approach — see Domain Patterns below for guidance]
19
- - **Selected Trends**: [TODO: Fill from Step 1.3 trend research — e.g., Bento Grid, Glassmorphism]
19
+ - **Selected Trends**: [TODO: Fill from the trend research — e.g., Bento Grid, Glassmorphism]
20
20
 
21
21
  ---
22
22
 
@@ -44,7 +44,7 @@ Resultado buscado: <o estado depois: o que muda, para quem, como se percebe.>
44
44
  `prova: teste` exige `risco:` regra | dinheiro | contrato | concorrência | dado | regressão; sem risco, `leitura`.
45
45
  `degrau:` migrar | irreversível quando um revert não desfaz (toda migration é migrar); sem a linha, refazer.
46
46
  Cenário que fala de arquivo, grep ou texto exige a linha "> Por que artefato:" logo abaixo.
47
- `título:` é o nome do cenário para o dono (página, next, gate, report): até dez palavras, linguagem de quem usa, sem identificador de código. -->
47
+ `título:` é o nome do cenário para o dono (conversa, report, PR): até dez palavras, linguagem de quem usa, sem identificador de código. -->
48
48
 
49
49
  - **C1** — Dado <estado>, quando <ação>, então <resultado observável>.
50
50
  título: <o que passa a funcionar>
@@ -2,7 +2,7 @@
2
2
  // LIDO POR: Morph.AiKit.Providers.ModelRegistry.FromJson
3
3
  // STANDARD: ai-agents-providers-model-registry
4
4
  //
5
- // O que a v2 acrescenta a v1 (templates/code/dotnet/ai-agents/model-registry.json.template):
5
+ // O que a v2 acrescenta a v1:
6
6
  //
7
7
  // api: protocolo POR ALIAS. Omitido = "responses" (a decisao da casa).
8
8
  // "chat" e opt-in explicito: alguem tem de escrever, e assumir.
@@ -49,7 +49,7 @@ public sealed class MediaDisclosureTests
49
49
  Assert.False(
50
50
  result.IsSuccess,
51
51
  "publicar sem marcacao e o caminho que a obrigacao legal existe para fechar; " +
52
- "se ele existe, a prova de midia do Gate 3 esta presa so por prosa");
52
+ "se ele existe, a prova de midia da revisao esta presa so por prosa");
53
53
  Assert.Equal(MediaErrorCode.InvalidTransition, result.Error!.Code);
54
54
  Assert.Contains("marcacao", result.Error.Message, StringComparison.OrdinalIgnoreCase);
55
55
  }
@@ -19,8 +19,7 @@
19
19
  pelo menos um: uma execucao verde de menos de N casos sai 9. ZERO casos
20
20
  continua saindo 8 (ZeroTests) — o piso NAO supera o veredito 8; a ordem
21
21
  medida e ZeroTests antes da politica (duas vezes em 2026-09-14, com piso
22
- 275 e com piso 1; capturas em test/fixtures/test-output/ na fonte do
23
- morph-spec). Medido em 2026‑09‑08 contra o SDK .NET 10:
22
+ 275 e com piso 1). Medido em 2026‑09‑08 contra o SDK .NET 10:
24
23
  piso 221 → 221 aprovados, exit 0
25
24
  piso 9999 → 115 aprovados, exit 9
26
25
 
@@ -45,8 +44,7 @@
45
44
  VSTest. Medido nos dois locales em 2026-09-08. Um parser escrito so para
46
45
  VSTest (que procure uma linha COMECANDO em "Aprovado!"/"Passed!" e
47
46
  contendo "Total de testes:"/"Total:") nao consegue contar os testes deste
48
- projeto; o `verify` do morph-spec le este bloco nos dois locales desde a
49
- issue #115 (antes, a contagem deste projeto voltava desconhecida). O piso
47
+ projeto; o `morph-spec check` nao le o sumario, julga pelo exit code. O piso
50
48
  acima garante por conta propria que uma descoberta parcial saia com
51
49
  codigo 9 — o eixo que ESTE arquivo controla.
52
50
  -->
@@ -13,23 +13,19 @@ export function {{pascalCase sectionName}}Section() {
13
13
  const containerRef = useRef<HTMLDivElement>(null);
14
14
 
15
15
  useGSAP(() => {
16
- const prefersReducedMotion = window.matchMedia(
17
- '(prefers-reduced-motion: reduce)'
18
- ).matches;
19
-
20
- if (prefersReducedMotion) return;
21
-
22
- gsap.from('.{{kebabCase sectionName}}-item', {
23
- y: 40,
24
- opacity: 0,
25
- stagger: 0.1,
26
- duration: durations.base,
27
- ease: 'power2.out',
28
- scrollTrigger: {
29
- trigger: containerRef.current,
30
- start: 'top 80%',
31
- toggleActions: 'play none none none',
32
- },
16
+ gsap.matchMedia().add('(prefers-reduced-motion: no-preference)', () => {
17
+ gsap.from('.{{kebabCase sectionName}}-item', {
18
+ y: 40,
19
+ autoAlpha: 0,
20
+ stagger: 0.1,
21
+ duration: durations.base,
22
+ ease: 'power2.out',
23
+ scrollTrigger: {
24
+ trigger: containerRef.current,
25
+ start: 'top 80%',
26
+ toggleActions: 'play none none none',
27
+ },
28
+ });
33
29
  });
34
30
  }, { scope: containerRef });
35
31
 
@@ -4,11 +4,10 @@
4
4
 
5
5
  ## Overview
6
6
 
7
- Reusable GitHub Actions workflows and composite actions for the **nextjs-neon** stack (Coolify/Docker deployment).
7
+ Reusable GitHub Actions workflows for a .NET API + Next.js web deployed on Coolify with Docker.
8
8
 
9
9
  **Key Features:**
10
- - Handlebars v2.0 templating with helpers
11
- - Composite actions for shared logic
10
+ - Handlebars templates (`.hbs`)
12
11
  - Docker multi-stage builds (.NET API + Next.js Web)
13
12
  - Coolify deployment via SSH (no MCP/CLI exists — the Coolify API is not publicly exposed, so the runner SSHes into the VPS to trigger it)
14
13
 
@@ -18,14 +17,10 @@ Reusable GitHub Actions workflows and composite actions for the **nextjs-neon**
18
17
 
19
18
  ```
20
19
  infrastructure/github/
21
- ├── workflows/
22
- │ ├── dotnet-build.yml.hbs # .NET restore, build, test, coverage
23
- │ ├── docker-build-push.yml.hbs # Docker build & push to registry
24
- │ └── deploy-coolify.yml.hbs # Coolify deployment via SSH
25
- │
26
- └── actions/
27
- ├── docker-build-push/action.yml.hbs # Build & push Docker image
28
- └── health-check/action.yml.hbs # Poll health endpoint
20
+ └── workflows/
21
+ ├── dotnet-build.yml.hbs # .NET restore, build, test, coverage
22
+ ├── docker-build-push.yml.hbs # Docker build & push to registry
23
+ └── deploy-coolify.yml.hbs # Coolify deployment via SSH
29
24
  ```
30
25
 
31
26
  ## Workflows
@@ -46,10 +41,12 @@ infrastructure/github/
46
41
 
47
42
  ## Usage
48
43
 
49
- Templates are rendered during `morph-spec init` based on project stack configuration.
44
+ Nothing installs these files: read one by its `REGISTRY.json` id and adapt it to the project.
50
45
 
51
46
  ```bash
52
- morph-spec init --stack nextjs-neon
47
+ morph-spec scaffold show github-workflow-dotnet-build
48
+ morph-spec scaffold show github-workflow-docker-build-push
49
+ morph-spec scaffold show github-workflow-deploy-coolify
53
50
  ```
54
51
 
55
52
  ---
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.0",
4
4
  "description": "MORPH-SPEC: NLH (Natural Language Harness) for spec-driven development with Claude Code",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -58,7 +58,7 @@
58
58
  "fs-extra": "^11.2.0",
59
59
  "handlebars": "^4.7.8",
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": {