@atlashub/smartstack-cli 4.22.0 → 4.24.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 (36) hide show
  1. package/package.json +1 -1
  2. package/templates/skills/ba-design-ui/SKILL.md +91 -0
  3. package/templates/skills/ba-design-ui/steps/step-01-screens.md +177 -0
  4. package/templates/skills/ba-design-ui/steps/step-02-wireframes.md +140 -0
  5. package/templates/skills/ba-design-ui/steps/step-03-navigation.md +134 -0
  6. package/templates/skills/ba-generate-html/SKILL.md +0 -1
  7. package/templates/skills/ba-generate-html/html/ba-interactive.html +950 -1055
  8. package/templates/skills/ba-generate-html/html/src/scripts/01-data-init.js +1 -2
  9. package/templates/skills/ba-generate-html/html/src/scripts/02-navigation.js +0 -1
  10. package/templates/skills/ba-generate-html/html/src/scripts/03-render-cadrage.js +0 -39
  11. package/templates/skills/ba-generate-html/html/src/scripts/05-render-specs.js +0 -1
  12. package/templates/skills/ba-generate-html/html/src/scripts/07-render-handoff.js +0 -1
  13. package/templates/skills/ba-generate-html/html/src/scripts/08-editing.js +133 -135
  14. package/templates/skills/ba-generate-html/html/src/scripts/10-comments.js +199 -199
  15. package/templates/skills/ba-generate-html/html/src/scripts/11-review-panel.js +165 -166
  16. package/templates/skills/ba-generate-html/html/src/styles/05-modules.css +444 -454
  17. package/templates/skills/ba-generate-html/html/src/template.html +0 -49
  18. package/templates/skills/ba-generate-html/references/data-build.md +176 -182
  19. package/templates/skills/ba-generate-html/references/data-mapping.md +295 -299
  20. package/templates/skills/ba-generate-html/steps/step-01-collect.md +4 -22
  21. package/templates/skills/ba-generate-html/steps/step-02-build-data.md +2 -11
  22. package/templates/skills/ba-review/SKILL.md +16 -1
  23. package/templates/skills/ba-review/steps/step-01-apply.md +60 -10
  24. package/templates/skills/business-analyse/SKILL.md +19 -15
  25. package/templates/skills/business-analyse/steps/step-03-specify.md +9 -38
  26. package/templates/skills/derive-prd/SKILL.md +9 -9
  27. package/templates/skills/derive-prd/references/acceptance-criteria.md +166 -116
  28. package/templates/skills/derive-prd/references/entity-domain-mapping.md +5 -5
  29. package/templates/skills/derive-prd/references/handoff-file-templates.md +12 -12
  30. package/templates/skills/derive-prd/references/handoff-mappings.md +13 -14
  31. package/templates/skills/derive-prd/references/handoff-seeddata-generation.md +1 -1
  32. package/templates/skills/derive-prd/references/readiness-scoring.md +41 -50
  33. package/templates/skills/derive-prd/schemas/handoff-schema.json +2 -2
  34. package/templates/skills/derive-prd/steps/step-00-validate.md +73 -52
  35. package/templates/skills/derive-prd/steps/step-01-transform.md +86 -43
  36. package/templates/skills/ba-generate-html/html/src/partials/cadrage-risks.html +0 -48
@@ -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,13 +51,13 @@ 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 = {
71
58
  master: {
72
59
  index: READ(index.json), // metadata, modules[], consolidation, handoff
73
- cadrage: READ(cadrage.json) // context, stakeholders, scope, risks
60
+ cadrage: READ(cadrage.json) // context, stakeholders, scope
74
61
  },
75
62
  modules: {}
76
63
  }
@@ -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
@@ -69,15 +69,6 @@ scope: {
69
69
 
70
70
  > Safety net: also check `master.cadrage.coverageMatrix` as alternative source for scope items.
71
71
 
72
- **cadrage.risks:**
73
- ```javascript
74
- risks: (master.cadrage.risks || []).map(r => ({
75
- description: r.description,
76
- probability: r.probability,
77
- impact: r.impact,
78
- mitigation: r.mitigation || ""
79
- }))
80
- ```
81
72
 
82
73
  **modules[]:**
83
74
  ```javascript
@@ -119,8 +110,8 @@ moduleSpecs[moduleCode] = {
119
110
  name: ent.name,
120
111
  description: ent.description || "",
121
112
  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 || "" })),
113
+ ? ent.attributes.map(a => ({ name: a.name, type: a.type || "string", required: a.required || false, description: a.description || "" }))
114
+ : (ent.fields || []).map(f => ({ name: f.name, type: f.type || "string", required: f.required || false, description: f.description || "" })),
124
115
  relationships: (ent.relationships || []).map(r =>
125
116
  typeof r === 'string' ? r : r.target + " (" + r.type + ") - " + (r.description || ""))
126
117
  })),
@@ -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
@@ -29,8 +29,8 @@ Transforms consolidated BA data into structured handoff and PRD files.
29
29
 
30
30
  ## Input
31
31
 
32
- - Consolidated BA feature (`status = "consolidated"`)
33
- - Source: `docs/{app}/{module}/business-analyse/v{X.Y}/index.json`
32
+ - Consolidated BA feature (`status = "consolidated"` or `"specified"`)
33
+ - Source: `docs/{app}/business-analyse/v{X.Y}/index.json` (app-level) + `docs/{app}/{module}/business-analyse/v{X.Y}/` (flat files per module)
34
34
  - Usage: `--feature <path>` or auto-detection from `docs/`
35
35
 
36
36
  ## Output
@@ -45,14 +45,14 @@ Transforms consolidated BA data into structured handoff and PRD files.
45
45
 
46
46
  ## Handoff Categories (8)
47
47
 
48
- | Category | Source | Key rules |
48
+ | Category | Source (flat files) | Key rules |
49
49
  |----------|--------|-----------|
50
- | **domain** | `analysis.entities[]` | Entities, ValueObjects, Enums |
51
- | **application** | `analysis.useCases[]` | Services, DTOs, Validators |
52
- | **infrastructure** | `analysis.entities[]` | EF Configurations, DbSet |
53
- | **api** | `specification.apiEndpoints[]` | Controllers (exact copy) |
54
- | **frontend** | `specification.uiWireframes[]` | Pages, Components, Hooks |
55
- | **seedData** | `specification.seedDataCore` | CORE + business |
50
+ | **domain** | `entities.json > entities[]` | Entities, ValueObjects, Enums |
51
+ | **application** | `usecases.json > useCases[]` | Services, DTOs, Validators |
52
+ | **infrastructure** | `entities.json > entities[]` | EF Configurations, DbSet |
53
+ | **api** | Generated from useCases + entities | Controllers |
54
+ | **frontend** | `screens.json > screens[]` | Pages, Components, Hooks |
55
+ | **seedData** | Generated from entities + permissions | CORE + business |
56
56
  | **tests** | All layers | Unit, Integration, Security tests |
57
57
  | **documentation** | All layers | Technical docs, user guides, API specs |
58
58