@atlashub/smartstack-cli 4.21.0 → 4.23.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "4.21.0",
3
+ "version": "4.23.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: ba-design-ui
3
+ description: "Design user interfaces for each module: screens, wireframes, and navigation tree from Phase 1 analysis data."
4
+ model: opus
5
+ user_invocable: true
6
+ ---
7
+
8
+ # /ba-design-ui
9
+
10
+ Design user interfaces for each module based on the business analysis data (entities, use cases, permissions) produced by `/business-analyse`.
11
+
12
+ ## Triggers
13
+
14
+ - Explicit invocation: `/ba-design-ui <feature-id>`
15
+ - After `/business-analyse` step-04 (consolidation complete)
16
+ - After `/ba-review` when corrections target UI/screens
17
+
18
+ ## Parameters
19
+
20
+ | Parameter | Required | Description |
21
+ |-----------|----------|-------------|
22
+ | `<feature-id>` | Yes | Feature identifier (e.g., FEAT-001) |
23
+ | `--module` | No | Restrict to a single module (e.g., HumanResources) |
24
+
25
+ ## Prerequisites
26
+
27
+ - `/business-analyse` must be completed (step-04 consolidated)
28
+ - JSON files must exist: `index.json`, `entities.json`, `usecases.json`, `permissions.json` per module
29
+ - Feature status must be `consolidated` or `reviewed`
30
+
31
+ ## Workflow
32
+
33
+ 3 progressive steps:
34
+
35
+ | Step | File | Role |
36
+ |------|------|------|
37
+ | 01 | `steps/step-01-screens.md` | Define sections/resources with detailed specs per module |
38
+ | 02 | `steps/step-02-wireframes.md` | Generate wireframes (ASCII/HTML) for each screen |
39
+ | 03 | `steps/step-03-navigation.md` | Define the complete navigation tree (seedDataCore) |
40
+
41
+ ## Input
42
+
43
+ For each module, load via ba-reader:
44
+ - `index.json` (module metadata, anticipatedSections)
45
+ - `entities.json` (attributes with types, relationships)
46
+ - `usecases.json` (actor actions, scenarios)
47
+ - `permissions.json` (role matrix, permission paths)
48
+
49
+ ## Output
50
+
51
+ Per module:
52
+ - `screens.json` — Detailed interface specifications (SmartTable columns, SmartForm fields, SmartDashboard KPIs)
53
+ - Wireframes embedded in screens.json (mockupFormat, elements[], layout, componentMapping)
54
+
55
+ Project-level:
56
+ - `navigation.json` — Complete navigation tree (routes, menus, breadcrumbs)
57
+
58
+ ## Absolute Rules
59
+
60
+ - **NEVER** invent entities or permissions not defined in Phase 1 — UI specs MUST reference existing analysis data
61
+ - **Every screen** MUST have a `permission` field referencing a valid permission path from permissions.json
62
+ - **Every SmartTable column** MUST reference a valid entity attribute or relationship
63
+ - **Every SmartForm field** MUST reference a valid entity attribute
64
+ - **screens.json** MUST have at least one section per module
65
+
66
+ ## Post-Design Workflow
67
+
68
+ ```
69
+ /ba-design-ui completes
70
+ |
71
+ v
72
+ /ba-generate-html (generates interactive HTML with mockups, ERD, permission matrix)
73
+ |
74
+ v
75
+ Client reviews HTML
76
+ |
77
+ v
78
+ /ba-review (apply corrections, route back to /business-analyse or /ba-design-ui)
79
+ ```
80
+
81
+ ## References
82
+
83
+ | File | Content |
84
+ |------|---------|
85
+ | `/business-analyse` skill | Source analysis data (entities, UCs, permissions) |
86
+ | `/ba-generate-html` skill | HTML generation consuming screens.json |
87
+ | `ba-generate-html/references/data-mapping.md` | JSON to FEATURE_DATA field mapping |
88
+
89
+ ## Entry Point
90
+
91
+ **FIRST ACTION:** Load `steps/step-01-screens.md`
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: step-01-screens
3
+ description: Define sections and resources with detailed UI specs per module
4
+ model: opus
5
+ next_step: steps/step-02-wireframes.md
6
+ ---
7
+
8
+ # Step 01 — Screens (Define Sections & Resources)
9
+
10
+ ## Objective
11
+
12
+ For each module, define all sections and resources with detailed interface specifications: SmartTable columns, SmartForm fields with types, SmartDashboard KPIs, SmartKanban columns.
13
+
14
+ ## Prerequisites
15
+
16
+ - `/business-analyse` completed (entities, usecases, permissions exist)
17
+ - Module index.json accessible via ba-reader
18
+
19
+ ## Execution
20
+
21
+ ### 1. Load Analysis Data
22
+
23
+ For each module (in dependency order from index.json):
24
+
25
+ ```
26
+ Load via ba-reader:
27
+ - entities.json → entity attributes with types, relationships
28
+ - usecases.json → actor actions, CRUD operations
29
+ - permissions.json → role matrix, permission paths
30
+ - index.json → anticipatedSections from step-02
31
+ ```
32
+
33
+ ### 2. Define Sections & Resources
34
+
35
+ For each module, transform anticipatedSections into detailed screen specs.
36
+
37
+ **SmartTable resource:**
38
+ ```json
39
+ {
40
+ "code": "{entity-plural}-grid",
41
+ "type": "SmartTable",
42
+ "label": "Grille des {entity-plural}",
43
+ "columns": [
44
+ { "field": "code", "label": "Code", "type": "text", "sortable": true, "width": "100px" },
45
+ { "field": "fullName", "label": "Nom", "type": "text", "sortable": true },
46
+ { "field": "department.name", "label": "Departement", "type": "lookup", "filterable": true },
47
+ { "field": "status", "label": "Statut", "type": "badge", "filterable": true, "options": ["Active", "Inactive"] }
48
+ ],
49
+ "actions": ["create", "edit", "delete", "export"],
50
+ "filters": [
51
+ { "field": "department", "type": "select", "label": "Departement" },
52
+ { "field": "status", "type": "select", "label": "Statut" }
53
+ ],
54
+ "permission": "{AppCode}.{ModuleCode}.Read",
55
+ "rowActions": ["edit", "view-detail"],
56
+ "defaultSort": { "field": "code", "direction": "asc" },
57
+ "pageSize": 25
58
+ }
59
+ ```
60
+
61
+ **SmartForm resource:**
62
+ ```json
63
+ {
64
+ "code": "{entity}-form",
65
+ "type": "SmartForm",
66
+ "label": "Fiche {entity}",
67
+ "tabs": [
68
+ {
69
+ "label": "Informations",
70
+ "fields": [
71
+ { "field": "firstName", "label": "Prenom", "type": "text", "required": true, "col": 6 },
72
+ { "field": "lastName", "label": "Nom", "type": "text", "required": true, "col": 6 },
73
+ { "field": "email", "label": "Email", "type": "email", "required": true, "validation": "unique" },
74
+ { "field": "department", "label": "Departement", "type": "lookup", "entity": "Department", "required": true },
75
+ { "field": "status", "label": "Statut", "type": "select", "options": ["Active", "Inactive"], "readonly": "onCreate" }
76
+ ]
77
+ },
78
+ {
79
+ "label": "Contrats",
80
+ "type": "subtable",
81
+ "entity": "Contract",
82
+ "columns": ["contractType", "startDate", "endDate", "status"]
83
+ }
84
+ ],
85
+ "permission": "{AppCode}.{ModuleCode}.Update"
86
+ }
87
+ ```
88
+
89
+ **SmartDashboard resource:**
90
+ ```json
91
+ {
92
+ "code": "{module}-dashboard",
93
+ "type": "SmartDashboard",
94
+ "label": "Tableau de bord {module}",
95
+ "kpis": [
96
+ { "label": "Total actifs", "value": "count(status=Active)", "icon": "users", "color": "primary" },
97
+ { "label": "En conge", "value": "count(status=OnLeave)", "icon": "calendar", "color": "warning" }
98
+ ],
99
+ "charts": [
100
+ { "type": "pie", "label": "Repartition par departement", "dataSource": "employees", "groupBy": "department" },
101
+ { "type": "bar", "label": "Evolution des effectifs", "dataSource": "employees", "groupBy": "hireDate.year" }
102
+ ],
103
+ "permission": "{AppCode}.{ModuleCode}.Read"
104
+ }
105
+ ```
106
+
107
+ **SmartKanban resource:**
108
+ ```json
109
+ {
110
+ "code": "{entity}-kanban",
111
+ "type": "SmartKanban",
112
+ "label": "Kanban {entity}",
113
+ "statusField": "status",
114
+ "columns": [
115
+ { "value": "Draft", "label": "Brouillon", "color": "gray" },
116
+ { "value": "Submitted", "label": "Soumis", "color": "blue" },
117
+ { "value": "Approved", "label": "Approuve", "color": "green" }
118
+ ],
119
+ "cardFields": ["code", "assignee", "dueDate"],
120
+ "permission": "{AppCode}.{ModuleCode}.Read"
121
+ }
122
+ ```
123
+
124
+ ### 3. Column/Field Type Mapping
125
+
126
+ Map entity attribute types to UI component types:
127
+
128
+ | Entity type | SmartTable type | SmartForm type |
129
+ |-------------|----------------|----------------|
130
+ | `string` | `text` | `text` |
131
+ | `int`, `decimal` | `number` | `number` |
132
+ | `date` | `date` | `datepicker` |
133
+ | `datetime` | `datetime` | `datetimepicker` |
134
+ | `bool` | `boolean` | `checkbox` |
135
+ | `enum` | `badge` | `select` |
136
+ | `guid` (FK) | `lookup` | `lookup` |
137
+ | `text` (long) | `text` (truncated) | `textarea` |
138
+
139
+ ### 4. Write screens.json
140
+
141
+ For each module, write via ba-writer:
142
+
143
+ ```json
144
+ {
145
+ "sections": [
146
+ {
147
+ "sectionCode": "list",
148
+ "sectionLabel": "Liste des employes",
149
+ "resources": [ /* SmartTable, filters */ ]
150
+ },
151
+ {
152
+ "sectionCode": "form",
153
+ "sectionLabel": "Fiche employe",
154
+ "resources": [ /* SmartForm with tabs */ ]
155
+ },
156
+ {
157
+ "sectionCode": "dashboard",
158
+ "sectionLabel": "Tableau de bord",
159
+ "resources": [ /* SmartDashboard */ ]
160
+ }
161
+ ]
162
+ }
163
+ ```
164
+
165
+ Update `index.json` with screens.json hash and status.
166
+
167
+ ## Validation
168
+
169
+ - [ ] Every resource has a valid `permission` referencing permissions.json
170
+ - [ ] Every SmartTable column references a valid entity attribute
171
+ - [ ] Every SmartForm field references a valid entity attribute
172
+ - [ ] Every section has at least one resource
173
+ - [ ] Every module has at least one section
174
+
175
+ ## Transition
176
+
177
+ -> Step 02 (wireframes) — Generate visual mockups for each screen
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: step-02-wireframes
3
+ description: Generate wireframes (ASCII/HTML mockups) for each screen defined in step-01
4
+ model: opus
5
+ next_step: steps/step-03-navigation.md
6
+ ---
7
+
8
+ # Step 02 — Wireframes (Generate Mockups)
9
+
10
+ ## Objective
11
+
12
+ Generate visual wireframes for each screen defined in screens.json. Each wireframe provides a concrete representation of the UI layout, component placement, and user interactions.
13
+
14
+ ## Prerequisites
15
+
16
+ - Step 01 (screens) completed
17
+ - screens.json exists for each module with detailed section/resource specs
18
+
19
+ ## Execution
20
+
21
+ ### 1. Load Screen Specs
22
+
23
+ For each module, read screens.json via ba-reader.
24
+
25
+ ### 2. Generate Wireframes per Resource
26
+
27
+ For each resource in each section, generate a wireframe object:
28
+
29
+ **SmartTable wireframe:**
30
+ ```json
31
+ {
32
+ "screen": "{sectionCode}-{resourceCode}",
33
+ "section": "{sectionCode}",
34
+ "mockupFormat": "ascii",
35
+ "mockup": "+----------------------------------------------------------+\n| [Departement v] [Statut v] [+ Nouveau employe] |\n+------+----------------+---------------+--------+---------+\n| Code | Nom complet | Departement | Statut | Actions |\n+------+----------------+---------------+--------+---------+\n| E001 | Dupont Marie | RH | Actif | [E] [S] |\n| E002 | Martin Pierre | IT | Conge | [E] [S] |\n+------+----------------+---------------+--------+---------+\n| << 1 2 3 ... 10 >> 25 par page |\n+----------------------------------------------------------+",
36
+ "elements": ["FilterBar", "DataGrid", "Pagination", "ActionButtons"],
37
+ "actions": ["filter", "sort", "create", "edit", "delete", "export"],
38
+ "componentMapping": [
39
+ { "wireframeElement": "FilterBar", "reactComponent": "SmartFilter" },
40
+ { "wireframeElement": "DataGrid", "reactComponent": "SmartTable" },
41
+ { "wireframeElement": "Pagination", "reactComponent": "SmartPagination" },
42
+ { "wireframeElement": "ActionButtons", "reactComponent": "SmartToolbar" }
43
+ ],
44
+ "layout": {
45
+ "type": "vertical",
46
+ "regions": ["filters", "grid", "pagination"]
47
+ },
48
+ "permissionsRequired": ["{AppCode}.{ModuleCode}.Read"]
49
+ }
50
+ ```
51
+
52
+ **SmartForm wireframe:**
53
+ ```json
54
+ {
55
+ "screen": "{sectionCode}-{resourceCode}",
56
+ "section": "{sectionCode}",
57
+ "mockupFormat": "ascii",
58
+ "mockup": "+----------------------------------------------------------+\n| Fiche Employe [Sauvegarder] |\n+----------------------------------------------------------+\n| [Informations] [Contrats] [Documents] |\n+----------------------------------------------------------+\n| Prenom: [_______________] Nom: [_______________] |\n| Email: [_______________] Tel: [_______________] |\n| Departement: [Selectionnez v ] Poste: [_____________] |\n| Date embauche: [__ /__ /____] Statut: [Actif v] |\n+----------------------------------------------------------+",
59
+ "elements": ["TabBar", "FormFields", "SaveButton"],
60
+ "actions": ["save", "cancel", "tab-switch"],
61
+ "componentMapping": [
62
+ { "wireframeElement": "TabBar", "reactComponent": "SmartTabs" },
63
+ { "wireframeElement": "FormFields", "reactComponent": "SmartForm" },
64
+ { "wireframeElement": "SaveButton", "reactComponent": "SmartButton" }
65
+ ],
66
+ "layout": {
67
+ "type": "vertical",
68
+ "regions": ["header", "tabs", "form-body", "actions"]
69
+ },
70
+ "permissionsRequired": ["{AppCode}.{ModuleCode}.Update"]
71
+ }
72
+ ```
73
+
74
+ **SmartDashboard wireframe:**
75
+ ```json
76
+ {
77
+ "screen": "{sectionCode}-{resourceCode}",
78
+ "section": "{sectionCode}",
79
+ "mockupFormat": "ascii",
80
+ "mockup": "+----------------------------------------------------------+\n| Tableau de bord RH |\n+-------------+-------------+-------------+----------------+\n| Total actifs| En conge | Nouveaux | Taux rotation |\n| 156 | 12 | 8 | 3.2% |\n+-------------+-------------+-------------+----------------+\n| [Repartition par dept (pie)] [Evolution effectifs (bar)]|\n+----------------------------------------------------------+",
81
+ "elements": ["KPICards", "PieChart", "BarChart"],
82
+ "actions": ["filter-period", "export-report"],
83
+ "componentMapping": [
84
+ { "wireframeElement": "KPICards", "reactComponent": "SmartKPI" },
85
+ { "wireframeElement": "PieChart", "reactComponent": "SmartChart" },
86
+ { "wireframeElement": "BarChart", "reactComponent": "SmartChart" }
87
+ ],
88
+ "layout": {
89
+ "type": "grid",
90
+ "regions": ["kpi-row", "charts-row"]
91
+ },
92
+ "permissionsRequired": ["{AppCode}.{ModuleCode}.Read"]
93
+ }
94
+ ```
95
+
96
+ ### 3. Enrich screens.json with Wireframes
97
+
98
+ For each module, update screens.json to embed wireframes at the resource level:
99
+
100
+ ```json
101
+ {
102
+ "sections": [
103
+ {
104
+ "sectionCode": "list",
105
+ "sectionLabel": "Liste des employes",
106
+ "resources": [
107
+ {
108
+ "code": "employees-grid",
109
+ "type": "SmartTable",
110
+ "columns": [ /* ... */ ],
111
+ "wireframe": {
112
+ "screen": "list-employees-grid",
113
+ "mockupFormat": "ascii",
114
+ "mockup": "...",
115
+ "elements": [...],
116
+ "componentMapping": [...],
117
+ "layout": {...}
118
+ }
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ }
124
+ ```
125
+
126
+ ### 4. Write Updated screens.json
127
+
128
+ Write via ba-writer for each module. Update index.json hashes.
129
+
130
+ ## Validation
131
+
132
+ - [ ] Every resource has a wireframe object
133
+ - [ ] Every wireframe has a non-empty `mockup` field
134
+ - [ ] Every wireframe has `elements[]` and `componentMapping[]`
135
+ - [ ] Wireframe `permissionsRequired` references valid permission paths
136
+ - [ ] All wireframes have `mockupFormat` set ("ascii" or "html")
137
+
138
+ ## Transition
139
+
140
+ -> Step 03 (navigation) — Define the complete navigation tree
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: step-03-navigation
3
+ description: Define the complete navigation tree (routes, menus, breadcrumbs)
4
+ model: opus
5
+ ---
6
+
7
+ # Step 03 — Navigation (Navigation Tree)
8
+
9
+ ## Objective
10
+
11
+ Define the complete navigation tree for the application: routes, menus, breadcrumbs, and seedDataCore entries. This ensures consistent navigation across all modules.
12
+
13
+ ## Prerequisites
14
+
15
+ - Step 01 (screens) and Step 02 (wireframes) completed
16
+ - screens.json exists for each module with sections and resources
17
+
18
+ ## Execution
19
+
20
+ ### 1. Load All Screens
21
+
22
+ Read screens.json for every module via ba-reader. Collect all sections and resources.
23
+
24
+ ### 2. Build Navigation Tree
25
+
26
+ Build the navigation hierarchy following SmartStack conventions:
27
+
28
+ ```
29
+ Application
30
+ |-- Module 1
31
+ | |-- Section 1 (e.g., "Liste")
32
+ | | |-- Resource 1 (e.g., "employees-grid")
33
+ | |-- Section 2 (e.g., "Fiche")
34
+ | | |-- Resource 1 (e.g., "employee-form")
35
+ | |-- Section 3 (e.g., "Dashboard")
36
+ | |-- Resource 1 (e.g., "hr-dashboard")
37
+ |-- Module 2
38
+ |-- ...
39
+ ```
40
+
41
+ ### 3. Generate navigation.json
42
+
43
+ ```json
44
+ {
45
+ "application": {
46
+ "code": "{AppCode}",
47
+ "name": "{AppName}",
48
+ "icon": "app-icon"
49
+ },
50
+ "modules": [
51
+ {
52
+ "code": "{ModuleCode}",
53
+ "name": "{ModuleName}",
54
+ "icon": "module-icon",
55
+ "route": "/{app-code}/{module-code}",
56
+ "permission": "{AppCode}.{ModuleCode}.Read",
57
+ "sections": [
58
+ {
59
+ "code": "{sectionCode}",
60
+ "label": "{sectionLabel}",
61
+ "route": "/{app-code}/{module-code}/{section-code}",
62
+ "icon": "section-icon",
63
+ "resources": [
64
+ {
65
+ "code": "{resourceCode}",
66
+ "type": "{SmartTable|SmartForm|SmartDashboard|SmartKanban}",
67
+ "route": "/{app-code}/{module-code}/{section-code}/{resource-code}",
68
+ "permission": "{AppCode}.{ModuleCode}.{Action}"
69
+ }
70
+ ]
71
+ }
72
+ ]
73
+ }
74
+ ],
75
+ "menuItems": [
76
+ {
77
+ "label": "{ModuleName}",
78
+ "icon": "module-icon",
79
+ "route": "/{app-code}/{module-code}",
80
+ "permission": "{AppCode}.{ModuleCode}.Read",
81
+ "children": [
82
+ {
83
+ "label": "{sectionLabel}",
84
+ "route": "/{app-code}/{module-code}/{section-code}",
85
+ "permission": "{AppCode}.{ModuleCode}.Read"
86
+ }
87
+ ]
88
+ }
89
+ ],
90
+ "breadcrumbs": {
91
+ "/{app-code}/{module-code}/{section-code}": [
92
+ { "label": "{AppName}", "route": "/{app-code}" },
93
+ { "label": "{ModuleName}", "route": "/{app-code}/{module-code}" },
94
+ { "label": "{sectionLabel}", "route": "" }
95
+ ]
96
+ }
97
+ }
98
+ ```
99
+
100
+ ### 4. Write navigation.json
101
+
102
+ Write via ba-writer at project level (alongside master index.json). Update index.json with navigation.json reference.
103
+
104
+ ## Validation
105
+
106
+ - [ ] Every module in index.json has a corresponding navigation entry
107
+ - [ ] Every section in screens.json has a corresponding menu item
108
+ - [ ] Every route is unique
109
+ - [ ] Every menu item has a valid permission reference
110
+ - [ ] Breadcrumbs cover all routes
111
+
112
+ ## Completion Summary
113
+
114
+ ```
115
+ ================================================================
116
+ UI DESIGN COMPLETE
117
+ ================================================================
118
+
119
+ | Module | Sections | Resources | Wireframes |
120
+ |-----------------|----------|-----------|------------|
121
+ | {moduleCode} | {count} | {count} | {count} |
122
+ | ... | ... | ... | ... |
123
+
124
+ | Artifact | Path |
125
+ |-----------------|-----------------------------------|
126
+ | screens.json | {module-path}/screens.json |
127
+ | navigation.json | {project-path}/navigation.json |
128
+
129
+ NEXT STEPS:
130
+ 1. Run /ba-generate-html to produce the interactive HTML with mockups
131
+ 2. Client reviews the HTML (mockups, ERD, permission matrix)
132
+ 3. Run /ba-review to apply corrections
133
+ ================================================================
134
+ ```
@@ -25,7 +25,6 @@ Generate the interactive HTML document of the business analysis from the JSON an
25
25
  ## Prerequisites
26
26
 
27
27
  - JSON analysis files must exist (at minimum `index.json` + `cadrage.json`)
28
- - PRD files must exist (`.ralph/prd-{moduleCode}.json`) — run `/derive-prd` first
29
28
  - Feature status must be `consolidated`
30
29
 
31
30
  ## Workflow
@@ -77,8 +77,8 @@ const FEATURE_DATA = {
77
77
  name: ent.name,
78
78
  description: ent.description || "",
79
79
  attributes: (ent.attributes || []).length > 0
80
- ? ent.attributes.map(a => ({ name: a.name, description: a.description || "" }))
81
- : (ent.fields || []).map(f => ({ name: f.name, description: f.description || f.type || "" })),
80
+ ? ent.attributes.map(a => ({ name: a.name, type: a.type || "string", required: a.required || false, description: a.description || "" }))
81
+ : (ent.fields || []).map(f => ({ name: f.name, type: f.type || "string", required: f.required || false, description: f.description || "" })),
82
82
  relationships: (ent.relationships || []).length > 0
83
83
  ? ent.relationships.map(r =>
84
84
  typeof r === 'string' ? r : `${r.target} (${r.type}) - ${r.description || ""}`)
@@ -126,6 +126,8 @@ moduleSpecs[moduleCode] = {
126
126
  description: ent.description || "",
127
127
  attributes: (ent.attributes || []).map(a => ({
128
128
  name: a.name,
129
+ type: a.type || "string", // string, int, decimal, date, datetime, bool, enum, guid, text
130
+ required: a.required || false,
129
131
  description: a.description || ""
130
132
  })),
131
133
  relationships: (ent.relationships || []).map(r =>
@@ -36,20 +36,7 @@ ELSE:
36
36
  Store: workflow.mode
37
37
  ```
38
38
 
39
- ### 3. Verify PRD Exists
40
-
41
- ```
42
- FOR each module in modules:
43
- prdPath = ".ralph/prd-{moduleCode}.json"
44
- IF NOT exists(prdPath):
45
- BLOCKING ERROR: "PRD not found: {prdPath} — Run /derive-prd first"
46
- STOP
47
- IF fileSize(prdPath) < 100:
48
- BLOCKING ERROR: "PRD file too small: {prdPath} — Run /derive-prd to regenerate"
49
- STOP
50
- ```
51
-
52
- ### 4. Verify Consolidation Status
39
+ ### 3. Verify Consolidation Status
53
40
 
54
41
  ```
55
42
  IF workflow.mode === "project":
@@ -64,7 +51,7 @@ ELSE:
64
51
  BLOCKING ERROR: "Feature status: {feature.status}, expected consolidated"
65
52
  ```
66
53
 
67
- ### 5. Read All JSON Files
54
+ ### 4. Read All JSON Files
68
55
 
69
56
  ```
70
57
  collected_data = {
@@ -86,13 +73,9 @@ FOR each module in master.index.modules[]:
86
73
  }
87
74
  ```
88
75
 
89
- ### 6. Display Collection Summary
76
+ ### 5. Display Collection Summary
90
77
 
91
78
  ```
92
- PRD verified: {module_count} modules
93
- .ralph/prd-{module1}.json ({size} bytes)
94
- .ralph/prd-{module2}.json ({size} bytes)
95
-
96
79
  JSON collected:
97
80
  Master: index.json + cadrage.json
98
81
  Modules: {module_count} module index files
@@ -105,7 +88,6 @@ JSON collected:
105
88
 
106
89
  - BLOCK if index.json absent
107
90
  - BLOCK if 0 modules found
108
- - BLOCK if any PRD file missing
109
91
  - BLOCK if feature not consolidated
110
92
 
111
93
  ## NEXT STEP
@@ -119,8 +119,8 @@ moduleSpecs[moduleCode] = {
119
119
  name: ent.name,
120
120
  description: ent.description || "",
121
121
  attributes: (ent.attributes || []).length > 0
122
- ? ent.attributes.map(a => ({ name: a.name, description: a.description || "" }))
123
- : (ent.fields || []).map(f => ({ name: f.name, description: f.description || f.type || "" })),
122
+ ? ent.attributes.map(a => ({ name: a.name, type: a.type || "string", required: a.required || false, description: a.description || "" }))
123
+ : (ent.fields || []).map(f => ({ name: f.name, type: f.type || "string", required: f.required || false, description: f.description || "" })),
124
124
  relationships: (ent.relationships || []).map(r =>
125
125
  typeof r === 'string' ? r : r.target + " (" + r.type + ") - " + (r.description || ""))
126
126
  })),
@@ -32,7 +32,22 @@ Apply corrections exported from the interactive HTML review (`ba-review.json`) t
32
32
  |------|------|------|
33
33
  | 01 | `steps/step-01-apply.md` | Read ba-review.json, create new version, apply corrections to JSON files |
34
34
 
35
- After step-01 completes, delegate to `/ba-generate-html` to regenerate the interactive HTML document.
35
+ After step-01 completes:
36
+ 1. Determine correction scope (analysis data vs UI design vs both)
37
+ 2. Route to the appropriate phase for re-execution
38
+ 3. Regenerate HTML via `/ba-generate-html`
39
+
40
+ ## Correction Routing
41
+
42
+ After applying corrections, ask the client which phase to re-execute:
43
+
44
+ | Correction type | Route to | Reason |
45
+ |-----------------|----------|--------|
46
+ | Entities, rules, UCs, permissions changed | `/business-analyse` step-03 (specify) | Re-run analysis for affected modules |
47
+ | Screens, wireframes, navigation changed | `/ba-design-ui` | Re-run UI design for affected modules |
48
+ | Both analysis and UI changed | `/business-analyse` step-03, then `/ba-design-ui` | Full re-specification |
49
+ | Only cadrage/scope corrections | `/ba-generate-html` | Just regenerate HTML |
50
+ | Client approves (no corrections) | `/derive-prd` | Proceed to PRD generation |
36
51
 
37
52
  ## References
38
53
 
@@ -180,7 +180,31 @@ review_section = {
180
180
  Create review.json with review_section and update hash in index.json
181
181
  ```
182
182
 
183
- ## Step 8: Regenerate Interactive HTML
183
+ ## Step 8: Determine Correction Routing
184
+
185
+ Analyze the corrections applied to determine which phase needs re-execution:
186
+
187
+ ```
188
+ analysis_changes = false
189
+ ui_changes = false
190
+
191
+ FOR EACH module in corrected_modules:
192
+ IF entities, rules, usecases, or permissions were modified:
193
+ analysis_changes = true
194
+ IF screens, wireframes, or navigation were modified:
195
+ ui_changes = true
196
+
197
+ IF analysis_changes AND ui_changes:
198
+ route = "both"
199
+ ELSE IF analysis_changes:
200
+ route = "analysis"
201
+ ELSE IF ui_changes:
202
+ route = "ui"
203
+ ELSE:
204
+ route = "html-only"
205
+ ```
206
+
207
+ ## Step 9: Regenerate Interactive HTML
184
208
 
185
209
  Delegate HTML generation to `/ba-generate-html` skill:
186
210
 
@@ -190,7 +214,7 @@ Delegate HTML generation to `/ba-generate-html` skill:
190
214
  3. Output: {new_version_dir}/ba-interactive.html
191
215
  ```
192
216
 
193
- ## Step 9: Update Manifest
217
+ ## Step 10: Update Manifest
194
218
 
195
219
  ```
196
220
  1. Read docs/index.json
@@ -200,12 +224,12 @@ Delegate HTML generation to `/ba-generate-html` skill:
200
224
  5. Write docs/index.json
201
225
  ```
202
226
 
203
- ## Step 10: Display Completion Summary
227
+ ## Step 11: Display Completion Summary
204
228
 
205
229
  ```
206
- ═══════════════════════════════════════════════════════════════
230
+ =====================================================================
207
231
  REVIEW CORRECTIONS APPLIED SUCCESSFULLY
208
- ═══════════════════════════════════════════════════════════════
232
+ =====================================================================
209
233
 
210
234
  | Field | Value |
211
235
  |----------------------|--------------------------------------|
@@ -231,11 +255,37 @@ Artifacts regenerated:
231
255
  | Thematic files | {new_version_dir}/*.json |
232
256
  | Manifest | docs/index.json |
233
257
 
234
- NEXT STEPS:
235
- 1. Open the new ba-interactive.html to verify corrections
236
- 2. Run /ralph-loop to start development from the updated analysis
237
- (Use /ralph-loop -r ONLY to resume an interrupted loop)
238
- ═══════════════════════════════════════════════════════════════
258
+ NEXT STEPS (based on correction routing: {route}):
259
+ ```
260
+
261
+ Display next steps based on `route`:
262
+
263
+ ```
264
+ IF route == "analysis":
265
+ "1. Run /business-analyse step-03 for modules: {corrected_module_list}"
266
+ "2. Then run /ba-design-ui to update UI specs"
267
+ "3. Then run /ba-generate-html to regenerate documentation"
268
+
269
+ IF route == "ui":
270
+ "1. Run /ba-design-ui for modules: {corrected_module_list}"
271
+ "2. Then run /ba-generate-html to regenerate documentation"
272
+
273
+ IF route == "both":
274
+ "1. Run /business-analyse step-03 for modules: {analysis_corrected_modules}"
275
+ "2. Then run /ba-design-ui for modules: {ui_corrected_modules}"
276
+ "3. Then run /ba-generate-html to regenerate documentation"
277
+
278
+ IF route == "html-only":
279
+ "HTML has been regenerated. Review the updated document."
280
+ "If satisfied, run /derive-prd to generate PRD files."
281
+
282
+ IF no corrections (client approves):
283
+ "No corrections needed. Run /derive-prd to generate PRD files."
284
+ "Then run /ralph-loop to start development."
285
+ ```
286
+
287
+ ```
288
+ =====================================================================
239
289
  ```
240
290
 
241
291
  ## Error Handling
@@ -23,23 +23,27 @@ user_invocable: true
23
23
 
24
24
  | Step | File | Model | Role |
25
25
  |------|------|-------|------|
26
- | 03 | `step-03-specify.md` | Opus | Deep dive per module: entities, BRs, UCs, permissions, screens. Sequential internal loop |
26
+ | 03 | `step-03-specify.md` | Opus | Deep dive per module: entities, BRs, UCs, permissions. Sequential internal loop |
27
27
  | 04 | `step-04-consolidate.md` | Opus | Cross-module validation: data model, permission coherence, E2E flows |
28
28
 
29
29
  ### Post-BA Workflow
30
30
  ```
31
- Phase 1 (steps 00-02) → Phase 2 (steps 03-04) → /ba-generate-html → Client reviews HTML
32
-
33
- Client comments/enriches
34
-
35
- Export ba-review.json
36
-
37
- /ba-review /ba-generate-html
38
-
39
- /derive-prd → /ralph-loop
31
+ Phase 1: /business-analyse (steps 00-04)
32
+ |
33
+ v
34
+ Phase 2: /ba-design-ui (screens, wireframes, navigation)
35
+ |
36
+ v
37
+ Phase 3: /ba-generate-html (interactive HTML with mockups, ERD, permissions)
38
+ |
39
+ v
40
+ Phase 4: /ba-review (client corrections → back to Phase 1 or 2)
41
+ |
42
+ v (client approves)
43
+ Phase 5: /derive-prd → Phase 6: /ralph-loop
40
44
  ```
41
45
 
42
- > After step-04, invoke `/ba-generate-html` to generate the HTML, then `/ba-review` for the client correction cycle.
46
+ > After step-04, invoke `/ba-design-ui` to design interfaces, then `/ba-generate-html` to generate the HTML, then `/ba-review` for the client correction cycle.
43
47
  > **PRD generation:** Handoff data and PRD files are generated by the `/derive-prd` skill.
44
48
 
45
49
  ## JSON Architecture — Granular files + Index
@@ -54,7 +58,7 @@ docs/{app}/{module}/business-analyse/v1.0/
54
58
  rules.json ← Business rules (BRs)
55
59
  usecases.json ← Use cases (UCs)
56
60
  permissions.json ← Permissions, roles, access matrix
57
- screens.json ← Interface specs (sections, resources, mockups)
61
+ screens.json ← Interface specs (produced by /ba-design-ui)
58
62
  validation.json ← Validation results, checks
59
63
  handoff.json ← File mapping, APIs, handoff data
60
64
  ```
@@ -135,15 +139,15 @@ STEP 02 (structure)
135
139
  STEP 03 (specify) — SEQUENTIAL MODULE LOOP
136
140
  → For each module (in dependency order):
137
141
  → Load: _shared.md, step-03-specify.md, module index.json
138
- → Execute: entities, BRs, UCs, permissions, screens
139
- → Output: entities.json, rules.json, usecases.json, permissions.json, screens.json
142
+ → Execute: entities, BRs, UCs, permissions
143
+ → Output: entities.json, rules.json, usecases.json, permissions.json
140
144
  → No team mode — sequential ensures 100% context per module
141
145
 
142
146
  STEP 04 (consolidate) — FINAL BA STEP
143
147
  → Load: _shared.md, step-04-consolidate.md, all index.json
144
148
  → Execute: Data model validation, permission coherence, E2E flows
145
149
  → Output: validation.json, consolidated data
146
- → Next: invoke /ba-generate-html, then /ba-review for client cycle
150
+ → Next: invoke /ba-design-ui (Phase 2), then /ba-generate-html, then /ba-review for client cycle
147
151
  ```
148
152
 
149
153
  ## References
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: step-03-specify
3
- description: Sequential deep dive per module - entities, BRs, UCs, permissions, screens
3
+ description: Sequential deep dive per module - entities, BRs, UCs, permissions
4
4
  model: opus
5
5
  next_step: steps/step-04-consolidate.md
6
6
  ---
@@ -9,7 +9,7 @@ next_step: steps/step-04-consolidate.md
9
9
 
10
10
  ## Objective
11
11
 
12
- For each module (in dependency order), produce complete specifications: entities, business rules, use cases, permissions, and interface specs (screens).
12
+ For each module (in dependency order), produce complete specifications: entities, business rules, use cases, and permissions. Interface specs (screens, wireframes, navigation) are handled by Phase 2 (`/ba-design-ui`).
13
13
 
14
14
  ## Prerequisites
15
15
 
@@ -123,40 +123,11 @@ Define the permission matrix:
123
123
  }
124
124
  ```
125
125
 
126
- ### F. Interface Specs (Screens)
126
+ ### F. Interface Specs — Delegated to /ba-design-ui
127
127
 
128
- For each section/resource identified in step 02, specify the full interface:
129
-
130
- ```json
131
- {
132
- "sectionCode": "list",
133
- "sectionLabel": "Liste des employes",
134
- "resources": [
135
- {
136
- "code": "employees-grid",
137
- "type": "SmartTable",
138
- "label": "Grille des employes",
139
- "columns": [
140
- { "field": "code", "label": "Code", "type": "text", "sortable": true },
141
- { "field": "fullName", "label": "Nom complet", "type": "text", "sortable": true },
142
- { "field": "department.name", "label": "Departement", "type": "lookup", "filterable": true },
143
- { "field": "status", "label": "Statut", "type": "badge", "filterable": true }
144
- ],
145
- "actions": ["create", "edit", "delete", "export"],
146
- "filters": ["department", "status"],
147
- "permission": "HumanResources.Employees.Read"
148
- }
149
- ]
150
- }
151
- ```
152
-
153
- Resource types:
154
- - **SmartTable**: columns[], actions[], filters[], permission
155
- - **SmartForm**: tabs[{ label, fields[{ field, label, type, required, readonly, options }] }], actions[], permission
156
- - **SmartCard**: columns/fields[], permission
157
- - **SmartKanban**: options/columns[], permission
158
- - **SmartDashboard**: kpis[{ label, value }], permission
159
- - **SmartFilter**: options[], permission
128
+ > **Screen specifications are NOT produced in this step.**
129
+ > Interface design (SmartTable columns, SmartForm fields, wireframes, navigation) is handled by Phase 2: `/ba-design-ui`.
130
+ > This separation allows iterating on UI design without replaying the full analysis cycle.
160
131
 
161
132
  ### G. Write & Advance
162
133
 
@@ -167,7 +138,6 @@ After completing all sub-steps for a module:
167
138
  - `rules.json`
168
139
  - `usecases.json`
169
140
  - `permissions.json`
170
- - `screens.json`
171
141
  - Update `index.json` (hashes, summary counts)
172
142
 
173
143
  2. Update module status to `specified`
@@ -178,7 +148,8 @@ After completing all sub-steps for a module:
178
148
 
179
149
  After all modules are specified:
180
150
  - Verify all modules have status `specified`
181
- - Display summary: total entities, rules, UCs, permissions, screens across all modules
151
+ - Display summary: total entities, rules, UCs, permissions across all modules
152
+ - Remind user: "Run /ba-design-ui to design interfaces for these modules"
182
153
  - Transition to step 04
183
154
 
184
155
  ## POST-CHECK
@@ -188,7 +159,7 @@ Before advancing to step 04, verify:
188
159
  - [ ] Every module has at least 1 use case
189
160
  - [ ] Every module has at least 1 business rule
190
161
  - [ ] Every module has permissions defined
191
- - [ ] Every module has at least 1 screen defined
162
+ - [ ] Entity attributes have `type` defined (string, int, date, enum, guid, etc.)
192
163
  - [ ] All entity relationships reference existing entities
193
164
  - [ ] All UC business rule references exist
194
165
  - [ ] All permission paths follow the convention