@atlashub/smartstack-cli 3.37.0 → 3.38.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 (216) hide show
  1. package/dist/index.js +16 -24
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +201 -256
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/scripts/extract-api-endpoints.ts +5 -5
  7. package/scripts/generate-doc-with-mock-ui.ts +10 -17
  8. package/templates/agents/ba-reader.md +9 -9
  9. package/templates/agents/ba-writer.md +12 -15
  10. package/templates/agents/code-reviewer.md +1 -1
  11. package/templates/agents/docs-context-reader.md +1 -1
  12. package/templates/agents/gitflow/merge.md +0 -4
  13. package/templates/agents/gitflow/pr.md +0 -4
  14. package/templates/agents/gitflow/start.md +30 -5
  15. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +20 -20
  16. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +16 -24
  17. package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +2 -2
  18. package/templates/skills/_resources/mcp-validate-documentation-spec.md +3 -3
  19. package/templates/skills/_shared.md +15 -17
  20. package/templates/skills/ai-prompt/SKILL.md +1 -1
  21. package/templates/skills/ai-prompt/steps/step-00-init.md +47 -0
  22. package/templates/skills/apex/SKILL.md +3 -4
  23. package/templates/skills/apex/_shared.md +10 -20
  24. package/templates/skills/apex/references/analysis-methods.md +141 -0
  25. package/templates/skills/apex/references/challenge-questions.md +1 -21
  26. package/templates/skills/apex/references/core-seed-data.md +35 -57
  27. package/templates/skills/apex/references/examine-build-validation.md +87 -0
  28. package/templates/skills/apex/references/execution-frontend-gates.md +177 -0
  29. package/templates/skills/apex/references/execution-frontend-patterns.md +105 -0
  30. package/templates/skills/apex/references/execution-layer1-rules.md +96 -0
  31. package/templates/skills/apex/references/initialization-challenge-flow.md +110 -0
  32. package/templates/skills/apex/references/planning-layer-mapping.md +151 -0
  33. package/templates/skills/apex/references/post-checks.md +145 -40
  34. package/templates/skills/apex/references/smartstack-api.md +35 -51
  35. package/templates/skills/apex/references/smartstack-frontend.md +17 -17
  36. package/templates/skills/apex/references/smartstack-layers.md +38 -62
  37. package/templates/skills/apex/steps/step-00-init.md +14 -26
  38. package/templates/skills/apex/steps/step-01-analyze.md +10 -143
  39. package/templates/skills/apex/steps/step-02-plan.md +10 -92
  40. package/templates/skills/apex/steps/step-03-execute.md +47 -249
  41. package/templates/skills/apex/steps/step-04-examine.md +14 -78
  42. package/templates/skills/apex/steps/step-05-deep-review.md +2 -2
  43. package/templates/skills/apex/steps/step-08-run-tests.md +2 -0
  44. package/templates/skills/application/SKILL.md +6 -7
  45. package/templates/skills/application/references/backend-controller-hierarchy.md +16 -16
  46. package/templates/skills/application/references/backend-seeding-and-dto-output.md +83 -0
  47. package/templates/skills/application/references/backend-table-prefix-mapping.md +79 -0
  48. package/templates/skills/application/references/backend-verification.md +1 -1
  49. package/templates/skills/application/references/frontend-i18n-and-output.md +67 -0
  50. package/templates/skills/application/references/frontend-route-naming.md +117 -0
  51. package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +107 -0
  52. package/templates/skills/application/references/frontend-verification.md +12 -12
  53. package/templates/skills/application/references/init-parameter-detection.md +120 -0
  54. package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
  55. package/templates/skills/application/references/nav-fallback-procedure.md +5 -6
  56. package/templates/skills/application/references/provider-template.md +2 -6
  57. package/templates/skills/application/references/roles-client-project-handling.md +55 -0
  58. package/templates/skills/application/references/roles-fallback-procedure.md +149 -0
  59. package/templates/skills/application/references/test-coverage-requirements.md +213 -0
  60. package/templates/skills/application/references/test-frontend.md +3 -3
  61. package/templates/skills/application/steps/step-00-init.md +11 -141
  62. package/templates/skills/application/steps/step-01-navigation.md +3 -3
  63. package/templates/skills/application/steps/step-02-permissions.md +4 -4
  64. package/templates/skills/application/steps/step-03-roles.md +18 -175
  65. package/templates/skills/application/steps/step-03b-provider.md +1 -2
  66. package/templates/skills/application/steps/step-04-backend.md +19 -110
  67. package/templates/skills/application/steps/step-05-frontend.md +17 -143
  68. package/templates/skills/application/steps/step-06-migration.md +12 -60
  69. package/templates/skills/application/steps/step-07-tests.md +9 -76
  70. package/templates/skills/application/templates-backend.md +29 -27
  71. package/templates/skills/application/templates-frontend.md +48 -48
  72. package/templates/skills/application/templates-seed.md +57 -131
  73. package/templates/skills/business-analyse/SKILL.md +27 -30
  74. package/templates/skills/business-analyse/_architecture.md +6 -6
  75. package/templates/skills/business-analyse/_shared.md +60 -88
  76. package/templates/skills/business-analyse/questionnaire/04-data.md +3 -3
  77. package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
  78. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +1 -1
  79. package/templates/skills/business-analyse/react/application-viewer.md +12 -12
  80. package/templates/skills/business-analyse/react/components.md +8 -12
  81. package/templates/skills/business-analyse/react/schema.md +11 -11
  82. package/templates/skills/business-analyse/references/agent-module-prompt.md +2 -3
  83. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +190 -0
  84. package/templates/skills/business-analyse/references/cache-warming-strategy.md +2 -2
  85. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +41 -0
  86. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +74 -0
  87. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +69 -0
  88. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +1 -1
  89. package/templates/skills/business-analyse/references/compilation-structure-cards.md +297 -0
  90. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
  91. package/templates/skills/business-analyse/references/deploy-modes.md +5 -5
  92. package/templates/skills/business-analyse/references/detection-strategies.md +7 -7
  93. package/templates/skills/business-analyse/references/handoff-file-templates.md +14 -22
  94. package/templates/skills/business-analyse/references/handoff-mappings.md +4 -4
  95. package/templates/skills/business-analyse/references/handoff-seeddata-generation.md +312 -0
  96. package/templates/skills/business-analyse/references/init-schema-deployment.md +3 -3
  97. package/templates/skills/business-analyse/references/naming-conventions.md +22 -24
  98. package/templates/skills/business-analyse/references/prd-generation.md +2 -2
  99. package/templates/skills/business-analyse/references/review-data-mapping.md +2 -2
  100. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  101. package/templates/skills/business-analyse/references/spec-auto-inference.md +3 -3
  102. package/templates/skills/business-analyse/references/team-orchestration.md +49 -6
  103. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  104. package/templates/skills/business-analyse/references/ui-resource-cards.md +18 -18
  105. package/templates/skills/business-analyse/references/validate-incremental-html.md +2 -2
  106. package/templates/skills/business-analyse/references/validation-checklist.md +2 -2
  107. package/templates/skills/business-analyse/schemas/application-schema.json +4 -5
  108. package/templates/skills/business-analyse/schemas/project-schema.json +1 -6
  109. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -3
  110. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +4 -4
  111. package/templates/skills/business-analyse/steps/step-00-init.md +8 -17
  112. package/templates/skills/business-analyse/steps/step-01-cadrage.md +35 -198
  113. package/templates/skills/business-analyse/steps/step-01b-applications.md +16 -20
  114. package/templates/skills/business-analyse/steps/step-02-decomposition.md +1 -1
  115. package/templates/skills/business-analyse/steps/step-03a1-setup.md +4 -4
  116. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +1 -1
  117. package/templates/skills/business-analyse/steps/step-03b-ui.md +4 -4
  118. package/templates/skills/business-analyse/steps/step-03c-compile.md +66 -140
  119. package/templates/skills/business-analyse/steps/step-03d-validate.md +2 -2
  120. package/templates/skills/business-analyse/steps/step-04a-collect.md +2 -2
  121. package/templates/skills/business-analyse/steps/step-04b-analyze.md +42 -160
  122. package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
  123. package/templates/skills/business-analyse/steps/step-05a-handoff.md +74 -104
  124. package/templates/skills/business-analyse/steps/step-05b-deploy.md +13 -11
  125. package/templates/skills/business-analyse/steps/step-06-review.md +3 -3
  126. package/templates/skills/business-analyse/templates/tpl-frd.md +13 -13
  127. package/templates/skills/business-analyse/templates/tpl-handoff.md +12 -12
  128. package/templates/skills/business-analyse/templates-frd.md +25 -25
  129. package/templates/skills/business-analyse/templates-react.md +15 -21
  130. package/templates/skills/controller/SKILL.md +1 -1
  131. package/templates/skills/controller/postman-templates.md +1 -1
  132. package/templates/skills/controller/references/controller-code-templates.md +2 -2
  133. package/templates/skills/controller/references/mcp-scaffold-workflow.md +209 -0
  134. package/templates/skills/controller/references/permission-sync-templates.md +13 -16
  135. package/templates/skills/controller/steps/step-00-init.md +11 -11
  136. package/templates/skills/controller/steps/step-03-generate.md +64 -103
  137. package/templates/skills/controller/templates.md +67 -71
  138. package/templates/skills/debug/SKILL.md +13 -218
  139. package/templates/skills/debug/steps/step-00-init.md +57 -0
  140. package/templates/skills/debug/steps/step-01-analyze.md +219 -0
  141. package/templates/skills/debug/steps/step-02-resolve.md +85 -0
  142. package/templates/skills/documentation/SKILL.md +49 -345
  143. package/templates/skills/documentation/data-schema.md +11 -8
  144. package/templates/skills/documentation/steps/step-00-init.md +70 -0
  145. package/templates/skills/documentation/steps/step-01-scan.md +113 -0
  146. package/templates/skills/documentation/steps/step-02-generate.md +231 -0
  147. package/templates/skills/documentation/steps/step-03-validate.md +238 -0
  148. package/templates/skills/documentation/templates.md +480 -322
  149. package/templates/skills/efcore/references/both-contexts.md +32 -0
  150. package/templates/skills/efcore/references/database-operations.md +67 -0
  151. package/templates/skills/efcore/references/destructive-operations.md +38 -0
  152. package/templates/skills/efcore/references/reset-operations.md +81 -0
  153. package/templates/skills/efcore/references/seed-methods.md +86 -0
  154. package/templates/skills/efcore/references/shared-init-functions.md +250 -0
  155. package/templates/skills/efcore/references/sql-objects-injection.md +61 -0
  156. package/templates/skills/efcore/references/troubleshooting.md +81 -0
  157. package/templates/skills/efcore/steps/db/step-deploy.md +1 -32
  158. package/templates/skills/efcore/steps/db/step-reset.md +7 -103
  159. package/templates/skills/efcore/steps/db/step-seed.md +10 -132
  160. package/templates/skills/efcore/steps/db/step-status.md +5 -44
  161. package/templates/skills/efcore/steps/migration/step-03-validate.md +8 -62
  162. package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +1 -57
  163. package/templates/skills/efcore/steps/shared/step-00-init.md +11 -254
  164. package/templates/skills/efcore/steps/squash/step-03-create.md +1 -58
  165. package/templates/skills/feature-full/SKILL.md +1 -1
  166. package/templates/skills/feature-full/steps/step-00-init.md +57 -0
  167. package/templates/skills/feature-full/steps/step-01-implementation.md +1 -1
  168. package/templates/skills/gitflow/SKILL.md +1 -1
  169. package/templates/skills/gitflow/_shared.md +23 -0
  170. package/templates/skills/gitflow/references/commit-message-generation.md +58 -0
  171. package/templates/skills/gitflow/references/commit-migration-validation.md +49 -0
  172. package/templates/skills/gitflow/references/finish-cleanup.md +51 -0
  173. package/templates/skills/gitflow/references/finish-version-bumping.md +45 -0
  174. package/templates/skills/gitflow/references/init-environment-detection.md +41 -0
  175. package/templates/skills/gitflow/references/init-questions.md +185 -0
  176. package/templates/skills/gitflow/references/init-structure-creation.md +71 -0
  177. package/templates/skills/gitflow/references/init-version-detection.md +21 -0
  178. package/templates/skills/gitflow/references/init-workspace-detection.md +43 -0
  179. package/templates/skills/gitflow/references/merge-ci-status.md +36 -0
  180. package/templates/skills/gitflow/references/merge-execution.md +62 -0
  181. package/templates/skills/gitflow/references/merge-pr-context.md +76 -0
  182. package/templates/skills/gitflow/references/pr-build-checks.md +60 -0
  183. package/templates/skills/gitflow/references/pr-generation.md +58 -0
  184. package/templates/skills/gitflow/references/start-branch-normalization.md +28 -0
  185. package/templates/skills/gitflow/references/start-worktree-creation.md +50 -0
  186. package/templates/skills/gitflow/references/sync-push-verify.md +44 -0
  187. package/templates/skills/gitflow/references/sync-rebase-conflicts.md +38 -0
  188. package/templates/skills/gitflow/steps/step-commit.md +12 -91
  189. package/templates/skills/gitflow/steps/step-finish.md +15 -159
  190. package/templates/skills/gitflow/steps/step-init.md +24 -326
  191. package/templates/skills/gitflow/steps/step-merge.md +17 -176
  192. package/templates/skills/gitflow/steps/step-pr.md +10 -116
  193. package/templates/skills/gitflow/steps/step-start.md +16 -109
  194. package/templates/skills/gitflow/steps/step-sync.md +6 -69
  195. package/templates/skills/ralph-loop/SKILL.md +6 -0
  196. package/templates/skills/ralph-loop/references/category-completeness.md +185 -0
  197. package/templates/skills/ralph-loop/references/compact-loop.md +1 -1
  198. package/templates/skills/ralph-loop/references/init-resume-recovery.md +127 -0
  199. package/templates/skills/ralph-loop/references/module-transition.md +151 -0
  200. package/templates/skills/ralph-loop/references/multi-module-queue.md +171 -0
  201. package/templates/skills/ralph-loop/references/parallel-execution.md +246 -0
  202. package/templates/skills/ralph-loop/references/task-transform-legacy.md +6 -9
  203. package/templates/skills/ralph-loop/references/team-orchestration.md +45 -3
  204. package/templates/skills/ralph-loop/steps/step-00-init.md +36 -109
  205. package/templates/skills/ralph-loop/steps/step-01-task.md +15 -163
  206. package/templates/skills/ralph-loop/steps/step-02-execute.md +8 -154
  207. package/templates/skills/ralph-loop/steps/step-04-check.md +21 -73
  208. package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
  209. package/templates/skills/review-code/references/smartstack-conventions.md +11 -11
  210. package/templates/skills/validate-feature/references/api-smoke-tests.md +140 -0
  211. package/templates/skills/validate-feature/references/db-validation-checks.md +180 -0
  212. package/templates/skills/validate-feature/steps/step-01-compile.md +5 -2
  213. package/templates/skills/validate-feature/steps/step-04-api-smoke.md +34 -145
  214. package/templates/skills/validate-feature/steps/step-05-db-validation.md +74 -260
  215. package/templates/skills/workflow/SKILL.md +1 -1
  216. package/templates/skills/workflow/steps/step-00-init.md +57 -0
@@ -16,9 +16,9 @@ next_step: steps/step-04-perms.md
16
16
 
17
17
  ## YOUR TASK
18
18
 
19
- Call the SmartStack MCP `scaffold_extension` tool with type "controller" to generate:
20
- 1. API Controller with NavRoute attribute
21
- 2. DTOs (Response, Create, Update)
19
+ Call the SmartStack MCP `scaffold_extension` tool (TWO calls):
20
+ 1. Generate DTOs (Response, Create, Update)
21
+ 2. Generate API Controller with NavRoute attribute
22
22
 
23
23
  ---
24
24
 
@@ -52,57 +52,52 @@ module: "user-profiles" → entityName: "UserProfile"
52
52
 
53
53
  Based on navigation context extracted from `{permission_path}`:
54
54
 
55
- | Context | Table Prefix | Controller Folder |
56
- |---------|--------------|-------------------|
57
- | platform.administration | `auth_` or `cfg_` | `Admin` |
58
- | platform.support | `support_` | `Support` |
59
- | business.* | `ref_` or domain-specific | `Business` |
60
- | personal.* | `usr_` | `User` |
55
+ | Application | Table Prefix | Controller Folder |
56
+ |-------------|--------------|-------------------|
57
+ | administration | `auth_` or `cfg_` | `Administration` |
58
+ | support | `support_` | `Support` |
59
+ | {application} | `ref_` or domain-specific | `{ApplicationPascal}` |
60
+ | myspace | `usr_` | `MySpace` |
61
61
 
62
62
  ### 3. Call MCP scaffold_extension (TWO CALLS)
63
63
 
64
- **First call: Generate DTOs**
64
+ See `references/mcp-scaffold-workflow.md` for complete MCP workflow, error handling, and post-generation checks.
65
65
 
66
- ```
67
- Tool: mcp__smartstack__scaffold_extension
68
- Args:
69
- type: "dto"
70
- name: "{entityName}" # PascalCase from step 1
71
- options:
72
- navRoute: "{permission_path}" # For proper namespace hierarchy
73
- schema: "core"
66
+ **Call 1: Generate DTOs**
67
+ ```javascript
68
+ mcp__smartstack__scaffold_extension({
69
+ type: "dto",
70
+ name: "{entityName}",
71
+ options: {
72
+ navRoute: "{permission_path}",
73
+ schema: "core",
74
74
  dryRun: false
75
+ }
76
+ });
75
77
  ```
76
78
 
77
- **Second call: Generate Controller with NavRoute**
78
-
79
- ```
80
- Tool: mcp__smartstack__scaffold_extension
81
- Args:
82
- type: "controller"
83
- name: "{entityName}" # PascalCase from step 1
84
- options:
85
- navRoute: "{permission_path}" # MANDATORY for NavRoute attribute
86
- navRouteSuffix: null # Optional (e.g., "details" → [NavRoute("path", Suffix = "details")])
79
+ **Call 2: Generate Controller**
80
+ ```javascript
81
+ mcp__smartstack__scaffold_extension({
82
+ type: "controller",
83
+ name: "{entityName}",
84
+ options: {
85
+ navRoute: "{permission_path}", // MANDATORY for NavRoute attribute
86
+ navRouteSuffix: null,
87
87
  dryRun: false
88
+ }
89
+ });
88
90
  ```
89
91
 
90
- **CRITICAL: NavRoute is MANDATORY** - Without it, frontend/backend sync will fail.
91
-
92
- **Why two calls?**
93
- - The skill `/controller` assumes the Entity already exists (verified in step-01-analyze.md)
94
- - Type "dto" generates DTOs without regenerating the Entity
95
- - Type "controller" generates the Controller with NavRoute and references to DTOs
96
-
97
92
  ### 4. Parse MCP Responses
98
93
 
99
94
  **From first call (DTOs):**
100
- - `Application/{Context}/{Application}/{Module}/DTOs/{entityName}ResponseDto.cs` - Response DTO
101
- - `Application/{Context}/{Application}/{Module}/DTOs/Create{entityName}Dto.cs` - Create request
102
- - `Application/{Context}/{Application}/{Module}/DTOs/Update{entityName}Dto.cs` - Update request
95
+ - `Application/{Application}/{Module}/DTOs/{entityName}ResponseDto.cs`
96
+ - `Application/{Application}/{Module}/DTOs/Create{entityName}Dto.cs`
97
+ - `Application/{Application}/{Module}/DTOs/Update{entityName}Dto.cs`
103
98
 
104
99
  **From second call (Controller):**
105
- - `Api/Controllers/{area}/{entityName}Controller.cs` - REST Controller **with [NavRoute]**
100
+ - `Api/Controllers/{area}/{entityName}Controller.cs` with **[NavRoute]** attribute
106
101
 
107
102
  ### 5. Present Output to User
108
103
 
@@ -112,27 +107,19 @@ Args:
112
107
  ### API Layer
113
108
  - `Controllers/{area}/{entityName}Controller.cs`
114
109
  - **NavRoute: `{permission_path}`** ✅
115
- - Endpoints:
116
- - GET /api/{module} - List all
117
- - GET /api/{module}/{id} - Get by ID
118
- - POST /api/{module} - Create
119
- - PUT /api/{module}/{id} - Update
120
- - DELETE /api/{module}/{id} - Delete
110
+ - Endpoints: GET /api/{module}, POST, PUT, DELETE
121
111
 
122
112
  ### Application Layer (DTOs)
123
- - `{Context}/{Application}/{Module}/DTOs/{entityName}ResponseDto.cs`
124
- - `{Context}/{Application}/{Module}/DTOs/Create{entityName}Dto.cs`
125
- - `{Context}/{Application}/{Module}/DTOs/Update{entityName}Dto.cs`
113
+ - `{entityName}ResponseDto.cs`
114
+ - `Create{entityName}Dto.cs`
115
+ - `Update{entityName}Dto.cs`
126
116
 
127
117
  ### ✅ NavRoute Integration
128
- The controller uses `[NavRoute("{permission_path}")]` which enables:
129
- - Automatic frontend route generation
130
- - Permission-based navigation sync
131
- - ✅ Dynamic API routing from Navigation entities
132
-
133
- ### Next Steps
134
- 1. Permissions will be synchronized in step-04-perms.md
135
- 2. Validate conventions with MCP `validate_conventions`
118
+ - [NavRoute("{permission_path}")] attribute present
119
+ - Frontend/backend sync enabled
120
+ - Permission-based navigation ready
121
+
122
+ Next: step-04-perms.md
136
123
  ```
137
124
 
138
125
  ---
@@ -141,86 +128,60 @@ The controller uses `[NavRoute("{permission_path}")]` which enables:
141
128
 
142
129
  ### Success Case
143
130
 
144
- **After first call (DTOs):**
131
+ **After Call 1 (DTOs):**
145
132
  - Display all generated DTO files
146
133
  - Verify DTOs match entity properties
147
- - Continue to second call
134
+ - Continue to Call 2
148
135
 
149
- **After second call (Controller):**
150
- - Display controller file
151
- - Show NavRoute attribute included
152
- - Highlight frontend/backend sync enabled
153
- - Store controller info for permission sync
136
+ **After Call 2 (Controller):**
137
+ - Display controller file with NavRoute
138
+ - Show frontend/backend sync enabled
154
139
  - Proceed to step-04-perms.md
155
140
 
156
141
  ### Error Case
157
142
 
158
- **If first call (DTOs) fails:**
143
+ **If Call 1 (DTOs) fails:**
159
144
  - Display error message
160
- - Suggest checking entity name format
145
+ - Suggest checking entity name format (must be PascalCase)
161
146
  - Verify entity properties are defined
162
- - Verify MCP server is running (`/mcp:healthcheck`)
163
- - Do NOT proceed to second call
147
+ - Do NOT proceed to Call 2
164
148
 
165
- **If second call (Controller) fails:**
149
+ **If Call 2 (Controller) fails:**
166
150
  - Display error message
167
151
  - Note that DTOs were generated successfully
168
152
  - Suggest checking navRoute format
169
- - Verify MCP server is running (`/mcp:healthcheck`)
170
153
  - Do NOT proceed to step-04-perms.md
171
154
 
172
155
  ---
173
156
 
174
157
  ## NAVROUTE VALIDATION
175
158
 
176
- **After generation, verify NavRoute is present:**
159
+ Verify NavRoute is present (from `references/mcp-scaffold-workflow.md`):
177
160
 
161
+ ```javascript
162
+ if (!controllerContent.includes('[NavRoute(')) {
163
+ console.error(`NavRoute attribute NOT FOUND`);
164
+ console.error(`Expected: [NavRoute("${permission_path}")]`);
165
+ STOP;
166
+ }
178
167
  ```
179
- Generated controller MUST contain:
180
- [NavRoute("{permission_path}")]
181
168
 
182
- WITHOUT NavRoute:
183
- ❌ Frontend routes will be hardcoded
184
- ❌ No automatic permission sync
185
- ❌ Manual navigation management required
186
- ```
187
-
188
- ---
189
-
190
- ## OUTPUT FORMAT:
191
-
192
- ```
193
- Generated Files:
194
-
195
- | File | Path | Status |
196
- |------|------|--------|
197
- | Controller | src/.../Controllers/{area}/{entity}Controller.cs | ✅ Created with [NavRoute] |
198
- | CreateDto | src/.../DTOs/{module}/{entity}CreateDto.cs | ✅ Created |
199
- | UpdateDto | src/.../DTOs/{module}/{entity}UpdateDto.cs | ✅ Created |
200
- | ResponseDto | src/.../DTOs/{module}/{entity}ResponseDto.cs | ✅ Created |
201
-
202
- -> Synchronizing permissions...
203
- ```
169
+ Without NavRoute:
170
+ - ❌ Frontend routes hardcoded
171
+ - ❌ No automatic permission sync
172
+ - ❌ Manual navigation required
204
173
 
205
174
  ---
206
175
 
207
176
  ## SUCCESS METRICS
208
177
 
209
- - MCP scaffold_extension called successfully (DTOs)
178
+ - MCP scaffold_extension called twice (DTOs, then Controller)
210
179
  - DTOs generated (ResponseDto, CreateDto, UpdateDto)
211
- - MCP scaffold_extension called successfully (Controller)
212
180
  - Controller generated with **[NavRoute]** attribute
213
181
  - NavRoute matches permission_path
214
182
  - Controller references DTOs correctly
215
183
  - Proceeded to step-04-perms.md
216
184
 
217
- ## FAILURE MODES
218
-
219
- - MCP call failed (display error, run /mcp:healthcheck, stop)
220
- - Invalid entity name (must be PascalCase)
221
- - Invalid navRoute format
222
- - MCP server not running
223
-
224
185
  ---
225
186
 
226
187
  ## NEXT STEP:
@@ -585,8 +585,8 @@ var {module}ModuleId = Guid.Parse("{MODULE-GUID}"); // Get from ModuleConfigura
585
585
  // STEP 2: Add permissions (HasData)
586
586
  // ============================================
587
587
 
588
- // Pattern: {context}.{application}.{module}.{action}
589
- // Example: platform.administration.users.read
588
+ // Pattern: {application}.{module}.{action}
589
+ // Example: administration.users.read
590
590
 
591
591
  var seedDate = new DateTime(2024, 1, 1, 0, 0, 0, DateTimeKind.Utc);
592
592
 
@@ -595,7 +595,7 @@ builder.HasData(
595
595
  new
596
596
  {
597
597
  Id = Guid.Parse("{NOUVEAU-GUID-1}"),
598
- Path = "{context}.{application}.{module}.*",
598
+ Path = "{application}.{module}.*",
599
599
  Level = PermissionLevel.Module,
600
600
  Action = (PermissionAction?)null,
601
601
  IsWildcard = true,
@@ -608,7 +608,7 @@ builder.HasData(
608
608
  new
609
609
  {
610
610
  Id = Guid.Parse("{NOUVEAU-GUID-2}"),
611
- Path = "{context}.{application}.{module}.read",
611
+ Path = "{application}.{module}.read",
612
612
  Level = PermissionLevel.Module,
613
613
  Action = PermissionAction.Read,
614
614
  IsWildcard = false,
@@ -621,7 +621,7 @@ builder.HasData(
621
621
  new
622
622
  {
623
623
  Id = Guid.Parse("{NOUVEAU-GUID-3}"),
624
- Path = "{context}.{application}.{module}.create",
624
+ Path = "{application}.{module}.create",
625
625
  Level = PermissionLevel.Module,
626
626
  Action = PermissionAction.Create,
627
627
  IsWildcard = false,
@@ -634,7 +634,7 @@ builder.HasData(
634
634
  new
635
635
  {
636
636
  Id = Guid.Parse("{NOUVEAU-GUID-4}"),
637
- Path = "{context}.{application}.{module}.update",
637
+ Path = "{application}.{module}.update",
638
638
  Level = PermissionLevel.Module,
639
639
  Action = PermissionAction.Update,
640
640
  IsWildcard = false,
@@ -647,7 +647,7 @@ builder.HasData(
647
647
  new
648
648
  {
649
649
  Id = Guid.Parse("{NOUVEAU-GUID-5}"),
650
- Path = "{context}.{application}.{module}.delete",
650
+ Path = "{application}.{module}.delete",
651
651
  Level = PermissionLevel.Module,
652
652
  Action = PermissionAction.Delete,
653
653
  IsWildcard = false,
@@ -683,13 +683,13 @@ uuidgen | tr '[:upper:]' '[:lower:]'
683
683
  │ │
684
684
  │ Permissions.cs PermissionConfiguration.cs │
685
685
  │ ────────────────────────────── ────────────────────────────────────── │
686
- │ Permissions.Support.Tickets.View → Path = "platform.support.tickets.read"│
687
- │ Permissions.Support.Tickets.Create→ Path = "platform.support.tickets.create"│
688
- │ Permissions.Support.Tickets.Update→ Path = "platform.support.tickets.update"│
689
- │ Permissions.Support.Tickets.Delete→ Path = "platform.support.tickets.delete"│
686
+ │ Permissions.Support.Tickets.View → Path = "support.tickets.read"│
687
+ │ Permissions.Support.Tickets.Create→ Path = "support.tickets.create"│
688
+ │ Permissions.Support.Tickets.Update→ Path = "support.tickets.update"│
689
+ │ Permissions.Support.Tickets.Delete→ Path = "support.tickets.delete"│
690
690
  │ │
691
691
  │ WARNING: COMMON ERROR: │
692
- │ - Permissions.cs: "platform.support.tickets.read" │
692
+ │ - Permissions.cs: "support.tickets.read" │
693
693
  │ - PermissionConfiguration.cs: MISSING │
694
694
  │ → Result: 403 Forbidden for ALL users │
695
695
  │ │
@@ -845,7 +845,7 @@ _logger.LogInformation(
845
845
 
846
846
  ---
847
847
 
848
- ## Template Section-Level Permissions (Level 4)
848
+ ## Template Section-Level Permissions (Level 3)
849
849
 
850
850
  > **Usage:** When a Module has multiple sub-pages/tabs with different permissions (ex: AI → Dashboard, Settings, Prompts)
851
851
 
@@ -858,14 +858,14 @@ public static class Admin
858
858
  {
859
859
  public static class {Module}
860
860
  {
861
- // Section permissions (Level 4)
861
+ // Section permissions (Level 3)
862
862
  public static class {Section}
863
863
  {
864
- public const string View = "{context}.{application}.{module}.{section}.read";
865
- public const string Create = "{context}.{application}.{module}.{section}.create";
866
- public const string Update = "{context}.{application}.{module}.{section}.update";
867
- public const string Delete = "{context}.{application}.{module}.{section}.delete";
868
- public const string Execute = "{context}.{application}.{module}.{section}.execute";
864
+ public const string View = "{application}.{module}.{section}.read";
865
+ public const string Create = "{application}.{module}.{section}.create";
866
+ public const string Update = "{application}.{module}.{section}.update";
867
+ public const string Delete = "{application}.{module}.{section}.delete";
868
+ public const string Execute = "{application}.{module}.{section}.execute";
869
869
  }
870
870
  }
871
871
  }
@@ -885,18 +885,18 @@ public static class Admin
885
885
  var {section}SectionId = Guid.Parse("{SECTION-GUID}");
886
886
 
887
887
  // ============================================
888
- // STEP 2: Add Section permissions (Level 4)
888
+ // STEP 2: Add Section permissions (Level 3)
889
889
  // ============================================
890
890
 
891
- // Pattern: {context}.{application}.{module}.{section}.{action}
892
- // Example: platform.administration.ai.settings.read
891
+ // Pattern: {application}.{module}.{section}.{action}
892
+ // Example: administration.ai.settings.read
893
893
 
894
894
  builder.HasData(
895
895
  // Wildcard permission (full section access)
896
896
  new
897
897
  {
898
898
  Id = Guid.Parse("{NOUVEAU-GUID-1}"),
899
- Path = "{context}.{application}.{module}.{section}.*",
899
+ Path = "{application}.{module}.{section}.*",
900
900
  Level = PermissionLevel.Section,
901
901
  Action = (PermissionAction?)null,
902
902
  IsWildcard = true,
@@ -909,7 +909,7 @@ builder.HasData(
909
909
  new
910
910
  {
911
911
  Id = Guid.Parse("{NOUVEAU-GUID-2}"),
912
- Path = "{context}.{application}.{module}.{section}.read",
912
+ Path = "{application}.{module}.{section}.read",
913
913
  Level = PermissionLevel.Section,
914
914
  Action = PermissionAction.Read,
915
915
  IsWildcard = false,
@@ -922,7 +922,7 @@ builder.HasData(
922
922
  new
923
923
  {
924
924
  Id = Guid.Parse("{NOUVEAU-GUID-3}"),
925
- Path = "{context}.{application}.{module}.{section}.create",
925
+ Path = "{application}.{module}.{section}.create",
926
926
  Level = PermissionLevel.Section,
927
927
  Action = PermissionAction.Create,
928
928
  IsWildcard = false,
@@ -935,7 +935,7 @@ builder.HasData(
935
935
  new
936
936
  {
937
937
  Id = Guid.Parse("{NOUVEAU-GUID-4}"),
938
- Path = "{context}.{application}.{module}.{section}.update",
938
+ Path = "{application}.{module}.{section}.update",
939
939
  Level = PermissionLevel.Section,
940
940
  Action = PermissionAction.Update,
941
941
  IsWildcard = false,
@@ -948,7 +948,7 @@ builder.HasData(
948
948
  new
949
949
  {
950
950
  Id = Guid.Parse("{NOUVEAU-GUID-5}"),
951
- Path = "{context}.{application}.{module}.{section}.delete",
951
+ Path = "{application}.{module}.{section}.delete",
952
952
  Level = PermissionLevel.Section,
953
953
  Action = PermissionAction.Delete,
954
954
  IsWildcard = false,
@@ -961,7 +961,7 @@ builder.HasData(
961
961
  new
962
962
  {
963
963
  Id = Guid.Parse("{NOUVEAU-GUID-6}"),
964
- Path = "{context}.{application}.{module}.{section}.execute",
964
+ Path = "{application}.{module}.{section}.execute",
965
965
  Level = PermissionLevel.Section,
966
966
  Action = PermissionAction.Execute,
967
967
  IsWildcard = false,
@@ -974,7 +974,7 @@ builder.HasData(
974
974
 
975
975
  ---
976
976
 
977
- ## Template Resource-Level Permissions (Level 5)
977
+ ## Template Resource-Level Permissions (Level 4)
978
978
 
979
979
  > **Usage:** For the finest granularity level (ex: Prompts → Blocks, Users → Profiles)
980
980
  > **CRITICAL:** Used when a Section contains sub-resources with distinct permissions
@@ -992,13 +992,13 @@ public static class Admin
992
992
  {
993
993
  // Section-level permissions...
994
994
 
995
- // Resource permissions (Level 5 - finest granularity)
995
+ // Resource permissions (Level 4 - finest granularity)
996
996
  public static class {Resource}
997
997
  {
998
- public const string View = "{context}.{application}.{module}.{section}.{resource}.read";
999
- public const string Create = "{context}.{application}.{module}.{section}.{resource}.create";
1000
- public const string Update = "{context}.{application}.{module}.{section}.{resource}.update";
1001
- public const string Delete = "{context}.{application}.{module}.{section}.{resource}.delete";
998
+ public const string View = "{application}.{module}.{section}.{resource}.read";
999
+ public const string Create = "{application}.{module}.{section}.{resource}.create";
1000
+ public const string Update = "{application}.{module}.{section}.{resource}.update";
1001
+ public const string Delete = "{application}.{module}.{section}.{resource}.delete";
1002
1002
  }
1003
1003
  }
1004
1004
  }
@@ -1019,18 +1019,18 @@ public static class Admin
1019
1019
  var {resource}ResourceId = Guid.Parse("{RESOURCE-GUID}");
1020
1020
 
1021
1021
  // ============================================
1022
- // STEP 2: Add Resource permissions (Level 5)
1022
+ // STEP 2: Add Resource permissions (Level 4)
1023
1023
  // ============================================
1024
1024
 
1025
- // Pattern: {context}.{application}.{module}.{section}.{resource}.{action}
1026
- // Example: platform.administration.ai.prompts.blocks.read
1025
+ // Pattern: {application}.{module}.{section}.{resource}.{action}
1026
+ // Example: administration.ai.prompts.blocks.read
1027
1027
 
1028
1028
  builder.HasData(
1029
1029
  // Wildcard permission (full resource access)
1030
1030
  new
1031
1031
  {
1032
1032
  Id = Guid.Parse("{NOUVEAU-GUID-1}"),
1033
- Path = "{context}.{application}.{module}.{section}.{resource}.*",
1033
+ Path = "{application}.{module}.{section}.{resource}.*",
1034
1034
  Level = PermissionLevel.Resource,
1035
1035
  Action = (PermissionAction?)null,
1036
1036
  IsWildcard = true,
@@ -1043,7 +1043,7 @@ builder.HasData(
1043
1043
  new
1044
1044
  {
1045
1045
  Id = Guid.Parse("{NOUVEAU-GUID-2}"),
1046
- Path = "{context}.{application}.{module}.{section}.{resource}.read",
1046
+ Path = "{application}.{module}.{section}.{resource}.read",
1047
1047
  Level = PermissionLevel.Resource,
1048
1048
  Action = PermissionAction.Read,
1049
1049
  IsWildcard = false,
@@ -1056,7 +1056,7 @@ builder.HasData(
1056
1056
  new
1057
1057
  {
1058
1058
  Id = Guid.Parse("{NOUVEAU-GUID-3}"),
1059
- Path = "{context}.{application}.{module}.{section}.{resource}.create",
1059
+ Path = "{application}.{module}.{section}.{resource}.create",
1060
1060
  Level = PermissionLevel.Resource,
1061
1061
  Action = PermissionAction.Create,
1062
1062
  IsWildcard = false,
@@ -1069,7 +1069,7 @@ builder.HasData(
1069
1069
  new
1070
1070
  {
1071
1071
  Id = Guid.Parse("{NOUVEAU-GUID-4}"),
1072
- Path = "{context}.{application}.{module}.{section}.{resource}.update",
1072
+ Path = "{application}.{module}.{section}.{resource}.update",
1073
1073
  Level = PermissionLevel.Resource,
1074
1074
  Action = PermissionAction.Update,
1075
1075
  IsWildcard = false,
@@ -1082,7 +1082,7 @@ builder.HasData(
1082
1082
  new
1083
1083
  {
1084
1084
  Id = Guid.Parse("{NOUVEAU-GUID-5}"),
1085
- Path = "{context}.{application}.{module}.{section}.{resource}.delete",
1085
+ Path = "{application}.{module}.{section}.{resource}.delete",
1086
1086
  Level = PermissionLevel.Resource,
1087
1087
  Action = PermissionAction.Delete,
1088
1088
  IsWildcard = false,
@@ -1130,7 +1130,7 @@ public static class {Module}
1130
1130
  new
1131
1131
  {
1132
1132
  Id = Guid.Parse("{NOUVEAU-GUID-BULK-1}"),
1133
- Path = "{context}.{application}.{module}.bulk-create",
1133
+ Path = "{application}.{module}.bulk-create",
1134
1134
  Level = PermissionLevel.Module,
1135
1135
  Action = PermissionAction.Create,
1136
1136
  IsWildcard = false,
@@ -1143,7 +1143,7 @@ new
1143
1143
  new
1144
1144
  {
1145
1145
  Id = Guid.Parse("{NOUVEAU-GUID-BULK-2}"),
1146
- Path = "{context}.{application}.{module}.bulk-update",
1146
+ Path = "{application}.{module}.bulk-update",
1147
1147
  Level = PermissionLevel.Module,
1148
1148
  Action = PermissionAction.Update,
1149
1149
  IsWildcard = false,
@@ -1156,7 +1156,7 @@ new
1156
1156
  new
1157
1157
  {
1158
1158
  Id = Guid.Parse("{NOUVEAU-GUID-BULK-3}"),
1159
- Path = "{context}.{application}.{module}.bulk-delete",
1159
+ Path = "{application}.{module}.bulk-delete",
1160
1160
  Level = PermissionLevel.Module,
1161
1161
  Action = PermissionAction.Delete,
1162
1162
  IsWildcard = false,
@@ -1169,7 +1169,7 @@ new
1169
1169
  new
1170
1170
  {
1171
1171
  Id = Guid.Parse("{NOUVEAU-GUID-EXPORT}"),
1172
- Path = "{context}.{application}.{module}.export",
1172
+ Path = "{application}.{module}.export",
1173
1173
  Level = PermissionLevel.Module,
1174
1174
  Action = PermissionAction.Execute,
1175
1175
  IsWildcard = false,
@@ -1182,7 +1182,7 @@ new
1182
1182
  new
1183
1183
  {
1184
1184
  Id = Guid.Parse("{NOUVEAU-GUID-IMPORT}"),
1185
- Path = "{context}.{application}.{module}.import",
1185
+ Path = "{application}.{module}.import",
1186
1186
  Level = PermissionLevel.Module,
1187
1187
  Action = PermissionAction.Create,
1188
1188
  IsWildcard = false,
@@ -1419,26 +1419,22 @@ public record BulkUpdate{Entity}Request(
1419
1419
  │ COMPLETE PERMISSIONS HIERARCHY │
1420
1420
  ├─────────────────────────────────────────────────────────────────────────────────┤
1421
1421
  │ │
1422
- │ Level 1: CONTEXT
1423
- │ └─ Path: {context}.*
1424
- │ └─ Ex: platform.* → Full platform context access
1422
+ │ Level 1: APPLICATION
1423
+ │ └─ Path: {application}.*
1424
+ │ └─ Ex: administration.* → Full administration access
1425
1425
  │ │
1426
- │ Level 2: APPLICATION
1427
- │ └─ Path: {context}.{application}.*
1428
- │ └─ Ex: platform.administration.*Full administration access
1426
+ │ Level 2: MODULE
1427
+ │ └─ Path: {application}.{module}.{action}
1428
+ │ └─ Ex: administration.users.readRead users
1429
+ │ └─ BULK: administration.users.bulk-create → Batch create │
1429
1430
  │ │
1430
- │ Level 3: MODULE
1431
- │ └─ Path: {context}.{application}.{module}.{action} │
1432
- │ └─ Ex: platform.administration.users.readRead users
1433
- │ └─ BULK: platform.administration.users.bulk-create → Batch create │
1431
+ │ Level 3: SECTION
1432
+ │ └─ Path: {application}.{module}.{section}.{action} │
1433
+ │ └─ Ex: administration.ai.settings.updateUpdate AI settings
1434
1434
  │ │
1435
- │ Level 4: SECTION
1436
- │ └─ Path: {context}.{application}.{module}.{section}.{action}
1437
- │ └─ Ex: platform.administration.ai.settings.updateUpdate AI settings
1438
- │ │
1439
- │ Level 5: RESOURCE (finest granularity) │
1440
- │ └─ Path: {context}.{application}.{module}.{section}.{resource}.{action} │
1441
- │ └─ Ex: platform.administration.ai.prompts.blocks.delete → Delete blocks │
1435
+ │ Level 4: RESOURCE (finest granularity)
1436
+ │ └─ Path: {application}.{module}.{section}.{resource}.{action}
1437
+ │ └─ Ex: administration.ai.prompts.blocks.deleteDelete blocks
1442
1438
  │ │
1443
1439
  └─────────────────────────────────────────────────────────────────────────────────┘
1444
1440
  ```
@@ -1474,9 +1470,9 @@ public record BulkUpdate{Entity}Request(
1474
1470
  □ See API Versioning section below
1475
1471
 
1476
1472
  □ Correct Permission Level
1477
- □ Module (Level 3) - For main CRUD
1478
- □ Section (Level 4) - If sub-pages with different permissions
1479
- □ Resource (Level 5) - If sub-resources with distinct permissions
1473
+ □ Module (Level 2) - For main CRUD
1474
+ □ Section (Level 3) - If sub-pages with different permissions
1475
+ □ Resource (Level 4) - If sub-resources with distinct permissions
1480
1476
  ```
1481
1477
 
1482
1478
  ---
@@ -1509,22 +1505,22 @@ builder.Services.AddApiVersioning(options =>
1509
1505
  // v1 - Default (no attribute needed if only one version exists)
1510
1506
  [ApiController]
1511
1507
  [ApiVersion("1.0")]
1512
- [NavRoute("business.crm.contacts")]
1508
+ [NavRoute("crm.contacts")]
1513
1509
  public class ContactsController : ControllerBase
1514
1510
  {
1515
1511
  [HttpGet]
1516
- [RequirePermission(Permissions.Business.Crm.Contacts.Read)]
1512
+ [RequirePermission(Permissions.Crm.Contacts.Read)]
1517
1513
  public async Task<ActionResult<PaginatedResult<ContactDto>>> GetAll(...) { ... }
1518
1514
  }
1519
1515
 
1520
1516
  // v2 - Breaking changes only
1521
1517
  [ApiController]
1522
1518
  [ApiVersion("2.0")]
1523
- [NavRoute("business.crm.contacts")]
1519
+ [NavRoute("crm.contacts")]
1524
1520
  public class ContactsV2Controller : ControllerBase
1525
1521
  {
1526
1522
  [HttpGet]
1527
- [RequirePermission(Permissions.Business.Crm.Contacts.Read)]
1523
+ [RequirePermission(Permissions.Crm.Contacts.Read)]
1528
1524
  public async Task<ActionResult<PaginatedResult<ContactV2Dto>>> GetAll(...) { ... }
1529
1525
  }
1530
1526
  ```