@atlashub/smartstack-cli 3.36.0 → 3.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/dist/index.js +16 -24
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +201 -256
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +3 -2
  6. package/scripts/extract-api-endpoints.ts +325 -0
  7. package/scripts/extract-business-rules.ts +440 -0
  8. package/scripts/generate-doc-with-mock-ui.ts +804 -0
  9. package/scripts/health-check.sh +168 -0
  10. package/scripts/postinstall.js +18 -0
  11. package/templates/agents/ba-reader.md +9 -9
  12. package/templates/agents/ba-writer.md +12 -15
  13. package/templates/agents/code-reviewer.md +1 -1
  14. package/templates/agents/docs-context-reader.md +1 -1
  15. package/templates/agents/gitflow/merge.md +0 -4
  16. package/templates/agents/gitflow/pr.md +0 -4
  17. package/templates/agents/gitflow/start.md +30 -5
  18. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +20 -20
  19. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +16 -24
  20. package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +2 -2
  21. package/templates/skills/_resources/mcp-validate-documentation-spec.md +3 -3
  22. package/templates/skills/_shared.md +15 -17
  23. package/templates/skills/ai-prompt/SKILL.md +1 -1
  24. package/templates/skills/ai-prompt/steps/step-00-init.md +47 -0
  25. package/templates/skills/apex/SKILL.md +3 -4
  26. package/templates/skills/apex/_shared.md +10 -20
  27. package/templates/skills/apex/references/analysis-methods.md +141 -0
  28. package/templates/skills/apex/references/challenge-questions.md +1 -21
  29. package/templates/skills/apex/references/core-seed-data.md +35 -57
  30. package/templates/skills/apex/references/examine-build-validation.md +87 -0
  31. package/templates/skills/apex/references/execution-frontend-gates.md +177 -0
  32. package/templates/skills/apex/references/execution-frontend-patterns.md +105 -0
  33. package/templates/skills/apex/references/execution-layer1-rules.md +96 -0
  34. package/templates/skills/apex/references/initialization-challenge-flow.md +110 -0
  35. package/templates/skills/apex/references/planning-layer-mapping.md +151 -0
  36. package/templates/skills/apex/references/post-checks.md +145 -40
  37. package/templates/skills/apex/references/smartstack-api.md +35 -51
  38. package/templates/skills/apex/references/smartstack-frontend.md +17 -17
  39. package/templates/skills/apex/references/smartstack-layers.md +38 -62
  40. package/templates/skills/apex/steps/step-00-init.md +14 -26
  41. package/templates/skills/apex/steps/step-01-analyze.md +10 -143
  42. package/templates/skills/apex/steps/step-02-plan.md +10 -92
  43. package/templates/skills/apex/steps/step-03-execute.md +47 -249
  44. package/templates/skills/apex/steps/step-04-examine.md +14 -78
  45. package/templates/skills/apex/steps/step-05-deep-review.md +2 -2
  46. package/templates/skills/apex/steps/step-08-run-tests.md +2 -0
  47. package/templates/skills/application/SKILL.md +6 -7
  48. package/templates/skills/application/references/backend-controller-hierarchy.md +16 -16
  49. package/templates/skills/application/references/backend-seeding-and-dto-output.md +83 -0
  50. package/templates/skills/application/references/backend-table-prefix-mapping.md +79 -0
  51. package/templates/skills/application/references/backend-verification.md +1 -1
  52. package/templates/skills/application/references/frontend-i18n-and-output.md +67 -0
  53. package/templates/skills/application/references/frontend-route-naming.md +117 -0
  54. package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +107 -0
  55. package/templates/skills/application/references/frontend-verification.md +12 -12
  56. package/templates/skills/application/references/init-parameter-detection.md +120 -0
  57. package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
  58. package/templates/skills/application/references/nav-fallback-procedure.md +5 -6
  59. package/templates/skills/application/references/provider-template.md +2 -6
  60. package/templates/skills/application/references/roles-client-project-handling.md +55 -0
  61. package/templates/skills/application/references/roles-fallback-procedure.md +149 -0
  62. package/templates/skills/application/references/test-coverage-requirements.md +213 -0
  63. package/templates/skills/application/references/test-frontend.md +3 -3
  64. package/templates/skills/application/steps/step-00-init.md +11 -141
  65. package/templates/skills/application/steps/step-01-navigation.md +3 -3
  66. package/templates/skills/application/steps/step-02-permissions.md +4 -4
  67. package/templates/skills/application/steps/step-03-roles.md +18 -175
  68. package/templates/skills/application/steps/step-03b-provider.md +1 -2
  69. package/templates/skills/application/steps/step-04-backend.md +19 -110
  70. package/templates/skills/application/steps/step-05-frontend.md +17 -143
  71. package/templates/skills/application/steps/step-06-migration.md +12 -60
  72. package/templates/skills/application/steps/step-07-tests.md +9 -76
  73. package/templates/skills/application/templates-backend.md +29 -27
  74. package/templates/skills/application/templates-frontend.md +48 -48
  75. package/templates/skills/application/templates-seed.md +57 -131
  76. package/templates/skills/business-analyse/SKILL.md +27 -30
  77. package/templates/skills/business-analyse/_architecture.md +6 -6
  78. package/templates/skills/business-analyse/_shared.md +60 -88
  79. package/templates/skills/business-analyse/questionnaire/04-data.md +3 -3
  80. package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
  81. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +1 -1
  82. package/templates/skills/business-analyse/react/application-viewer.md +12 -12
  83. package/templates/skills/business-analyse/react/components.md +8 -12
  84. package/templates/skills/business-analyse/react/schema.md +11 -11
  85. package/templates/skills/business-analyse/references/agent-module-prompt.md +2 -3
  86. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +190 -0
  87. package/templates/skills/business-analyse/references/cache-warming-strategy.md +2 -2
  88. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +41 -0
  89. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +74 -0
  90. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +69 -0
  91. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +1 -1
  92. package/templates/skills/business-analyse/references/compilation-structure-cards.md +297 -0
  93. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
  94. package/templates/skills/business-analyse/references/deploy-modes.md +5 -5
  95. package/templates/skills/business-analyse/references/detection-strategies.md +7 -7
  96. package/templates/skills/business-analyse/references/handoff-file-templates.md +14 -22
  97. package/templates/skills/business-analyse/references/handoff-mappings.md +4 -4
  98. package/templates/skills/business-analyse/references/handoff-seeddata-generation.md +312 -0
  99. package/templates/skills/business-analyse/references/init-schema-deployment.md +3 -3
  100. package/templates/skills/business-analyse/references/naming-conventions.md +22 -24
  101. package/templates/skills/business-analyse/references/prd-generation.md +2 -2
  102. package/templates/skills/business-analyse/references/review-data-mapping.md +2 -2
  103. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  104. package/templates/skills/business-analyse/references/spec-auto-inference.md +3 -3
  105. package/templates/skills/business-analyse/references/team-orchestration.md +49 -6
  106. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  107. package/templates/skills/business-analyse/references/ui-resource-cards.md +18 -18
  108. package/templates/skills/business-analyse/references/validate-incremental-html.md +2 -2
  109. package/templates/skills/business-analyse/references/validation-checklist.md +2 -2
  110. package/templates/skills/business-analyse/schemas/application-schema.json +4 -5
  111. package/templates/skills/business-analyse/schemas/project-schema.json +1 -6
  112. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -3
  113. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +4 -4
  114. package/templates/skills/business-analyse/steps/step-00-init.md +8 -17
  115. package/templates/skills/business-analyse/steps/step-01-cadrage.md +35 -198
  116. package/templates/skills/business-analyse/steps/step-01b-applications.md +16 -20
  117. package/templates/skills/business-analyse/steps/step-02-decomposition.md +1 -1
  118. package/templates/skills/business-analyse/steps/step-03a1-setup.md +4 -4
  119. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +1 -1
  120. package/templates/skills/business-analyse/steps/step-03b-ui.md +4 -4
  121. package/templates/skills/business-analyse/steps/step-03c-compile.md +66 -140
  122. package/templates/skills/business-analyse/steps/step-03d-validate.md +2 -2
  123. package/templates/skills/business-analyse/steps/step-04a-collect.md +2 -2
  124. package/templates/skills/business-analyse/steps/step-04b-analyze.md +42 -160
  125. package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
  126. package/templates/skills/business-analyse/steps/step-05a-handoff.md +74 -104
  127. package/templates/skills/business-analyse/steps/step-05b-deploy.md +13 -11
  128. package/templates/skills/business-analyse/steps/step-06-review.md +3 -3
  129. package/templates/skills/business-analyse/templates/tpl-frd.md +13 -13
  130. package/templates/skills/business-analyse/templates/tpl-handoff.md +12 -12
  131. package/templates/skills/business-analyse/templates-frd.md +25 -25
  132. package/templates/skills/business-analyse/templates-react.md +15 -21
  133. package/templates/skills/controller/SKILL.md +1 -1
  134. package/templates/skills/controller/postman-templates.md +1 -1
  135. package/templates/skills/controller/references/controller-code-templates.md +2 -2
  136. package/templates/skills/controller/references/mcp-scaffold-workflow.md +209 -0
  137. package/templates/skills/controller/references/permission-sync-templates.md +13 -16
  138. package/templates/skills/controller/steps/step-00-init.md +11 -11
  139. package/templates/skills/controller/steps/step-03-generate.md +64 -103
  140. package/templates/skills/controller/templates.md +67 -71
  141. package/templates/skills/debug/SKILL.md +13 -218
  142. package/templates/skills/debug/steps/step-00-init.md +57 -0
  143. package/templates/skills/debug/steps/step-01-analyze.md +219 -0
  144. package/templates/skills/debug/steps/step-02-resolve.md +85 -0
  145. package/templates/skills/documentation/SKILL.md +49 -345
  146. package/templates/skills/documentation/data-schema.md +11 -8
  147. package/templates/skills/documentation/steps/step-00-init.md +70 -0
  148. package/templates/skills/documentation/steps/step-01-scan.md +113 -0
  149. package/templates/skills/documentation/steps/step-02-generate.md +231 -0
  150. package/templates/skills/documentation/steps/step-03-validate.md +238 -0
  151. package/templates/skills/documentation/templates.md +480 -322
  152. package/templates/skills/efcore/references/both-contexts.md +32 -0
  153. package/templates/skills/efcore/references/database-operations.md +67 -0
  154. package/templates/skills/efcore/references/destructive-operations.md +38 -0
  155. package/templates/skills/efcore/references/reset-operations.md +81 -0
  156. package/templates/skills/efcore/references/seed-methods.md +86 -0
  157. package/templates/skills/efcore/references/shared-init-functions.md +250 -0
  158. package/templates/skills/efcore/references/sql-objects-injection.md +61 -0
  159. package/templates/skills/efcore/references/troubleshooting.md +81 -0
  160. package/templates/skills/efcore/steps/db/step-deploy.md +1 -32
  161. package/templates/skills/efcore/steps/db/step-reset.md +7 -103
  162. package/templates/skills/efcore/steps/db/step-seed.md +10 -132
  163. package/templates/skills/efcore/steps/db/step-status.md +5 -44
  164. package/templates/skills/efcore/steps/migration/step-03-validate.md +8 -62
  165. package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +1 -57
  166. package/templates/skills/efcore/steps/shared/step-00-init.md +11 -254
  167. package/templates/skills/efcore/steps/squash/step-03-create.md +1 -58
  168. package/templates/skills/feature-full/SKILL.md +1 -1
  169. package/templates/skills/feature-full/steps/step-00-init.md +57 -0
  170. package/templates/skills/feature-full/steps/step-01-implementation.md +1 -1
  171. package/templates/skills/gitflow/SKILL.md +1 -1
  172. package/templates/skills/gitflow/_shared.md +23 -0
  173. package/templates/skills/gitflow/references/commit-message-generation.md +58 -0
  174. package/templates/skills/gitflow/references/commit-migration-validation.md +49 -0
  175. package/templates/skills/gitflow/references/finish-cleanup.md +51 -0
  176. package/templates/skills/gitflow/references/finish-version-bumping.md +45 -0
  177. package/templates/skills/gitflow/references/init-environment-detection.md +41 -0
  178. package/templates/skills/gitflow/references/init-questions.md +185 -0
  179. package/templates/skills/gitflow/references/init-structure-creation.md +71 -0
  180. package/templates/skills/gitflow/references/init-version-detection.md +21 -0
  181. package/templates/skills/gitflow/references/init-workspace-detection.md +43 -0
  182. package/templates/skills/gitflow/references/merge-ci-status.md +36 -0
  183. package/templates/skills/gitflow/references/merge-execution.md +62 -0
  184. package/templates/skills/gitflow/references/merge-pr-context.md +76 -0
  185. package/templates/skills/gitflow/references/pr-build-checks.md +60 -0
  186. package/templates/skills/gitflow/references/pr-generation.md +58 -0
  187. package/templates/skills/gitflow/references/start-branch-normalization.md +28 -0
  188. package/templates/skills/gitflow/references/start-worktree-creation.md +50 -0
  189. package/templates/skills/gitflow/references/sync-push-verify.md +44 -0
  190. package/templates/skills/gitflow/references/sync-rebase-conflicts.md +38 -0
  191. package/templates/skills/gitflow/steps/step-commit.md +12 -91
  192. package/templates/skills/gitflow/steps/step-finish.md +15 -159
  193. package/templates/skills/gitflow/steps/step-init.md +24 -326
  194. package/templates/skills/gitflow/steps/step-merge.md +17 -176
  195. package/templates/skills/gitflow/steps/step-pr.md +10 -116
  196. package/templates/skills/gitflow/steps/step-start.md +16 -109
  197. package/templates/skills/gitflow/steps/step-sync.md +6 -69
  198. package/templates/skills/ralph-loop/SKILL.md +6 -0
  199. package/templates/skills/ralph-loop/references/category-completeness.md +185 -0
  200. package/templates/skills/ralph-loop/references/compact-loop.md +1 -1
  201. package/templates/skills/ralph-loop/references/init-resume-recovery.md +127 -0
  202. package/templates/skills/ralph-loop/references/module-transition.md +151 -0
  203. package/templates/skills/ralph-loop/references/multi-module-queue.md +171 -0
  204. package/templates/skills/ralph-loop/references/parallel-execution.md +246 -0
  205. package/templates/skills/ralph-loop/references/task-transform-legacy.md +6 -9
  206. package/templates/skills/ralph-loop/references/team-orchestration.md +45 -3
  207. package/templates/skills/ralph-loop/steps/step-00-init.md +36 -109
  208. package/templates/skills/ralph-loop/steps/step-01-task.md +15 -163
  209. package/templates/skills/ralph-loop/steps/step-02-execute.md +8 -154
  210. package/templates/skills/ralph-loop/steps/step-04-check.md +21 -73
  211. package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
  212. package/templates/skills/review-code/references/smartstack-conventions.md +11 -11
  213. package/templates/skills/validate-feature/references/api-smoke-tests.md +140 -0
  214. package/templates/skills/validate-feature/references/db-validation-checks.md +180 -0
  215. package/templates/skills/validate-feature/steps/step-01-compile.md +5 -2
  216. package/templates/skills/validate-feature/steps/step-04-api-smoke.md +34 -145
  217. package/templates/skills/validate-feature/steps/step-05-db-validation.md +74 -260
  218. package/templates/skills/workflow/SKILL.md +1 -1
  219. package/templates/skills/workflow/steps/step-00-init.md +57 -0
@@ -0,0 +1,312 @@
1
+ # SeedData Core Generation for Handoff
2
+
3
+ Complete reference for generating `seedDataCore` from feature.json modules, application roles, and coverage matrix.
4
+
5
+ ## Helper Functions
6
+
7
+ ### PascalCase to Human Readable
8
+
9
+ ```javascript
10
+ function toHumanReadable(pascalCase) {
11
+ return pascalCase
12
+ .replace(/([a-z])([A-Z])/g, '$1 $2')
13
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2');
14
+ }
15
+ ```
16
+
17
+ ### PascalCase to Kebab Case
18
+
19
+ ```javascript
20
+ function toKebabCase(code) {
21
+ return code
22
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
23
+ .toLowerCase();
24
+ }
25
+ ```
26
+
27
+ ## SeedDataCore Template
28
+
29
+ ```javascript
30
+ const appCode = master.metadata.application;
31
+ const appLabel = toHumanReadable(appCode);
32
+ const appDesc = master.cadrage?.problem?.split('.')[0] || `Gestion ${appLabel}`;
33
+ const lang = master.metadata.language || "fr";
34
+
35
+ const seedDataCore = {
36
+ // Application-level navigation (MANDATORY — one entry per application)
37
+ navigationApplications: (() => {
38
+ if (workflow.mode === "project") {
39
+ // Multi-app: one navigation entry per application
40
+ return projectFeature.applications.map((app, idx) => {
41
+ const appLabel = toHumanReadable(app.code);
42
+ return {
43
+ code: app.code.toLowerCase(),
44
+ name: app.code,
45
+ labels: {
46
+ fr: lang === "fr" ? (app.name || appLabel) : appLabel,
47
+ en: lang === "en" ? (app.name || appLabel) : appLabel,
48
+ it: appLabel,
49
+ de: appLabel
50
+ },
51
+ description: {
52
+ fr: lang === "fr" ? (app.description || `Gestion ${appLabel}`) : `Gestion ${appLabel}`,
53
+ en: lang === "en" ? (app.description || `${appLabel} management`) : `${appLabel} management`,
54
+ it: `Gestione ${appLabel}`,
55
+ de: `${appLabel} Verwaltung`
56
+ },
57
+ icon: app.icon || inferIconFromApplication({ metadata: { application: app.code } }) || "layout-grid",
58
+ iconType: "lucide",
59
+ route: `/${toKebabCase(app.code)}`,
60
+ displayOrder: (idx + 1) * 10
61
+ };
62
+ });
63
+ } else {
64
+ // Single-app: one navigation entry
65
+ return [{
66
+ code: appCode.toLowerCase(),
67
+ name: appCode,
68
+ labels: {
69
+ fr: lang === "fr" ? (master.cadrage?.applicationName || appLabel) : appLabel,
70
+ en: lang === "en" ? (master.cadrage?.applicationName || appLabel) : appLabel,
71
+ it: appLabel,
72
+ de: appLabel
73
+ },
74
+ description: {
75
+ fr: lang === "fr" ? appDesc : `Gestion ${appLabel}`,
76
+ en: lang === "en" ? appDesc : `${appLabel} management`,
77
+ it: `Gestione ${appLabel}`,
78
+ de: `${appLabel} Verwaltung`
79
+ },
80
+ icon: inferIconFromApplication(master) || "layout-grid",
81
+ iconType: "lucide",
82
+ route: `/${toKebabCase(appCode)}`,
83
+ displayOrder: 1
84
+ }];
85
+ }
86
+ })(),
87
+
88
+ navigationModules: (() => {
89
+ if (workflow.mode === "project") {
90
+ let order = 0;
91
+ return projectFeature.applications.flatMap(app => {
92
+ return (app.modules || []).map(m => ({
93
+ code: m.code,
94
+ applicationCode: app.code,
95
+ label: m.name || m.code,
96
+ description: m.description,
97
+ icon: inferIconFromModule(m) || "folder",
98
+ iconType: "lucide",
99
+ route: `/${toKebabCase(app.code)}/${toKebabCase(m.code)}`,
100
+ displayOrder: (++order) * 10
101
+ }));
102
+ });
103
+ } else {
104
+ return master.modules.map((m, i) => ({
105
+ code: m.code,
106
+ label: m.name || m.code,
107
+ description: m.description,
108
+ icon: inferIconFromModule(m) || "folder",
109
+ iconType: "lucide",
110
+ route: `/${toKebabCase(appCode)}/${toKebabCase(m.code)}`,
111
+ displayOrder: (i + 1) * 10
112
+ }));
113
+ }
114
+ })(),
115
+
116
+ navigationSections: (() => {
117
+ const buildSections = (modules, appCode) =>
118
+ modules.flatMap(m =>
119
+ (m.anticipatedSections || []).map((s, j) => ({
120
+ moduleCode: m.code,
121
+ code: s.code,
122
+ label: s.description?.split(':')[0] || s.code,
123
+ description: s.description || "",
124
+ route: s.code === "list"
125
+ ? `/${toKebabCase(appCode)}/${toKebabCase(m.code)}`
126
+ : s.code === "detail"
127
+ ? `/${toKebabCase(appCode)}/${toKebabCase(m.code)}/:id`
128
+ : `/${toKebabCase(appCode)}/${toKebabCase(m.code)}/${toKebabCase(s.code)}`,
129
+ displayOrder: (j + 1) * 10,
130
+ navigation: s.code === "detail" ? "hidden" : "visible"
131
+ }))
132
+ );
133
+
134
+ if (workflow.mode === "project") {
135
+ return projectFeature.applications.flatMap(app =>
136
+ buildSections(app.modules || [], app.code)
137
+ );
138
+ } else {
139
+ return buildSections(master.modules, appCode);
140
+ }
141
+ })(),
142
+
143
+ navigationResources: master.cadrage.coverageMatrix
144
+ .filter(cm => cm.module && cm.anticipatedResources?.length > 0)
145
+ .flatMap(cm =>
146
+ cm.anticipatedResources.map((r, k) => ({
147
+ moduleCode: cm.module,
148
+ sectionCode: cm.anticipatedSections?.[0] || "list",
149
+ code: r,
150
+ label: r.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase()),
151
+ displayOrder: (k + 1) * 10
152
+ }))
153
+ ),
154
+
155
+ navigationTranslations: master.modules.flatMap(m => {
156
+ const langs = ["fr", "en", "it", "de"];
157
+ return langs.map(lang => ({
158
+ moduleCode: m.code,
159
+ language: lang,
160
+ label: lang === master.metadata.language ? (m.name || m.code) : m.code,
161
+ description: lang === master.metadata.language ? m.description : ""
162
+ }));
163
+ }),
164
+
165
+ permissions: (() => {
166
+ const buildPermissions = (modules, appCode) =>
167
+ modules.flatMap(m => {
168
+ const basePath = `${toKebabCase(appCode)}.${toKebabCase(m.code)}`;
169
+ const actions = ['read', 'create', 'update', 'delete'];
170
+ return [
171
+ { path: `${basePath}.*`, action: '*', description: `Full ${m.name || m.code} access` },
172
+ ...actions.map(action => ({
173
+ path: `${basePath}.${action}`,
174
+ action: action,
175
+ description: `${action.charAt(0).toUpperCase() + action.slice(1)} ${m.name || m.code}`
176
+ }))
177
+ ];
178
+ });
179
+
180
+ if (workflow.mode === "project") {
181
+ return projectFeature.applications.flatMap(app =>
182
+ buildPermissions(app.modules || [], app.code)
183
+ );
184
+ } else {
185
+ return buildPermissions(master.modules, appCode);
186
+ }
187
+ })(),
188
+
189
+ rolePermissions: (() => {
190
+ const buildRolePermissions = (roles, modules, appCode) =>
191
+ roles.map(role => ({
192
+ role: role.role,
193
+ level: role.level,
194
+ permissions: modules.map(m => `${toKebabCase(appCode)}.${toKebabCase(m.code)}.${
195
+ role.level === 'admin' ? '*' :
196
+ role.level === 'manager' ? 'read,create,update' :
197
+ role.level === 'contributor' ? 'read,create' : 'read'
198
+ }`)
199
+ }));
200
+
201
+ if (workflow.mode === "project") {
202
+ return projectFeature.applications.flatMap(app =>
203
+ buildRolePermissions(app.applicationRoles || [], app.modules || [], app.code)
204
+ );
205
+ } else {
206
+ return buildRolePermissions(master.cadrage.applicationRoles, master.modules, appCode);
207
+ }
208
+ })(),
209
+
210
+ permissionConstants: (() => {
211
+ const buildConstants = (modules, appCode) =>
212
+ modules.flatMap(m =>
213
+ ['Read', 'Create', 'Update', 'Delete', 'Validate', 'Export'].map(action => ({
214
+ module: m.code,
215
+ application: appCode,
216
+ action: action,
217
+ constant: `${appCode}${m.code}${action}`,
218
+ path: `${toKebabCase(appCode)}.${toKebabCase(m.code)}.${action.toLowerCase()}`
219
+ }))
220
+ );
221
+
222
+ if (workflow.mode === "project") {
223
+ return projectFeature.applications.flatMap(app =>
224
+ buildConstants(app.modules || [], app.code)
225
+ );
226
+ } else {
227
+ return buildConstants(master.modules, appCode);
228
+ }
229
+ })()
230
+ };
231
+ ```
232
+
233
+ ## Icon Inference Functions
234
+
235
+ ### Application Level
236
+
237
+ ```javascript
238
+ function inferIconFromApplication(master) {
239
+ const appLC = (master.metadata.application || '').toLowerCase();
240
+ const iconMap = {
241
+ 'humanresource': 'users', 'rh': 'users', 'hr': 'users', 'personnel': 'users',
242
+ 'sales': 'shopping-cart', 'vente': 'shopping-cart', 'commerce': 'shopping-cart',
243
+ 'finance': 'wallet', 'comptabilite': 'calculator', 'accounting': 'calculator',
244
+ 'inventory': 'warehouse', 'stock': 'package', 'logistic': 'truck',
245
+ 'crm': 'building-2', 'customer': 'building', 'client': 'building-2',
246
+ 'project': 'folder-kanban', 'task': 'check-square', 'gestion': 'layout-grid',
247
+ 'admin': 'shield', 'support': 'headphones', 'maintenance': 'wrench',
248
+ 'production': 'factory', 'quality': 'badge-check', 'document': 'file-text',
249
+ 'fleet': 'car', 'vehicle': 'car', 'transport': 'truck',
250
+ 'education': 'graduation-cap', 'formation': 'graduation-cap', 'training': 'graduation-cap'
251
+ };
252
+ for (const [keyword, icon] of Object.entries(iconMap)) {
253
+ if (appLC.includes(keyword)) return icon;
254
+ }
255
+ return "layout-grid"; // fallback — NEVER null
256
+ }
257
+ ```
258
+
259
+ ### Module Level
260
+
261
+ ```javascript
262
+ function inferIconFromModule(module) {
263
+ const codeLC = module.code.toLowerCase();
264
+ const iconMap = {
265
+ 'employee': 'users', 'staff': 'users', 'personnel': 'users', 'user': 'users',
266
+ 'project': 'folder-kanban', 'task': 'check-square', 'work': 'briefcase',
267
+ 'time': 'clock', 'schedule': 'calendar', 'planning': 'calendar-days',
268
+ 'absence': 'calendar-off', 'leave': 'calendar-off', 'vacation': 'palm-tree',
269
+ 'finance': 'wallet', 'billing': 'receipt', 'invoice': 'file-text',
270
+ 'inventory': 'warehouse', 'stock': 'package', 'product': 'shopping-bag',
271
+ 'customer': 'building', 'client': 'building-2', 'contact': 'contact',
272
+ 'report': 'bar-chart', 'dashboard': 'layout-dashboard', 'analytics': 'trending-up',
273
+ 'document': 'file-text', 'notification': 'bell', 'setting': 'settings',
274
+ 'order': 'shopping-cart', 'vehicle': 'car', 'maintenance': 'wrench',
275
+ 'audit': 'shield-check', 'workflow': 'git-branch', 'approval': 'check-circle'
276
+ };
277
+ for (const [keyword, icon] of Object.entries(iconMap)) {
278
+ if (codeLC.includes(keyword)) return icon;
279
+ }
280
+ return "folder"; // fallback — NEVER null
281
+ }
282
+ ```
283
+
284
+ ## POST-CHECK (BLOCKING for icons/application, warning for counts)
285
+
286
+ ```javascript
287
+ IF !seedDataCore.navigationApplications || seedDataCore.navigationApplications.length === 0:
288
+ BLOCKING ERROR: "navigationApplications is empty — Application navigation will NOT be seeded. Menu will show (nothing) → Modules."
289
+ IF seedDataCore.navigationApplications[0].icon === null || seedDataCore.navigationApplications[0].icon === undefined:
290
+ BLOCKING ERROR: "Application icon is null — ralph-loop will render empty navigation"
291
+ IF !seedDataCore.navigationApplications[0].labels?.fr || !seedDataCore.navigationApplications[0].labels?.en:
292
+ BLOCKING ERROR: "Application labels missing fr/en — translations will fail"
293
+ IF seedDataCore.navigationModules.length !== master.modules.length:
294
+ WARNING: seedDataCore has ${seedDataCore.navigationModules.length} nav modules but ${master.modules.length} modules exist
295
+ IF seedDataCore.permissions.length === 0:
296
+ WARNING: seedDataCore has 0 permissions — applicationRoles may be missing
297
+ IF seedDataCore.navigationModules.some(m => !m.icon || m.icon === null):
298
+ BLOCKING ERROR: "Navigation modules with null icons detected — ralph-loop will render empty navigation"
299
+ → Fix: Re-run inferIconFromModule() for modules with null icons
300
+ IF seedDataCore.navigationSections.length === 0:
301
+ WARNING: "0 navigation sections — every module should have at least 1 section (e.g., 'list')"
302
+ ```
303
+
304
+ ## Writing to Feature.json
305
+
306
+ ```javascript
307
+ ba-writer.enrichSection({
308
+ featureId: {feature_id},
309
+ section: "seedDataCore",
310
+ data: seedDataCore
311
+ })
312
+ ```
@@ -6,7 +6,7 @@
6
6
 
7
7
  ### Step 1: Check Deployment Cache
8
8
 
9
- Cache file location: `docs/business/{app}/business-analyse/.schema-cache.json`
9
+ Cache file location: `docs/{app}/business-analyse/.schema-cache.json`
10
10
 
11
11
  ```
12
12
  IF EXISTS .schema-cache.json:
@@ -25,10 +25,10 @@ ELSE:
25
25
  ### Step 2: Deploy Schemas (if needed)
26
26
 
27
27
  Source: `schemas/` (relative to skill root = `~/.claude/skills/business-analyse/schemas/`)
28
- Destination: `docs/business/{app}/business-analyse/schemas/`
28
+ Destination: `docs/{app}/business-analyse/schemas/`
29
29
 
30
30
  ```
31
- docs/business/{app}/business-analyse/schemas/
31
+ docs/{app}/business-analyse/schemas/
32
32
  ├── feature-schema.json
33
33
  ├── application-schema.json
34
34
  ├── sections/
@@ -15,7 +15,7 @@
15
15
 
16
16
  ### In URL Routes
17
17
 
18
- - **kebab-case lowercase** (e.g., `"/business/human-resources/employees"`)
18
+ - **kebab-case lowercase** (e.g., `"/human-resources/employees"`)
19
19
  - Transform: `PascalCase` → `kebab-case` via helper function
20
20
  - Used for: Web URLs, navigation routes, API paths
21
21
 
@@ -27,8 +27,7 @@
27
27
  |--------|--------|---------|-------|
28
28
  | Module code | `PascalCase` | `HumanResources` | C# files, classes, namespaces |
29
29
  | Application code | `PascalCase` | `HumanResources` | Namespaces, folders |
30
- | Context code | `lowercase` | `business` | URLs, routes, contexts |
31
- | Route path | `kebab-case` | `/business/human-resources` | Web URLs, navigation |
30
+ | Route path | `kebab-case` | `/human-resources` | Web URLs, navigation |
32
31
  | Section code | `kebab-case` | `time-tracking`, `approve` | URLs, API paths, sections |
33
32
  | Resource code | `kebab-case` | `repair-grid`, `employee-form` | Component IDs, resources |
34
33
 
@@ -63,7 +62,7 @@
63
62
 
64
63
  **Usage:**
65
64
  ```csharp
66
- Route = ToKebabCase($"/{contextCode}/{appCode}/{moduleCode}")
65
+ Route = ToKebabCase($"/{appCode}/{moduleCode}")
67
66
  ```
68
67
 
69
68
  **Transformation Examples:**
@@ -80,7 +79,7 @@ Route = ToKebabCase($"/{contextCode}/{appCode}/{moduleCode}")
80
79
 
81
80
  **Usage:**
82
81
  ```javascript
83
- const route = `/${contextCode}/${toKebabCase(appCode)}/${toKebabCase(moduleCode)}`;
82
+ const route = `/${toKebabCase(appCode)}/${toKebabCase(moduleCode)}`;
84
83
  ```
85
84
 
86
85
  **Implementation:**
@@ -139,8 +138,8 @@ validate_frontend_routes
139
138
  **Output Example:**
140
139
  ```
141
140
  ❌ Case mismatch detected (1 routes with uppercase):
142
- Route "business.humanresources" uses PascalCase in URL.
143
- Found: business/HumanResources → Expected: business/human-resources
141
+ Route "humanresources" uses PascalCase in URL.
142
+ Found: HumanResources → Expected: human-resources
144
143
  Fix: Use ToKebabCase() in NavigationSeedData route generation
145
144
  ```
146
145
 
@@ -152,27 +151,27 @@ validate_frontend_routes
152
151
 
153
152
  **Wrong (causes 404 on menu click):**
154
153
  ```csharp
155
- Route = $"/{contextCode}/{appCode}/{moduleCode}"
156
- // Result: /business/HumanResources/Projects
154
+ Route = $"/{appCode}/{moduleCode}"
155
+ // Result: /HumanResources/Projects
157
156
  ```
158
157
 
159
158
  **Correct:**
160
159
  ```csharp
161
- Route = ToKebabCase($"/{contextCode}/{appCode}/{moduleCode}")
162
- // Result: /business/human-resources/projects
160
+ Route = ToKebabCase($"/{appCode}/{moduleCode}")
161
+ // Result: /human-resources/projects
163
162
  ```
164
163
 
165
164
  ### ❌ Hardcoding Routes in lowercase
166
165
 
167
166
  **Wrong (loses traceability to code):**
168
167
  ```csharp
169
- Route = "/business/humanresources" // Flattens multi-word into single word
168
+ Route = "/humanresources" // Flattens multi-word into single word
170
169
  ```
171
170
 
172
171
  **Correct:**
173
172
  ```csharp
174
- Route = ToKebabCase($"/{contextCode}/{appCode}")
175
- // If appCode = "HumanResources" → /business/human-resources
173
+ Route = ToKebabCase($"/{appCode}")
174
+ // If appCode = "HumanResources" → /human-resources
176
175
  ```
177
176
 
178
177
  ### ❌ Inconsistent Section/Resource Codes
@@ -189,7 +188,7 @@ Route = ToKebabCase($"/{contextCode}/{appCode}")
189
188
  ```json
190
189
  {
191
190
  "code": "time-tracking", // kebab-case from start
192
- "route": "/business/human-resources/time-tracking"
191
+ "route": "/human-resources/time-tracking"
193
192
  }
194
193
  ```
195
194
 
@@ -205,7 +204,6 @@ Sections and resources ALWAYS use kebab-case (no transformation needed).
205
204
  ```json
206
205
  {
207
206
  "metadata": {
208
- "context": "business",
209
207
  "application": "HumanResources"
210
208
  },
211
209
  "modules": [
@@ -217,22 +215,22 @@ Sections and resources ALWAYS use kebab-case (no transformation needed).
217
215
 
218
216
  **Generated Routes (seed data):**
219
217
  ```
220
- Application: /business/human-resources
221
- Module 1: /business/human-resources/time-management
222
- Module 2: /business/human-resources/projects
218
+ Application: /human-resources
219
+ Module 1: /human-resources/time-management
220
+ Module 2: /human-resources/projects
223
221
  ```
224
222
 
225
223
  **C# Code Structure:**
226
224
  ```
227
- src/Domain/Entities/Business/HumanResources/TimeManagement/TimeEntry.cs
228
- src/Application/Services/Business/HumanResources/TimeManagement/TimeEntryService.cs
229
- src/API/Controllers/Business/HumanResources/TimeManagementController.cs
225
+ src/Domain/Entities/HumanResources/TimeManagement/TimeEntry.cs
226
+ src/Application/Services/HumanResources/TimeManagement/TimeEntryService.cs
227
+ src/API/Controllers/HumanResources/TimeManagementController.cs
230
228
  ```
231
229
 
232
230
  **Frontend Routes (React Router):**
233
231
  ```tsx
234
- <Route path="/business/human-resources/time-management" element={<TimeManagementPage />} />
235
- <Route path="/business/human-resources/projects" element={<ProjectsPage />} />
232
+ <Route path="/human-resources/time-management" element={<TimeManagementPage />} />
233
+ <Route path="/human-resources/projects" element={<ProjectsPage />} />
236
234
  ```
237
235
 
238
236
  ---
@@ -216,14 +216,14 @@ BLOCKING_ERROR: api: prd has 8 files but feature.json has 12
216
216
  **Derive PRD from feature.json:**
217
217
  ```bash
218
218
  ss derive-prd \
219
- --feature docs/business/{App}/{Module}/business-analyse/v1.0/feature.json \
219
+ --feature docs/{App}/business-analyse/v1.0/feature.json \
220
220
  --output .ralph/prd-{ModuleCode}.json
221
221
  ```
222
222
 
223
223
  **Example:**
224
224
  ```bash
225
225
  ss derive-prd \
226
- --feature docs/business/HumanResources/Projects/business-analyse/v1.0/feature.json \
226
+ --feature docs/HumanResources/business-analyse/v1.0/feature.json \
227
227
  --output .ralph/prd-Projects.json
228
228
  ```
229
229
 
@@ -220,12 +220,12 @@ reversePermissions(htmlPermissions, moduleCode, appName) {
220
220
  if (action === "*") {
221
221
  // Wildcard: add all standard permission paths
222
222
  Object.values(actionToPermission).forEach(permAction => {
223
- const path = `business.${appName}.${moduleCode}.*.${permAction}`;
223
+ const path = `${appName}.${moduleCode}.*.${permAction}`;
224
224
  if (!rolePerms[role].includes(path)) rolePerms[role].push(path);
225
225
  });
226
226
  } else {
227
227
  const permAction = actionToPermission[action] || action.toLowerCase();
228
- const path = `business.${appName}.${moduleCode}.*.${permAction}`;
228
+ const path = `${appName}.${moduleCode}.*.${permAction}`;
229
229
  if (!rolePerms[role].includes(path)) rolePerms[role].push(path);
230
230
  }
231
231
  });
@@ -50,7 +50,7 @@ Ensures each module has ALL required components before being marked as "specifie
50
50
  | # | Check | Minimum | Blocking | Rationale |
51
51
  |---|-------|---------|----------|-----------|
52
52
  | 4.1 | Permissions count | ≥5 | YES | CRUD (4) + 1 business action minimum |
53
- | 4.2 | Permission format | Module: `business.{app}.{module}.{action}` or Section: `business.{app}.{module}.{section}.{action}` | YES | Wrong format breaks RBAC system |
53
+ | 4.2 | Permission format | Module: `{app}.{module}.{action}` or Section: `{app}.{module}.{section}.{action}` | YES | Wrong format breaks RBAC system |
54
54
  | 4.3 | Role permissions | All roles have ≥1 permission | YES | Roles without permissions are useless |
55
55
 
56
56
  #### SECTION 5: UI & Navigation (4 checks)
@@ -90,15 +90,15 @@ IF entity has lifeCycles:
90
90
  ### Detail section auto-generation
91
91
 
92
92
  When auto-generating the detail section, create:
93
- - `specification.sections[]` entry with `code: "detail"`, `navigation: "hidden"`, route `/business/{app}/{module}/:id`
93
+ - `specification.sections[]` entry with `code: "detail"`, `navigation: "hidden"`, route `/{app}/{module}/:id`
94
94
  - `specification.uiWireframes[]` entry with `section: "detail"` and ASCII mockup showing all tabs
95
95
  - Resources: `{module}-detail-header` (DetailHeader), `{module}-detail-tabs` (TabPanel), `{module}-info-card` (DetailCard), one `{module}-{relation}-grid` per relation tab, `{module}-history` (Timeline if auditable)
96
96
 
97
97
  ### Detail page navigation wiring
98
98
 
99
99
  The detail page is NOT a sidebar entry. Navigation is handled by:
100
- - **From list**: row click action `navigate:detail` → `/business/{app}/{module}/{id}`
101
- - **Back button**: detail header → `/business/{app}/{module}`
100
+ - **From list**: row click action `navigate:detail` → `/{app}/{module}/{id}`
101
+ - **Back button**: detail header → `/{app}/{module}`
102
102
  - **Route registration**: route MUST be registered in frontend routing with `:id` parameter
103
103
 
104
104
  ## Status/Lifecycle Enhancement
@@ -80,7 +80,7 @@ rm -rf ~/.claude/teams/ba-{appName} 2>/dev/null
80
80
  ### 1b. Create Team and Capture Actual Name
81
81
 
82
82
  ```javascript
83
- const result = TeamCreate({ team_name: "ba-{appName}" });
83
+ const result = TeamCreate({ team_name: "ba-{appName}", description: "BA module analysis for {appName}" });
84
84
  // CRITICAL: TeamCreate may return a DIFFERENT name than requested!
85
85
  // Always use the RETURNED team_name, not the requested one.
86
86
  const actualTeamName = result.team_name;
@@ -139,8 +139,8 @@ IF layer.modules.length >= 2:
139
139
 
140
140
  5. Permission path consistency
141
141
  → Verify permission paths won't collide:
142
- {context}.{app}.{module1}.{entity}.{action}
143
- {context}.{app}.{module2}.{entity}.{action}
142
+ {app}.{module1}.{entity}.{action}
143
+ {app}.{module2}.{entity}.{action}
144
144
 
145
145
  Build coordinationNotes for EACH module in the layer:
146
146
  ```
@@ -215,7 +215,7 @@ Task({
215
215
  completedModulesSummary,
216
216
  coordinationNotes: "", // empty for single-module layer
217
217
  language: metadata.language,
218
- docsDir: "docs/business/{appName}/{moduleCode}/business-analyse/v{version}/"
218
+ docsDir: "docs/{appName}/{moduleCode}/business-analyse/v{version}/"
219
219
  }),
220
220
  description: "Specify {moduleCode}"
221
221
  });
@@ -507,7 +507,7 @@ IF layer.modules.length >= 2 AND all modules approved:
507
507
  → e.g., if Products.CategoryId references Categories.Category, names must match
508
508
 
509
509
  2. Permission paths: Are paths consistent and non-colliding?
510
- business.{app}.{module1}.{entity}.read vs business.{app}.{module2}.{entity}.read
510
+ → {app}.{module1}.{entity}.read vs {app}.{module2}.{entity}.read
511
511
 
512
512
  3. i18n keys: Do keys follow consistent patterns? No collisions?
513
513
  → {module1}.labels.name vs {module2}.labels.name (OK — namespaced)
@@ -691,7 +691,7 @@ Validate interactions between ALL applications in the project:
691
691
  1. Cross-application shared entities
692
692
  → Entity defined in App A, referenced by App B via data dependency
693
693
  2. Cross-application permission path consistency
694
- → Each app uses its own context prefix (e.g., business.hr.* vs business.selfservice.*)
694
+ → Each app uses its own context prefix (e.g., hr.* vs selfservice.*)
695
695
  3. Cross-application role consistency
696
696
  → Same role names have compatible permission levels across apps
697
697
  4. Cross-application navigation coherence
@@ -902,6 +902,49 @@ If the entire session crashes:
902
902
 
903
903
  ---
904
904
 
905
+ ## Task List Coordination (T10)
906
+
907
+ Create tasks for each module analysis before spawning teammates:
908
+
909
+ ```javascript
910
+ // Create tasks for each module before spawning agents
911
+ for (const mod of moduleOrder) {
912
+ TaskCreate({
913
+ subject: `Specify ${mod} module`,
914
+ description: `Propose business specification including entities, attributes, permissions, and workflows for ${mod}`,
915
+ activeForm: `Analyzing ${mod}`
916
+ });
917
+ }
918
+
919
+ // Teammates update task status when done
920
+ TaskUpdate({ taskId: currentTaskId, status: 'completed' });
921
+
922
+ // Team lead checks progress
923
+ TaskList(); // View all tasks and their status
924
+ ```
925
+
926
+ ---
927
+
928
+ ## Idle State Handling (T13)
929
+
930
+ > **IMPORTANT:** Teammates go idle after every turn — this is completely normal.
931
+ > Idle simply means the teammate is waiting for input. An idle notification immediately
932
+ > after a message does NOT mean the teammate is done or has errors.
933
+ > Send a message to an idle teammate to wake it up.
934
+
935
+ ---
936
+
937
+ ## Team Config Discovery (T14)
938
+
939
+ ```javascript
940
+ // Teammates can discover each other via team config:
941
+ // ~/.claude/teams/{team-name}/config.json
942
+ // Contains: members[] with name, agentId, agentType
943
+ // Always refer to teammates by NAME, not by UUID.
944
+ ```
945
+
946
+ ---
947
+
905
948
  ## Decision Matrix
906
949
 
907
950
  | Condition | Action |
@@ -56,7 +56,7 @@ When a "dashboard" section is selected, capture structured KPI and chart data **
56
56
  { "field": "dateRange", "type": "dateRange", "label": "Période" },
57
57
  { "field": "status", "type": "multiselect", "label": "Statut" }
58
58
  ],
59
- "permissionsRequired": ["business.{app}.{module}.read"]
59
+ "permissionsRequired": ["{app}.{module}.read"]
60
60
  }
61
61
  ```
62
62