@polymorphism-tech/morph-spec 9.7.0 → 10.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 (211) hide show
  1. package/CLAUDE.md +11 -11
  2. package/README.md +4 -4
  3. package/bin/morph-spec.js +41 -44
  4. package/claude-plugin.json +1 -1
  5. package/docs/CHEATSHEET.md +1 -1
  6. package/docs/QUICKSTART.md +1 -1
  7. package/framework/CLAUDE.md +24 -30
  8. package/framework/MORPH.md +47 -123
  9. package/framework/agents.json +6 -374
  10. package/framework/commands/morph-apply.md +1 -1
  11. package/framework/commands/morph-archive.md +4 -3
  12. package/framework/commands/morph-hotfix.md +8 -30
  13. package/framework/commands/morph-infra.md +2 -2
  14. package/framework/commands/morph-media.md +10 -9
  15. package/framework/commands/morph-review.md +15 -0
  16. package/framework/commands/morph-status.md +1 -1
  17. package/framework/docs/CLI.md +100 -102
  18. package/framework/evals/review-checklist.md +46 -54
  19. package/framework/hooks/README.md +4 -4
  20. package/framework/hooks/claude-code/__pycache__/statusline.cpython-313.pyc +0 -0
  21. package/framework/hooks/claude-code/core/README.md +1 -1
  22. package/framework/hooks/claude-code/core/denylist.json +4 -4
  23. package/framework/hooks/claude-code/core/gate-guard.js +9 -0
  24. package/framework/hooks/claude-code/core/masked-exit.js +49 -0
  25. package/framework/hooks/claude-code/core/state-sync.js +4 -1
  26. package/framework/hooks/claude-code/core/telemetry-log.js +1 -2
  27. package/framework/hooks/claude-code/core/test-budget.js +10 -70
  28. package/framework/hooks/claude-code/core/validate-completion.js +11 -24
  29. package/framework/hooks/claude-code/core/worktree-context.js +5 -22
  30. package/framework/hooks/claude-code/core/worktree-create.js +6 -45
  31. package/framework/hooks/claude-code/core/worktree-env-inject.js +2 -10
  32. package/framework/hooks/shared/e2e-check.js +0 -0
  33. package/framework/hooks/shared/gate-event.js +2 -2
  34. package/framework/hooks/shared/graph-refresh.js +20 -3
  35. package/framework/hooks/shared/heavy-command.js +32 -1
  36. package/framework/hooks/shared/heavy-config.js +1 -1
  37. package/framework/hooks/shared/heavy-slots.js +41 -4
  38. package/framework/hooks/shared/next-step.js +63 -24
  39. package/framework/hooks/shared/phase-utils.js +6 -9
  40. package/framework/hooks/shared/report-progress.js +86 -0
  41. package/framework/hooks/shared/state-reader.js +3 -2
  42. package/framework/hooks/statusline.js +332 -0
  43. package/framework/phases.json +32 -10
  44. package/framework/rules/ai-agents-standards.md +9 -1
  45. package/framework/rules/csharp-standards.md +4 -0
  46. package/framework/rules/ef-standards.md +20 -0
  47. package/framework/rules/frontend-standards.md +1 -1
  48. package/framework/rules/implement-report.md +25 -0
  49. package/framework/rules/infrastructure-standards.md +2 -0
  50. package/framework/rules/nextjs-standards.md +7 -0
  51. package/framework/rules/plan-grammar.md +53 -0
  52. package/framework/rules/ui-design.md +27 -0
  53. package/framework/schemas/config.schema.json +12 -19
  54. package/framework/schemas/feature.schema.json +7 -1
  55. package/framework/skills/core/create-umbraco-lp/SKILL.md +1 -1
  56. package/framework/skills/core/create-umbraco-lp/references/umbraco-lp-patterns.md +1 -1
  57. package/framework/skills/core/migrate-lp-to-umbraco/SKILL.md +2 -2
  58. package/framework/skills/core/morph-apply/SKILL.md +38 -166
  59. package/framework/skills/core/morph-apply/references/debugging.md +8 -0
  60. package/framework/skills/core/morph-apply/references/hotfix.md +42 -0
  61. package/framework/skills/core/morph-apply/references/machine.md +29 -0
  62. package/framework/skills/core/{morph-media/SKILL.md → morph-apply/references/media.md} +11 -74
  63. package/framework/skills/core/morph-apply/references/review.md +65 -0
  64. package/framework/skills/core/morph-plan/SKILL.md +42 -108
  65. package/framework/skills/core/morph-plan/references/critique.md +40 -0
  66. package/framework/skills/core/morph-plan/references/interview.md +25 -0
  67. package/framework/skills/core/morph-uiux/SKILL.md +47 -64
  68. package/framework/skills/core/morph-uiux/surfaces.json +32 -0
  69. package/framework/standards/STANDARDS.json +32 -5
  70. package/framework/standards/STANDARDS.meta.json +5 -1
  71. package/framework/standards/ai-agents/agent-session.md +2 -3
  72. package/framework/standards/ai-agents/context-providers.md +2 -2
  73. package/framework/standards/ai-agents/durable-workflows-hitl.md +2 -2
  74. package/framework/standards/ai-agents/providers/model-registry.md +2 -2
  75. package/framework/standards/ai-agents/rag-custom-pgvector.md +6 -6
  76. package/framework/standards/ai-agents/setup.md +1 -1
  77. package/framework/standards/ai-agents/tool-adapters.md +2 -2
  78. package/framework/standards/architecture/stack-baseline.md +47 -0
  79. package/framework/standards/backend/integrations/neon-auth/neon-auth.md +2 -4
  80. package/framework/standards/frontend/design-system/ai-image-generation.md +51 -12
  81. package/framework/standards/frontend/design-system/ai-video-generation.md +50 -4
  82. package/framework/standards/frontend/design-system/art-direction.md +2 -2
  83. package/framework/standards/frontend/scroll-driven/frame-scrub.md +12 -2
  84. package/framework/standards/frontend/scroll-driven/scroll-components.md +76 -4
  85. package/framework/templates/.idea/morph-templates.xml +92 -0
  86. package/framework/templates/.vscode/morph-templates.code-snippets +186 -0
  87. package/framework/templates/IDE-SNIPPETS.md +262 -262
  88. package/framework/templates/REGISTRY.json +1 -2
  89. package/framework/templates/code/dotnet/abstractions/api-endpoint.cs +7 -7
  90. package/framework/templates/code/dotnet/feature/request.cs.hbs +4 -4
  91. package/framework/templates/code/dotnet/feature/response.cs.hbs +4 -4
  92. package/framework/templates/code/sql/ai-agents/pgvector-embeddings-migration.sql.template +91 -91
  93. package/framework/templates/context/ARCHITECTURE.md +1 -1
  94. package/framework/templates/docs/plan.md +12 -12
  95. package/framework/templates/docs/ui-mockups.md +17 -105
  96. package/framework/templates/frontend/nextjs/client-component.tsx.hbs +26 -26
  97. package/framework/templates/frontend/nextjs/tsconfig.json.hbs +26 -26
  98. package/framework/templates/infrastructure/docker/Dockerfile.template +58 -58
  99. package/framework/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -38
  100. package/framework/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -48
  101. package/framework/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +45 -45
  102. package/framework/templates/infrastructure/github/actions/health-check/action.yml.hbs +27 -27
  103. package/framework/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +59 -59
  104. package/framework/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +39 -39
  105. package/framework/templates/state.template.json +17 -17
  106. package/framework/templates/ui/design-system.css +226 -226
  107. package/package.json +1 -1
  108. package/src/commands/e2e/e2e.js +88 -23
  109. package/src/commands/graph/diff.js +74 -0
  110. package/src/commands/graph/status.js +1 -1
  111. package/src/commands/observability/cost.js +2 -4
  112. package/src/commands/observability/telemetry.js +1 -1
  113. package/src/commands/project/doctor.js +23 -39
  114. package/src/commands/project/fleet.js +5 -6
  115. package/src/commands/project/init.js +63 -36
  116. package/src/commands/project/stack-scan.js +3 -42
  117. package/src/commands/project/stack-set.js +26 -0
  118. package/src/commands/project/status.js +12 -13
  119. package/src/commands/project/update.js +39 -3
  120. package/src/commands/project/worktree.js +27 -16
  121. package/src/commands/state/advance.js +17 -17
  122. package/src/commands/state/approve.js +0 -6
  123. package/src/commands/state/archive.js +27 -1
  124. package/src/commands/state/auto-approval.js +1 -1
  125. package/src/commands/state/create.js +0 -5
  126. package/src/commands/state/finish.js +43 -1
  127. package/src/commands/state/gate-check.js +37 -30
  128. package/src/commands/state/gate-decision.js +3 -2
  129. package/src/commands/state/next.js +1 -0
  130. package/src/commands/state/recap.js +67 -0
  131. package/src/commands/state/report-check.js +39 -146
  132. package/src/commands/validation/plan-check.js +16 -11
  133. package/src/commands/validation/validate-feature.js +3 -3
  134. package/src/commands/validation/verify.js +6 -6
  135. package/src/core/paths/output-schema.js +3 -3
  136. package/src/core/state/state-manager.js +2 -4
  137. package/src/dashboard/app/components/CommandPalette.jsx +2 -5
  138. package/src/dashboard/app/components/GatePauses.jsx +116 -0
  139. package/src/dashboard/app/components/SessionMap.jsx +77 -0
  140. package/src/dashboard/app/main.jsx +13 -13
  141. package/src/dashboard/app/pages/Activity.jsx +4 -0
  142. package/src/dashboard/app/pages/AgentMap.jsx +1 -2
  143. package/src/dashboard/app/pages/FeatureDetail.jsx +129 -186
  144. package/src/dashboard/app/pages/Features.jsx +7 -7
  145. package/src/dashboard/app/pages/PhasePipeline.jsx +1 -1
  146. package/src/dashboard/app/pages/Portfolio.jsx +40 -5
  147. package/src/dashboard/scanner/activity-scanner.js +29 -0
  148. package/src/dashboard/scanner/agents-scanner.js +11 -14
  149. package/src/dashboard/scanner/features-scanner.js +45 -24
  150. package/src/dashboard/scanner/project-api.js +11 -2
  151. package/src/dashboard/scanner/skills-scanner.js +11 -1
  152. package/src/dashboard/vite.config.js +24 -24
  153. package/src/lib/e2e/applicability.js +3 -1
  154. package/src/lib/git/tree-state.js +1 -16
  155. package/src/lib/graph/diff-tree.js +127 -0
  156. package/src/lib/graph/graphify-runtime.js +12 -5
  157. package/src/lib/heavy/gate.js +22 -1
  158. package/src/lib/installers/memory-installer.js +2 -2
  159. package/src/lib/installers/rules-installer.js +57 -0
  160. package/src/lib/installers/stack-assets.js +17 -0
  161. package/src/lib/installers/stack-sync.js +219 -0
  162. package/src/lib/plan/checks.js +55 -110
  163. package/src/lib/plan/critique.js +28 -0
  164. package/src/lib/plan/media.js +42 -0
  165. package/src/lib/plan/plan-html.js +125 -0
  166. package/src/lib/plan/plan-parser.js +34 -45
  167. package/src/lib/recap/piper.js +36 -0
  168. package/src/lib/recap/recap.js +232 -0
  169. package/src/lib/review-reports.js +33 -7
  170. package/src/lib/risk-detector.js +90 -11
  171. package/src/lib/specs/screen-checklist.js +33 -48
  172. package/src/lib/stack/dotnet-build-ignores.js +8 -9
  173. package/src/lib/tasks/test-nodes.js +24 -6
  174. package/src/lib/tasks/test-runner.js +40 -1
  175. package/src/lib/telemetry/metrics.js +27 -29
  176. package/src/lib/validators/reuse/reuse-validator.js +1 -9
  177. package/src/lib/validators/verify-runner.js +50 -19
  178. package/src/lib/worktree/fleet-scanner.js +7 -20
  179. package/src/lib/worktree/worktree-audit.js +0 -37
  180. package/src/scripts/setup-infra.js +15 -50
  181. package/src/utils/agents-installer.js +27 -201
  182. package/src/utils/hooks-installer.js +11 -95
  183. package/framework/hooks/claude-code/core/warn-bash-source-write.js +0 -23
  184. package/framework/hooks/claude-code/statusline.py +0 -699
  185. package/framework/hooks/claude-code/statusline.sh +0 -11
  186. package/framework/hooks/shared/agent-reap.js +0 -74
  187. package/framework/hooks/shared/slice-progress.js +0 -110
  188. package/framework/skills/core/morph-hotfix/SKILL.md +0 -133
  189. package/framework/skills/core/morph-machine/SKILL.md +0 -46
  190. package/framework/skills/core/morph-review/SKILL.md +0 -129
  191. package/framework/skills/core/morph-standards/SKILL.md +0 -52
  192. package/framework/standards/PROVENANCE.json +0 -119
  193. package/src/commands/project/worktree-reap.js +0 -34
  194. package/src/commands/state/handoff.js +0 -65
  195. package/src/commands/validation/mutate.js +0 -263
  196. package/src/commands/validation/scout-check.js +0 -28
  197. package/src/lib/generators/handoff-generator.js +0 -172
  198. package/src/lib/mutation/adapters.js +0 -79
  199. package/src/lib/mutation/commands.js +0 -61
  200. package/src/lib/mutation/dotnet-introspection.js +0 -281
  201. package/src/lib/mutation/manifest.js +0 -144
  202. package/src/lib/mutation/plan.js +0 -44
  203. package/src/lib/mutation/report.js +0 -68
  204. package/src/lib/mutation/runner.js +0 -301
  205. package/src/lib/mutation/schemata.js +0 -60
  206. package/src/lib/mutation/snapshot.js +0 -65
  207. package/src/lib/mutation/subset.js +0 -109
  208. package/src/lib/mutation/trx.js +0 -50
  209. package/src/lib/scout/scout-check.js +0 -293
  210. package/src/lib/validators/traceability-check.js +0 -103
  211. package/src/lib/worktree/agent-reaper.js +0 -247
@@ -1,262 +1,262 @@
1
- # IDE Snippets for MORPH Templates
2
-
3
- > Boost your productivity with IDE snippets for Handlebars template syntax
4
-
5
- ---
6
-
7
- ## 📦 Installation
8
-
9
- ### VS Code
10
-
11
- **Option 1: Project Snippets (Recommended)**
12
-
13
- Snippets are already configured in `framework/templates/.vscode/morph-templates.code-snippets`.
14
-
15
- To use them:
16
- 1. Open your project in VS Code
17
- 2. Snippets auto-activate when editing template files
18
- 3. Type a prefix (e.g., `morph-pascal`) and press `Tab`
19
-
20
- **Option 2: Global Snippets**
21
-
22
- To use snippets across all projects:
23
- 1. Open VS Code
24
- 2. Go to `File > Preferences > Configure User Snippets`
25
- 3. Select `New Global Snippets file...`
26
- 4. Name it `morph-templates.code-snippets`
27
- 5. Copy content from `framework/templates/.vscode/morph-templates.code-snippets`
28
-
29
- ---
30
-
31
- ### JetBrains IDEs (Rider, WebStorm, IntelliJ IDEA)
32
-
33
- **Installation:**
34
-
35
- 1. Open your IDE
36
- 2. Go to `File > Settings > Editor > Live Templates`
37
- 3. Click the `⚙️` gear icon → `Import Settings...`
38
- 4. Select `framework/templates/.idea/morph-templates.xml`
39
- 5. Click `OK` to import
40
-
41
- **Activation:**
42
-
43
- Snippets will be available in the "MORPH Templates" group. Type the prefix and press `Tab`.
44
-
45
- ---
46
-
47
- ## 🎯 Available Snippets
48
-
49
- ### Handlebars Helpers (Case Transformations)
50
-
51
- | Prefix | Output | Example Result |
52
- |--------|--------|----------------|
53
- | `morph-pascal` | `{{pascalCase FEATURE_NAME}}` | `UserAuthentication` |
54
- | `morph-camel` | `{{camelCase FEATURE_NAME}}` | `userAuthentication` |
55
- | `morph-snake` | `{{snakeCase FEATURE_NAME}}` | `user_authentication` |
56
- | `morph-title` | `{{titleCase FEATURE_NAME}}` | `User Authentication` |
57
- | `morph-kebab` | `{{kebabCase FEATURE_NAME}}` | `user-authentication` |
58
- | `morph-upper-snake` | `{{upperSnakeCase FEATURE_NAME}}` | `USER_AUTHENTICATION` |
59
-
60
- ### Handlebars Control Flow
61
-
62
- | Prefix | Description | Example |
63
- |--------|-------------|---------|
64
- | `morph-if` | If block | `{{#if condition}}...{{/if}}` |
65
- | `morph-if-else` | If-else block | `{{#if condition}}...{{else}}...{{/if}}` |
66
- | `morph-each` | Loop over array | `{{#each items}}{{this.name}}{{/each}}` |
67
- | `morph-unless` | Unless block | `{{#unless condition}}...{{/unless}}` |
68
-
69
- ### .NET Templates
70
-
71
- | Prefix | Template | File Extension |
72
- |--------|----------|----------------|
73
- | `morph-service` | Service class (business logic) | `.cs` |
74
- | `morph-repository` | Repository class (data access) | `.cs` |
75
- | `morph-migration` | EF Core migration | `.cs` |
76
- | `morph-job` | Hangfire background job | `.cs` |
77
-
78
- ### TypeScript Templates
79
-
80
- | Prefix | Template | File Extension |
81
- |--------|----------|----------------|
82
- | `morph-ts-contract` | TypeScript interfaces (DTOs) | `.ts` |
83
-
84
- ---
85
-
86
- ## 🚀 Usage Examples
87
-
88
- ### Example 1: Creating a Service Template
89
-
90
- **Steps:**
91
- 1. Create new file: `UserService.cs`
92
- 2. Type `morph-service` → Press `Tab`
93
- 3. Result:
94
- ```csharp
95
- namespace {{NAMESPACE}}.Application.Features.{{pascalCase FEATURE_NAME}}.Services;
96
-
97
- public class {{pascalCase FEATURE_NAME}}Service(
98
- I{{pascalCase FEATURE_NAME}}Repository repository,
99
- ILogger<{{pascalCase FEATURE_NAME}}Service> logger) : I{{pascalCase FEATURE_NAME}}Service
100
- {
101
- public async Task<{{pascalCase FEATURE_NAME}}Dto?> GetByIdAsync(int id, CancellationToken cancellationToken = default)
102
- {
103
- // Cursor here
104
- }
105
- }
106
- ```
107
-
108
- ### Example 2: Using Case Helpers
109
-
110
- **Scenario:** Convert `user-authentication` to different cases
111
-
112
- ```handlebars
113
- // Type: morph-pascal → Tab
114
- {{pascalCase FEATURE_NAME}} // Output: UserAuthentication
115
-
116
- // Type: morph-camel → Tab
117
- {{camelCase FEATURE_NAME}} // Output: userAuthentication
118
-
119
- // Type: morph-snake → Tab
120
- {{snakeCase FEATURE_NAME}} // Output: user_authentication
121
- ```
122
-
123
- ### Example 3: Conditional Rendering
124
-
125
- **Scenario:** Show different content based on stack
126
-
127
- ```handlebars
128
- // Type: morph-if-else → Tab
129
- {{#if (eq STACK "Nextjs")}}
130
- // Next.js-specific code
131
- {{else}}
132
- // Generic code
133
- {{/if}}
134
- ```
135
-
136
- ### Example 4: Looping Over Items
137
-
138
- **Scenario:** Generate multiple DTOs
139
-
140
- ```handlebars
141
- // Type: morph-each → Tab
142
- {{#each entities}}
143
- public class {{pascalCase this.name}}Dto
144
- {
145
- // Properties
146
- }
147
- {{/each}}
148
- ```
149
-
150
- ---
151
-
152
- ## 📝 Customizing Snippets
153
-
154
- ### VS Code
155
-
156
- Edit `framework/templates/.vscode/morph-templates.code-snippets`:
157
-
158
- ```json
159
- {
160
- "MORPH Template - Custom": {
161
- "prefix": "morph-custom",
162
- "body": [
163
- "// Your custom template",
164
- "$1"
165
- ],
166
- "description": "Your description"
167
- }
168
- }
169
- ```
170
-
171
- ### JetBrains IDEs
172
-
173
- 1. Go to `File > Settings > Editor > Live Templates`
174
- 2. Select "MORPH Templates" group
175
- 3. Click `+` → `Live Template`
176
- 4. Set abbreviation (prefix), description, and template text
177
-
178
- ---
179
-
180
- ## 🎨 Snippet Scopes
181
-
182
- | Snippet | VS Code Scope | JetBrains Scope |
183
- |---------|---------------|-----------------|
184
- | Handlebars helpers | All files | All files |
185
- | .NET templates | `.cs`, `.razor` | C#, HTML |
186
- | TypeScript templates | `.ts`, `.tsx` | TypeScript |
187
-
188
- ---
189
-
190
- ## 💡 Best Practices
191
-
192
- **1. Use Helpers Over Pre-computed Variables**
193
-
194
- ```handlebars
195
- ✅ GOOD: {{pascalCase FEATURE_NAME}}Service
196
- ❌ BAD: {{FEATURE_NAME_PASCAL}}Service // Deprecated
197
- ```
198
-
199
- **2. Chain Helpers for Complex Transformations**
200
-
201
- ```handlebars
202
- // Pluralize a PascalCase name
203
- {{pascalCase (pluralize FEATURE_NAME)}} // Users, Orders, etc.
204
- ```
205
-
206
- **3. Use Conditional Blocks for Stack-Specific Code**
207
-
208
- ```handlebars
209
- {{#if (eq STACK "Nextjs")}}
210
- import { useRouter } from 'next/navigation';
211
- {{/if}}
212
- ```
213
-
214
- **4. Extract Common Patterns to Snippets**
215
-
216
- If you find yourself typing the same template code repeatedly, create a custom snippet!
217
-
218
- ---
219
-
220
- ## 🔧 Troubleshooting
221
-
222
- ### Snippets Not Showing Up (VS Code)
223
-
224
- **Solution:**
225
- 1. Check file extension matches snippet scope (e.g., `.cs` for C# snippets)
226
- 2. Reload VS Code: `Ctrl+Shift+P` → `Developer: Reload Window`
227
- 3. Verify snippet file location: `framework/templates/.vscode/morph-templates.code-snippets`
228
-
229
- ### Snippets Not Showing Up (JetBrains)
230
-
231
- **Solution:**
232
- 1. Verify import: `File > Settings > Editor > Live Templates` → Check "MORPH Templates" group exists
233
- 2. Check snippet scope: Click snippet → Verify "Applicable in" contexts
234
- 3. Restart IDE
235
-
236
- ### Tab Not Expanding Snippet
237
-
238
- **Solution:**
239
- - **VS Code:** Ensure `editor.tabCompletion` is enabled in settings
240
- - **JetBrains:** Ensure `Tab` is set as expansion key in `Settings > Editor > Live Templates`
241
-
242
- ---
243
-
244
- ## 📚 Related Documentation
245
-
246
- - [Template System README](framework/templates/README.md) - Complete template system documentation
247
- - [Handlebars Helpers](framework/templates/README.md#handlebars-helpers) - Full list of available helpers
248
- - [CLI Template Commands](CLAUDE.md#templates) - Command-line template management
249
-
250
- ---
251
-
252
- ## 🎁 Contributing Custom Snippets
253
-
254
- Have a useful snippet? Share it!
255
-
256
- 1. Add snippet to appropriate file (`.vscode/` or `.idea/`)
257
- 2. Document it in this README (add row to tables)
258
- 3. Submit PR with description of use case
259
-
260
- ---
261
-
262
- *MORPH-SPEC Template Snippets by Polymorphism Tech*
1
+ # IDE Snippets for MORPH Templates
2
+
3
+ > Boost your productivity with IDE snippets for Handlebars template syntax
4
+
5
+ ---
6
+
7
+ ## 📦 Installation
8
+
9
+ ### VS Code
10
+
11
+ **Option 1: Project Snippets (Recommended)**
12
+
13
+ Snippets are already configured in `framework/templates/.vscode/morph-templates.code-snippets`.
14
+
15
+ To use them:
16
+ 1. Open your project in VS Code
17
+ 2. Snippets auto-activate when editing template files
18
+ 3. Type a prefix (e.g., `morph-pascal`) and press `Tab`
19
+
20
+ **Option 2: Global Snippets**
21
+
22
+ To use snippets across all projects:
23
+ 1. Open VS Code
24
+ 2. Go to `File > Preferences > Configure User Snippets`
25
+ 3. Select `New Global Snippets file...`
26
+ 4. Name it `morph-templates.code-snippets`
27
+ 5. Copy content from `framework/templates/.vscode/morph-templates.code-snippets`
28
+
29
+ ---
30
+
31
+ ### JetBrains IDEs (Rider, WebStorm, IntelliJ IDEA)
32
+
33
+ **Installation:**
34
+
35
+ 1. Open your IDE
36
+ 2. Go to `File > Settings > Editor > Live Templates`
37
+ 3. Click the `⚙️` gear icon → `Import Settings...`
38
+ 4. Select `framework/templates/.idea/morph-templates.xml`
39
+ 5. Click `OK` to import
40
+
41
+ **Activation:**
42
+
43
+ Snippets will be available in the "MORPH Templates" group. Type the prefix and press `Tab`.
44
+
45
+ ---
46
+
47
+ ## 🎯 Available Snippets
48
+
49
+ ### Handlebars Helpers (Case Transformations)
50
+
51
+ | Prefix | Output | Example Result |
52
+ |--------|--------|----------------|
53
+ | `morph-pascal` | `{{pascalCase FEATURE_NAME}}` | `UserAuthentication` |
54
+ | `morph-camel` | `{{camelCase FEATURE_NAME}}` | `userAuthentication` |
55
+ | `morph-snake` | `{{snakeCase FEATURE_NAME}}` | `user_authentication` |
56
+ | `morph-title` | `{{titleCase FEATURE_NAME}}` | `User Authentication` |
57
+ | `morph-kebab` | `{{kebabCase FEATURE_NAME}}` | `user-authentication` |
58
+ | `morph-upper-snake` | `{{upperSnakeCase FEATURE_NAME}}` | `USER_AUTHENTICATION` |
59
+
60
+ ### Handlebars Control Flow
61
+
62
+ | Prefix | Description | Example |
63
+ |--------|-------------|---------|
64
+ | `morph-if` | If block | `{{#if condition}}...{{/if}}` |
65
+ | `morph-if-else` | If-else block | `{{#if condition}}...{{else}}...{{/if}}` |
66
+ | `morph-each` | Loop over array | `{{#each items}}{{this.name}}{{/each}}` |
67
+ | `morph-unless` | Unless block | `{{#unless condition}}...{{/unless}}` |
68
+
69
+ ### .NET Templates
70
+
71
+ | Prefix | Template | File Extension |
72
+ |--------|----------|----------------|
73
+ | `morph-service` | Service class (business logic) | `.cs` |
74
+ | `morph-repository` | Repository class (data access) | `.cs` |
75
+ | `morph-migration` | EF Core migration | `.cs` |
76
+ | `morph-job` | Hangfire background job | `.cs` |
77
+
78
+ ### TypeScript Templates
79
+
80
+ | Prefix | Template | File Extension |
81
+ |--------|----------|----------------|
82
+ | `morph-ts-contract` | TypeScript interfaces (DTOs) | `.ts` |
83
+
84
+ ---
85
+
86
+ ## 🚀 Usage Examples
87
+
88
+ ### Example 1: Creating a Service Template
89
+
90
+ **Steps:**
91
+ 1. Create new file: `UserService.cs`
92
+ 2. Type `morph-service` → Press `Tab`
93
+ 3. Result:
94
+ ```csharp
95
+ namespace {{NAMESPACE}}.Application.Features.{{pascalCase FEATURE_NAME}}.Services;
96
+
97
+ public class {{pascalCase FEATURE_NAME}}Service(
98
+ I{{pascalCase FEATURE_NAME}}Repository repository,
99
+ ILogger<{{pascalCase FEATURE_NAME}}Service> logger) : I{{pascalCase FEATURE_NAME}}Service
100
+ {
101
+ public async Task<{{pascalCase FEATURE_NAME}}Dto?> GetByIdAsync(int id, CancellationToken cancellationToken = default)
102
+ {
103
+ // Cursor here
104
+ }
105
+ }
106
+ ```
107
+
108
+ ### Example 2: Using Case Helpers
109
+
110
+ **Scenario:** Convert `user-authentication` to different cases
111
+
112
+ ```handlebars
113
+ // Type: morph-pascal → Tab
114
+ {{pascalCase FEATURE_NAME}} // Output: UserAuthentication
115
+
116
+ // Type: morph-camel → Tab
117
+ {{camelCase FEATURE_NAME}} // Output: userAuthentication
118
+
119
+ // Type: morph-snake → Tab
120
+ {{snakeCase FEATURE_NAME}} // Output: user_authentication
121
+ ```
122
+
123
+ ### Example 3: Conditional Rendering
124
+
125
+ **Scenario:** Show different content based on stack
126
+
127
+ ```handlebars
128
+ // Type: morph-if-else → Tab
129
+ {{#if (eq STACK "Nextjs")}}
130
+ // Next.js-specific code
131
+ {{else}}
132
+ // Generic code
133
+ {{/if}}
134
+ ```
135
+
136
+ ### Example 4: Looping Over Items
137
+
138
+ **Scenario:** Generate multiple DTOs
139
+
140
+ ```handlebars
141
+ // Type: morph-each → Tab
142
+ {{#each entities}}
143
+ public class {{pascalCase this.name}}Dto
144
+ {
145
+ // Properties
146
+ }
147
+ {{/each}}
148
+ ```
149
+
150
+ ---
151
+
152
+ ## 📝 Customizing Snippets
153
+
154
+ ### VS Code
155
+
156
+ Edit `framework/templates/.vscode/morph-templates.code-snippets`:
157
+
158
+ ```json
159
+ {
160
+ "MORPH Template - Custom": {
161
+ "prefix": "morph-custom",
162
+ "body": [
163
+ "// Your custom template",
164
+ "$1"
165
+ ],
166
+ "description": "Your description"
167
+ }
168
+ }
169
+ ```
170
+
171
+ ### JetBrains IDEs
172
+
173
+ 1. Go to `File > Settings > Editor > Live Templates`
174
+ 2. Select "MORPH Templates" group
175
+ 3. Click `+` → `Live Template`
176
+ 4. Set abbreviation (prefix), description, and template text
177
+
178
+ ---
179
+
180
+ ## 🎨 Snippet Scopes
181
+
182
+ | Snippet | VS Code Scope | JetBrains Scope |
183
+ |---------|---------------|-----------------|
184
+ | Handlebars helpers | All files | All files |
185
+ | .NET templates | `.cs`, `.razor` | C#, HTML |
186
+ | TypeScript templates | `.ts`, `.tsx` | TypeScript |
187
+
188
+ ---
189
+
190
+ ## 💡 Best Practices
191
+
192
+ **1. Use Helpers Over Pre-computed Variables**
193
+
194
+ ```handlebars
195
+ ✅ GOOD: {{pascalCase FEATURE_NAME}}Service
196
+ ❌ BAD: {{FEATURE_NAME_PASCAL}}Service // Deprecated
197
+ ```
198
+
199
+ **2. Chain Helpers for Complex Transformations**
200
+
201
+ ```handlebars
202
+ // Pluralize a PascalCase name
203
+ {{pascalCase (pluralize FEATURE_NAME)}} // Users, Orders, etc.
204
+ ```
205
+
206
+ **3. Use Conditional Blocks for Stack-Specific Code**
207
+
208
+ ```handlebars
209
+ {{#if (eq STACK "Nextjs")}}
210
+ import { useRouter } from 'next/navigation';
211
+ {{/if}}
212
+ ```
213
+
214
+ **4. Extract Common Patterns to Snippets**
215
+
216
+ If you find yourself typing the same template code repeatedly, create a custom snippet!
217
+
218
+ ---
219
+
220
+ ## 🔧 Troubleshooting
221
+
222
+ ### Snippets Not Showing Up (VS Code)
223
+
224
+ **Solution:**
225
+ 1. Check file extension matches snippet scope (e.g., `.cs` for C# snippets)
226
+ 2. Reload VS Code: `Ctrl+Shift+P` → `Developer: Reload Window`
227
+ 3. Verify snippet file location: `framework/templates/.vscode/morph-templates.code-snippets`
228
+
229
+ ### Snippets Not Showing Up (JetBrains)
230
+
231
+ **Solution:**
232
+ 1. Verify import: `File > Settings > Editor > Live Templates` → Check "MORPH Templates" group exists
233
+ 2. Check snippet scope: Click snippet → Verify "Applicable in" contexts
234
+ 3. Restart IDE
235
+
236
+ ### Tab Not Expanding Snippet
237
+
238
+ **Solution:**
239
+ - **VS Code:** Ensure `editor.tabCompletion` is enabled in settings
240
+ - **JetBrains:** Ensure `Tab` is set as expansion key in `Settings > Editor > Live Templates`
241
+
242
+ ---
243
+
244
+ ## 📚 Related Documentation
245
+
246
+ - [Template System README](framework/templates/README.md) - Complete template system documentation
247
+ - [Handlebars Helpers](framework/templates/README.md#handlebars-helpers) - Full list of available helpers
248
+ - [CLI Template Commands](CLAUDE.md#templates) - Command-line template management
249
+
250
+ ---
251
+
252
+ ## 🎁 Contributing Custom Snippets
253
+
254
+ Have a useful snippet? Share it!
255
+
256
+ 1. Add snippet to appropriate file (`.vscode/` or `.idea/`)
257
+ 2. Document it in this README (add row to tables)
258
+ 3. Submit PR with description of use case
259
+
260
+ ---
261
+
262
+ *MORPH-SPEC Template Snippets by Polymorphism Tech*
@@ -332,10 +332,9 @@
332
332
  "path": "docs/ui-mockups.md",
333
333
  "category": "documentation",
334
334
  "phase": "uiux",
335
- "description": "Wireframes and layout specifications with ASCII mockups and responsive breakpoints",
335
+ "description": "Por tela: protótipo HTML, direção escolhida, checklist de tela de 5 itens, componentes e fluxo",
336
336
  "outputName": "mockups.md",
337
337
  "placeholders": [
338
- "DATE",
339
338
  "FEATURE_NAME"
340
339
  ],
341
340
  "deprecated": false,
@@ -1,7 +1,7 @@
1
- namespace {{pascalCase PROJECT_NAME}}.Abstractions
2
- {
3
- public interface IApiEndpoint
4
- {
5
- void MapEndpoint(IEndpointRouteBuilder app);
6
- }
7
- }
1
+ namespace {{pascalCase PROJECT_NAME}}.Abstractions
2
+ {
3
+ public interface IApiEndpoint
4
+ {
5
+ void MapEndpoint(IEndpointRouteBuilder app);
6
+ }
7
+ }
@@ -1,4 +1,4 @@
1
- namespace {{pascalCase PROJECT_NAME}}.Features.{{pascalCase FEATURE_NAME}}Feature.{{pascalCase SLICE_NAME}};
2
-
3
- // TODO: Add properties matching the {{pascalCase SLICE_NAME}} command
4
- public sealed record {{pascalCase SLICE_NAME}}Request();
1
+ namespace {{pascalCase PROJECT_NAME}}.Features.{{pascalCase FEATURE_NAME}}Feature.{{pascalCase SLICE_NAME}};
2
+
3
+ // TODO: Add properties matching the {{pascalCase SLICE_NAME}} command
4
+ public sealed record {{pascalCase SLICE_NAME}}Request();
@@ -1,4 +1,4 @@
1
- namespace {{pascalCase PROJECT_NAME}}.Features.{{pascalCase FEATURE_NAME}}Feature.{{pascalCase SLICE_NAME}};
2
-
3
- // TODO: Add properties matching the {{pascalCase SLICE_NAME}} response
4
- public sealed record {{pascalCase SLICE_NAME}}Response(Guid Id);
1
+ namespace {{pascalCase PROJECT_NAME}}.Features.{{pascalCase FEATURE_NAME}}Feature.{{pascalCase SLICE_NAME}};
2
+
3
+ // TODO: Add properties matching the {{pascalCase SLICE_NAME}} response
4
+ public sealed record {{pascalCase SLICE_NAME}}Response(Guid Id);