@atlashub/smartstack-cli 4.74.0 → 4.76.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 (121) hide show
  1. package/dist/index.js +152 -31
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +14 -3
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/agents/ba-reader.md +17 -15
  7. package/templates/agents/ba-writer.md +49 -51
  8. package/templates/skills/apex/SKILL.md +2 -2
  9. package/templates/skills/apex/_shared.md +1 -1
  10. package/templates/skills/apex/references/checks/backend-checks.sh +21 -7
  11. package/templates/skills/apex/references/checks/frontend-checks.sh +26 -0
  12. package/templates/skills/apex/references/checks/infrastructure-checks.sh +47 -10
  13. package/templates/skills/apex/references/checks/seed-checks.sh +47 -7
  14. package/templates/skills/apex/references/core-seed-data.md +20 -18
  15. package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +3 -0
  16. package/templates/skills/apex/references/post-checks.md +23 -3
  17. package/templates/skills/apex/references/smartstack-api.md +4 -4
  18. package/templates/skills/apex/references/smartstack-frontend.md +54 -8
  19. package/templates/skills/apex/references/smartstack-layers.md +6 -6
  20. package/templates/skills/apex/steps/step-00-init.md +75 -1
  21. package/templates/skills/apex/steps/step-03-execute.md +16 -4
  22. package/templates/skills/apex/steps/step-03b-layer1-seed.md +65 -6
  23. package/templates/skills/apex/steps/step-03c-layer2-backend.md +50 -5
  24. package/templates/skills/apex/steps/step-03d-layer3-frontend.md +226 -4
  25. package/templates/skills/apex/steps/step-04-examine.md +163 -0
  26. package/templates/skills/apex-verify/SKILL.md +110 -0
  27. package/templates/skills/apex-verify/references/audit-rules.md +50 -0
  28. package/templates/skills/apex-verify/steps/step-00-init.md +119 -0
  29. package/templates/skills/apex-verify/steps/step-01-nav-audit.md +92 -0
  30. package/templates/skills/apex-verify/steps/step-02-crud-audit.md +127 -0
  31. package/templates/skills/apex-verify/steps/step-03-perm-audit.md +119 -0
  32. package/templates/skills/apex-verify/steps/step-04-route-audit.md +98 -0
  33. package/templates/skills/apex-verify/steps/step-05-report.md +110 -0
  34. package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +3 -0
  35. package/templates/skills/application/templates-frontend.md +2 -2
  36. package/templates/skills/business-analyse/SKILL.md +17 -3
  37. package/templates/skills/business-analyse/_shared.md +64 -0
  38. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +34 -26
  39. package/templates/skills/business-analyse/questionnaire/01-context.md +13 -9
  40. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +20 -27
  41. package/templates/skills/business-analyse/questionnaire.md +86 -9
  42. package/templates/skills/business-analyse/references/03-json-schemas.md +221 -0
  43. package/templates/skills/business-analyse/references/03-post-check-validation.md +208 -0
  44. package/templates/skills/business-analyse/references/03-smartstack-entity-guards.md +32 -0
  45. package/templates/skills/business-analyse/references/04-cross-module-validation.md +95 -0
  46. package/templates/skills/business-analyse/references/04-file-allocation.md +162 -0
  47. package/templates/skills/business-analyse/references/04-naming-audit-checks.md +174 -0
  48. package/templates/skills/business-analyse/references/04-semantic-validation-matrix.md +118 -0
  49. package/templates/skills/business-analyse/references/canonical-json-formats.md +7 -3
  50. package/templates/skills/business-analyse/references/domain-research-playbook.md +234 -0
  51. package/templates/skills/business-analyse/references/entity-sourcing-presentation.md +166 -0
  52. package/templates/skills/business-analyse/references/init-resume-logic.md +70 -0
  53. package/templates/skills/business-analyse/references/module-completeness-challenge.md +174 -0
  54. package/templates/skills/business-analyse/references/multi-app-detection.md +149 -0
  55. package/templates/skills/business-analyse/references/portal-classification.md +52 -0
  56. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  57. package/templates/skills/business-analyse/references/validation-checklist.md +35 -6
  58. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +50 -6
  59. package/templates/skills/business-analyse/steps/step-00-init.md +22 -190
  60. package/templates/skills/business-analyse/steps/step-01-cadrage.md +365 -269
  61. package/templates/skills/business-analyse/steps/step-02-structure.md +98 -20
  62. package/templates/skills/business-analyse/steps/step-03-specify.md +810 -229
  63. package/templates/skills/business-analyse/steps/step-04-consolidate.md +509 -278
  64. package/templates/skills/business-analyse-design/SKILL.md +10 -0
  65. package/templates/skills/business-analyse-design/references/screens-post-check.md +221 -0
  66. package/templates/skills/business-analyse-design/references/screens-type-mapping.md +138 -0
  67. package/templates/skills/business-analyse-design/references/smartcomponents-templates.md +225 -0
  68. package/templates/skills/{business-analyse → business-analyse-design}/references/spec-auto-inference.md +117 -117
  69. package/templates/skills/business-analyse-design/steps/step-01-screens.md +36 -162
  70. package/templates/skills/business-analyse-design/steps/step-02-wireframes.md +8 -7
  71. package/templates/skills/business-analyse-design/steps/step-03-navigation.md +89 -42
  72. package/templates/skills/business-analyse-develop/references/compact-loop.md +9 -0
  73. package/templates/skills/business-analyse-develop/references/handoff-quality-gate.md +132 -0
  74. package/templates/skills/business-analyse-develop/references/prd-v3-transformation.md +326 -0
  75. package/templates/skills/business-analyse-develop/references/report-reconciliation.md +140 -0
  76. package/templates/skills/business-analyse-develop/references/report-template.md +142 -0
  77. package/templates/skills/business-analyse-develop/steps/step-01-task.md +5 -177
  78. package/templates/skills/business-analyse-develop/steps/step-02-execute.md +17 -4
  79. package/templates/skills/business-analyse-develop/steps/step-03-commit.md +6 -2
  80. package/templates/skills/business-analyse-develop/steps/step-04-check.md +6 -0
  81. package/templates/skills/business-analyse-develop/steps/step-05-report.md +3 -269
  82. package/templates/skills/business-analyse-handoff/SKILL.md +10 -0
  83. package/templates/skills/business-analyse-handoff/references/agent-handoff-transform-prompt.md +211 -0
  84. package/templates/skills/business-analyse-handoff/references/context-isolation-pattern.md +47 -0
  85. package/templates/skills/business-analyse-handoff/references/handoff-file-inventory.md +49 -0
  86. package/templates/skills/business-analyse-handoff/references/handoff-global-validation.md +142 -0
  87. package/templates/skills/business-analyse-handoff/references/prd-validation-checks.md +125 -0
  88. package/templates/skills/business-analyse-handoff/references/project-index-update.md +98 -0
  89. package/templates/skills/business-analyse-handoff/steps/step-01-transform.md +9 -160
  90. package/templates/skills/business-analyse-handoff/steps/step-02-export.md +10 -99
  91. package/templates/skills/business-analyse-html/SKILL.md +10 -0
  92. package/templates/skills/business-analyse-html/html/ba-interactive.html +504 -97
  93. package/templates/skills/business-analyse-html/html/src/scripts/01-data-init.js +79 -2
  94. package/templates/skills/business-analyse-html/html/src/scripts/02-navigation.js +6 -46
  95. package/templates/skills/business-analyse-html/html/src/scripts/05-render-specs.js +80 -11
  96. package/templates/skills/business-analyse-html/html/src/scripts/06-render-consolidation.js +2 -2
  97. package/templates/skills/business-analyse-html/html/src/scripts/06-render-mockups.js +94 -36
  98. package/templates/skills/business-analyse-html/html/src/scripts/12-render-diagrams.js +162 -0
  99. package/templates/skills/business-analyse-html/html/src/styles/10-diagrams.css +73 -0
  100. package/templates/skills/business-analyse-html/html/src/template.html +2 -0
  101. package/templates/skills/business-analyse-html/references/02-embedded-artifacts-building.md +144 -0
  102. package/templates/skills/business-analyse-html/references/02-feature-data-building.md +143 -0
  103. package/templates/skills/business-analyse-html/references/02-mapping-tables.md +442 -0
  104. package/templates/skills/business-analyse-html/references/02-normalization-helpers.md +139 -0
  105. package/templates/skills/business-analyse-html/references/02-screen-format-detection.md +283 -0
  106. package/templates/skills/business-analyse-html/references/02-self-check-validation.md +199 -0
  107. package/templates/skills/business-analyse-html/references/data-build.md +24 -1
  108. package/templates/skills/business-analyse-html/references/data-mapping.md +119 -17
  109. package/templates/skills/business-analyse-html/steps/step-02-build-data.md +18 -555
  110. package/templates/skills/business-analyse-html/steps/step-04-verify.md +92 -3
  111. package/templates/skills/business-analyse-quick/SKILL.md +807 -0
  112. package/templates/skills/{sketch → business-analyse-quick}/references/domain-heuristics.md +59 -3
  113. package/templates/skills/business-analyse-quick/references/prd-schema.md +268 -0
  114. package/templates/skills/business-analyse-review/SKILL.md +10 -0
  115. package/templates/skills/business-analyse-review/references/review-data-mapping.md +6 -0
  116. package/templates/skills/business-analyse-status/SKILL.md +8 -0
  117. package/templates/skills/dev-start/SKILL.md +143 -307
  118. package/templates/skills/efcore/SKILL.md +13 -0
  119. package/templates/skills/sketch/SKILL.md +15 -153
  120. package/templates/skills/ui-components/SKILL.md +1 -1
  121. package/templates/skills/ui-components/patterns/data-table.md +1 -1
@@ -51,9 +51,16 @@ Build a JSON object following this **exact mapping** from index.json to the HTML
51
51
  validated: ac.validated || false
52
52
  }))
53
53
  },
54
+ // Multi-app support: applications[] from navigation.json or index.json
55
+ applications: (collected_data.navigation?.applications || master.applications || []).map(app => ({
56
+ code: app.code,
57
+ name: app.name || app.code,
58
+ icon: app.icon || ""
59
+ })),
54
60
  modules: master.modules.map(m => ({
55
61
  code: m.code,
56
62
  name: m.name || m.code, // display name (MANDATORY, separate from code)
63
+ applicationCode: m.applicationCode || "", // for multi-app sidebar grouping
57
64
  description: m.description || "",
58
65
  featureType: m.featureType || "data-centric",
59
66
  entities: m.entities || [],
@@ -115,6 +122,7 @@ moduleSpecs[moduleCode] = {
115
122
  name: uc.name || uc.title || uc.id || "", // Format A: "name", Format B: "title" or "id"
116
123
  sectionCode: uc.sectionCode || "",
117
124
  actor: uc.primaryActor || uc.actor || "", // Format A: "primaryActor", Format B: "actor"
125
+ description: uc.description || "", // Optional description field
118
126
  // SAFETY NET: steps may be string[] or object[] ({step, action})
119
127
  steps: (uc.mainScenario || uc.steps || []).map(s =>
120
128
  typeof s === 'string' ? s : (s.action || s.description || "")
@@ -123,7 +131,10 @@ moduleSpecs[moduleCode] = {
123
131
  (a.name || a.trigger || "") + ": " + (a.steps || a.actions || []).map(s =>
124
132
  typeof s === 'string' ? s : (s.action || s.description || "")
125
133
  ).join(", ")
126
- ).join("\n")
134
+ ).join("\n"),
135
+ preconditions: uc.preconditions || [], // Array of precondition objects or strings
136
+ postconditions: uc.postconditions || [], // Array of postcondition objects or strings
137
+ errorScenarios: uc.errorScenarios || [] // Array of error scenario objects
127
138
  })),
128
139
  businessRules: rawBRs.map(br => ({
129
140
  name: br.name || br.id || "",
@@ -159,33 +170,124 @@ The HTML uses `"Role|Action"` format (e.g. `"RH Admin|Consulter"`):
159
170
 
160
171
  ```javascript
161
172
  // Input: permissions object from flat file (mod.permissions), NOT moduleFeature
162
- function buildPermissionKeys(permissionsData) {
173
+ // lang: optional language override ('fr' or 'en'), defaults to 'fr'
174
+ function buildPermissionKeys(permissionsData, lang = 'fr') {
163
175
  const keys = [];
176
+
177
+ // Bilingual actionMap based on language parameter
178
+ const actionMap = lang === 'en'
179
+ ? {
180
+ read: 'Read', create: 'Create', update: 'Update', delete: 'Delete',
181
+ approve: 'Approve', export: 'Export', validate: 'Validate', admin: 'Admin',
182
+ Read: 'Read', Create: 'Create', Update: 'Update', Delete: 'Delete',
183
+ Approve: 'Approve', Export: 'Export', Validate: 'Validate', Admin: 'Admin',
184
+ submit: 'Validate', import: 'Create', Submit: 'Validate', Import: 'Create'
185
+ }
186
+ : {
187
+ read: 'Consulter', create: 'Créer', update: 'Modifier', delete: 'Supprimer',
188
+ approve: 'Valider', export: 'Exporter', validate: 'Valider', admin: 'Administrer',
189
+ Read: 'Consulter', Create: 'Créer', Update: 'Modifier', Delete: 'Supprimer',
190
+ Approve: 'Valider', Export: 'Exporter', Validate: 'Valider', Admin: 'Administrer',
191
+ submit: 'Valider', import: 'Créer', Submit: 'Valider', Import: 'Créer'
192
+ };
193
+
164
194
  const matrix = permissionsData?.matrix || permissionsData?.permissionMatrix;
165
- if (!matrix) return keys;
166
- const actionMap = { read: "Consulter", create: "Creer", update: "Modifier",
167
- delete: "Supprimer", validate: "Valider", export: "Exporter",
168
- submit: "Valider", import: "Creer" };
169
- (matrix.roleAssignments || []).forEach(ra => {
170
- (ra.permissions || []).forEach(permPath => {
171
- const action = permPath.split(".").pop(); // last segment = action
172
- if (action === "*") {
173
- // Wildcard: expand to all standard actions
174
- Object.values(actionMap).forEach(uiAction => {
195
+
196
+ // Format A: matrix is array of { role, permissions[] } (ba-009+ format)
197
+ if (Array.isArray(matrix)) {
198
+ matrix.forEach(entry => {
199
+ const role = entry.role || "";
200
+ (entry.permissions || []).forEach(perm => {
201
+ const action = perm.split(".").pop(); // "Read" or "HumanResources.Employees.Read"
202
+ if (action === "*") {
203
+ Object.values(actionMap).forEach(uiAction => {
204
+ const key = role + "|" + uiAction;
205
+ if (!keys.includes(key)) keys.push(key);
206
+ });
207
+ } else {
208
+ const uiAction = actionMap[action] || action;
209
+ const key = role + "|" + uiAction;
210
+ if (!keys.includes(key)) keys.push(key);
211
+ }
212
+ });
213
+ });
214
+ return keys;
215
+ }
216
+
217
+ // Format B: legacy matrix.roleAssignments[] format
218
+ if (matrix && matrix.roleAssignments) {
219
+ (matrix.roleAssignments || []).forEach(ra => {
220
+ (ra.permissions || []).forEach(permPath => {
221
+ const action = permPath.split(".").pop();
222
+ if (action === "*") {
223
+ Object.values(actionMap).forEach(uiAction => {
224
+ const key = ra.role + "|" + uiAction;
225
+ if (!keys.includes(key)) keys.push(key);
226
+ });
227
+ } else {
228
+ const uiAction = actionMap[action] || action;
175
229
  const key = ra.role + "|" + uiAction;
176
230
  if (!keys.includes(key)) keys.push(key);
231
+ }
232
+ });
233
+ });
234
+ return keys;
235
+ }
236
+
237
+ // Format C: permissions.json from step-03 with top-level roles[]
238
+ if (keys.length === 0 && permissionsData?.roles) {
239
+ const actionMap_C = lang === 'en'
240
+ ? { read: 'Read', create: 'Create', update: 'Update', delete: 'Delete', approve: 'Approve', export: 'Export', validate: 'Validate', admin: 'Admin' }
241
+ : { read: 'Consulter', create: 'Créer', update: 'Modifier', delete: 'Supprimer', approve: 'Valider', export: 'Exporter', validate: 'Valider', admin: 'Administrer' };
242
+
243
+ permissionsData.roles.forEach(entry => {
244
+ const role = entry.role || entry.name || '';
245
+ (entry.permissions || entry.actions || []).forEach(perm => {
246
+ const action = typeof perm === 'string' ? perm.split('.').pop().toLowerCase() : (perm.action || '').toLowerCase();
247
+ const uiAction = actionMap_C[action] || action;
248
+ const key = role + '|' + uiAction;
249
+ if (role && !keys.includes(key)) keys.push(key);
250
+ });
251
+ // Handle wildcard patterns like "HumanResources.*"
252
+ if ((entry.permissionPattern || '').endsWith('*')) {
253
+ Object.values(actionMap_C).forEach(a => {
254
+ const key = (entry.role || entry.name) + '|' + a;
255
+ if (!keys.includes(key)) keys.push(key);
177
256
  });
178
- } else {
179
- const uiAction = actionMap[action] || action;
180
- keys.push(ra.role + "|" + uiAction);
181
257
  }
182
258
  });
183
- });
259
+ }
260
+
261
+ // Format D: permissionMatrix.roleAssignments[]
262
+ if (keys.length === 0 && permissionsData?.permissionMatrix?.roleAssignments) {
263
+ const actionMap_D = lang === 'en'
264
+ ? { read: 'Read', create: 'Create', update: 'Update', delete: 'Delete', approve: 'Approve', export: 'Export', validate: 'Validate', admin: 'Admin' }
265
+ : { read: 'Consulter', create: 'Créer', update: 'Modifier', delete: 'Supprimer', approve: 'Valider', export: 'Exporter', validate: 'Valider', admin: 'Administrer' };
266
+
267
+ permissionsData.permissionMatrix.roleAssignments.forEach(entry => {
268
+ const role = entry.role || '';
269
+ (entry.permissions || []).forEach(perm => {
270
+ if (typeof perm === 'string' && perm.endsWith('.*')) {
271
+ // Wildcard: expand to all standard actions
272
+ Object.values(actionMap_D).forEach(a => {
273
+ const key = role + '|' + a;
274
+ if (!keys.includes(key)) keys.push(key);
275
+ });
276
+ } else {
277
+ const action = typeof perm === 'string' ? perm.split('.').pop().toLowerCase() : '';
278
+ const uiAction = actionMap_D[action] || action;
279
+ const key = role + '|' + uiAction;
280
+ if (role && action && !keys.includes(key)) keys.push(key);
281
+ }
282
+ });
283
+ });
284
+ }
285
+
184
286
  return keys;
185
287
  }
186
288
  ```
187
289
 
188
- > **Language handling:** The actionMap should use `metadata.language` to select the correct labels. For `fr`: Consulter/Créer/Modifier/Supprimer. For `en`: Read/Create/Update/Delete. Default to English if language is unknown.
290
+ > **Language handling:** The function accepts an optional `lang` parameter ('fr' or 'en'). Defaults to 'fr' (French). For English labels: Read/Create/Update/Delete/Export/Validate. For French: Consulter/Créer/Modifier/Supprimer/Exporter/Valider.
189
291
 
190
292
  ### Frequency Mapping
191
293