@atlashub/smartstack-cli 3.37.0 → 3.39.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 (228) hide show
  1. package/dist/index.js +16 -24
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +235 -265
  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/efcore/scan.md +3 -1
  13. package/templates/agents/gitflow/commit.md +74 -0
  14. package/templates/agents/gitflow/finish.md +5 -2
  15. package/templates/agents/gitflow/init-clone.md +3 -3
  16. package/templates/agents/gitflow/init-validate.md +3 -2
  17. package/templates/agents/gitflow/merge.md +5 -4
  18. package/templates/agents/gitflow/pr.md +5 -4
  19. package/templates/agents/gitflow/start.md +37 -5
  20. package/templates/hooks/hooks.json +11 -0
  21. package/templates/hooks/wsl-dotnet-cleanup.sh +24 -0
  22. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +20 -20
  23. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +16 -24
  24. package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +2 -2
  25. package/templates/skills/_resources/mcp-validate-documentation-spec.md +3 -3
  26. package/templates/skills/_shared.md +15 -17
  27. package/templates/skills/ai-prompt/SKILL.md +1 -1
  28. package/templates/skills/ai-prompt/steps/step-00-init.md +47 -0
  29. package/templates/skills/apex/SKILL.md +3 -4
  30. package/templates/skills/apex/_shared.md +10 -20
  31. package/templates/skills/apex/references/analysis-methods.md +141 -0
  32. package/templates/skills/apex/references/challenge-questions.md +1 -21
  33. package/templates/skills/apex/references/core-seed-data.md +35 -58
  34. package/templates/skills/apex/references/examine-build-validation.md +82 -0
  35. package/templates/skills/apex/references/execution-frontend-gates.md +177 -0
  36. package/templates/skills/apex/references/execution-frontend-patterns.md +105 -0
  37. package/templates/skills/apex/references/execution-layer1-rules.md +96 -0
  38. package/templates/skills/apex/references/initialization-challenge-flow.md +110 -0
  39. package/templates/skills/apex/references/planning-layer-mapping.md +151 -0
  40. package/templates/skills/apex/references/post-checks.md +145 -40
  41. package/templates/skills/apex/references/smartstack-api.md +35 -51
  42. package/templates/skills/apex/references/smartstack-frontend.md +18 -18
  43. package/templates/skills/apex/references/smartstack-layers.md +38 -62
  44. package/templates/skills/apex/steps/step-00-init.md +14 -26
  45. package/templates/skills/apex/steps/step-01-analyze.md +10 -143
  46. package/templates/skills/apex/steps/step-02-plan.md +10 -92
  47. package/templates/skills/apex/steps/step-03-execute.md +45 -252
  48. package/templates/skills/apex/steps/step-04-examine.md +14 -78
  49. package/templates/skills/apex/steps/step-05-deep-review.md +2 -2
  50. package/templates/skills/apex/steps/step-08-run-tests.md +1 -0
  51. package/templates/skills/application/SKILL.md +241 -242
  52. package/templates/skills/application/references/backend-controller-hierarchy.md +16 -16
  53. package/templates/skills/application/references/backend-seeding-and-dto-output.md +83 -0
  54. package/templates/skills/application/references/backend-table-prefix-mapping.md +79 -0
  55. package/templates/skills/application/references/backend-verification.md +1 -1
  56. package/templates/skills/application/references/frontend-i18n-and-output.md +67 -0
  57. package/templates/skills/application/references/frontend-route-naming.md +117 -0
  58. package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +107 -0
  59. package/templates/skills/application/references/frontend-verification.md +12 -12
  60. package/templates/skills/application/references/init-parameter-detection.md +121 -0
  61. package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
  62. package/templates/skills/application/references/nav-fallback-procedure.md +199 -200
  63. package/templates/skills/application/references/provider-template.md +2 -6
  64. package/templates/skills/application/references/roles-client-project-handling.md +55 -0
  65. package/templates/skills/application/references/roles-fallback-procedure.md +149 -0
  66. package/templates/skills/application/references/test-coverage-requirements.md +213 -0
  67. package/templates/skills/application/references/test-frontend.md +3 -3
  68. package/templates/skills/application/steps/step-00-init.md +130 -260
  69. package/templates/skills/application/steps/step-01-navigation.md +170 -170
  70. package/templates/skills/application/steps/step-02-permissions.md +196 -196
  71. package/templates/skills/application/steps/step-03-roles.md +182 -339
  72. package/templates/skills/application/steps/step-03b-provider.md +133 -134
  73. package/templates/skills/application/steps/step-04-backend.md +174 -265
  74. package/templates/skills/application/steps/step-05-frontend.md +18 -144
  75. package/templates/skills/application/steps/step-06-migration.md +12 -60
  76. package/templates/skills/application/steps/step-07-tests.md +9 -76
  77. package/templates/skills/application/templates-backend.md +29 -27
  78. package/templates/skills/application/templates-frontend.md +49 -49
  79. package/templates/skills/application/templates-seed.md +57 -131
  80. package/templates/skills/business-analyse/SKILL.md +27 -30
  81. package/templates/skills/business-analyse/_architecture.md +6 -6
  82. package/templates/skills/business-analyse/_shared.md +60 -88
  83. package/templates/skills/business-analyse/questionnaire/04-data.md +3 -3
  84. package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
  85. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +1 -1
  86. package/templates/skills/business-analyse/react/application-viewer.md +12 -12
  87. package/templates/skills/business-analyse/react/components.md +8 -12
  88. package/templates/skills/business-analyse/react/schema.md +836 -836
  89. package/templates/skills/business-analyse/references/agent-module-prompt.md +2 -3
  90. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +190 -0
  91. package/templates/skills/business-analyse/references/cache-warming-strategy.md +2 -2
  92. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +41 -0
  93. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +74 -0
  94. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +69 -0
  95. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +1 -1
  96. package/templates/skills/business-analyse/references/compilation-structure-cards.md +297 -0
  97. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
  98. package/templates/skills/business-analyse/references/deploy-modes.md +5 -5
  99. package/templates/skills/business-analyse/references/detection-strategies.md +7 -7
  100. package/templates/skills/business-analyse/references/handoff-file-templates.md +14 -22
  101. package/templates/skills/business-analyse/references/handoff-mappings.md +4 -4
  102. package/templates/skills/business-analyse/references/handoff-seeddata-generation.md +312 -0
  103. package/templates/skills/business-analyse/references/init-schema-deployment.md +3 -3
  104. package/templates/skills/business-analyse/references/naming-conventions.md +22 -24
  105. package/templates/skills/business-analyse/references/prd-generation.md +2 -2
  106. package/templates/skills/business-analyse/references/review-data-mapping.md +2 -2
  107. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  108. package/templates/skills/business-analyse/references/spec-auto-inference.md +3 -3
  109. package/templates/skills/business-analyse/references/team-orchestration.md +49 -6
  110. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  111. package/templates/skills/business-analyse/references/ui-resource-cards.md +18 -18
  112. package/templates/skills/business-analyse/references/validate-incremental-html.md +2 -2
  113. package/templates/skills/business-analyse/references/validation-checklist.md +2 -2
  114. package/templates/skills/business-analyse/schemas/application-schema.json +4 -5
  115. package/templates/skills/business-analyse/schemas/project-schema.json +1 -6
  116. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -3
  117. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +4 -4
  118. package/templates/skills/business-analyse/steps/step-00-init.md +8 -17
  119. package/templates/skills/business-analyse/steps/step-01-cadrage.md +35 -198
  120. package/templates/skills/business-analyse/steps/step-01b-applications.md +16 -20
  121. package/templates/skills/business-analyse/steps/step-02-decomposition.md +1 -1
  122. package/templates/skills/business-analyse/steps/step-03a1-setup.md +4 -4
  123. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +1 -1
  124. package/templates/skills/business-analyse/steps/step-03b-ui.md +4 -4
  125. package/templates/skills/business-analyse/steps/step-03c-compile.md +66 -140
  126. package/templates/skills/business-analyse/steps/step-03d-validate.md +2 -2
  127. package/templates/skills/business-analyse/steps/step-04a-collect.md +2 -2
  128. package/templates/skills/business-analyse/steps/step-04b-analyze.md +42 -160
  129. package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
  130. package/templates/skills/business-analyse/steps/step-05a-handoff.md +74 -104
  131. package/templates/skills/business-analyse/steps/step-05b-deploy.md +13 -11
  132. package/templates/skills/business-analyse/steps/step-06-review.md +3 -3
  133. package/templates/skills/business-analyse/templates/tpl-frd.md +13 -13
  134. package/templates/skills/business-analyse/templates/tpl-handoff.md +12 -12
  135. package/templates/skills/business-analyse/templates/tpl-progress.md +1 -1
  136. package/templates/skills/business-analyse/templates-frd.md +25 -25
  137. package/templates/skills/business-analyse/templates-react.md +15 -21
  138. package/templates/skills/controller/SKILL.md +1 -1
  139. package/templates/skills/controller/postman-templates.md +1 -1
  140. package/templates/skills/controller/references/controller-code-templates.md +2 -2
  141. package/templates/skills/controller/references/mcp-scaffold-workflow.md +209 -0
  142. package/templates/skills/controller/references/permission-sync-templates.md +13 -16
  143. package/templates/skills/controller/steps/step-00-init.md +11 -11
  144. package/templates/skills/controller/steps/step-03-generate.md +64 -103
  145. package/templates/skills/controller/templates.md +67 -71
  146. package/templates/skills/debug/SKILL.md +13 -218
  147. package/templates/skills/debug/steps/step-00-init.md +57 -0
  148. package/templates/skills/debug/steps/step-01-analyze.md +219 -0
  149. package/templates/skills/debug/steps/step-02-resolve.md +85 -0
  150. package/templates/skills/documentation/SKILL.md +49 -345
  151. package/templates/skills/documentation/data-schema.md +11 -8
  152. package/templates/skills/documentation/steps/step-00-init.md +70 -0
  153. package/templates/skills/documentation/steps/step-01-scan.md +113 -0
  154. package/templates/skills/documentation/steps/step-02-generate.md +231 -0
  155. package/templates/skills/documentation/steps/step-03-validate.md +238 -0
  156. package/templates/skills/documentation/templates.md +480 -322
  157. package/templates/skills/efcore/SKILL.md +1 -1
  158. package/templates/skills/efcore/references/both-contexts.md +32 -0
  159. package/templates/skills/efcore/references/database-operations.md +67 -0
  160. package/templates/skills/efcore/references/destructive-operations.md +38 -0
  161. package/templates/skills/efcore/references/reset-operations.md +81 -0
  162. package/templates/skills/efcore/references/seed-methods.md +86 -0
  163. package/templates/skills/efcore/references/shared-init-functions.md +250 -0
  164. package/templates/skills/efcore/references/sql-objects-injection.md +61 -0
  165. package/templates/skills/efcore/references/troubleshooting.md +81 -0
  166. package/templates/skills/efcore/steps/db/step-deploy.md +1 -32
  167. package/templates/skills/efcore/steps/db/step-reset.md +7 -103
  168. package/templates/skills/efcore/steps/db/step-seed.md +10 -132
  169. package/templates/skills/efcore/steps/db/step-status.md +5 -44
  170. package/templates/skills/efcore/steps/migration/step-02-create.md +1 -14
  171. package/templates/skills/efcore/steps/migration/step-03-validate.md +8 -62
  172. package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +1 -57
  173. package/templates/skills/efcore/steps/shared/step-00-init.md +11 -254
  174. package/templates/skills/efcore/steps/squash/step-03-create.md +1 -58
  175. package/templates/skills/feature-full/SKILL.md +1 -1
  176. package/templates/skills/feature-full/steps/step-00-init.md +57 -0
  177. package/templates/skills/feature-full/steps/step-01-implementation.md +1 -1
  178. package/templates/skills/gitflow/SKILL.md +28 -5
  179. package/templates/skills/gitflow/_shared.md +109 -12
  180. package/templates/skills/gitflow/phases/abort.md +4 -0
  181. package/templates/skills/gitflow/phases/cleanup.md +4 -0
  182. package/templates/skills/gitflow/references/commit-message-generation.md +58 -0
  183. package/templates/skills/gitflow/references/commit-migration-validation.md +49 -0
  184. package/templates/skills/gitflow/references/finish-cleanup.md +55 -0
  185. package/templates/skills/gitflow/references/finish-version-bumping.md +45 -0
  186. package/templates/skills/gitflow/references/init-environment-detection.md +41 -0
  187. package/templates/skills/gitflow/references/init-questions.md +185 -0
  188. package/templates/skills/gitflow/references/init-structure-creation.md +75 -0
  189. package/templates/skills/gitflow/references/init-version-detection.md +21 -0
  190. package/templates/skills/gitflow/references/init-workspace-detection.md +43 -0
  191. package/templates/skills/gitflow/references/merge-ci-status.md +36 -0
  192. package/templates/skills/gitflow/references/merge-execution.md +62 -0
  193. package/templates/skills/gitflow/references/merge-pr-context.md +76 -0
  194. package/templates/skills/gitflow/references/pr-build-checks.md +60 -0
  195. package/templates/skills/gitflow/references/pr-generation.md +58 -0
  196. package/templates/skills/gitflow/references/start-branch-normalization.md +28 -0
  197. package/templates/skills/gitflow/references/start-worktree-creation.md +50 -0
  198. package/templates/skills/gitflow/references/sync-push-verify.md +44 -0
  199. package/templates/skills/gitflow/references/sync-rebase-conflicts.md +38 -0
  200. package/templates/skills/gitflow/steps/step-commit.md +12 -91
  201. package/templates/skills/gitflow/steps/step-finish.md +15 -159
  202. package/templates/skills/gitflow/steps/step-init.md +24 -326
  203. package/templates/skills/gitflow/steps/step-merge.md +17 -176
  204. package/templates/skills/gitflow/steps/step-pr.md +10 -116
  205. package/templates/skills/gitflow/steps/step-start.md +16 -109
  206. package/templates/skills/gitflow/steps/step-sync.md +6 -69
  207. package/templates/skills/ralph-loop/SKILL.md +6 -0
  208. package/templates/skills/ralph-loop/references/category-completeness.md +185 -0
  209. package/templates/skills/ralph-loop/references/compact-loop.md +1 -1
  210. package/templates/skills/ralph-loop/references/init-resume-recovery.md +127 -0
  211. package/templates/skills/ralph-loop/references/module-transition.md +151 -0
  212. package/templates/skills/ralph-loop/references/multi-module-queue.md +171 -0
  213. package/templates/skills/ralph-loop/references/parallel-execution.md +246 -0
  214. package/templates/skills/ralph-loop/references/task-transform-legacy.md +6 -9
  215. package/templates/skills/ralph-loop/references/team-orchestration.md +45 -3
  216. package/templates/skills/ralph-loop/steps/step-00-init.md +36 -109
  217. package/templates/skills/ralph-loop/steps/step-01-task.md +15 -163
  218. package/templates/skills/ralph-loop/steps/step-02-execute.md +8 -154
  219. package/templates/skills/ralph-loop/steps/step-04-check.md +20 -73
  220. package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
  221. package/templates/skills/review-code/references/smartstack-conventions.md +568 -568
  222. package/templates/skills/validate-feature/references/api-smoke-tests.md +140 -0
  223. package/templates/skills/validate-feature/references/db-validation-checks.md +180 -0
  224. package/templates/skills/validate-feature/steps/step-01-compile.md +1 -3
  225. package/templates/skills/validate-feature/steps/step-04-api-smoke.md +34 -145
  226. package/templates/skills/validate-feature/steps/step-05-db-validation.md +74 -260
  227. package/templates/skills/workflow/SKILL.md +1 -1
  228. package/templates/skills/workflow/steps/step-00-init.md +57 -0
@@ -39,26 +39,11 @@ From previous steps:
39
39
 
40
40
  ### 0. Pre-Migration Build Verification (BLOCKING)
41
41
 
42
- **CRITICAL:** The backend MUST build successfully before creating a migration.
43
- EF Core tools compile the project internally; a build failure produces confusing errors
44
- that do not point to the actual source file.
45
-
46
- ```bash
47
- dotnet build {SolutionName}.sln --no-restore
48
- ```
49
-
50
- IF build fails:
51
- - Fix all compilation errors before proceeding
52
- - Common causes at this stage:
53
- - Missing DbSet registration (should have been caught in step-04 Check 2)
54
- - Missing DI registration (should have been caught in step-04 Check 3)
55
- - Circular references between generated services
56
- - Missing package references (e.g., FluentValidation)
57
- - Frontend changes that modified shared files
58
- - Re-run build until successful
59
- - DO NOT attempt migration creation on a broken build
60
-
61
- **After build succeeds:** Continue to migration name suggestion.
42
+ See [references/migration-checklist-troubleshooting.md](../references/migration-checklist-troubleshooting.md) for:
43
+ - Build verification command
44
+ - Common compilation causes
45
+ - Fix strategies
46
+ - Quick recovery commands
62
47
 
63
48
  ### 1. Get Migration Name Suggestion
64
49
 
@@ -103,29 +88,11 @@ dotnet ef migrations add {suggested_migration_name} --context ExtensionsDbContex
103
88
 
104
89
  ### 2b. Inject SQL Objects (if any exist)
105
90
 
106
- Check if any SQL object files exist:
107
- ```
108
- Glob: **/Persistence/SqlObjects/Functions/*.sql
109
- ```
110
-
111
- If SQL files are found, the migration's `Up()` method should include a call to re-apply all SQL objects:
112
- ```csharp
113
- // At the end of the Up() method:
114
- SqlObjectHelper.ApplyAll(migrationBuilder);
115
- ```
116
-
117
- This ensures SQL functions/views are re-applied with each migration (`CREATE OR ALTER` = idempotent).
91
+ See [references/migration-checklist-troubleshooting.md](../references/migration-checklist-troubleshooting.md) for SQL Objects injection pattern.
118
92
 
119
93
  ### 3. Verify Migration Content
120
94
 
121
- The migration should include:
122
- - Navigation entity (Context/Application/Module/Section)
123
- - Navigation translations (4 languages)
124
- - Permissions (CRUD + wildcard)
125
- - RolePermissions (role assignments)
126
- - Domain entity table
127
- - Indexes and constraints
128
- - SQL Objects injection (if any .sql files exist)
95
+ See [references/migration-checklist-troubleshooting.md](../references/migration-checklist-troubleshooting.md) for complete migration content verification checklist.
129
96
 
130
97
  ### 4. Apply Migration
131
98
 
@@ -205,26 +172,11 @@ dotnet ef database update --context ExtensionsDbContext
205
172
 
206
173
  ## TROUBLESHOOTING
207
174
 
208
- ### Common Issues
209
-
210
- | Issue | Solution |
211
- |-------|----------|
212
- | Migration conflicts | Run `/efcore:conflicts` to analyze |
213
- | Permission 403 errors | Verify Permissions.cs and PermissionConfiguration.cs are in sync |
214
- | Navigation not visible | Check user role has appropriate permissions |
215
- | Route not found | Verify nested route structure in routes.tsx |
216
- | i18n missing | Check locale files exist and are properly loaded |
217
-
218
- ### Quick Fixes
219
-
220
- ```bash
221
- # Rebuild and restart
222
- dotnet build
223
- dotnet ef database update
224
-
225
- # Clear frontend cache
226
- cd web && rm -rf node_modules/.cache && npm run dev
227
- ```
175
+ See [references/migration-checklist-troubleshooting.md](../references/migration-checklist-troubleshooting.md) for:
176
+ - Common issues and solutions
177
+ - Quick fix commands
178
+ - Database reset procedures
179
+ - Final verification checklist
228
180
 
229
181
  ---
230
182
 
@@ -195,82 +195,15 @@ This generates:
195
195
 
196
196
  ## POST-GENERATION VERIFICATION (MANDATORY)
197
197
 
198
- ### 1. Naming Convention Check (BLOCKING)
199
-
200
- All test methods MUST follow: `{Method}_When{Condition}_Should{Result}`
201
-
202
- ```
203
- FORBIDDEN patterns:
204
- Test1, Test2, TestMethod, MyTest
205
- Should_Return_OK, test_get_all
206
-
207
- REQUIRED pattern:
208
- GetAll_WhenCalled_ShouldReturn200WithList
209
- Create_WhenDuplicateCode_ShouldThrowException
210
- Delete_WhenNotAuthenticated_ShouldReturn401
211
- ```
212
-
213
- ### 2. Test Structure Check (BLOCKING)
214
-
215
- All tests MUST follow Arrange-Act-Assert:
216
-
217
- ```csharp
218
- // CORRECT
219
- [Fact]
220
- public async Task GetById_WhenExists_ShouldReturn200()
221
- {
222
- // Arrange
223
- var id = Guid.NewGuid();
224
- // ...
225
-
226
- // Act
227
- var response = await _client.GetAsync($"/api/{entityCode}/{id}");
228
-
229
- // Assert
230
- response.StatusCode.Should().Be(HttpStatusCode.OK);
231
- }
232
- ```
233
-
234
- ### 3. Dependencies Check (BLOCKING)
235
-
236
- Verify test project references:
237
- - `FluentAssertions` (NOT `Assert.Equal`)
238
- - `Moq` (NOT manual fakes)
239
- - `xunit` (NOT NUnit or MSTest)
240
-
241
- ### 4. Coverage Check
242
-
243
- Minimum test coverage per category:
244
-
245
- | Category | Minimum Tests |
246
- |----------|---------------|
247
- | Controller (mock) | 10 (CRUD + auth + tenant) |
248
- | Controller (real integration) | 8 (CRUD + persistence + tenant isolation) |
249
- | Service | 8 (CRUD + errors) |
250
- | Entity | 5 (factory + update + validation) |
251
- | Validator | 8 (code + name + security) |
252
- | Repository | 8 (CRUD + tenant + pagination) |
253
- | Security | 10 (auth + injection + headers) |
254
-
255
- ### 5. Build Check (BLOCKING)
256
-
257
- ```bash
258
- dotnet build tests/{SolutionName}.Tests/{SolutionName}.Tests.csproj
259
- ```
260
-
261
- If build fails, fix compilation errors before proceeding.
262
-
263
- ### 6. Test Run (BLOCKING)
264
-
265
- ```bash
266
- dotnet test tests/{SolutionName}.Tests/{SolutionName}.Tests.csproj --no-build --verbosity normal
267
- ```
268
-
269
- **ALL tests MUST pass.** If tests fail:
270
- 1. Read the failure output carefully
271
- 2. Fix the failing tests or the code they test
272
- 3. Re-run until all tests pass
273
- 4. Do NOT proceed to the next step until all tests are green
198
+ See [references/test-coverage-requirements.md](../references/test-coverage-requirements.md) for:
199
+ - **Naming Convention Check** (BLOCKING) — `{Method}_When{Condition}_Should{Result}` pattern
200
+ - **Test Structure Check** (BLOCKING) — Arrange-Act-Assert format
201
+ - **Dependencies Check** (BLOCKING) — FluentAssertions, Moq, xunit
202
+ - **Coverage Check** — Minimum tests per category (CRUD + auth + tenant + persistence + security)
203
+ - **Build Check** (BLOCKING) — `dotnet build` must succeed
204
+ - **Test Run** (BLOCKING) — `dotnet test` must pass 100%
205
+ - **Real Integration Test Coverage** — DB persistence verification
206
+ - **Security Test Categories** — OWASP coverage
274
207
 
275
208
  ---
276
209
 
@@ -9,35 +9,37 @@
9
9
  ```csharp
10
10
  // Add to src/SmartStack.Application/Common/Authorization/Permissions.cs
11
11
 
12
- public static class $CONTEXT_PASCAL
12
+ public static class $APPLICATION_PASCAL
13
13
  {
14
- public const string Access = "$context.$application";
14
+ public const string Access = "$application";
15
15
 
16
16
  public static class $MODULE_PASCAL
17
17
  {
18
- public const string View = "$context.$application.$module.read";
19
- public const string Create = "$context.$application.$module.create";
20
- public const string Update = "$context.$application.$module.update";
21
- public const string Delete = "$context.$application.$module.delete";
22
- public const string Assign = "$context.$application.$module.assign";
23
- public const string Execute = "$context.$application.$module.execute";
18
+ public const string View = "$application.$module.read";
19
+ public const string Create = "$application.$module.create";
20
+ public const string Update = "$application.$module.update";
21
+ public const string Delete = "$application.$module.delete";
22
+ public const string Assign = "$application.$module.assign";
23
+ public const string Execute = "$application.$module.execute";
24
24
  }
25
25
  }
26
26
  ```
27
27
 
28
- ### Example for ERP > Sales > Products
28
+ ### Example for Sales > Products
29
29
 
30
30
  ```csharp
31
- public static class Erp
31
+ public static class Sales
32
32
  {
33
- public const string Access = "erp.sales";
33
+ public const string Access = "sales";
34
34
 
35
35
  public static class Products
36
36
  {
37
- public const string View = "erp.sales.products.read";
38
- public const string Create = "erp.sales.products.create";
39
- public const string Update = "erp.sales.products.update";
40
- public const string Delete = "erp.sales.products.delete";
37
+ public const string View = "sales.products.read";
38
+ public const string Create = "sales.products.create";
39
+ public const string Update = "sales.products.update";
40
+ public const string Delete = "sales.products.delete";
41
+ public const string Assign = "sales.products.assign";
42
+ public const string Execute = "sales.products.execute";
41
43
  }
42
44
  }
43
45
  ```
@@ -49,7 +51,7 @@ public static class Erp
49
51
  ```csharp
50
52
  // src/SmartStack.Application/Common/Interfaces/I{Module}Service.cs
51
53
 
52
- using SmartStack.Application.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL.DTOs;
54
+ using SmartStack.Application.$APPLICATION_PASCAL.$MODULE_PASCAL.DTOs;
53
55
 
54
56
  namespace SmartStack.Application.Common.Interfaces;
55
57
 
@@ -89,15 +91,15 @@ public interface I$MODULE_PASCALService
89
91
  > - NEVER use `Guid.Empty` as a placeholder — resolve the actual value from `_currentUser`
90
92
 
91
93
  ```csharp
92
- // src/SmartStack.Infrastructure/Services/$CONTEXT_PASCAL/$APPLICATION_PASCAL/$MODULE_PASCAL/$MODULE_PASCALService.cs
94
+ // src/SmartStack.Infrastructure/Services/$APPLICATION_PASCAL/$MODULE_PASCAL/$MODULE_PASCALService.cs
93
95
 
94
96
  using Microsoft.EntityFrameworkCore;
95
97
  using Microsoft.Extensions.Logging;
96
98
  using SmartStack.Application.Common.Interfaces;
97
- using SmartStack.Application.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL.DTOs;
98
- using SmartStack.Domain.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL;
99
+ using SmartStack.Application.$APPLICATION_PASCAL.$MODULE_PASCAL.DTOs;
100
+ using SmartStack.Domain.$APPLICATION_PASCAL.$MODULE_PASCAL;
99
101
 
100
- namespace SmartStack.Infrastructure.Services.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL;
102
+ namespace SmartStack.Infrastructure.Services.$APPLICATION_PASCAL.$MODULE_PASCAL;
101
103
 
102
104
  public class $MODULE_PASCALService : I$MODULE_PASCALService
103
105
  {
@@ -280,9 +282,9 @@ public class $MODULE_PASCALService : I$MODULE_PASCALService
280
282
  ## TEMPLATE: DTOs
281
283
 
282
284
  ```csharp
283
- // src/SmartStack.Application/$CONTEXT_PASCAL/$APPLICATION_PASCAL/$MODULE_PASCAL/DTOs/$ENTITY_PASCALDto.cs
285
+ // src/SmartStack.Application/$APPLICATION_PASCAL/$MODULE_PASCAL/DTOs/$ENTITY_PASCALDto.cs
284
286
 
285
- namespace SmartStack.Application.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL.DTOs;
287
+ namespace SmartStack.Application.$APPLICATION_PASCAL.$MODULE_PASCAL.DTOs;
286
288
 
287
289
  public record $ENTITY_PASCALDto
288
290
  {
@@ -321,11 +323,11 @@ public record $ENTITY_PASCALQueryParameters
321
323
  ## TEMPLATE: DOMAIN ENTITY
322
324
 
323
325
  ```csharp
324
- // src/SmartStack.Domain/$CONTEXT_PASCAL/$APPLICATION_PASCAL/$MODULE_PASCAL/$ENTITY_PASCAL.cs
326
+ // src/SmartStack.Domain/$APPLICATION_PASCAL/$MODULE_PASCAL/$ENTITY_PASCAL.cs
325
327
 
326
328
  using SmartStack.Domain.Common;
327
329
 
328
- namespace SmartStack.Domain.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL;
330
+ namespace SmartStack.Domain.$APPLICATION_PASCAL.$MODULE_PASCAL;
329
331
 
330
332
  public class $ENTITY_PASCAL : BaseEntity
331
333
  {
@@ -370,13 +372,13 @@ public class $ENTITY_PASCAL : BaseEntity
370
372
  ## TEMPLATE: EF CONFIGURATION
371
373
 
372
374
  ```csharp
373
- // src/SmartStack.Infrastructure/Persistence/Configurations/$CONTEXT_PASCAL/$APPLICATION_PASCAL/$MODULE_PASCAL/$ENTITY_PASCALConfiguration.cs
375
+ // src/SmartStack.Infrastructure/Persistence/Configurations/$APPLICATION_PASCAL/$MODULE_PASCAL/$ENTITY_PASCALConfiguration.cs
374
376
 
375
377
  using Microsoft.EntityFrameworkCore;
376
378
  using Microsoft.EntityFrameworkCore.Metadata.Builders;
377
- using SmartStack.Domain.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL;
379
+ using SmartStack.Domain.$APPLICATION_PASCAL.$MODULE_PASCAL;
378
380
 
379
- namespace SmartStack.Infrastructure.Persistence.Configurations.$CONTEXT_PASCAL.$APPLICATION_PASCAL.$MODULE_PASCAL;
381
+ namespace SmartStack.Infrastructure.Persistence.Configurations.$APPLICATION_PASCAL.$MODULE_PASCAL;
380
382
 
381
383
  public class $ENTITY_PASCALConfiguration : IEntityTypeConfiguration<$ENTITY_PASCAL>
382
384
  {
@@ -8,11 +8,11 @@
8
8
 
9
9
  ```
10
10
  web/smartstack-web/src/
11
- ├── pages/$CONTEXT/$APPLICATION/$MODULE/
11
+ ├── pages/$APPLICATION/$MODULE/
12
12
  │ ├── $MODULE_PASCALPage.tsx # Main page (list)
13
13
  │ ├── $MODULE_PASCALDetailPage.tsx # Detail page
14
14
  │ └── Create$MODULE_PASCALPage.tsx # Create page
15
- ├── components/$CONTEXT/$MODULE/
15
+ ├── components/$APPLICATION/$MODULE/
16
16
  │ ├── $MODULE_PASCALListView.tsx # Reusable list component
17
17
  │ ├── $MODULE_PASCALForm.tsx # CRUD form
18
18
  │ └── $MODULE_PASCALFilters.tsx # Filters
@@ -55,10 +55,10 @@ Examples:
55
55
  ## TEMPLATE: MAIN PAGE
56
56
 
57
57
  ```tsx
58
- // pages/$CONTEXT/$APPLICATION/$MODULE/$MODULE_PASCALPage.tsx
58
+ // pages/$APPLICATION/$MODULE/$MODULE_PASCALPage.tsx
59
59
 
60
60
  import { useTranslation } from 'react-i18next';
61
- import { $MODULE_PASCALListView } from '@/components/$CONTEXT/$MODULE/$MODULE_PASCALListView';
61
+ import { $MODULE_PASCALListView } from '@/components/$APPLICATION/$MODULE/$MODULE_PASCALListView';
62
62
 
63
63
  export function $MODULE_PASCALPage() {
64
64
  const { t } = useTranslation(['$module', 'common']);
@@ -78,7 +78,7 @@ export function $MODULE_PASCALPage() {
78
78
  ## TEMPLATE: LIST VIEW (Reusable component)
79
79
 
80
80
  ```tsx
81
- // components/$CONTEXT/$MODULE/$MODULE_PASCALListView.tsx
81
+ // components/$APPLICATION/$MODULE/$MODULE_PASCALListView.tsx
82
82
 
83
83
  import { useState, useEffect } from 'react';
84
84
  import { useNavigate } from 'react-router-dom';
@@ -511,78 +511,78 @@ Before adding routes, **read App.tsx** and detect which pattern is used:
511
511
 
512
512
  | Pattern | How to detect | Action |
513
513
  |---------|---------------|--------|
514
- | **Pattern A** (mergeRoutes) | `contextRoutes: ContextRouteExtensions` present | Add to `contextRoutes.{context}[]` array |
515
- | **Pattern B** (JSX Routes) | `<Route path="/{context}" element={<{Layout} />}>` present | Insert `<Route>` children inside Layout wrapper |
514
+ | **Pattern A** (mergeRoutes) | `applicationRoutes: ApplicationRouteExtensions` present | Add to `applicationRoutes.{application}[]` array |
515
+ | **Pattern B** (JSX Routes) | `<Route path="/{application}" element={<{Layout} />}>` present | Insert `<Route>` children inside Layout wrapper |
516
516
 
517
- ### Pattern A: mergeRoutes (contextRoutes array)
517
+ ### Pattern A: mergeRoutes (applicationRoutes array)
518
518
 
519
519
  > **This is the DEFAULT pattern** generated by `smartstack init`.
520
- > Routes added to `contextRoutes` are automatically injected into BOTH standard and tenant-prefixed route trees by `mergeRoutes()`. No manual duplication needed.
520
+ > Routes added to `applicationRoutes` are automatically injected into BOTH standard and tenant-prefixed route trees by `mergeRoutes()`. No manual duplication needed.
521
521
 
522
522
  ```tsx
523
523
  // Add to App.tsx — imports at top
524
- import { $MODULE_PASCALPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/$MODULE_PASCALPage';
525
- import { $MODULE_PASCALDetailPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/$MODULE_PASCALDetailPage';
526
- import { Create$MODULE_PASCALPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/Create$MODULE_PASCALPage';
524
+ import { $MODULE_PASCALPage } from '@/pages/$APPLICATION/$MODULE/$MODULE_PASCALPage';
525
+ import { $MODULE_PASCALDetailPage } from '@/pages/$APPLICATION/$MODULE/$MODULE_PASCALDetailPage';
526
+ import { Create$MODULE_PASCALPage } from '@/pages/$APPLICATION/$MODULE/Create$MODULE_PASCALPage';
527
527
 
528
- // Add routes to contextRoutes.{context}[] with RELATIVE paths (no leading /)
529
- const contextRoutes: ContextRouteExtensions = {
530
- $CONTEXT: [
528
+ // Add routes to applicationRoutes.{application}[] with RELATIVE paths (no leading /)
529
+ const applicationRoutes: ApplicationRouteExtensions = {
530
+ $APPLICATION: [
531
531
  // ... existing routes ...
532
- { path: '$APPLICATION_KEBAB/$MODULE_KEBAB', element: <$MODULE_PASCALPage /> },
533
- { path: '$APPLICATION_KEBAB/$MODULE_KEBAB/new', element: <Create$MODULE_PASCALPage /> },
534
- { path: '$APPLICATION_KEBAB/$MODULE_KEBAB/:id', element: <$MODULE_PASCALDetailPage /> },
535
- { path: '$APPLICATION_KEBAB/$MODULE_KEBAB/:id/edit', element: <Create$MODULE_PASCALPage /> },
532
+ { path: '$MODULE_KEBAB', element: <$MODULE_PASCALPage /> },
533
+ { path: '$MODULE_KEBAB/new', element: <Create$MODULE_PASCALPage /> },
534
+ { path: '$MODULE_KEBAB/:id', element: <$MODULE_PASCALDetailPage /> },
535
+ { path: '$MODULE_KEBAB/:id/edit', element: <Create$MODULE_PASCALPage /> },
536
536
  ],
537
537
  };
538
538
  ```
539
539
 
540
- **mergeRoutes auto-generates redirects** for intermediate paths (e.g., `$APPLICATION_KEBAB` → `$APPLICATION_KEBAB/$DEFAULT_MODULE_KEBAB`) so you don't need to add index redirects manually.
540
+ **mergeRoutes auto-generates redirects** for intermediate paths (e.g., `$APPLICATION` → `$APPLICATION/$DEFAULT_MODULE_KEBAB`) so you don't need to add index redirects manually.
541
541
 
542
- **Context-to-Layout mapping (automatic via mergeRoutes):**
542
+ **Application-to-Layout mapping (automatic via mergeRoutes):**
543
543
 
544
- | Context key | Injected into Layout | Standard path | Tenant path |
545
- |-------------|---------------------|---------------|-------------|
546
- | `platform` | `AdminLayout` | `/platform/...` | `/t/:slug/platform/...` |
547
- | `business` | `BusinessLayout` | `/business/...` | `/t/:slug/business/...` |
548
- | `personal` | `UserLayout` | `/personal/myspace/...` | `/t/:slug/personal/myspace/...` |
544
+ | Application key | Injected into Layout | Standard path | Tenant path |
545
+ |-----------------|---------------------|---------------|-------------|
546
+ | `administration` | `AppLayout` | `/administration/...` | `/t/:slug/administration/...` |
547
+ | `{application}` | `AppLayout` | `/{application}/...` | `/t/:slug/{application}/...` |
548
+ | `myspace` | `AppLayout` | `/myspace/...` | `/t/:slug/myspace/...` |
549
549
 
550
550
  ### Pattern B: JSX Routes (inside Layout wrapper)
551
551
 
552
552
  > **Legacy pattern** — only used if App.tsx was manually restructured with JSX `<Route>` elements.
553
553
 
554
- SmartStack layouts (`AdminLayout`, `BusinessLayout`, `UserLayout`) provide the application shell: **header with AvatarMenu**, sidebar, navigation. They render child pages via React Router's `<Outlet />`.
554
+ The unified `AppLayout` provides the application shell: **header with AvatarMenu**, sidebar, navigation. It renders child pages via React Router's `<Outlet />`.
555
555
 
556
556
  **If routes are placed OUTSIDE the layout wrapper, the shell (header, sidebar, AvatarMenu) will NOT render. The page appears "naked" without any navigation.**
557
557
 
558
558
  **Step-by-step insertion:**
559
559
 
560
560
  1. Open `App.tsx`
561
- 2. Find the existing layout route for the target context:
562
- - `platform` → `<Route path="/platform" element={<AdminLayout />}>`
563
- - `business` → `<Route path="/business" element={<BusinessLayout />}>`
564
- - `personal` → `<Route path="/personal/myspace" element={<UserLayout />}>`
561
+ 2. Find the existing layout route for the target application:
562
+ - `administration` → `<Route path="/administration" element={<AppLayout />}>`
563
+ - `{application}` → `<Route path="/{application}" element={<AppLayout />}>`
564
+ - `myspace` → `<Route path="/myspace" element={<AppLayout />}>`
565
565
  3. Add the new routes **INSIDE** that `<Route>` block
566
566
  4. If a tenant-prefixed block exists (`/t/:slug/...`), add the routes there too
567
567
 
568
568
  ```tsx
569
569
  // Add to App.tsx
570
570
 
571
- import { $MODULE_PASCALPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/$MODULE_PASCALPage';
572
- import { $MODULE_PASCALDetailPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/$MODULE_PASCALDetailPage';
573
- import { Create$MODULE_PASCALPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/Create$MODULE_PASCALPage';
571
+ import { $MODULE_PASCALPage } from '@/pages/$APPLICATION/$MODULE/$MODULE_PASCALPage';
572
+ import { $MODULE_PASCALDetailPage } from '@/pages/$APPLICATION/$MODULE/$MODULE_PASCALDetailPage';
573
+ import { Create$MODULE_PASCALPage } from '@/pages/$APPLICATION/$MODULE/Create$MODULE_PASCALPage';
574
574
 
575
575
  // Find the EXISTING layout route and add routes INSIDE it:
576
- <Route path="/$CONTEXT" element={<$CONTEXT_Layout />}>
576
+ <Route path="/$APPLICATION" element={<$APPLICATION_Layout />}>
577
577
  {/* ... existing routes stay here ... */}
578
578
 
579
- {/* NEW: $APPLICATION routes - added as children of the layout */}
580
- <Route path="$APPLICATION_KEBAB">
581
- <Route index element={<Navigate to="$DEFAULT_MODULE_KEBAB" replace />} />
582
- <Route path="$MODULE_KEBAB" element={<$MODULE_PASCALPage />} />
583
- <Route path="$MODULE_KEBAB/new" element={<Create$MODULE_PASCALPage />} />
584
- <Route path="$MODULE_KEBAB/:id" element={<$MODULE_PASCALDetailPage />} />
585
- <Route path="$MODULE_KEBAB/:id/edit" element={<Create$MODULE_PASCALPage />} />
579
+ {/* NEW: $MODULE routes - added as children of the layout */}
580
+ <Route path="$MODULE_KEBAB">
581
+ <Route index element={<Navigate to="." replace />} />
582
+ <Route index element={<$MODULE_PASCALPage />} />
583
+ <Route path="new" element={<Create$MODULE_PASCALPage />} />
584
+ <Route path=":id" element={<$MODULE_PASCALDetailPage />} />
585
+ <Route path=":id/edit" element={<Create$MODULE_PASCALPage />} />
586
586
  </Route>
587
587
  </Route>
588
588
  ```
@@ -593,22 +593,22 @@ import { Create$MODULE_PASCALPage } from '@/pages/$CONTEXT/$APPLICATION/$MODULE/
593
593
  ```tsx
594
594
  // ❌ WRONG — bypasses layout entirely, shell will NOT render
595
595
  const clientRoutes: RouteConfig[] = [
596
- { path: '/business/$APPLICATION_KEBAB/$MODULE_KEBAB', element: <$MODULE_PASCALPage /> },
596
+ { path: '/$APPLICATION_KEBAB/$MODULE_KEBAB', element: <$MODULE_PASCALPage /> },
597
597
  ];
598
598
  ```
599
599
 
600
- `clientRoutes` is ONLY for routes **outside** SmartStack locked contexts (e.g., `/about`, `/pricing`).
600
+ `clientRoutes` is ONLY for routes **outside** SmartStack locked applications (e.g., `/about`, `/pricing`).
601
601
 
602
602
  **FORBIDDEN — Flat routes outside layout:**
603
603
  ```tsx
604
604
  // ❌ WRONG (Pattern B only) — flat route bypasses layout
605
- <Route path="/$CONTEXT/$APPLICATION_KEBAB/$MODULE_KEBAB" element={<$MODULE_PASCALPage />} />
605
+ <Route path="/$APPLICATION_KEBAB/$MODULE_KEBAB" element={<$MODULE_PASCALPage />} />
606
606
  ```
607
607
 
608
608
  ### Why nested/context routes?
609
609
 
610
- | Aspect | clientRoutes (wrong) | contextRoutes / nested (correct) |
611
- |--------|---------------------|----------------------------------|
610
+ | Aspect | clientRoutes (wrong) | applicationRoutes / nested (correct) |
611
+ |--------|---------------------|--------------------------------------|
612
612
  | Shell rendered | No (bypasses layout) | Yes (Outlet pattern) |
613
613
  | AvatarMenu visible | No | Yes |
614
614
  | Tenant prefix | Manual duplication | Automatic (mergeRoutes) |
@@ -628,7 +628,7 @@ These patterns are **strictly prohibited** in generated frontend code:
628
628
  | Any hardcoded Tailwind color (`bg-{color}-{shade}`) | CSS variables from style-guide.md |
629
629
  | `rounded-lg`, `rounded-md` | `rounded-[var(--radius-card)]`, `rounded-[var(--radius-button)]` |
630
630
  | Custom `<div>` cards for entity lists | `<EntityCard>` component (MANDATORY) |
631
- | Flat routes outside Layout wrapper | Nested routes inside `<BusinessLayout>` / `<AdminLayout>` |
631
+ | Flat routes outside Layout wrapper | Nested routes inside Layout wrapper |
632
632
  | Route paths with PascalCase or concatenated words (e.g., `humanresources`, `timeManagement`) | Kebab-case route paths (e.g., `human-resources`, `time-management`) |
633
633
  | `navigate(\`${basePath}/${item.id}\`)` in list row click | `navigate(item.id)` (relative navigation, no path duplication) |
634
634
  | Only 2 languages (fr/en) | All 4 languages (fr/en/it/de) |
@@ -649,7 +649,7 @@ These patterns are **strictly prohibited** in generated frontend code:
649
649
  | ☐ Preferences hook created (`use$MODULE_PASCALPreferences.ts`) | |
650
650
  | ☐ API service created (uses `apiClient`, NOT raw axios) | |
651
651
  | ☐ Routes added inside Layout wrapper in App.tsx | |
652
- | ☐ Route path follows `/{context}/{application_kebab}/{module_kebab}` (kebab-case) | |
652
+ | ☐ Route path follows `/{application_kebab}/{module_kebab}` (kebab-case) | |
653
653
 
654
654
  ### Theme Compliance
655
655
  | Check | Status |