@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
@@ -97,7 +97,7 @@ IF mcp_available:
97
97
  Launch 3 agents in parallel:
98
98
  Agent 1: Search for existing domain entities (Glob: **/Domain/**/*.cs)
99
99
  Agent 2: Search for existing services/integrations (Grep: IService, IRepository)
100
- Agent 3: Search for existing page patterns (Glob: **/pages/business/**/*.tsx)
100
+ Agent 3: Search for existing page patterns (Glob: **/pages/**/*.tsx)
101
101
 
102
102
  Merge findings into {codebase_context}
103
103
  ```
@@ -228,56 +228,26 @@ Ask in 1-2 batches. After each batch:
228
228
  **Mandatory minimum:** Q3.2 (must-have), Q3.4 (exclusions), Q3.5 (main journey).
229
229
 
230
230
  Ask in 1-2 batches. After each batch:
231
- - If everything is "must-have" → **BLOCKING**: apply MoSCoW prioritization question (see POST-CHECK below)
231
+ - If everything is "must-have" → **BLOCKING**: apply MoSCoW prioritization question
232
232
  - If no exclusions → probe: "What should this system explicitly NOT do?"
233
233
  - If journey is too simple → detail: "What happens when something goes wrong? When someone cancels?"
234
234
 
235
235
  > **BLOCKING RULE — MoSCoW DISTRIBUTION:**
236
236
  > If the client classifies ALL features as "must-have", you MUST challenge this BEFORE proceeding.
237
- > Ask via AskUserQuestion:
238
- > ```
239
- > question: "{language == 'fr'
240
- > ? 'Toutes les fonctionnalités sont marquées indispensables. Si vous ne pouviez livrer que 60% du périmètre en v1, lesquelles pourraient attendre la v2 ?'
241
- > : 'All features are marked must-have. If you could only deliver 60% of scope in v1, which ones could wait for v2?'}"
242
- > header: "Priorisation"
243
- > multiSelect: true
244
- > options:
245
- > - label: "{feature_1}"
246
- > description: "{language == 'fr' ? 'Pourrait passer en Important (v1.x)' : 'Could move to Important (v1.x)'}"
247
- > - label: "{feature_2}"
248
- > description: "{language == 'fr' ? 'Pourrait passer en Optionnel (v2)' : 'Could move to Optional (v2)'}"
249
- > - label: "{feature_3}"
250
- > description: "{language == 'fr' ? 'Pourrait passer en Important (v1.x)' : 'Could move to Important (v1.x)'}"
251
- > - label: "{language == 'fr' ? 'Tout est vraiment indispensable' : 'Everything is truly must-have'}"
252
- > description: "{language == 'fr' ? 'Je confirme que toutes les fonctionnalités sont critiques pour la v1' : 'I confirm all features are critical for v1'}"
253
- > ```
237
+ > **Reference:** Load `references/cadrage-challenge-patterns.md` § "MoSCoW Prioritization Template" for the exact question format.
254
238
  > If client moves items → update categories. If client confirms ALL mustHave → accept but log in changelog.
255
239
 
256
240
  #### 4d. Challenge Implicit Assumptions (CRITICAL)
257
241
 
258
- > **Apply elicitation techniques to challenge what the client considers "obvious".**
259
- > This is what separates a deep analysis from a shallow one.
242
+ > **Reference:** Load `references/cadrage-challenge-patterns.md` for domain-specific patterns and elicitation techniques.
260
243
 
261
- For EACH specific point from the brief, prepare a targeted challenge question.
244
+ Apply elicitation techniques to challenge what the client considers "obvious".
245
+ This is what separates a deep analysis from a shallow one.
262
246
 
263
- **Rules for challenge questions:**
247
+ For EACH specific point from the brief, prepare a targeted challenge question:
264
248
  1. Identify the assumption (what the client stated as fact)
265
249
  2. Formulate a "what if the opposite?" question
266
- 3. Use Technique 4 (absence test) or Technique 7 (contradiction test)
267
-
268
- **Examples by domain pattern:**
269
-
270
- | Brief statement | Implicit assumption | Challenge question |
271
- |----------------|--------------------|--------------------|
272
- | "Entities are 1:1 extensions of X" | Cardinality is always 1:1 | "Can a user be linked to multiple employee records (temp contracts, part-time multi-position)? Can an employee NOT have a user account?" |
273
- | "Entry split into activity and absence" | Binary decomposition is sufficient | "What granularity? Day, half-day, hour? Are activities linked to projects or clients? Are there other entry types (training, travel, on-call)?" |
274
- | "A reports section" | Reports are a simple addition | "Which reports exactly? For whom? How often? PDF/Excel export? Real-time dashboards? Aggregated or detailed?" |
275
- | "Module X manages Y" | The scope of "manages" is clear | "What does 'manage' mean concretely? Create, read, update, delete? Approve? Archive? Import/export?" |
276
-
277
- Use these techniques:
278
- - **Technique 3** (concrete scenario): "Walk me through a typical day of [role] using this module"
279
- - **Technique 4** (absence test): "If [feature] didn't exist, how would you handle it?"
280
- - **Technique 8** (impact escalation): "With 50 records this works, but with 500? 5000? Does the process stay the same?"
250
+ 3. Use techniques from the reference (Scenario, Absence Test, Impact Escalation)
281
251
 
282
252
  Ask challenge questions via AskUserQuestion (1-2 batches of max 4).
283
253
 
@@ -354,7 +324,6 @@ ULTRATHINK — Entity Architecture Analysis for {entity_name}:
354
324
 
355
325
  | {language == "fr" ? "Niveau" : "Level"} | {language == "fr" ? "Valeur" : "Value"} | {language == "fr" ? "Justification" : "Rationale"} |
356
326
  |--------|--------|---------------|
357
- | Context | `business` | {language == "fr" ? "Contexte métier standard" : "Standard business context"} |
358
327
  | Application | `{app_code}` | {app_name} |
359
328
  | Module | `{ModuleCode}` | {language == "fr" ? "{pourquoi ce découpage}" : "{why this decomposition}"} |
360
329
 
@@ -531,83 +500,13 @@ options:
531
500
 
532
501
  **This section is SKIPPED if `workflow_mode !== "project"`.**
533
502
 
534
- **Process:**
535
-
536
- 1. Build module inventory per candidate application:
537
-
538
- ```javascript
539
- // From candidateApplications (step-00) + enriched by cadrage phases 1-4
540
- const modulesByApp = {};
541
- for (const app of candidate_applications) {
542
- modulesByApp[app.name] = app.modules; // e.g., { "RH": ["Employes", "Conges", "Temps"], "Projet": ["Projets", "Temps"] }
543
- }
544
- ```
545
-
546
- 2. Detect modules appearing in 2+ applications:
547
-
548
- ```javascript
549
- const allModules = Object.values(modulesByApp).flat();
550
- const moduleCounts = {};
551
- for (const mod of allModules) {
552
- const normalized = normalizeModuleName(mod); // "Temps", "Saisie du temps", "Time Tracking" → same concept
553
- moduleCounts[normalized] = (moduleCounts[normalized] || 0) + 1;
554
- }
555
- const sharedModules = Object.entries(moduleCounts)
556
- .filter(([_, count]) => count >= 2)
557
- .map(([name, count]) => ({ name, appearsIn: count, applications: findAppsContaining(name) }));
558
- ```
559
-
560
- 3. IF shared modules found, propose extraction:
503
+ **Reference:** Load `references/cadrage-shared-modules.md` for detection algorithm, extraction logic, and question template.
561
504
 
562
- ```
563
- {language == "fr"
564
- ? "### Modules partagés détectés\n\nCertains modules apparaissent dans plusieurs applications. Les extraire en application(s) dédiée(s) améliore la réutilisabilité et évite la duplication :"
565
- : "### Shared modules detected\n\nSome modules appear in multiple applications. Extracting them as dedicated application(s) improves reusability and avoids duplication:"}
566
-
567
- | Module | Présent dans | Suggestion |
568
- |--------|-------------|-----------|
569
- {for each shared: name | apps.join(", ") | "Extraire en application '{name}'" }
570
-
571
- {language == "fr"
572
- ? "**Exemple :** Si 'Gestion du temps' est dans RH et Projet, créer une application 'Temps' dédiée que les deux autres consomment."
573
- : "**Example:** If 'Time Management' is in HR and Project, create a dedicated 'Time' application that the other two consume."}
574
- ```
575
-
576
- Ask via AskUserQuestion:
577
- ```
578
- question: "{language == 'fr' ? 'Souhaitez-vous extraire les modules partagés en application(s) dédiée(s) ?' : 'Do you want to extract shared modules as dedicated application(s)?'}"
579
- header: "Extraction"
580
- options:
581
- - label: "{language == 'fr' ? 'Oui, extraire' : 'Yes, extract'}"
582
- description: "{language == 'fr' ? 'Créer {sharedModules.length} application(s) transversale(s) supplémentaire(s)' : 'Create {sharedModules.length} additional cross-cutting application(s)'}"
583
- - label: "{language == 'fr' ? 'Non, garder en l\'état' : 'No, keep as-is'}"
584
- description: "{language == 'fr' ? 'Chaque application garde sa propre version du module' : 'Each application keeps its own version of the module'}"
585
- ```
586
-
587
- **IF "Oui, extraire":**
588
- ```javascript
589
- for (const shared of sharedModules) {
590
- // Create new candidate application
591
- candidate_applications.push({
592
- name: shared.name,
593
- description: `Application transversale pour ${shared.name}`,
594
- modules: [shared.name],
595
- context: "business",
596
- isTransversal: true,
597
- consumedBy: shared.applications
598
- });
599
-
600
- // Remove the shared module from original applications
601
- for (const appName of shared.applications) {
602
- const app = candidate_applications.find(a => a.name === appName);
603
- app.modules = app.modules.filter(m => normalizeModuleName(m) !== shared.name);
604
- app.dependencies = app.dependencies || [];
605
- app.dependencies.push({ target: shared.name, type: "data-dependency" });
606
- }
607
- }
608
- ```
609
-
610
- Update `candidate_applications` in the project feature.json.
505
+ The detection process:
506
+ 1. Build module inventory per candidate application
507
+ 2. Detect modules appearing in 2+ applications
508
+ 3. Propose extraction to user with the template from the reference
509
+ 4. IF "Yes" → Extract and update `candidate_applications` in the project feature.json
611
510
 
612
511
  ---
613
512
 
@@ -624,7 +523,7 @@ Application Roles for {application_name}:
624
523
 
625
524
  | Role | Level | Default Permissions |
626
525
  |------|-------|-------------------|
627
- | {App} Admin | admin | business.{app}.* (wildcard) |
526
+ | {App} Admin | admin | {app}.* (wildcard) |
628
527
  | {App} Manager | manager | read, create, update, assign |
629
528
  | {App} Contributor | contributor | read, create, update |
630
529
  | {App} Viewer | viewer | read only |
@@ -687,95 +586,33 @@ options:
687
586
 
688
587
  ### 7. Coverage Matrix with Sections & Resources (MANDATORY)
689
588
 
690
- > **ENRICHMENT: The coverage matrix now includes anticipated sections (Level 4) and resources (Level 5).**
691
- > This gives downstream steps (step-02, step-03) a concrete starting point.
589
+ > **Reference:** Load `references/cadrage-coverage-matrix.md` for complete coverage matrix building and validation rules.
590
+
591
+ **ENRICHMENT:** The coverage matrix now includes anticipated sections (Level 4) and resources (Level 5).
592
+ This gives downstream steps (step-02, step-03) a concrete starting point.
692
593
 
693
594
  BEFORE transitioning to step-02:
694
595
 
695
596
  1. Re-read the original prompt/brief in its entirety
696
597
  2. Re-read ALL answers collected during phases 2-4
697
598
  3. For EACH distinct feature/requirement identified:
698
- a. Create an entry in `cadrage.coverageMatrix[]`
699
- b. Assign it to mustHave, shouldHave, couldHave, or outOfScope
700
- c. Assign the module that will cover it (or null if cross-cutting)
701
- d. **List anticipated sections** (Level 4) — ONLY functional zones (see `references/entity-architecture-decision.md` section 4)
702
- e. **List anticipated resources** (Level 5) for each section
703
- f. **List detail page tabs** — for entities accessible via click from `list`
704
-
705
- > **SECTION RULE:** Sections are functional zones (list, dashboard, approve, import, rapport...).
706
- > `create` and `edit` are SEPARATE PAGES with their own URL routes (`/create` and `/:id/edit`).
707
- > `detail` is a page with tabs accessible by clicking a row in `list`, NOT a standalone section.
708
-
709
- 4. **OUTPUT the matrix as text** (do NOT put it inside AskUserQuestion — it won't render):
710
-
711
- Print a markdown table with columns: **Fonctionnalité | Priorité | Module | Section | Resources clés | Onglets détail**
712
-
713
- Example:
714
- ```
715
- {language == "fr"
716
- ? "Voici la matrice de couverture enrichie. J'ai identifié {N} fonctionnalités :"
717
- : "Here is the enriched coverage matrix. I identified {N} features:"}
718
-
719
- | Fonctionnalité | Priorité | Module | Section | Resources clés | Onglets détail |
720
- |---|---|---|---|---|---|
721
- | Gestion des employés | mustHave | Employees | list | employee-grid, employee-filters, employee-form | Infos, Contrats, Documents |
722
- | Suivi des activités | mustHave | TimeTracking | list | activity-grid, activity-filters, activity-form | Infos, Imputations |
723
- | Saisie d'absences | mustHave | TimeTracking | list | absence-grid, absence-form, absence-calendar | Infos, Justificatifs |
724
- | Rapports temps | shouldHave | TimeTracking | dashboard | time-kpi-cards, time-summary-chart | — |
725
- | Validation absences | shouldHave | TimeTracking | approve | approval-queue, status-timeline | — |
726
- | Export PDF/Excel | couldHave | TimeTracking | rapport | export-panel | — |
727
- | Intégration paie | outOfScope | — | — | — | — |
728
- ```
729
-
730
- 5. **THEN** (after the table is displayed) ask via AskUserQuestion:
731
- ```
732
- question: "{language == 'fr' ? 'Cette matrice de couverture vous convient-elle ?' : 'Does this coverage matrix suit you?'}"
733
- header: "Couverture"
734
- options:
735
- - label: "{language == 'fr' ? 'Oui, parfait' : 'Yes, perfect'}"
736
- description: "{language == 'fr' ? 'La classification et les sections sont correctes' : 'Classification and sections are correct'}"
737
- - label: "{language == 'fr' ? 'Ajouter des éléments' : 'Add items'}"
738
- description: "{language == 'fr' ? 'Il manque des fonctionnalités ou des sections' : 'Missing features or sections'}"
739
- - label: "{language == 'fr' ? 'Réajuster' : 'Readjust'}"
740
- description: "{language == 'fr' ? 'Modifier les priorités, modules ou sections' : 'Change priorities, modules, or sections'}"
741
- ```
742
-
743
- 6. Iterate until the client confirms.
599
+ - Create an entry in `cadrage.coverageMatrix[]`
600
+ - Assign it to mustHave, shouldHave, couldHave, or outOfScope
601
+ - Assign the module that will cover it (or null if cross-cutting)
602
+ - List anticipated sections (Level 4) — ONLY functional zones
603
+ - List anticipated resources (Level 5) for each section
604
+ - List detail page tabs — for entities accessible via click from `list`
744
605
 
745
- **VALIDATION:**
746
- - Every line of the original prompt must map to at least one coverageMatrix entry.
747
- - If a feature is in mustHave → it MUST have at least one anticipated section.
748
- - Accepted suggestions from Phase 4 must appear in the matrix.
606
+ 4. **OUTPUT the matrix as text** (do NOT put it inside AskUserQuestion — it won't render)
749
607
 
750
- **POST-CHECK PRIORITY DISTRIBUTION (BLOCKING):**
608
+ 5. **THEN** (after the table is displayed) ask via AskUserQuestion for confirmation
751
609
 
752
- ```
753
- coverageItems = cadrage.coverageMatrix[]
754
- mustHaveCount = coverageItems.filter(i => i.category === "mustHave").length
755
- shouldHaveCount = coverageItems.filter(i => i.category === "shouldHave").length
756
- couldHaveCount = coverageItems.filter(i => i.category === "couldHave").length
757
- outOfScopeCount = coverageItems.filter(i => i.category === "outOfScope").length
610
+ 6. Iterate until the client confirms
758
611
 
759
- IF shouldHaveCount === 0 AND couldHaveCount === 0 AND outOfScopeCount === 0:
760
- FAIL: ALL {mustHaveCount} items are mustHave no distribution.
761
- ACTION: Return to Phase 3 section 4c and apply MoSCoW question.
762
- DO NOT write cadrage until at least shouldHave OR outOfScope has ≥ 1 item.
763
- → EXCEPTION: If client explicitly confirmed "tout est indispensable" during
764
- Phase 3 section 4c, accept but ADD a changelog entry:
765
- "Client confirmed all {N} features as mustHave after MoSCoW challenge"
766
- ```
767
-
768
- **POST-CHECK — CROSS-CUTTING COVERAGE (WARNING):**
769
-
770
- ```
771
- FOR each item in coverageMatrix WHERE item.module === null:
772
- IF item.category === "mustHave":
773
- → WARNING: "{item.item}" is mustHave but has no assigned module.
774
- → Ensure it is covered by infrastructure or a cross-cutting concern.
775
- → Add a note explaining HOW it will be implemented (e.g., "handled by platform notification service").
776
- IF item.anticipatedSections.length === 0 AND item.category !== "outOfScope":
777
- → WARNING: "{item.item}" has no anticipated sections — will it be implemented?
778
- ```
612
+ **The reference file includes:**
613
+ - Section rule clarification (list, detail, create, edit, dashboard, etc.)
614
+ - Priority distribution POST-CHECK (BLOCKING)
615
+ - Cross-cutting coverage POST-CHECK (WARNING)
779
616
 
780
617
  ---
781
618
 
@@ -858,9 +695,9 @@ Display analysis as markdown:
858
695
  ? "### Analyse multi-application\n\nD'après mon analyse, ce projet couvre plusieurs domaines fonctionnels qui pourraient former des applications indépendantes :\n\n"
859
696
  : "### Multi-Application Analysis\n\nBased on my analysis, this project spans multiple functional domains that could form independent applications:\n\n"}
860
697
 
861
- | Domain | Suggested Context | Suggested Application | Key Modules |
862
- |--------|-------------------|----------------------|-------------|
863
- {for each identified domain: domain name | business/platform/personal | PascalCase name | top modules}
698
+ | Domain | Suggested Application | Key Modules |
699
+ |--------|----------------------|-------------|
700
+ {for each identified domain: domain name | PascalCase name | top modules}
864
701
  ```
865
702
 
866
703
  Ask via AskUserQuestion:
@@ -51,8 +51,7 @@ From the cadrage data, derive the formal application identity:
51
51
  ```javascript
52
52
  applicationCode = toPascalCase(metadata.application) // e.g., "HumanResources"
53
53
  applicationLabel = metadata.application // e.g., "Ressources Humaines" (human-readable)
54
- context = metadata.context // "business" (validated in step-00)
55
- applicationRoute = `/${context}/${toKebabCase(applicationCode)}` // e.g., "/business/human-resources"
54
+ applicationRoute = `/${toKebabCase(applicationCode)}` // e.g., "/human-resources"
56
55
  applicationIcon = suggestIconFromDomain(applicationCode) // e.g., "users" for HR, "shopping-cart" for Sales
57
56
  tablePrefix = metadata.tablePrefix // e.g., "rh_" (already defined in step-01)
58
57
  sort = 1 // First (and only) application
@@ -82,7 +81,6 @@ Display the application identity:
82
81
 
83
82
  | {language == "fr" ? "Niveau" : "Level"} | {language == "fr" ? "Valeur" : "Value"} |
84
83
  |-------|-------|
85
- | Context | `{context}` |
86
84
  | Application Code | `{applicationCode}` |
87
85
  | Application Name | `{applicationLabel}` |
88
86
  | Route | `{applicationRoute}` |
@@ -96,7 +94,7 @@ Display the application identity:
96
94
 
97
95
  | Role | Level | Permission Pattern |
98
96
  |------|-------|--------------------|
99
- {for each role in cadrage.applicationRoles: role.role | role.level | {context}.{kebab(applicationCode)}.* }
97
+ {for each role in cadrage.applicationRoles: role.role | role.level | {kebab(applicationCode)}.* }
100
98
  ```
101
99
 
102
100
  Ask via AskUserQuestion:
@@ -117,7 +115,7 @@ options:
117
115
 
118
116
  ### 0d. Build Application SeedData Entries
119
117
 
120
- Create the `navigationApplications` entry (Level 2 hierarchy entry):
118
+ Create the `navigationApplications` entry (Level 1 hierarchy entry):
121
119
 
122
120
  ```json
123
121
  {
@@ -207,19 +205,19 @@ For EACH candidate application from the cadrage analysis:
207
205
  Display proposed application:
208
206
  ```
209
207
  {language == "fr"
210
- ? "### Application : {suggestedName}\n\n**Contexte de navigation :** {suggestedContext}\n**Description :** {description based on coverage matrix items}"
211
- : "### Application: {suggestedName}\n\n**Navigation context:** {suggestedContext}\n**Description:** {description based on coverage matrix items}"}
208
+ ? "### Application : {suggestedName}\n\n**Description :** {description based on coverage matrix items}"
209
+ : "### Application: {suggestedName}\n\n**Description:** {description based on coverage matrix items}"}
212
210
  ```
213
211
 
214
212
  Ask via AskUserQuestion:
215
213
  ```
216
- question: "{language == 'fr' ? 'Cette application et son contexte vous conviennent-ils ?' : 'Does this application and its context suit you?'}"
214
+ question: "{language == 'fr' ? 'Cette application vous convient-elle ?' : 'Does this application suit you?'}"
217
215
  header: "{appName}"
218
216
  options:
219
217
  - label: "{language == 'fr' ? 'Oui, parfait' : 'Yes, perfect'}"
220
- description: "{language == 'fr' ? 'Nom et contexte corrects' : 'Name and context are correct'}"
218
+ description: "{language == 'fr' ? 'Nom et description corrects' : 'Name and description are correct'}"
221
219
  - label: "{language == 'fr' ? 'Modifier' : 'Modify'}"
222
- description: "{language == 'fr' ? 'Changer le nom, le contexte ou la description' : 'Change name, context, or description'}"
220
+ description: "{language == 'fr' ? 'Changer le nom ou la description' : 'Change name or description'}"
223
221
  ```
224
222
 
225
223
  #### 2b. Table Prefix (per application)
@@ -244,7 +242,7 @@ Based on global roles from cadrage + application-specific needs:
244
242
 
245
243
  | Role | Level | Permission Pattern |
246
244
  |------|-------|--------------------|
247
- {for each role: name | admin/manager/contributor/viewer | context.app.* pattern}
245
+ {for each role: name | admin/manager/contributor/viewer | app.* pattern}
248
246
  ```
249
247
 
250
248
  Ask via AskUserQuestion if additional roles are needed for this specific application.
@@ -300,9 +298,9 @@ Display the full application structure:
300
298
  ? "### Structure du projet\n\nVoici les applications identifiées :"
301
299
  : "### Project Structure\n\nHere are the identified applications:"}
302
300
 
303
- | # | Application | Contexte | Préfixe | Rôles | Dépendances |
304
- |---|-------------|----------|---------|-------|-------------|
305
- {for each app: index | name | context | prefix | role count | dependency list}
301
+ | # | Application | Préfixe | Rôles | Dépendances |
302
+ |---|-------------|---------|-------|-------------|
303
+ {for each app: index | name | prefix | role count | dependency list}
306
304
 
307
305
  {language == "fr"
308
306
  ? "### Ordre de traitement\n\nLes applications seront traitées dans cet ordre (fondations d'abord) :"
@@ -343,9 +341,8 @@ ba-writer.createApplicationFeature({
343
341
  metadata: {
344
342
  application: {app.code},
345
343
  applicationCode: {toPascalCase(app.code)},
346
- applicationRoute: {`/${app.context}/${toKebabCase(app.code)}`},
344
+ applicationRoute: {`/${toKebabCase(app.code)}`},
347
345
  applicationIcon: {app.icon},
348
- context: {app.context},
349
346
  language: {language},
350
347
  featureDescription: {app.description},
351
348
  workflowType: "new",
@@ -375,7 +372,6 @@ ba-writer.enrichApplicationRegistry({
375
372
  {
376
373
  code: {app1.code},
377
374
  name: {app1.name},
378
- context: {app1.context},
379
375
  tablePrefix: {app1.tablePrefix},
380
376
  icon: {app1.icon},
381
377
  route: {app1.route},
@@ -407,9 +403,9 @@ ba-writer.updateStatus({project_id}, "decomposed")
407
403
  ? "### Décomposition en applications terminée\n\n"
408
404
  : "### Application decomposition complete\n\n"}
409
405
 
410
- | Application | Contexte | Préfixe | Route | Feature ID |
411
- |-------------|----------|---------|-------|------------|
412
- {for each app: name | context | prefix | route | FEAT-NNN}
406
+ | Application | Préfixe | Route | Feature ID |
407
+ |-------------|---------|-------|------------|
408
+ {for each app: name | prefix | route | FEAT-NNN}
413
409
 
414
410
  {language == "fr"
415
411
  ? "→ Prochaine étape : décomposition en modules pour **{firstApp}** (application {1}/{total})"
@@ -303,7 +303,7 @@ ba-writer.updateStatus({feature_id}, "decomposed")
303
303
 
304
304
  For each module in moduleOrder:
305
305
  ```
306
- Create: docs/business/{app}/{module_code}/business-analyse/v1.0/
306
+ Create: docs/{app}/{module_code}/business-analyse/v1.0/
307
307
  ```
308
308
 
309
309
  > Module feature.json files will be created by step-03 when each module is processed.
@@ -128,7 +128,7 @@ ba-writer.create({
128
128
  scope: "module",
129
129
  applicationRef: {feature_id},
130
130
  moduleCode: {currentModule.code},
131
- path: "docs/business/{app}/{module_code}/business-analyse/v1.0/feature.json"
131
+ path: "docs/{app}/{module_code}/business-analyse/v1.0/feature.json"
132
132
  })
133
133
 
134
134
  // Inherit application roles from master
@@ -213,8 +213,8 @@ Total: {N} requirements mapped to this module
213
213
 
214
214
  ### 3. Section Walkthrough with Client
215
215
 
216
- > **This is the key interactive phase aligned with the 5-level SmartStack hierarchy.**
217
- > Level 3 = Module, Level 4 = Section, Level 5 = Resource
216
+ > **This is the key interactive phase aligned with the 4-level SmartStack hierarchy.**
217
+ > Level 2 = Module, Level 3 = Section, Level 4 = Resource
218
218
 
219
219
  #### 3a. Identify Module Sections
220
220
 
@@ -435,7 +435,7 @@ ULTRATHINK — Entity Architecture Analysis for {entity_name} (discovered during
435
435
  - **{language == "fr" ? "Recommandation" : "Recommendation"}** : **{recommended_option}** — {reasoning}
436
436
  ```
437
437
 
438
- **IF recommendation = new_module AND confidence >= MEDIUM, ALSO display the architecture proposal** (same format as cadrage 4d-bis Phase 2: Context/Application/Module table + Sections table + Detail tabs table + Impact).
438
+ **IF recommendation = new_module AND confidence >= MEDIUM, ALSO display the architecture proposal** (same format as cadrage 4d-bis Phase 2: Application/Module table + Sections table + Detail tabs table + Impact).
439
439
 
440
440
  ##### C. Ask with Recommended Option First
441
441
 
@@ -226,7 +226,7 @@ Extract business rules specific to this module:
226
226
 
227
227
  Before proceeding to step-03b-ui.md, VERIFY:
228
228
 
229
- 1. **Module feature.json exists** at expected path (`docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json`)
229
+ 1. **Module feature.json exists** at expected path (`docs/{app}/business-analyse/v{X.Y}/feature.json`)
230
230
  2. **Module feature.json has analysis section** with `entities[]` (at least 1) and `businessRules[]` (at least 1)
231
231
  3. **Entity schema compliance (BLOCKING)** — EVERY entity has `attributes[]` (NOT `fields[]`) and `relationships[]` arrays.
232
232
  Quick check: `analysis.entities.every(e => Array.isArray(e.attributes) && e.attributes.length >= 1)`
@@ -100,7 +100,7 @@ Ask client: "Depuis l'état {state}, quelles transitions sont possibles ?"
100
100
  "transitions": [
101
101
  {
102
102
  "from": "draft", "to": "submitted", "action": "submit",
103
- "permission": "business.{app}.{module}.submit",
103
+ "permission": "{app}.{module}.submit",
104
104
  "guards": ["BR-VAL-{PREFIX}-001"],
105
105
  "effects": [{ "type": "notification", "target": "role:manager", "template": "{module}-submitted" }],
106
106
  "confirm": true
@@ -255,7 +255,7 @@ A wireframe without `componentMapping` or `layout` will FAIL validation in step
255
255
 
256
256
  Adaptation rules for the detail mockup:
257
257
  - **Header**: entity code + name + status badge (if lifeCycles) + action buttons (edit, delete)
258
- - **Back button**: navigates to `/business/{app}/{module}`
258
+ - **Back button**: navigates to `/{app}/{module}`
259
259
  - **Tabs**: one per identified tab (Info + relations + history)
260
260
  - **Info tab content**: all entity attributes as label:value pairs (read-only by default)
261
261
  - **Edit button**: toggles the Info tab into SmartForm edit mode
@@ -273,7 +273,7 @@ Transition buttons are contextual: only show actions allowed from the current st
273
273
  5. **Store** in `specification.uiWireframes[]` with `section: "detail"`.
274
274
  See [references/ui-resource-cards.md](../references/ui-resource-cards.md) "Detail Page Wireframe" for exact JSON format.
275
275
 
276
- 6. **Create the detail section** in `specification.sections[]` with `navigation: "hidden"` and route `/business/{app}/{module}/:id`.
276
+ 6. **Create the detail section** in `specification.sections[]` with `navigation: "hidden"` and route `/{app}/{module}/:id`.
277
277
  See [references/ui-resource-cards.md](../references/ui-resource-cards.md) "Detail Page section" for exact JSON format.
278
278
 
279
279
  ### 3b-bis. Wireframe-to-Component Mapping
@@ -312,7 +312,7 @@ For EACH wireframe generated in 3b, generate a `layout` object alongside the ASC
312
312
  "regions": [
313
313
  { "id": "toolbar", "position": "top", "components": [
314
314
  { "type": "FilterBar", "resourceRef": "{module}-filters" },
315
- { "type": "ActionMenu", "resourceRef": "{module}-actions", "permission": "business.{app}.{module}.create" }
315
+ { "type": "ActionMenu", "resourceRef": "{module}-actions", "permission": "{app}.{module}.create" }
316
316
  ]},
317
317
  { "id": "content", "position": "main", "span": 12, "components": [
318
318
  { "type": "SmartTable", "resourceRef": "{module}-grid" }