@atlashub/smartstack-cli 4.18.0 → 4.20.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 (164) hide show
  1. package/package.json +1 -1
  2. package/templates/agents/ba-reader.md +86 -80
  3. package/templates/agents/ba-writer.md +318 -415
  4. package/templates/agents/docs-context-reader.md +3 -3
  5. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
  6. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +126 -0
  7. package/templates/skills/apex/SKILL.md +29 -16
  8. package/templates/skills/apex/_shared.md +62 -9
  9. package/templates/skills/apex/references/analysis-methods.md +8 -6
  10. package/templates/skills/apex/references/challenge-questions.md +5 -5
  11. package/templates/skills/apex/references/core-seed-data.md +68 -45
  12. package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +26 -21
  13. package/templates/skills/apex/references/parallel-execution.md +156 -0
  14. package/templates/skills/apex/references/person-extension-pattern.md +12 -12
  15. package/templates/skills/apex/references/post-checks.md +1748 -1726
  16. package/templates/skills/apex/references/smartstack-api.md +63 -57
  17. package/templates/skills/apex/references/smartstack-frontend-compliance.md +594 -0
  18. package/templates/skills/apex/references/smartstack-frontend.md +1246 -1842
  19. package/templates/skills/apex/references/smartstack-layers.md +98 -145
  20. package/templates/skills/apex/steps/step-00-init.md +30 -6
  21. package/templates/skills/apex/steps/step-01-analyze.md +27 -23
  22. package/templates/skills/apex/steps/step-02-plan.md +12 -12
  23. package/templates/skills/apex/steps/step-03-execute.md +198 -143
  24. package/templates/skills/apex/steps/step-04-examine.md +24 -93
  25. package/templates/skills/apex/steps/step-05-deep-review.md +16 -16
  26. package/templates/skills/apex/steps/step-06-resolve.md +9 -9
  27. package/templates/skills/apex/steps/step-07-tests.md +3 -1
  28. package/templates/skills/apex/steps/step-08-run-tests.md +1 -1
  29. package/templates/skills/business-analyse/SKILL.md +182 -301
  30. package/templates/skills/business-analyse/_shared.md +119 -336
  31. package/templates/skills/business-analyse/html/ba-interactive.html +706 -85
  32. package/templates/skills/business-analyse/html/build-html.js +41 -3
  33. package/templates/skills/business-analyse/html/src/partials/cadrage-context.html +34 -0
  34. package/templates/skills/business-analyse/html/src/partials/cadrage-risks.html +48 -0
  35. package/templates/skills/business-analyse/html/src/partials/cadrage-scope.html +49 -0
  36. package/templates/skills/business-analyse/html/src/partials/cadrage-stakeholders.html +55 -0
  37. package/templates/skills/business-analyse/html/src/partials/cadrage-success.html +34 -0
  38. package/templates/skills/business-analyse/html/src/partials/consol-datamodel.html +8 -0
  39. package/templates/skills/business-analyse/html/src/partials/consol-flows.html +29 -0
  40. package/templates/skills/business-analyse/html/src/partials/consol-interactions.html +8 -0
  41. package/templates/skills/business-analyse/html/src/partials/consol-permissions.html +8 -0
  42. package/templates/skills/business-analyse/html/src/partials/decomp-dependencies.html +38 -0
  43. package/templates/skills/business-analyse/html/src/partials/decomp-modules.html +51 -0
  44. package/templates/skills/business-analyse/html/src/partials/handoff-summary.html +24 -0
  45. package/templates/skills/business-analyse/html/src/partials/module-spec-container.html +4 -0
  46. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +17 -1
  47. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +32 -6
  48. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +100 -63
  49. package/templates/skills/business-analyse/html/src/scripts/06-render-mockups.js +372 -0
  50. package/templates/skills/business-analyse/html/src/scripts/07-render-handoff.js +1 -1
  51. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
  52. package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
  53. package/templates/skills/business-analyse/html/src/template.html +1 -1
  54. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
  55. package/templates/skills/business-analyse/questionnaire/01-context.md +11 -157
  56. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +101 -0
  57. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +92 -0
  58. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +6 -0
  59. package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
  60. package/templates/skills/business-analyse/questionnaire.md +22 -280
  61. package/templates/skills/business-analyse/react/application-viewer.md +2 -2
  62. package/templates/skills/business-analyse/react/components.md +4 -4
  63. package/templates/skills/business-analyse/react/i18n-template.md +1 -1
  64. package/templates/skills/business-analyse/react/schema.md +14 -14
  65. package/templates/skills/business-analyse/references/acceptance-criteria.md +21 -21
  66. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
  67. package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
  68. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +5 -5
  69. package/templates/skills/business-analyse/references/deploy-data-build.md +12 -11
  70. package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
  71. package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
  72. package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
  73. package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
  74. package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
  75. package/templates/skills/business-analyse/references/robustness-checks.md +36 -36
  76. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  77. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  78. package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
  79. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  80. package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
  81. package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
  82. package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
  83. package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
  84. package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
  85. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  86. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
  87. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
  88. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  89. package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -4
  90. package/templates/skills/business-analyse/steps/step-00-init.md +68 -77
  91. package/templates/skills/business-analyse/steps/step-01-cadrage.md +50 -216
  92. package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
  93. package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
  94. package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
  95. package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
  96. package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
  97. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  98. package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
  99. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
  100. package/templates/skills/business-analyse/templates-react.md +2 -2
  101. package/templates/skills/derive-prd/SKILL.md +92 -0
  102. package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
  103. package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
  104. package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
  105. package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
  106. package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
  107. package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -263
  108. package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
  109. package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
  110. package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
  111. package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
  112. package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
  113. package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
  114. package/templates/skills/documentation/SKILL.md +7 -0
  115. package/templates/skills/ralph-loop/SKILL.md +2 -1
  116. package/templates/skills/ralph-loop/references/init-resume-recovery.md +1 -1
  117. package/templates/skills/ralph-loop/steps/step-01-task.md +2 -2
  118. package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
  119. package/templates/skills/business-analyse/_architecture.md +0 -124
  120. package/templates/skills/business-analyse/_elicitation.md +0 -206
  121. package/templates/skills/business-analyse/_module-loop.md +0 -115
  122. package/templates/skills/business-analyse/_rules.md +0 -142
  123. package/templates/skills/business-analyse/_suggestions.md +0 -34
  124. package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
  125. package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
  126. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
  127. package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
  128. package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
  129. package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
  130. package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
  131. package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
  132. package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
  133. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
  134. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -58
  135. package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
  136. package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
  137. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
  138. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
  139. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
  140. package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -366
  141. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
  142. package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
  143. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
  144. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
  145. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
  146. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
  147. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
  148. package/templates/skills/business-analyse/references/team-orchestration.md +0 -1093
  149. package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
  150. package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
  151. package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
  152. package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
  153. package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -486
  154. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -300
  155. package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -405
  156. package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -516
  157. package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -691
  158. package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
  159. package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
  160. package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
  161. package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
  162. package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -937
  163. package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
  164. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
@@ -1,486 +0,0 @@
1
- ---
2
- name: step-03a1-setup
3
- description: Module setup, sections walkthrough, questionnaires, and cross-module references
4
- model: opus
5
- next_step: steps/step-03a2-analysis.md
6
- ---
7
-
8
- > **Context files:** `_shared.md` | `_elicitation.md` | `_architecture.md` | `_module-loop.md` | `_rules.md`
9
- > **Reference (5-bis):** `references/entity-architecture-decision.md` — Entity scoring, domain coherence, section patterns
10
-
11
- # Step 3a1: Setup - Module Initialization
12
-
13
- ## MANDATORY EXECUTION RULES
14
-
15
- - ALWAYS use ULTRATHINK mode
16
- - This step is EXECUTED ONCE PER MODULE in topological dependency order
17
- - ALWAYS check workflow state to determine current module
18
- - ALWAYS reference completed modules when specifying current one
19
- - **MANDATORY:** Generate and validate an ASCII/SVG mockup for EVERY section (not optional)
20
- - ALL questions via AskUserQuestion tool
21
- - ALL communication in `{language}`
22
- - NEVER skip per-module validation
23
- - **Rules:** See `_rules.md` § "ID Naming Convention" and § "Schema Conformity" (MANDATORY, NO EXCEPTION)
24
-
25
- ## MODE DETECTION
26
-
27
- **Check your execution context before proceeding:**
28
-
29
- **IF you are running as a TEAM AGENT** (you received a module-specifier prompt from `references/agent-module-prompt.md`):
30
- → You are in **AUTONOMOUS mode** (Propose & Review)
31
- → Do NOT use `AskUserQuestion` — you PROPOSE, the team lead handles user interaction
32
- → Replace ALL `AskUserQuestion` calls with **ULTRATHINK autonomous decisions**
33
- → Use the decomposition data + completed module summaries to make informed choices
34
- → After completing all steps (03a1 → 03a2 → 03b → 03c → 03d): send `PROPOSAL_READY` to team lead
35
- → See `references/agent-module-prompt.md` for autonomous decision rules
36
- → See `references/team-orchestration.md` § 3 for communication protocol
37
-
38
- **IF you are running in the MAIN CONVERSATION** (classic inline mode):
39
- → Normal interactive mode — use `AskUserQuestion` as documented below
40
- → No `SendMessage` calls needed
41
-
42
- **How to detect:** If your prompt contains `PROPOSE & REVIEW` or `team-lead` as recipient, you are a team agent.
43
-
44
- ---
45
-
46
- ## YOUR TASK
47
-
48
- Specify one module's data model and business logic: walk through sections, define entities, business rules, and validate with client before proceeding to UI specification.
49
-
50
- ---
51
-
52
- ## EXECUTION SEQUENCE
53
-
54
- ### 1. Determine Current Module
55
-
56
- ```
57
- ba-reader.readApplicationContext({feature_id})
58
- → Read metadata.workflow: moduleOrder, currentModuleIndex, completedModules
59
- → currentModule = moduleOrder[currentModuleIndex]
60
- → Display: "═══ Module {currentModuleIndex + 1}/{moduleOrder.length}: {currentModule} ═══"
61
- ```
62
-
63
- IF module already specified (status = "specified" in master):
64
- Increment currentModuleIndex, re-check
65
- IF all modules specified → Load step-04a-collect.md, STOP
66
-
67
- ### 1b. Cache Warming for Module Loop (FIRST MODULE ONLY)
68
-
69
- > **Performance Optimization:** Pre-load module specification references to reduce redundant reads across all modules.
70
- > This step runs ONLY for the FIRST module (currentModuleIndex = 0), not repeated for subsequent modules.
71
-
72
- ```
73
- IF currentModuleIndex === 0:
74
- // Pre-load module specification references (Bucket 3)
75
- const moduleRefs = [
76
- "~/.claude/skills/business-analyse/references/spec-auto-inference.md",
77
- "~/.claude/skills/business-analyse/references/ui-resource-cards.md",
78
- "~/.claude/skills/business-analyse/references/ui-dashboard-spec.md",
79
- "~/.claude/skills/business-analyse/references/cadrage-pre-analysis.md"
80
- ];
81
-
82
- for (const file of moduleRefs) {
83
- read(file); // Pre-load into cache
84
- }
85
-
86
- Display: "✓ Cache warmed: module specification references (23KB, 4 files)"
87
- Display: " Expected token savings: 75% reduction in reference reads across module loop"
88
- Display: " Retention: until step-04 (after all modules specified)"
89
- ELSE:
90
- // Subsequent modules use cached references (no re-load)
91
- Display: "✓ Using cached module references (from first module)"
92
- ```
93
-
94
- **Rationale:**
95
-
96
- - Module specification references are read 2-3× PER MODULE (5 modules = 10-15 reads without caching)
97
- - Pre-loading once at start of module loop eliminates 75% of redundant reads
98
- - Token savings: ~10,000 tokens for a 5-module application
99
- - Cache retained until step-04 (when consolidation starts, references no longer needed)
100
-
101
- See [references/cache-warming-strategy.md](../references/cache-warming-strategy.md) § Bucket 3 for details.
102
-
103
- ### 2. Initialize Module Feature.json
104
-
105
- ```
106
- // Create or load module-level feature.json
107
- ba-writer.create({
108
- scope: "module",
109
- applicationRef: {feature_id},
110
- moduleCode: {currentModule.code},
111
- path: "docs/{app}/{module_code}/business-analyse/v1.0/feature.json"
112
- })
113
-
114
- // Inherit application roles from master
115
- ba-reader.readApplicationContext({feature_id})
116
- → Copy cadrage.applicationRoles → module.applicationContext.applicationRoles
117
- ```
118
-
119
- // Update module status in master: "pending" → "in-progress"
120
- ba-writer.updateModuleStatus({feature_id}, {currentModule.code}, "in-progress")
121
-
122
- ### 2-ter. Derive Module Discovery Section (MANDATORY)
123
-
124
- > **The module feature.json MUST have a `discovery` section.** In multi-module mode, derive it from the parent application's `cadrage`. In single-module mode, it should already exist from step-01.
125
-
126
- ```
127
- ba-reader.readApplicationContext({feature_id})
128
- → Read cadrage: problem, asIs, toBe, trigger, stakeholders, risks, acceptanceCriteria
129
-
130
- // Filter to this module's scope
131
- moduleScope = cadrage.coverageMatrix.filter(cm => cm.module === currentModule.code)
132
- moduleStakeholders = cadrage.stakeholders.filter(s => s.tasks relevant to this module)
133
- moduleRisks = cadrage.risks.filter(r => r related to this module)
134
-
135
- ba-writer.enrichSection({
136
- featureId: {module_feature_id},
137
- section: "discovery",
138
- data: {
139
- problem: cadrage.problem,
140
- asIs: cadrage.asIs,
141
- toBe: cadrage.toBe,
142
- trigger: cadrage.trigger,
143
- stakeholders: moduleStakeholders,
144
- scope: {
145
- mustHave: moduleScope.filter(s => s.category === "mustHave").map(s => s.item),
146
- shouldHave: moduleScope.filter(s => s.category === "shouldHave").map(s => s.item),
147
- couldHave: moduleScope.filter(s => s.category === "couldHave").map(s => s.item),
148
- outOfScope: []
149
- },
150
- risks: moduleRisks,
151
- acceptanceCriteria: cadrage.acceptanceCriteria.filter(ac => relevant to module),
152
- codebaseContext: cadrage.codebaseContext
153
- }
154
- })
155
- ```
156
-
157
- > **STRUCTURE CARD: discovery** — Same format as cadrage but module-scoped.
158
- > Fields: `problem`, `asIs`, `toBe`, `trigger`, `stakeholders[]`, `scope{}`, `risks[]`, `acceptanceCriteria[]`, `codebaseContext`, `openQuestions[]`
159
-
160
- ### 2-bis. Coverage Verification (MANDATORY)
161
-
162
- > **Before specifying any module, verify that the coverageMatrix from cadrage covers this module.**
163
-
164
- ```
165
- ba-reader.readApplicationContext({feature_id})
166
- → Read cadrage.coverageMatrix[]
167
- → Filter entries where module = {currentModule.code}
168
- → Group by category: mustHave, shouldHave, couldHave
169
- ```
170
-
171
- Display to client:
172
- ```
173
- Module {currentModule}: Coverage from original brief
174
-
175
- | # | Requirement | Category |
176
- |---|-------------|----------|
177
- | 1 | {item} | {category} |
178
- | ... | ... | ... |
179
-
180
- Total: {N} requirements mapped to this module
181
- - Must-have: {count}
182
- - Should-have: {count}
183
- - Could-have: {count}
184
- ```
185
-
186
- **VALIDATION:** If mustHave count = 0 AND module is in must priority:
187
- → WARNING: "Module {currentModule} is must-priority but has no must-have requirements in coverageMatrix. Verify cadrage coverage."
188
-
189
- **POST-SPECIFICATION CHECK (at end of module, before advancing):**
190
- For EACH mustHave item in coverageMatrix for this module:
191
- → Verify at least 1 UC exists that covers this requirement
192
- → If uncovered: BLOCK and ask client to either add a UC or reclassify the requirement
193
-
194
- ### 3. Section Walkthrough with Client
195
-
196
- > **This is the key interactive phase aligned with the 4-level SmartStack hierarchy.**
197
- > Level 2 = Module, Level 3 = Section, Level 4 = Resource
198
-
199
- #### 3a. Identify Module Sections
200
-
201
- For each module, propose standard sections based on module type:
202
-
203
- > **RULE:** Sections = functional zones only. `list` is ALWAYS present (default).
204
- > `create`/`edit` = separate pages with own URL routes (`/create` and `/:id/edit`). `detail` = tabbed page from list click.
205
-
206
- | Module Type | Sections (functional zones) | Detail page tabs (from list click) |
207
- |-------------|---------------------------|-----------------------------------|
208
- | data-centric | list | Infos, {relations} |
209
- | workflow | list, approve | Infos, {relations}, Historique |
210
- | integration | list | Infos, Config, Logs, Sync |
211
- | reporting | dashboard | — |
212
- | full-module | list, dashboard, approve | Infos, {relations}, Historique |
213
-
214
- **Section `list` is automatic and ALWAYS included.** Ask ONLY about additional functional sections:
215
-
216
- Ask via AskUserQuestion:
217
-
218
- ```
219
- question: "{language == 'fr'
220
- ? 'Le module {currentModule} aura une page liste (avec création et détail par onglets). Quelles sections fonctionnelles supplémentaires souhaitez-vous ?'
221
- : 'Module {currentModule} will have a list page (with create and tabbed detail). Which additional functional sections do you want?'}"
222
- header: "Sections"
223
- multiSelect: true
224
- options:
225
- - label: "Dashboard"
226
- description: "{language == 'fr' ? 'Tableau de bord avec KPIs, graphiques et métriques clés' : 'Dashboard with KPIs, charts and key metrics'}"
227
- - label: "Validation/Approbation"
228
- description: "{language == 'fr' ? 'File d\'approbation avec workflow de changement de statut' : 'Approval queue with status change workflow'}"
229
- - label: "Import en masse"
230
- description: "{language == 'fr' ? 'Import CSV/Excel avec mapping et validation' : 'CSV/Excel import with mapping and validation'}"
231
- - label: "{language == 'fr' ? 'Aucune (liste seule)' : 'None (list only)'}"
232
- description: "{language == 'fr' ? 'Le module n\'a besoin que de la page liste avec détail' : 'Module only needs the list page with detail'}"
233
- ```
234
-
235
- #### 3a-depth. Determine Specification Depth
236
-
237
- > **Based on module complexity and type, determine how deeply to specify sections and resources.**
238
- > **This avoids over-specifying simple modules and under-specifying complex ones.**
239
-
240
- Read from application master:
241
- ```
242
- ba-reader.readApplicationContext({feature_id})
243
- → module = modules.find(m => m.code === currentModule)
244
- → complexity = module.estimatedComplexity // simple | medium | complex
245
- → featureType = module.featureType // data-centric | workflow | integration | reporting | full-module
246
- ```
247
-
248
- **Depth decision matrix:**
249
-
250
- | Complexity | featureType | Depth | Behavior |
251
- |---|---|---|---|
252
- | simple | data-centric | **convention** | Auto-generate sections + resources from entities. Quick client validation. |
253
- | simple | reporting | **convention** | Standard dashboard template. Quick validation. |
254
- | simple | * | **convention** | Standard sections for featureType. Quick validation. |
255
- | medium | data-centric | **override** | Auto-generate then ask client which sections to customize. |
256
- | medium | workflow | **full** | State machine required → always full. |
257
- | medium | * | **override** | Auto-generate then ask client to customize. |
258
- | complex | * | **full** | Full specification: state machine, typed columns, conditional actions. |
259
- | * | workflow | **full** | Always full for workflow modules (state machine is mandatory). |
260
-
261
- Display to client:
262
- ```
263
- "Module {currentModule}: complexité {complexity}, type {featureType} → profondeur: {depth}"
264
- ```
265
-
266
- **IF depth = convention:**
267
- - Execute 3a-infer (auto-inference) → generates sections + resources
268
- - Execute 3b (wireframes) for each section
269
- - Skip 3a-bis detailed walkthrough → present auto-generated spec for quick validation
270
- - Ask client: "La spécification auto-générée convient-elle, ou souhaitez-vous personnaliser certaines sections ?"
271
- - If client says OK → proceed to step 4 (questionnaires)
272
- - If client wants changes → switch to **override** for specified sections
273
-
274
- **IF depth = override:**
275
- - Execute 3a-infer (auto-inference) → generates base sections + resources
276
- - Ask client: "Quelles sections souhaitez-vous personnaliser ?"
277
- - For selected sections → execute full 3a-bis + 3b + 3b-ter
278
- - For other sections → keep auto-generated spec
279
-
280
- **IF depth = full:**
281
- - Execute standard flow: 3a-bis → 3b → 3b-bis → 3b-ter → 3c → 3d (as currently defined below)
282
- - PLUS: 3a-state (state machine definition) for entities with status fields
283
-
284
- #### 3a-infer. Auto-Infer Resources from Entities (Convention/Override)
285
-
286
- > **For convention and override depths, auto-generate resource details from entity definitions.**
287
- > **The goal: produce a complete spec without manual input, that the client only validates.**
288
-
289
- **Prerequisites:** Entity attributes must be defined (from step 6) OR anticipated from decomposition.
290
-
291
- See [references/spec-auto-inference.md](../references/spec-auto-inference.md) for complete inference rules:
292
- - Entity attribute → SmartTable column mapping (9 type rules)
293
- - Entity attribute → SmartForm field mapping (8 type rules)
294
- - Auto-generated sections per featureType (5 types)
295
- - Component generation rules (list section, create/edit form pages with own routes, detail page with tabs, dashboard section)
296
- - Status/lifecycle enhancement rules
297
-
298
- Write auto-generated sections to `specification.sections[]` via ba-writer.enrichSection()
299
-
300
- ### 4. Conditional Questionnaires
301
-
302
- Based on module type, load questionnaires per-module:
303
-
304
- | Condition | Category | Questionnaire |
305
- |-----------|----------|---------------|
306
- | featureType != "reporting" | 04 | `questionnaire/04-data.md` |
307
- | Has UI sections | 07 | `questionnaire/07-ui.md` |
308
- | Has lifecycle | 11 | `questionnaire/11-data-lifecycle.md` |
309
- | Has migration needs | 12 | `questionnaire/12-migration.md` |
310
- | References other modules | 13 | `questionnaire/13-cross-module.md` |
311
- | Documentation needed | 10 | `questionnaire/10-documentation.md` |
312
-
313
- Ask via AskUserQuestion, 1-2 batches per category.
314
-
315
- #### Store Documentation Requirements
316
-
317
- If questionnaire 10 was loaded, persist answers in feature.json:
318
-
319
- ```
320
- ba-writer.enrichSection({
321
- featureId: {feature_id},
322
- section: "documentation",
323
- data: {
324
- userDocRequired: {Q10.1 answer == "Yes"},
325
- techDocRequired: {Q10.2 answer == "Yes"},
326
- status: "pending"
327
- }
328
- })
329
- ```
330
-
331
- This data will be consumed by `/application` step-08 to auto-generate in-app documentation.
332
-
333
- ### 5. Cross-Module References
334
-
335
- > Reference completed modules to help define current one.
336
-
337
- ```
338
- completedModules = ba-reader.getCompletedModulesSummary({feature_id})
339
- → Returns max 100 lines summary: entity names, key BRs, permissions
340
-
341
- Display: "Modules déjà spécifiés : {completedModules.map(m => m.code).join(', ')}"
342
- ```
343
-
344
- For each completed module's entities, ask:
345
-
346
- ```
347
- question: "Le module {currentModule} référence-t-il des entités de {completedModule} ?"
348
- header: "Références"
349
- multiSelect: true
350
- options:
351
- - label: "{Entity1} (FK)"
352
- description: "Référence directe via clé étrangère"
353
- - label: "{Entity2} (Lookup)"
354
- description: "Table de référence / lookup"
355
- - label: "Aucune"
356
- description: "Pas de référence à {completedModule}"
357
- ```
358
-
359
- #### 5-bis. Unresolved Entity Dependencies (New Module Detection)
360
-
361
- > **When an entity reference is detected that does NOT belong to any completed or planned module, apply the SAME intelligent Entity Sourcing Pattern as step-01-cadrage (section 4d-bis).**
362
- > **Reference:** Load [references/entity-architecture-decision.md](../references/entity-architecture-decision.md) for scoring grid, decision tree, and section patterns.
363
-
364
- For each entity referenced by {currentModule} that is NOT covered by any existing/planned module:
365
-
366
- ##### A. ULTRATHINK: Silent Analysis (NO output to client)
367
-
368
- > **Same intelligence as cadrage 4d-bis. Score the entity, assess domain coherence, recommend.**
369
-
370
- ```
371
- ULTRATHINK — Entity Architecture Analysis for {entity_name} (discovered during specification of {currentModule}):
372
-
373
- 1. DOMAIN COHERENCE
374
- - Application domain: {app_description}
375
- - Entity fit: CORE | SUPPORT | PERIPHERAL
376
- - Justification: {1 sentence}
377
-
378
- 2. ENTITY SCORING (5 criteria, 0-3 each — from scoring grid in reference)
379
- - Lifecycle: {score}/3
380
- - Actors: {score}/3
381
- - Relations: {score}/3
382
- - Volume: {score}/3
383
- - Autonomy: {score}/3
384
- - TOTAL: {total}/15 → {classification}
385
-
386
- 3. PRE-CLASSIFICATION CHECK (from entity patterns in reference, section 10 of suggestion-catalog)
387
- - Match? → {yes: which pattern | no: use scoring}
388
-
389
- 4. RECOMMENDATION
390
- - Option: {in_this_module | new_module | external_system | config_list}
391
- - Confidence: HIGH | MEDIUM | LOW
392
- - Reasoning: {1-2 sentences}
393
-
394
- 5. IF recommendation = new_module → PRE-BUILD ARCHITECTURE
395
- - Module code: {PascalCase}
396
- - Section `list` + detail page tabs
397
- - Additional sections (ONLY functional zones)
398
- - Impact on dependency graph
399
- ```
400
-
401
- ##### B. Present Analysis & Recommendation
402
-
403
- **BEFORE AskUserQuestion, display as markdown:**
404
-
405
- ```
406
- ### {language == "fr" ? "Analyse" : "Analysis"} : {entity_plural}
407
-
408
- {language == "fr"
409
- ? "Pendant la spécification de **{currentModule}**, j'ai détecté une référence aux **{entity_plural}** qui ne font partie d'aucun module existant."
410
- : "During specification of **{currentModule}**, I detected a reference to **{entity_plural}** not covered by any existing module."}
411
-
412
- {language == "fr" ? "**Mon analyse :**" : "**My analysis:**"}
413
- - {language == "fr" ? "Cohérence domaine" : "Domain coherence"} : **{CORE|SUPPORT|PERIPHERAL}** — {justification}
414
- - {language == "fr" ? "Score de complexité" : "Complexity score"} : **{score}/15** ({classification})
415
- - **{language == "fr" ? "Recommandation" : "Recommendation"}** : **{recommended_option}** — {reasoning}
416
- ```
417
-
418
- **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).
419
-
420
- ##### C. Ask with Recommended Option First
421
-
422
- ```
423
- question: "{language == 'fr'
424
- ? 'Comment souhaitez-vous gérer les {entity_plural} ?'
425
- : 'How do you want to manage {entity_plural}?'}"
426
- header: "{entity_name}"
427
- options:
428
- (ORDER: recommended option FIRST with "(Recommandé)"/"(Recommended)", then remaining 3)
429
-
430
- IF recommendation = new_module:
431
- - label: "{language == 'fr' ? 'Nouveau module dédié (Recommandé)' : 'New dedicated module (Recommended)'}"
432
- description: "{language == 'fr'
433
- ? 'Module {ModuleCode} avec page liste, détail par onglets, permissions dédiées'
434
- : '{ModuleCode} module with list page, tabbed detail, dedicated permissions'}"
435
- - label: "{language == 'fr' ? 'Dans ce module' : 'In this module'}"
436
- description: "{language == 'fr'
437
- ? 'Onglet dans la page détail de {currentModule}'
438
- : 'Tab in {currentModule} detail page'}"
439
- - label: "{language == 'fr' ? 'Système externe' : 'External system'}"
440
- description: "..."
441
- - label: "{language == 'fr' ? 'Liste de référence' : 'Reference list'}"
442
- description: "..."
443
-
444
- IF recommendation = config_list:
445
- - label: "{language == 'fr' ? 'Liste de référence (Recommandé)' : 'Reference list (Recommended)'}"
446
- description: "{language == 'fr'
447
- ? 'Table de lookup configurable par l\'admin'
448
- : 'Admin-configurable lookup table'}"
449
- - (3 remaining options in logical order)
450
-
451
- IF recommendation = in_this_module:
452
- - label: "{language == 'fr' ? 'Dans ce module (Recommandé)' : 'In this module (Recommended)'}"
453
- description: "{language == 'fr'
454
- ? 'Onglet dans la page détail de {currentModule}'
455
- : 'Tab in {currentModule} detail page'}"
456
- - (3 remaining options)
457
-
458
- IF confidence = LOW:
459
- (all 4 options in neutral order, NO "(Recommandé)" tag)
460
- ```
461
-
462
- ##### D. Process Answer
463
-
464
- | Choice | Action |
465
- |--------|--------|
466
- | **Dans ce module** | Entity becomes a sub-entity of {currentModule}. Add as a **tab in the detail page**. Add to this module's `analysis.entities[]`. |
467
- | **Nouveau module dédié** | Add new module to master `modules[]` via ba-writer with proposed architecture (sections, detail tabs, dependencies). The `list` section is ALWAYS the main section. Additional sections ONLY for functional zones. |
468
- | **Système externe** | Flag for integration. Add to `coverageMatrix` as integration. |
469
- | **Liste de référence** | Lookup table, admin-managed. No module, no section. |
470
-
471
- **IF "Nouveau module dédié" is selected:**
472
- 1. Add new module to master `modules[]` via ba-writer (status: "pending", sortOrder: after current module)
473
- 2. Update dependency graph: current module depends on the new module
474
- 3. **Display:**
475
- ```
476
- "{language == 'fr'
477
- ? '⚠ Nouveau module {ModuleCode} ajouté au graphe de dépendances. Il sera spécifié après {currentModule}.'
478
- : '⚠ New module {ModuleCode} added to dependency graph. It will be specified after {currentModule}.'}"
479
- ```
480
- 4. Update `metadata.workflow.moduleOrder` to include the new module (inserted after its dependents)
481
-
482
- ---
483
-
484
- ## NEXT STEP
485
-
486
- Load: `./step-03a2-analysis.md`