@atlashub/smartstack-cli 3.4.1 → 3.6.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 (46) hide show
  1. package/dist/index.js +160 -5
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +4 -3
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/skills/_shared.md +1 -1
  7. package/templates/skills/application/steps/step-04-backend.md +4 -4
  8. package/templates/skills/application/templates-backend.md +4 -4
  9. package/templates/skills/business-analyse/SKILL.md +26 -15
  10. package/templates/skills/business-analyse/_architecture.md +4 -4
  11. package/templates/skills/business-analyse/_elicitation.md +1 -1
  12. package/templates/skills/business-analyse/_module-loop.md +4 -4
  13. package/templates/skills/business-analyse/html/ba-interactive.html +39 -10
  14. package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
  15. package/templates/skills/business-analyse/questionnaire.md +2 -2
  16. package/templates/skills/business-analyse/react/components.md +1 -1
  17. package/templates/skills/business-analyse/react/schema.md +1 -1
  18. package/templates/skills/business-analyse/references/html-data-mapping.md +4 -3
  19. package/templates/skills/business-analyse/schemas/feature-schema.json +1 -1
  20. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  21. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +1 -0
  22. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  23. package/templates/skills/business-analyse/steps/step-00-init.md +29 -0
  24. package/templates/skills/business-analyse/steps/step-01-cadrage.md +166 -6
  25. package/templates/skills/business-analyse/steps/step-02-decomposition.md +4 -4
  26. package/templates/skills/business-analyse/steps/{step-03a-specify.md → step-03a-data.md} +10 -359
  27. package/templates/skills/business-analyse/steps/step-03b-ui.md +414 -0
  28. package/templates/skills/business-analyse/steps/step-03c-compile.md +343 -0
  29. package/templates/skills/business-analyse/steps/{step-03b-compile.md → step-03d-validate.md} +26 -308
  30. package/templates/skills/business-analyse/steps/step-04-consolidation.md +2 -2
  31. package/templates/skills/business-analyse/steps/step-05a-handoff.md +49 -292
  32. package/templates/skills/business-analyse/steps/step-05b-mapping.md +302 -0
  33. package/templates/skills/business-analyse/steps/step-05c-deploy.md +296 -0
  34. package/templates/skills/business-analyse/steps/step-05d-html.md +326 -0
  35. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  36. package/templates/skills/business-analyse/templates/tpl-handoff.md +6 -6
  37. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +1 -1
  38. package/templates/skills/business-analyse/templates/tpl-progress.md +1 -1
  39. package/templates/skills/controller/steps/step-03-generate.md +2 -1
  40. package/templates/skills/ralph-loop/SKILL.md +17 -2
  41. package/templates/skills/ralph-loop/references/core-seed-data.md +538 -0
  42. package/templates/skills/ralph-loop/steps/step-00-init.md +2 -0
  43. package/templates/skills/ralph-loop/steps/step-01-task.md +273 -7
  44. package/templates/skills/ralph-loop/steps/step-02-execute.md +39 -15
  45. package/templates/skills/ralph-loop/steps/step-04-check.md +87 -4
  46. package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -432
@@ -70,7 +70,163 @@ Launch 3 agents in parallel:
70
70
  Merge findings into {codebase_context}
71
71
  ```
72
72
 
73
- ### 3. Application-Level Questionnaire (application mode)
73
+ ### 3. MODE ROUTING
74
+
75
+ ```
76
+ Read metadata.vibeCoding from feature.json
77
+
78
+ IF metadata.vibeCoding == true:
79
+ → Execute VIBE CODING FLOW (section 3v below)
80
+ → SKIP sections 3s through 8s (standard flow)
81
+ → Go directly to section 9 (Coverage Matrix)
82
+
83
+ ELSE:
84
+ → Execute STANDARD FLOW (sections 3s through 8s below)
85
+ ```
86
+
87
+ ---
88
+
89
+ ## VIBE CODING FLOW (accelerated — 3 lots max)
90
+
91
+ > **In vibe coding mode, the developer IS the product owner, the user, and the builder.**
92
+ > Skip organizational questions (adoption, change management, governance, KPIs).
93
+ > Focus on functional decisions and technical challenges.
94
+
95
+ ### 3v. Vibe Coding — Lot 1: Problem & Scope
96
+
97
+ **Goal:** Capture the core need and must-have features in a single batch.
98
+
99
+ Ask via AskUserQuestion (2 questions):
100
+ ```
101
+ question: "Quel est le besoin principal de cette application ?"
102
+ header: "Besoin"
103
+ options:
104
+ - label: "Automatiser un processus manuel"
105
+ description: "Remplacer des taches repetitives par une application"
106
+ - label: "Creer un outil manquant"
107
+ description: "Construire quelque chose qui n'existe pas encore"
108
+ - label: "Remplacer un outil existant"
109
+ description: "Remplacer un logiciel ou tableur qui ne convient plus"
110
+ - label: "Centraliser des donnees"
111
+ description: "Rassembler des informations dispersees en un seul endroit"
112
+ ```
113
+
114
+ ```
115
+ question: "Quelles fonctionnalites sont indispensables pour la V1 ?"
116
+ header: "Indispensable"
117
+ multiSelect: true
118
+ options:
119
+ → Generate 4 options dynamically from {feature_description}
120
+ → Each option = one functional area detected in the description
121
+ → Example for HR app: "Gestion des employes", "Saisie des heures", "Gestion des conges", "Rapports et exports"
122
+ ```
123
+
124
+ **Store:**
125
+ ```yaml
126
+ problem_type: string (from Q1)
127
+ must_have_features: string[] (from Q2)
128
+ ```
129
+
130
+ ### 4v. Vibe Coding — Lot 2: Users & Permissions
131
+
132
+ **Goal:** Determine access model (solo vs multi-user) and roles.
133
+
134
+ Ask via AskUserQuestion:
135
+ ```
136
+ question: "Qui va utiliser cette application ?"
137
+ header: "Utilisateurs"
138
+ options:
139
+ - label: "Moi seul"
140
+ description: "Application mono-utilisateur, je suis l'unique admin"
141
+ - label: "Quelques utilisateurs (2-10)"
142
+ description: "Petite equipe avec des roles differents"
143
+ - label: "Organisation (10+)"
144
+ description: "Deploiement a l'echelle d'une equipe ou entreprise"
145
+ ```
146
+
147
+ ```
148
+ IF "Moi seul":
149
+ Auto-set:
150
+ applicationRoles = [{ role: "{App} Admin", level: "admin", permissionPattern: "business.{app}.*" }]
151
+ stakeholders = [{ role: "Developpeur", function: "Product owner et developpeur", involvement: "decision-maker", tasks: ["Toutes les operations"] }]
152
+ → SKIP role question
153
+
154
+ IF "Quelques utilisateurs" or "Organisation":
155
+ Display standard 4-tier roles table, then ask:
156
+ question: "Ces 4 roles (Admin, Manager, Contributor, Viewer) conviennent-ils ?"
157
+ header: "Roles"
158
+ options:
159
+ - label: "Oui, parfait"
160
+ description: "Utiliser les 4 roles standards"
161
+ - label: "Personnaliser"
162
+ description: "Modifier les roles ou permissions"
163
+
164
+ Auto-set stakeholders from user type:
165
+ IF "Quelques utilisateurs":
166
+ stakeholders = [
167
+ { role: "Administrateur", function: "Gere le systeme et les utilisateurs", involvement: "decision-maker", tasks: ["Configuration", "Gestion utilisateurs"] },
168
+ { role: "Utilisateur", function: "Utilise le systeme au quotidien", involvement: "end-user", tasks: ["Saisie", "Consultation"] }
169
+ ]
170
+ IF "Organisation":
171
+ stakeholders = [
172
+ { role: "Administrateur", function: "Gere le systeme", involvement: "decision-maker", tasks: ["Configuration", "Gestion"] },
173
+ { role: "Manager", function: "Supervise et valide", involvement: "approver", tasks: ["Validation", "Reporting"] },
174
+ { role: "Utilisateur", function: "Operations quotidiennes", involvement: "end-user", tasks: ["Saisie", "Consultation"] }
175
+ ]
176
+ ```
177
+
178
+ ### 5v. Vibe Coding — Lot 3: Technical Challenges
179
+
180
+ **Goal:** Identify technical risks specific to AI-assisted development.
181
+
182
+ Ask via AskUserQuestion:
183
+ ```
184
+ question: "Quels defis techniques anticipez-vous ?"
185
+ header: "Defis"
186
+ multiSelect: true
187
+ options:
188
+ - label: "Regles metier complexes"
189
+ description: "Calculs, validations ou workflows difficiles a specifier"
190
+ - label: "Volume de donnees"
191
+ description: "Grandes quantites de donnees a gerer ou migrer"
192
+ - label: "Integrations externes"
193
+ description: "APIs, services tiers ou synchronisation avec d'autres systemes"
194
+ - label: "Interface riche"
195
+ description: "Ecrans avec beaucoup d'interactions, graphiques ou visualisations"
196
+ ```
197
+
198
+ **Auto-infer cadrage data (DO NOT ask these — derive from answers):**
199
+
200
+ ```yaml
201
+ cadrage.problem: "{feature_description} — {problem_type}"
202
+ cadrage.asIs: "Aucun systeme en place" | "Processus manuel existant" | "Outil existant a remplacer"
203
+ → Derived from Lot 1 problem_type
204
+ cadrage.toBe: "Application {application_name} couvrant: {must_have_features joined}"
205
+ cadrage.trigger: "Projet vibe coding initie par le developpeur"
206
+ cadrage.risks:
207
+ → Map each selected technical challenge to a RISK entry:
208
+ - "Regles metier complexes" → RISK-001, type: "technical", probability: "medium", impact: "high"
209
+ - "Volume de donnees" → RISK-002, type: "technical", probability: "low", impact: "medium"
210
+ - "Integrations externes" → RISK-003, type: "technical", probability: "medium", impact: "medium"
211
+ - "Interface riche" → RISK-004, type: "technical", probability: "low", impact: "low"
212
+ → Add mitigation for each: "Specification detaillee dans step-03 + generation iterative"
213
+ cadrage.acceptanceCriteria:
214
+ - { id: "AC-001", criterion: "Toutes les fonctionnalites must-have implementees et fonctionnelles", validated: false }
215
+ - { id: "AC-002", criterion: "Application deployable et utilisable", validated: false }
216
+ cadrage.globalScope:
217
+ mustHave: {must_have_features}
218
+ shouldHave: [] → Determined later in coverage matrix
219
+ couldHave: [] → Determined later in coverage matrix
220
+ outOfScope: []
221
+ ```
222
+
223
+ **After Lot 3:** Go directly to **section 9 (Coverage Matrix)**.
224
+
225
+ ---
226
+
227
+ ## STANDARD FLOW (full questionnaire — sections 3s through 8s)
228
+
229
+ ### 3s. Application-Level Questionnaire (application mode)
74
230
 
75
231
  > **Only loaded when workflow.mode = "application"**
76
232
 
@@ -96,7 +252,7 @@ Ask questions in batches of max 4 via AskUserQuestion:
96
252
 
97
253
  After each batch: Apply ULTRATHINK + Elicitation Techniques.
98
254
 
99
- ### 4. Core Questionnaires (always)
255
+ ### 4s. Core Questionnaires (always in standard mode)
100
256
 
101
257
  Load these categories in order. Each questionnaire contains its own batching strategy and elicitation guide.
102
258
 
@@ -125,7 +281,7 @@ Load these categories in order. Each questionnaire contains its own batching str
125
281
  - 2 lots AskUserQuestion
126
282
  - TOUJOURS charge (noyau) - ne jamais sauter cette categorie
127
283
 
128
- ### 5. Conditional Questionnaires
284
+ ### 5s. Conditional Questionnaires
129
285
 
130
286
  Based on feature description analysis, load additional categories:
131
287
 
@@ -139,7 +295,7 @@ Based on feature description analysis, load additional categories:
139
295
 
140
296
  > **Categories 04 (donnees), 07 (interface), 11 (cycle de vie), 12 (migration), 13 (inter-modules) sont par module et chargees dans step-03.**
141
297
 
142
- ### 6. Application Roles Definition
298
+ ### 6s. Application Roles Definition
143
299
 
144
300
  > **Define roles at the APPLICATION level, not per-module.**
145
301
 
@@ -173,7 +329,7 @@ options:
173
329
  IF single-module mode:
174
330
  Same role definition but inferred from stakeholders
175
331
 
176
- ### 7. Proactive Suggestions
332
+ ### 7s. Proactive Suggestions
177
333
 
178
334
  > **Same pattern as previous step-01.** Load suggestion catalog.
179
335
 
@@ -184,7 +340,7 @@ Load: `patterns/suggestion-catalog.md`
184
340
  3. Present top 3-4 suggestions via AskUserQuestion (multiSelect: true)
185
341
  4. Store accepted suggestions in `suggestions[]`
186
342
 
187
- ### 8. Risk Analysis
343
+ ### 8s. Risk Analysis
188
344
 
189
345
  Ask via AskUserQuestion:
190
346
  ```
@@ -207,6 +363,10 @@ Classify per probability/impact:
207
363
  - High/Low or Low/High → Medium (monitor)
208
364
  - Low/Low → Low (accept)
209
365
 
366
+ ---
367
+
368
+ ## COMMON FLOW (both modes rejoin here)
369
+
210
370
  ### 9. Coverage Matrix (MANDATORY)
211
371
 
212
372
  BEFORE transitioning to step-02:
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: step-02-decomposition
3
3
  description: Module decomposition - identify modules, dependency graph, topological sort, client checkpoint
4
- model: sonnet
5
- next_step: steps/step-03a-specify.md
4
+ model: opus
5
+ next_step: steps/step-03a-data.md
6
6
  ---
7
7
 
8
8
  > **Context files:** `_shared.md`
@@ -38,7 +38,7 @@ ba-reader.findFeature({feature_id})
38
38
 
39
39
  IF status already "decomposed":
40
40
  Display: "Decomposition already completed. Loading next step."
41
- Load: steps/step-03a-specify.md
41
+ Load: steps/step-03a-data.md
42
42
  STOP
43
43
 
44
44
  ### 2. Module Identification
@@ -292,4 +292,4 @@ When `workflow.mode = "module"` or only 1 scope item identified:
292
292
 
293
293
  ## NEXT STEP
294
294
 
295
- Load: `./step-03a-specify.md`
295
+ Load: `./step-03a-data.md`
@@ -1,13 +1,13 @@
1
1
  ---
2
- name: step-03a-specify
3
- description: Per-module specification - sections, entities, BR, wireframes, use cases (interactive phase)
2
+ name: step-03a-data
3
+ description: Per-module specification - sections, entities, business rules, questionnaires (data & logic phase)
4
4
  model: opus
5
- next_step: steps/step-03b-compile.md
5
+ next_step: steps/step-03b-ui.md
6
6
  ---
7
7
 
8
8
  > **Context files:** `_shared.md` | `_elicitation.md` | `_architecture.md` | `_module-loop.md`
9
9
 
10
- # Step 3a: Specification (Interactive Phase)
10
+ # Step 3a: Specification - Data & Logic
11
11
 
12
12
  ## MANDATORY EXECUTION RULES
13
13
 
@@ -19,7 +19,6 @@ next_step: steps/step-03b-compile.md
19
19
  - ALL questions via AskUserQuestion tool
20
20
  - ALL communication in `{language}`
21
21
  - NEVER skip per-module validation
22
- - **WIREFRAME RULE:** Every section MUST have a wireframe in `specification.uiWireframes[]`. No section without a validated mockup.
23
22
  - **ID NAMING RULE (MANDATORY, NO EXCEPTION):**
24
23
  All IDs MUST include a module prefix to guarantee application-wide uniqueness.
25
24
  The prefix is derived from the module code initials (2-4 chars):
@@ -44,7 +43,7 @@ next_step: steps/step-03b-compile.md
44
43
 
45
44
  ## YOUR TASK
46
45
 
47
- Specify one module completely: walk through its sections and resources with the client, define entities, business rules, use cases, permissions, mockups, and validate before moving to the next module.
46
+ 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.
48
47
 
49
48
  ---
50
49
 
@@ -298,355 +297,6 @@ Display to client:
298
297
 
299
298
  Write auto-generated sections to `specification.sections[]` via ba-writer.enrichSection()
300
299
 
301
- #### 3a-state. Define Entity State Machine (Full Depth)
302
-
303
- > **For full depth modules with entities that have a status/enum field, define the complete state machine.**
304
- > **This drives conditional actions, badges, and transition effects throughout the UI.**
305
-
306
- For each entity with a status-like attribute:
307
-
308
- 1. **Identify states** from the enum values or business rules:
309
- ```
310
- Ask client: "Quels sont les états possibles pour {Entity}.{statusField} ?"
311
- ```
312
-
313
- 2. **Define transitions** - for each state, ask:
314
- ```
315
- Ask client: "Depuis l'état {state}, quelles transitions sont possibles ?"
316
- ```
317
-
318
- 3. **For each transition**, capture:
319
- - `action`: verb label (submit, approve, reject, cancel, archive)
320
- - `permission`: which permission is required
321
- - `guards`: which BR must pass (reference existing BR-XXX from analysis)
322
- - `effects`: what happens after (notification, email, field update)
323
- - `confirm`: does the user need to confirm?
324
-
325
- 4. **Assign colors** to states for badge rendering:
326
- - Draft/New → gray
327
- - In Progress/Submitted → blue
328
- - Approved/Active → green
329
- - Warning/Pending → yellow
330
- - Error/Rejected → red
331
- - Archived/Cancelled → purple
332
-
333
- 5. **Store** in `specification.lifeCycles[]`:
334
- ```json
335
- {
336
- "entity": "{Entity}",
337
- "field": "status",
338
- "initialState": "{firstState}",
339
- "states": [
340
- { "id": "draft", "displayName": "Brouillon", "color": "gray", "allowedTransitions": ["submitted"], "isTerminal": false }
341
- ],
342
- "transitions": [
343
- {
344
- "from": "draft", "to": "submitted", "action": "submit",
345
- "permission": "business.{app}.{module}.submit",
346
- "guards": ["BR-VAL-{PREFIX}-001"],
347
- "effects": [{ "type": "notification", "target": "role:manager", "template": "{module}-submitted" }],
348
- "confirm": true
349
- }
350
- ]
351
- }
352
- ```
353
-
354
- 6. **Cross-validate:** Every `allowedTransitions` entry must have a matching `transitions[]` entry.
355
-
356
- #### 3a-bis. Structure Sections with Resources (Levels 4 & 5)
357
-
358
- > **DEPTH GATE:** Execute this section for **full** depth, or for individual sections flagged for customization in **override** depth. For **convention** depth, sections are auto-generated by 3a-infer — skip to 3b.
359
-
360
- For EACH section confirmed in 3a, build the `specification.sections[]` structure:
361
-
362
- 1. For each resource in the section, determine:
363
- - The SmartStack component type (SmartTable, SmartForm, DetailCard, KpiPanel, Chart, Map, Timeline, etc.)
364
- - The entity it operates on
365
- - Columns/fields based on entity attributes
366
- - Permission (inherit from section or more specific)
367
- - Available actions
368
-
369
- 2. Link use cases to sections:
370
- - Each UC MUST belong to exactly ONE section
371
- - Map UC to section based on the primary action (list → UC-XX-001, create → UC-XX-003, etc.)
372
-
373
- 3. Link business rules to sections:
374
- - Each BR can belong to one or more sections
375
- - Map BR based on where it's enforced (validation BR → create/edit section, calc BR → detail section)
376
-
377
- 4. Build the section object:
378
-
379
- > **STRUCTURE CARD: specification.sections[]** — Resources MUST include full depth definitions.
380
- > ```json
381
- > {
382
- > "code": "list",
383
- > "labels": { "fr": "Liste", "en": "List", "it": "Elenco", "de": "Liste" },
384
- > "route": "/business/{app}/{module}/list",
385
- > "icon": "list",
386
- > "permission": "business.{app}.{module}.read",
387
- > "wireframe": "{module}-list",
388
- > "useCases": ["UC-{PREFIX}-001", "UC-{PREFIX}-002"],
389
- > "businessRules": ["BR-VAL-{PREFIX}-001"],
390
- > "resources": [
391
- > {
392
- > "code": "{module}-grid",
393
- > "type": "SmartTable",
394
- > "entity": "{MainEntity}",
395
- > "permission": "business.{app}.{module}.read",
396
- > "columns": ["name", "status", "createdAt"],
397
- > "columnDefs": [
398
- > { "field": "code", "label": {"fr": "Code", "en": "Code"}, "format": "text", "sortable": true, "filterable": true, "clickAction": "navigate:detail" },
399
- > { "field": "name", "label": {"fr": "Nom", "en": "Name"}, "format": "text", "sortable": true, "filterable": true },
400
- > { "field": "status", "label": {"fr": "Statut", "en": "Status"}, "format": "badge", "sortable": true, "filterable": true, "colorMap": "stateMachine:{Entity}" },
401
- > { "field": "createdAt", "label": {"fr": "Créé le", "en": "Created"}, "format": "date-relative", "sortable": true }
402
- > ],
403
- > "actions": ["view", "edit", "delete"],
404
- > "rowActions": [
405
- > { "action": "view", "icon": "eye", "permission": "business.{app}.{module}.read" },
406
- > { "action": "edit", "icon": "edit", "permission": "business.{app}.{module}.update", "showWhen": {"status": ["draft"]} },
407
- > { "action": "delete", "icon": "trash", "permission": "business.{app}.{module}.delete", "confirm": true }
408
- > ],
409
- > "filters": ["status", "dateRange"],
410
- > "defaultSort": { "field": "createdAt", "direction": "desc" },
411
- > "defaultPageSize": 20,
412
- > "emptyState": { "icon": "inbox", "message": {"fr": "Aucun enregistrement", "en": "No records"}, "createAction": true }
413
- > }
414
- > ]
415
- > }
416
- > ```
417
- >
418
- > **SmartForm resource example (for create/edit sections):**
419
- > ```json
420
- > {
421
- > "code": "{module}-form",
422
- > "type": "SmartForm",
423
- > "entity": "{MainEntity}",
424
- > "permission": "business.{app}.{module}.create",
425
- > "fields": [
426
- > { "name": "code", "component": "Input", "required": true, "validation": "Unique, auto-generated" },
427
- > { "name": "name", "component": "Input", "required": true },
428
- > { "name": "type", "component": "Select", "required": true, "source": "EntityTypeEnum" },
429
- > { "name": "description", "component": "TextArea", "required": false },
430
- > { "name": "parentId", "component": "EntitySelect", "source": "ParentEntity", "required": true },
431
- > { "name": "startDate", "component": "DatePicker", "required": true },
432
- > { "name": "isActive", "component": "Toggle", "default": true }
433
- > ],
434
- > "formLayout": {
435
- > "type": "tabs",
436
- > "tabs": [
437
- > { "code": "general", "label": {"fr": "Général", "en": "General"}, "fields": ["code", "name", "type", "description"] },
438
- > { "code": "details", "label": {"fr": "Détails", "en": "Details"}, "fields": ["parentId", "startDate", "isActive"] }
439
- > ]
440
- > }
441
- > }
442
- > ```
443
- > **MANDATORY for SmartTable:** `columnDefs`, `rowActions`, `defaultSort`, `emptyState`
444
- > **MANDATORY for SmartForm:** `fields` with `component` type, `formLayout`
445
-
446
- 5. Write `specification.sections[]` via ba-writer.enrichSection()
447
-
448
- **VALIDATION:** Every UC must appear in exactly one section.useCases[]. No orphan UCs.
449
-
450
- #### 3b. For Each Section: Generate MANDATORY ASCII Mockup
451
-
452
- > **BLOCKING RULE:** Every section MUST have a wireframe. No section proceeds to entity definition (step 6) without a validated mockup stored in `specification.uiWireframes[]`.
453
- > **HTML INTEGRATION:** These wireframes are also rendered in the interactive HTML document (`ba-interactive.html`) deployed at handoff. The client can review and annotate mockups directly in their browser.
454
-
455
- For each confirmed section, generate an ASCII mockup and validate with client:
456
-
457
- Example for a list section:
458
-
459
- ```
460
- ╔═══════════════════════════════════════════════════════════╗
461
- ║ {Module} > Liste [+ Nouveau] ║
462
- ╠═══════════════════════════════════════════════════════════╣
463
- ║ 🔍 Rechercher... │ Statut: [Tous ▾] │ Date: [Ce mois ▾] ║
464
- ╠═══════════════════════════════════════════════════════════╣
465
- ║ # │ {Field1} │ {Field2} │ {Field3} │ Statut │ ··· ║
466
- ║ 1 │ VAL-001 │ Exemple 1 │ 12'500.- │ ● Brouillon │ ⋮ ║
467
- ║ 2 │ VAL-002 │ Exemple 2 │ 8'300.- │ ● Envoyé │ ⋮ ║
468
- ╠═══════════════════════════════════════════════════════════╣
469
- ║ 1-25 de 142 │ ◀ 1 2 3 ··· 6 ▶ ║
470
- ╚═══════════════════════════════════════════════════════════╝
471
- ```
472
-
473
- Store in specification.uiWireframes[] (**MANDATORY** for every section):
474
-
475
- > **STRUCTURE CARD: specification.uiWireframes[]** — ALL fields below are MANDATORY.
476
- > ```json
477
- > {
478
- > "screen": "{module}-{section}",
479
- > "section": "{section}",
480
- > "description": "Description of the screen",
481
- > "mockupFormat": "ascii",
482
- > "mockup": "╔═══...",
483
- > "elements": ["DataGrid", "FilterBar", "Pagination", "CreateButton"],
484
- > "actions": ["filter", "sort", "create", "view-detail"],
485
- > "permissionsRequired": ["business.{app}.{module}.read"],
486
- > "componentMapping": [
487
- > { "wireframeElement": "DataGrid", "reactComponent": "SmartTable" },
488
- > { "wireframeElement": "FilterBar", "reactComponent": "SmartFilter" },
489
- > { "wireframeElement": "CreateButton", "reactComponent": "Button" }
490
- > ],
491
- > "layout": {
492
- > "type": "page",
493
- > "regions": [
494
- > { "id": "toolbar", "position": "top", "components": [
495
- > { "type": "FilterBar", "resourceRef": "{module}-filters" },
496
- > { "type": "ActionMenu", "resourceRef": "{module}-actions", "permission": "business.{app}.{module}.create" }
497
- > ]},
498
- > { "id": "content", "position": "main", "span": 12, "components": [
499
- > { "type": "SmartTable", "resourceRef": "{module}-grid" }
500
- > ]}
501
- > ]
502
- > }
503
- > }
504
- > ```
505
- > **REQUIRED fields:** `screen`, `mockup`, `elements`, `section`, `componentMapping`, `layout` are ALL mandatory.
506
- > A wireframe without `componentMapping` or `layout` will FAIL validation in step 9.
507
- > **layout.regions[].components[].resourceRef** MUST match a `sections[].resources[].code`.
508
-
509
- Ask client to validate each mockup via AskUserQuestion (batch 2-3 mockups at once if possible).
510
-
511
- > **IF client rejects a mockup:** Revise and re-propose until validated. Do NOT proceed without client approval on the layout.
512
-
513
- #### 3b-bis. Wireframe-to-Component Mapping
514
-
515
- After client validates the mockup, map each wireframe element to a SmartStack React component:
516
-
517
- | Wireframe Element | SmartStack Component | Notes |
518
- |-------------------|---------------------|-------|
519
- | DataGrid | `SmartTable` or `EntityCard` grid | Use EntityCard for card layouts |
520
- | FilterBar | `SmartFilter` | Integrated with SmartTable |
521
- | SearchInput | `SearchInput` | Debounced search |
522
- | Pagination | Built into `SmartTable` | Server-side pagination |
523
- | ActionButton | `Button` + `RequirePermission` | Always wrapped in permission check |
524
- | StatusBadge | `StatusBadge` | Uses entity lifecycle states |
525
- | DetailCard | `EntityDetailCard` | Standard detail layout |
526
- | Form | `SmartForm` | FluentValidation-backed |
527
- | KpiCard | `StatCard` (Recharts) | Dashboard KPI display |
528
- | Chart:bar/line/pie | Recharts `BarChart`/`LineChart`/`PieChart` | CSS variables for colors |
529
-
530
- Store the component mapping alongside the wireframe to ensure downstream skills use the correct components.
531
-
532
- #### 3b-ter. Generate Structural Layout
533
-
534
- For EACH wireframe generated in 3b, generate a `layout` object alongside the ASCII mockup:
535
-
536
- 1. From the ASCII mockup, extract the visual regions (header, toolbar, main content, sidebar, etc.)
537
- 2. For each region, map the visual elements to SmartStack component types
538
- 3. Build the layout structure:
539
- ```json
540
- {
541
- "type": "page",
542
- "regions": [
543
- { "id": "toolbar", "position": "top", "components": [
544
- { "type": "FilterBar", "resourceRef": "{module}-filters" },
545
- { "type": "ActionMenu", "resourceRef": "{module}-actions", "permission": "business.{app}.{module}.create" }
546
- ]},
547
- { "id": "content", "position": "main", "span": 12, "components": [
548
- { "type": "SmartTable", "resourceRef": "{module}-grid" }
549
- ]}
550
- ]
551
- }
552
- ```
553
- 4. Cross-validate: each component in layout.regions[].components[] MUST have a corresponding resource in sections[].resources[]
554
- 5. Write layout alongside mockup in uiWireframes[]
555
-
556
- **RULE:** The layout is the source of truth for ralph-loop. The mockup is for human validation only.
557
-
558
- #### 3c. Identify Resources per Section
559
-
560
- For each section, identify what resources/components are needed:
561
-
562
- - List section → DataGrid, FilterBar, SearchInput, ExportButton
563
- - Detail section → DetailCard, StatusBadge, ActionButtons, Timeline
564
- - Create section → Form, ValidationMessages, SubmitButton
565
- - Approve section → StatusTransitionPanel, CommentBox, ApproveRejectButtons
566
- - Dashboard section → StatCard, RechartsChart (Bar/Line/Pie/Area), DashboardGrid, FilterBar
567
-
568
- #### 3d. Dashboard Specification (if section = dashboard)
569
-
570
- When a "dashboard" section is selected, capture structured KPI and chart data **in addition** to the standard ASCII mockup.
571
-
572
- 1. **Ask client for KPIs** via AskUserQuestion (batch):
573
- - KPI name and metric description
574
- - Visualization type: `kpi-card`, `bar`, `line`, `pie`, `area`, `donut`, `stacked-bar`
575
- - Data source entity
576
- - Format: `number`, `currency`, `percent`, `duration`
577
- - Thresholds (warning/critical) if applicable
578
-
579
- 2. **Ask client for filters:**
580
- - Date range filter? Default period? (day/week/month/quarter/year)
581
- - Entity-based filters? (status, category, etc.)
582
-
583
- 3. **Ask client for refresh mode:**
584
- - Static (load on page open)
585
- - Polling (periodic refresh)
586
- - SignalR (real-time push)
587
-
588
- 4. **Store in specification.dashboards[]:**
589
-
590
- ```json
591
- {
592
- "code": "{module}-dashboard",
593
- "title": "{Module} Dashboard",
594
- "description": "Vue d'ensemble des métriques {module}",
595
- "linkedUCs": ["UC-XXX"],
596
- "refreshMode": "static",
597
- "defaultPeriod": "month",
598
- "kpis": [
599
- {
600
- "code": "total-items",
601
- "label": "Total Items",
602
- "metric": "COUNT(entity)",
603
- "format": "number",
604
- "visualization": "kpi-card",
605
- "dataSource": "Entity",
606
- "thresholds": { "warning": 100, "critical": 50 }
607
- },
608
- {
609
- "code": "items-by-status",
610
- "label": "Items by Status",
611
- "metric": "COUNT(entity) GROUP BY status",
612
- "format": "number",
613
- "visualization": "pie",
614
- "dataSource": "Entity",
615
- "dimensions": ["status"]
616
- }
617
- ],
618
- "filters": [
619
- { "field": "dateRange", "type": "dateRange", "label": "Période" },
620
- { "field": "status", "type": "multiselect", "label": "Statut" }
621
- ],
622
- "permissionsRequired": ["business.{app}.{module}.read"]
623
- }
624
- ```
625
-
626
- 5. **ALSO generate the standard ASCII mockup** for the dashboard with KPI cards + chart placeholders:
627
-
628
- ```
629
- ╔═══════════════════════════════════════════════════════════════╗
630
- ║ {Module} > Dashboard Période: [Ce mois ▾] ║
631
- ╠═══════════════════════════════════════════════════════════════╣
632
- ║ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ║
633
- ║ │ KPI #1 │ │ KPI #2 │ │ KPI #3 │ │ KPI #4 │ ║
634
- ║ │ 1,234 │ │ 567 │ │ 89.2% │ │ 12,400 │ ║
635
- ║ │ ↑ +12% │ │ ↓ -3% │ │ → 0% │ │ ↑ +5% │ ║
636
- ║ └──────────┘ └──────────┘ └──────────┘ └──────────┘ ║
637
- ╠═══════════════════════════════════════════════════════════════╣
638
- ║ ┌─────────────────────────┐ ┌─────────────────────────┐ ║
639
- ║ │ [Bar Chart] │ │ [Pie Chart] │ ║
640
- ║ │ Items by Month │ │ Items by Status │ ║
641
- ║ │ ████ │ │ ████████ │ ║
642
- ║ │ ████ ████ │ │ ███ ███ │ ║
643
- ║ │ ████ ████ ████ │ │ ██ 42% ██ │ ║
644
- ║ └─────────────────────────┘ └─────────────────────────┘ ║
645
- ╚═══════════════════════════════════════════════════════════════╝
646
- ```
647
-
648
- Store the mockup in specification.wireframes[] AS WELL (for visual reference).
649
-
650
300
  ### 4. Conditional Questionnaires
651
301
 
652
302
  Based on module type, load questionnaires per-module:
@@ -806,19 +456,20 @@ Extract business rules specific to this module:
806
456
 
807
457
  ---
808
458
 
809
- ## SELF-VERIFICATION (MANDATORY before loading step-03b)
459
+ ## SELF-VERIFICATION (MANDATORY before loading step-03b-ui)
810
460
 
811
- Before proceeding to step-03b-compile.md, VERIFY:
461
+ Before proceeding to step-03b-ui.md, VERIFY:
812
462
 
813
463
  1. **Module feature.json exists** at expected path (`docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json`)
814
464
  2. **Module feature.json has analysis section** with `entities[]` (at least 1) and `businessRules[]` (at least 1)
815
465
  3. **Module status in master** = "in-progress" (set by section 2 above)
816
466
  4. **Master modules[].featureJsonPath** for this module ≠ null (set by ba-writer.create)
467
+ 5. **Sections identified** with clear roles and entities assigned
817
468
 
818
- **IF any check fails → FIX before proceeding.** Do NOT load step-03b with incomplete data.
469
+ **IF any check fails → FIX before proceeding.** Do NOT load step-03b-ui with incomplete data.
819
470
 
820
471
  ---
821
472
 
822
473
  ## NEXT STEP
823
474
 
824
- Load: `steps/step-03b-compile.md`
475
+ Load: `steps/step-03b-ui.md`