@atlashub/smartstack-cli 4.41.0 → 4.42.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 (142) hide show
  1. package/.documentation/apex.html +2 -2
  2. package/.documentation/business-analyse.html +26 -27
  3. package/.documentation/commands.html +6 -6
  4. package/dist/index.js +24 -13
  5. package/dist/index.js.map +1 -1
  6. package/package.json +2 -2
  7. package/templates/agents/ba-reader.md +2 -2
  8. package/templates/agents/ba-writer.md +44 -9
  9. package/templates/hooks/stop-hook.sh +6 -6
  10. package/templates/ralph/README.md +1 -1
  11. package/templates/scripts/setup-ralph-loop.sh +2 -2
  12. package/templates/skills/_resources/context-digest-template.md +1 -1
  13. package/templates/skills/_shared.md +13 -13
  14. package/templates/skills/apex/SKILL.md +14 -7
  15. package/templates/skills/apex/_shared.md +1 -1
  16. package/templates/skills/apex/references/challenge-questions.md +46 -13
  17. package/templates/skills/apex/references/core-seed-data.md +4 -4
  18. package/templates/skills/apex/references/error-classification.md +3 -3
  19. package/templates/skills/apex/references/smartstack-api.md +1 -1
  20. package/templates/skills/apex/references/smartstack-layers.md +1 -1
  21. package/templates/skills/apex/steps/step-00-init.md +46 -8
  22. package/templates/skills/apex/steps/step-01-analyze.md +1 -1
  23. package/templates/skills/apex/steps/step-02-plan.md +1 -1
  24. package/templates/skills/apex/steps/step-03-execute.md +1 -1
  25. package/templates/skills/business-analyse/SKILL.md +83 -22
  26. package/templates/skills/business-analyse/_shared.md +12 -9
  27. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +13 -0
  28. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +33 -0
  29. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +1 -1
  30. package/templates/skills/business-analyse/react/components.md +1 -1
  31. package/templates/skills/business-analyse/react/schema.md +1 -1
  32. package/templates/skills/business-analyse/references/acceptance-criteria.md +3 -3
  33. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +1 -1
  34. package/templates/skills/business-analyse/references/detection-strategies.md +2 -2
  35. package/templates/skills/business-analyse/references/entity-architecture-decision.md +1 -1
  36. package/templates/skills/business-analyse/references/naming-conventions.md +6 -6
  37. package/templates/skills/business-analyse/references/robustness-checks.md +4 -4
  38. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  39. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  40. package/templates/skills/business-analyse/schemas/feature-schema.json +1 -1
  41. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +2 -2
  42. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +3 -2
  43. package/templates/skills/business-analyse/steps/step-00-init.md +15 -5
  44. package/templates/skills/business-analyse/steps/step-01-cadrage.md +14 -5
  45. package/templates/skills/business-analyse/steps/step-02-structure.md +17 -1
  46. package/templates/skills/business-analyse/steps/step-03-specify.md +136 -26
  47. package/templates/skills/business-analyse/steps/step-04-consolidate.md +44 -8
  48. package/templates/skills/business-analyse/templates/tpl-handoff.md +5 -5
  49. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +4 -4
  50. package/templates/skills/business-analyse/templates-frd.md +4 -4
  51. package/templates/skills/{ba-design-ui → business-analyse-design}/SKILL.md +9 -9
  52. package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-01-screens.md +9 -0
  53. package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-03-navigation.md +9 -2
  54. package/templates/skills/business-analyse-develop/SKILL.md +248 -0
  55. package/templates/skills/{ralph-loop → business-analyse-develop}/references/category-completeness.md +1 -1
  56. package/templates/skills/{ralph-loop → business-analyse-develop}/references/init-resume-recovery.md +8 -8
  57. package/templates/skills/{ralph-loop → business-analyse-develop}/references/multi-module-queue.md +1 -1
  58. package/templates/skills/business-analyse-develop/references/quality-gates.md +70 -0
  59. package/templates/skills/{ralph-loop → business-analyse-develop}/references/task-transform-legacy.md +1 -1
  60. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-00-init.md +20 -4
  61. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-01-task.md +3 -2
  62. package/templates/skills/business-analyse-develop/steps/step-01-v4-execute.md +131 -0
  63. package/templates/skills/business-analyse-develop/steps/step-02-v4-verify.md +156 -0
  64. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-04-check.md +1 -1
  65. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-05-report.md +1 -1
  66. package/templates/skills/{derive-prd → business-analyse-handoff}/SKILL.md +7 -7
  67. package/templates/skills/{derive-prd → business-analyse-handoff}/references/acceptance-criteria.md +5 -5
  68. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-file-templates.md +1 -1
  69. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-mappings.md +1 -1
  70. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-seeddata-generation.md +2 -2
  71. package/templates/skills/{derive-prd → business-analyse-handoff}/references/prd-generation.md +14 -14
  72. package/templates/skills/{derive-prd → business-analyse-handoff}/schemas/handoff-schema.json +2 -2
  73. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-00-validate.md +6 -6
  74. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-01-transform.md +46 -7
  75. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-02-export.md +34 -14
  76. package/templates/skills/{ba-generate-html → business-analyse-html}/SKILL.md +4 -4
  77. package/templates/skills/{ba-generate-html → business-analyse-html}/html/ba-interactive.html +709 -277
  78. package/templates/skills/{ba-generate-html → business-analyse-html}/html/build-html.js +25 -3
  79. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/01-data-init.js +54 -0
  80. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/02-navigation.js +97 -3
  81. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/03-render-cadrage.js +8 -7
  82. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/04-render-modules.js +7 -7
  83. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/05-render-specs.js +188 -85
  84. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/06-render-consolidation.js +15 -14
  85. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/06-render-mockups.js +19 -19
  86. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/07-render-handoff.js +24 -4
  87. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/08-editing.js +6 -2
  88. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/09-export.js +27 -57
  89. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/10-comments.js +67 -45
  90. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/11-review-panel.js +15 -13
  91. package/templates/skills/business-analyse-html/html/src/styles/02-layout.css +216 -0
  92. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/05-modules.css +36 -0
  93. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/template.html +22 -12
  94. package/templates/skills/{ba-generate-html → business-analyse-html}/references/data-build.md +1 -1
  95. package/templates/skills/{ba-generate-html → business-analyse-html}/references/data-mapping.md +5 -1
  96. package/templates/skills/{ba-generate-html → business-analyse-html}/references/output-modes.md +7 -7
  97. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-01-collect.md +25 -1
  98. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-02-build-data.md +33 -5
  99. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-03-render.md +2 -2
  100. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-04-verify.md +2 -2
  101. package/templates/skills/{ba-review → business-analyse-review}/SKILL.md +11 -10
  102. package/templates/skills/{ba-review → business-analyse-review}/references/review-data-mapping.md +2 -2
  103. package/templates/skills/business-analyse-review/steps/step-00-init.md +107 -0
  104. package/templates/skills/{ba-review → business-analyse-review}/steps/step-01-apply.md +19 -11
  105. package/templates/skills/business-analyse-status/SKILL.md +118 -0
  106. package/templates/skills/documentation/SKILL.md +2 -2
  107. package/templates/skills/sketch/SKILL.md +172 -0
  108. package/templates/skills/sketch/references/domain-heuristics.md +116 -0
  109. package/templates/skills/ba-generate-html/html/src/styles/02-layout.css +0 -101
  110. package/templates/skills/ralph-loop/SKILL.md +0 -240
  111. /package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-02-wireframes.md +0 -0
  112. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/category-rules.md +0 -0
  113. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/compact-loop.md +0 -0
  114. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/module-transition.md +0 -0
  115. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/parallel-execution.md +0 -0
  116. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/section-splitting.md +0 -0
  117. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/team-orchestration.md +0 -0
  118. /package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-02-execute.md +0 -0
  119. /package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-03-commit.md +0 -0
  120. /package/templates/skills/{derive-prd → business-analyse-handoff}/references/entity-domain-mapping.md +0 -0
  121. /package/templates/skills/{derive-prd → business-analyse-handoff}/references/readiness-scoring.md +0 -0
  122. /package/templates/skills/{derive-prd → business-analyse-handoff}/templates/tpl-progress.md +0 -0
  123. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-context.html +0 -0
  124. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-scope.html +0 -0
  125. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-stakeholders.html +0 -0
  126. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-success.html +0 -0
  127. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-datamodel.html +0 -0
  128. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-flows.html +0 -0
  129. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-interactions.html +0 -0
  130. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-permissions.html +0 -0
  131. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/decomp-dependencies.html +0 -0
  132. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/decomp-modules.html +0 -0
  133. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/handoff-summary.html +0 -0
  134. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/module-spec-container.html +0 -0
  135. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/01-variables.css +0 -0
  136. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/03-navigation.css +0 -0
  137. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/04-cards.css +0 -0
  138. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/06-wireframes.css +0 -0
  139. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/07-comments.css +0 -0
  140. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/08-review-panel.css +0 -0
  141. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/09-mockups-html.css +0 -0
  142. /package/templates/skills/{ba-generate-html → business-analyse-html}/references/wireframe-svg-style-guide.md +0 -0
@@ -21,6 +21,15 @@ next_step: steps/step-02-structure.md
21
21
  - **NEVER skip the reformulation phase** — it is the foundation of good analysis
22
22
  - **NEVER auto-infer cadrage data without client validation** — every key decision is confirmed
23
23
 
24
+ ## CONTEXT RECOVERY
25
+
26
+ Re-read session variables from `.business-analyse/config.json` (do NOT rely on LLM memory):
27
+ ```javascript
28
+ const config = readJSON('.business-analyse/config.json').currentFeature;
29
+ const { id: feature_id, docsDir: docs_dir, application: application_name,
30
+ applicationCode, workflowMode: workflow_mode, language, version } = config;
31
+ ```
32
+
24
33
  ## YOUR TASK
25
34
 
26
35
  Frame the analysis scope at the **application level** through an interactive conversation with the client: understand the problem, stakeholders, scope, and define application-level roles. The analysis phase is ALWAYS interactive — the AI listens, reformulates, challenges, and validates with the user.
@@ -127,9 +136,9 @@ Analyze `{feature_description}` silently:
127
136
  4. **Prepare challenge questions** — specific to this brief, not generic
128
137
  5. **Pre-identify anticipated sections and resources** per detected module
129
138
 
130
- Store in `{pre_analysis}` (internal use only, NOT written to index.json):
139
+ Store in `{pre_analysis}` Write pre_analysis to cadrage.json as a `_preAnalysis` field (transient — removed on cadrage completion). This ensures the data survives context compaction:
131
140
  ```yaml
132
- pre_analysis:
141
+ _preAnalysis:
133
142
  problem_type: "new_tool|replace|automate|centralize"
134
143
  detected_modules: [{name, description, detected_sections}]
135
144
  shadow_zones: [{topic, why_it_matters, challenge_question}]
@@ -310,7 +319,7 @@ ULTRATHINK — Entity Architecture Analysis for {entity_name}:
310
319
  - Module code: {PascalCase}
311
320
  - Section `list`: {main entity grid + create action + navigation to detail}
312
321
  - Detail page tabs: [{tab_name: content}] (accessible by clicking a row in list)
313
- - Additional sections: [{code: justification}] (ONLY functional zones: dashboard, approve, import, rapport...)
322
+ - Additional sections: [{code: justification}] (ONLY functional sections: dashboard, approve, import, rapport...)
314
323
  - Dependencies: [{which modules reference/are referenced by this entity}]
315
324
  - Topological position: layer {N} (foundation if no dependencies)
316
325
  ```
@@ -430,7 +439,7 @@ options:
430
439
  | Choice | Action |
431
440
  |--------|--------|
432
441
  | **Géré dans l'app** | Entity becomes a sub-entity of the parent module. Add as a **tab in the detail page** of the referencing module. Note in coverageMatrix with `parentModule` field. |
433
- | **Nouveau module dédié** | **Add new module to `{pre_analysis}.detected_modules[]`** with the proposed architecture (sections, detail tabs, dependencies). Add to `coverageMatrix` as inScope. The `list` section is ALWAYS the main section. Additional sections ONLY for distinct functional zones (dashboard, approve, import...). `create` and `edit` are ACTIONS within `list` and detail pages, NEVER standalone sections. |
442
+ | **Nouveau module dédié** | **Add new module to `{pre_analysis}.detected_modules[]`** with the proposed architecture (sections, detail tabs, dependencies). Add to `coverageMatrix` as inScope. The `list` section is ALWAYS the main section. Additional sections ONLY for distinct functional sections (dashboard, approve, import...). `create` and `edit` are ACTIONS within `list` and detail pages, NEVER standalone sections. |
434
443
  | **Système externe** | Flag for integration specification. Add to `coverageMatrix` as integration. Load questionnaire materials on integrations if not already covered. |
435
444
  | **Liste simple en config** | Entity becomes a lookup/reference table (no dedicated module, no section). Note in coverageMatrix as config data. |
436
445
 
@@ -583,7 +592,7 @@ BEFORE transitioning to step-02:
583
592
  - Create an entry in `cadrage.coverageMatrix[]`
584
593
  - Assign it to inScope or outOfScope
585
594
  - Assign the module that will cover it (or null if cross-cutting)
586
- - List anticipated sections (Level 4) — ONLY functional zones
595
+ - List anticipated sections (Level 4) — ONLY functional sections
587
596
  - List anticipated resources (Level 5) for each section
588
597
  - List detail page tabs — for entities accessible via click from `list`
589
598
 
@@ -11,6 +11,15 @@ next_step: steps/step-03-specify.md
11
11
 
12
12
  Identify the complete hierarchy **Application > Module > Section > Resource** from the cadrage data, then CHALLENGE each element to ensure nothing is missing or superfluous.
13
13
 
14
+ ## Context Recovery
15
+
16
+ Re-read session variables from `.business-analyse/config.json`:
17
+ ```javascript
18
+ const config = readJSON('.business-analyse/config.json').currentFeature;
19
+ const { id: feature_id, docsDir: docs_dir, application: application_name,
20
+ applicationCode, workflowMode: workflow_mode, language } = config;
21
+ ```
22
+
14
23
  ## Prerequisites
15
24
 
16
25
  - Step 01 (cadrage) completed
@@ -83,7 +92,7 @@ For each section:
83
92
  | sectionType | permissionMode | When to use | Examples |
84
93
  |---|---|---|---|
85
94
  | `primary` | `crud` | Main entry point of the module, visible in menu | list |
86
- | `functional` | `crud` or `custom` | Independent functional zone with own access control | approve, import, planning |
95
+ | `functional` | `crud` or `custom` | Independent functional section with own access control | approve, import, planning |
87
96
  | `view` | `inherit` | Subordinate view reached from a primary section | detail, edit |
88
97
  | `embedded` | `read-only` | Widget or tab embedded in another section | dashboard (when embedded in module) |
89
98
 
@@ -182,6 +191,13 @@ Write via ba-writer:
182
191
  }
183
192
  ```
184
193
 
194
+ ## Status Update
195
+
196
+ After writing the structure, update the application status:
197
+ ```javascript
198
+ ba-writer.updateStatus({feature_id}, "decomposed")
199
+ ```
200
+
185
201
  ## Transition
186
202
 
187
203
  → Step 03 (specify) — Sequential module specification
@@ -9,7 +9,16 @@ 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, and permissions. Interface specs (screens, wireframes, navigation) are handled by Phase 2 (`/ba-design-ui`).
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 (`/business-analyse-design`).
13
+
14
+ ## Context Recovery
15
+
16
+ Re-read session variables from `.business-analyse/config.json`:
17
+ ```javascript
18
+ const config = readJSON('.business-analyse/config.json').currentFeature;
19
+ const { id: feature_id, docsDir: docs_dir, application: application_name,
20
+ applicationCode, workflowMode: workflow_mode, language } = config;
21
+ ```
13
22
 
14
23
  ## Prerequisites
15
24
 
@@ -51,8 +60,12 @@ For each entity identified in step 02:
51
60
  { "name": "departmentId", "type": "guid", "required": true, "description": "Département d'affectation" },
52
61
  { "name": "hireDate", "type": "date", "required": true, "description": "Date d'embauche" },
53
62
  { "name": "position", "type": "string", "description": "Poste occupé" },
54
- { "name": "status", "type": "enum", "options": ["Active", "Inactive", "OnLeave", "Terminated"], "description": "Statut de l'employé" }
63
+ { "name": "status", "type": "enum", "options": ["Active", "Inactive", "OnLeave", "Terminated"], "defaultValue": "Active", "description": "Statut de l'employé" },
64
+ { "name": "salary", "type": "decimal", "validation": { "min": 0 }, "description": "Salaire mensuel" }
55
65
  ],
66
+ "estimatedVolume": { "monthly": 50, "total2y": 1200 },
67
+ "searchableFields": ["code", "position", "status"],
68
+ "defaultFilters": ["status"],
56
69
  "relationships": [
57
70
  { "target": "Department", "type": "ManyToOne", "description": "Appartient à un département" },
58
71
  { "target": "Contract", "type": "OneToMany", "description": "Possède plusieurs contrats" }
@@ -62,13 +75,14 @@ For each entity identified in step 02:
62
75
 
63
76
  ### C. Business Rules
64
77
 
65
- For each entity/process, identify rules:
78
+ For each entity/process, identify rules. **Each rule MUST specify `sectionCode`** matching a code from `anticipatedSections[]`:
66
79
 
67
80
  ```json
68
81
  {
69
82
  "id": "BR-VAL-EMPLOYEES-001",
70
83
  "name": "Validation date embauche",
71
84
  "category": "validation",
85
+ "sectionCode": "list",
72
86
  "statement": "La date d'embauche ne peut pas être dans le futur",
73
87
  "example": "Date embauche = 2027-01-01 → erreur car > date du jour",
74
88
  "entities": ["Employee"],
@@ -76,16 +90,32 @@ For each entity/process, identify rules:
76
90
  }
77
91
  ```
78
92
 
79
- Categories: `validation`, `calculation`, `workflow`, `security`, `data`
93
+ Categories: `validation`, `calculation`, `workflow`, `security`, `data`, `notification`
94
+
95
+ > **OBLIGATOIRE** : Chaque attribut `enum` DOIT avoir un `defaultValue`. Chaque attribut numérique borné DOIT avoir `validation.min/max`. Les types userId (FK vers Identity) DOIVENT utiliser le type `string` (convention ASP.NET Identity).
96
+
97
+ > **OBLIGATOIRE** : Chaque attribut marqué "calculé" dans entities.json DOIT avoir une règle `category: "calculation"` correspondante avec le champ `formula`.
98
+
99
+ Exemple de règle de calcul :
100
+ ```json
101
+ {
102
+ "id": "BR-CALC-INV-003",
103
+ "category": "calculation",
104
+ "statement": "Le reste à payer = total - montant payé",
105
+ "formula": "remainingAmount = total - paidAmount",
106
+ "entities": ["Invoice"]
107
+ }
108
+ ```
80
109
 
81
110
  ### D. Use Cases
82
111
 
83
- For each stakeholder action:
112
+ For each stakeholder action. **Each use case MUST specify `sectionCode`** matching a code from `anticipatedSections[]` — this links the UC to the screen/page where it happens:
84
113
 
85
114
  ```json
86
115
  {
87
116
  "id": "UC-EMPLOYEES-001",
88
117
  "name": "Créer un employé",
118
+ "sectionCode": "list",
89
119
  "actor": "Responsable RH",
90
120
  "preconditions": ["L'utilisateur a la permission HumanResources.Employees.Create"],
91
121
  "steps": [
@@ -127,49 +157,129 @@ Define the permission matrix:
127
157
  - If the cadrage mentions "export", "Excel", "CSV", or "télécharger" → automatically add `.export` permission and an export use case (UC-{PREFIX}-EXPORT)
128
158
  - If the cadrage mentions "import", "importer", "upload" → automatically add `.import` permission and an import use case (UC-{PREFIX}-IMPORT)
129
159
 
130
- ### F. Interface Specs Delegated to /ba-design-ui
160
+ ### F. Seed Data pour tables de référence
161
+
162
+ > **OBLIGATOIRE** : Chaque entité de type "table de référence" (lookup, étapes de pipeline, types) DOIT avoir ses valeurs initiales documentées.
163
+
164
+ ```json
165
+ {
166
+ "entity": "OpportunityStage",
167
+ "type": "reference-table",
168
+ "seedData": [
169
+ { "name": "Qualification", "sortOrder": 1, "defaultProbability": 20, "isWon": false, "isLost": false },
170
+ { "name": "Proposition", "sortOrder": 2, "defaultProbability": 50, "isWon": false, "isLost": false },
171
+ { "name": "Négociation", "sortOrder": 3, "defaultProbability": 75, "isWon": false, "isLost": false },
172
+ { "name": "Gagné", "sortOrder": 4, "defaultProbability": 100, "isWon": true, "isLost": false },
173
+ { "name": "Perdu", "sortOrder": 5, "defaultProbability": 0, "isWon": false, "isLost": true }
174
+ ]
175
+ }
176
+ ```
177
+
178
+ ### G. Interface Specs — Delegated to /business-analyse-design
131
179
 
132
180
  > **Screen specifications are NOT produced in this step.**
133
- > Interface design (SmartTable columns, SmartForm fields, wireframes, navigation) is handled by Phase 2: `/ba-design-ui`.
181
+ > Interface design (SmartTable columns, SmartForm fields, wireframes, navigation) is handled by Phase 2: `/business-analyse-design`.
134
182
  > This separation allows iterating on UI design without replaying the full analysis cycle.
135
183
 
136
- ### G. Write & Advance
184
+ ### H. Write & Advance
137
185
 
138
186
  After completing all sub-steps for a module:
139
187
 
140
- 1. Write via ba-writer:
188
+ 1. **Validate against schema BEFORE writing** (uses schemas deployed in step-00):
189
+ ```javascript
190
+ ba-writer.validate("entities", entitiesData, docs_dir + "/schemas/entities.json")
191
+ ba-writer.validate("rules", rulesData, docs_dir + "/schemas/rules.json")
192
+ ba-writer.validate("usecases", usecasesData, docs_dir + "/schemas/usecases.json")
193
+ ba-writer.validate("permissions", permissionsData, docs_dir + "/schemas/permissions.json")
194
+ ```
195
+ > If validation fails: fix the data and re-validate. Do NOT write invalid JSON.
196
+
197
+ 2. Write via ba-writer:
141
198
  - `entities.json`
142
199
  - `rules.json`
143
200
  - `usecases.json`
144
201
  - `permissions.json`
145
202
  - Update `index.json` (hashes, summary counts)
146
203
 
147
- 2. Update module status to `specified`
204
+ 3. Update module status to `specified`
148
205
 
149
206
  3. Advance to next module in topological order
150
207
 
151
- ### H. Module Completion Check
208
+ ### I. Module Completion Check
152
209
 
153
210
  After all modules are specified:
154
211
  - Verify all modules have status `specified`
155
212
  - Display summary: total entities, rules, UCs, permissions across all modules
156
- - Remind user: "Run /ba-design-ui to design interfaces for these modules"
213
+ - Remind user: "Run /business-analyse-design to design interfaces for these modules"
157
214
  - Transition to step 04
158
215
 
159
- ## POST-CHECK
160
-
161
- Before advancing to step 04, verify:
162
- - [ ] Every module has at least 1 entity
163
- - [ ] Every module has at least 1 use case
164
- - [ ] Every module has at least 1 business rule
165
- - [ ] Every module has permissions defined
166
- - [ ] Entity attributes have `type` defined (string, int, date, enum, guid, etc.)
167
- - [ ] All entity relationships reference existing entities
168
- - [ ] All UC business rule references exist
169
- - [ ] All permission paths follow the convention
170
- - [ ] Sections with `sectionType: view` do NOT appear in `permissionPaths` (they inherit from module)
171
- - [ ] Sections with `permissionMode: read-only` only have `.read` in `permissionPaths` (no create/update/delete)
172
- - [ ] Sections with `permissionMode: inherit` have ZERO entries in `permissionPaths`
216
+ ## POST-CHECK (EXECUTABLE — BLOCKING)
217
+
218
+ Before advancing to step 04, run these validations for EACH module:
219
+
220
+ ```javascript
221
+ const errors = [];
222
+ const warnings = [];
223
+
224
+ for (const mod of modules) {
225
+ const ent = READ(mod.dir + '/entities.json')?.entities || [];
226
+ const ucs = READ(mod.dir + '/usecases.json')?.useCases || [];
227
+ const brs = READ(mod.dir + '/rules.json')?.rules || [];
228
+ const perms = READ(mod.dir + '/permissions.json');
229
+ const sections = mod.anticipatedSections || [];
230
+ const sectionCodes = new Set(sections.map(s => s.code));
231
+
232
+ // Mandatory checks (BLOCKING)
233
+ if (ent.length === 0) errors.push(mod.code + ": 0 entities");
234
+ if (ucs.length === 0) errors.push(mod.code + ": 0 use cases");
235
+ if (brs.length === 0) errors.push(mod.code + ": 0 business rules");
236
+ if (!perms?.permissionPaths?.length) errors.push(mod.code + ": no permissions");
237
+
238
+ // sectionCode validation
239
+ for (const uc of ucs) {
240
+ if (!uc.sectionCode) errors.push(mod.code + ": UC '" + uc.id + "' missing sectionCode");
241
+ else if (!sectionCodes.has(uc.sectionCode)) errors.push(mod.code + ": UC '" + uc.id + "' sectionCode '" + uc.sectionCode + "' not in anticipatedSections");
242
+ }
243
+ for (const br of brs) {
244
+ if (!br.sectionCode) errors.push(mod.code + ": BR '" + br.id + "' missing sectionCode");
245
+ else if (!sectionCodes.has(br.sectionCode)) errors.push(mod.code + ": BR '" + br.id + "' sectionCode '" + br.sectionCode + "' not in anticipatedSections");
246
+ }
247
+
248
+ // Entity attribute checks
249
+ for (const e of ent) {
250
+ for (const a of (e.attributes || [])) {
251
+ if (!a.type) warnings.push(mod.code + ": entity " + e.name + " attr '" + a.name + "' missing type");
252
+ if (a.type === 'enum' && !a.defaultValue) errors.push(mod.code + ": enum attr '" + a.name + "' missing defaultValue");
253
+ }
254
+ }
255
+
256
+ // Cross-reference checks
257
+ for (const uc of ucs) {
258
+ for (const brRef of (uc.businessRules || [])) {
259
+ if (!brs.find(br => br.id === brRef)) warnings.push(mod.code + ": UC '" + uc.id + "' references non-existent BR '" + brRef + "'");
260
+ }
261
+ }
262
+
263
+ // Section permission checks
264
+ for (const section of sections) {
265
+ if (section.sectionType === 'view') {
266
+ const viewPerms = (perms?.permissionPaths || []).filter(p => p.includes('.' + section.code + '.'));
267
+ if (viewPerms.length > 0) errors.push(mod.code + ": view section '" + section.code + "' has " + viewPerms.length + " permissions (should inherit)");
268
+ }
269
+ }
270
+ }
271
+
272
+ if (errors.length > 0) {
273
+ Display("POST-CHECK FAILED (" + errors.length + " errors):");
274
+ errors.forEach(e => Display(" ✗ " + e));
275
+ BLOCKING_ERROR("Fix all errors before advancing to step 04");
276
+ }
277
+ if (warnings.length > 0) {
278
+ Display("POST-CHECK warnings (" + warnings.length + "):");
279
+ warnings.forEach(w => Display(" ⚠ " + w));
280
+ }
281
+ Display("POST-CHECK PASS: " + modules.length + " modules validated");
282
+ ```
173
283
 
174
284
  ## Transition
175
285
 
@@ -16,8 +16,17 @@ next_step: none
16
16
  - NEVER duplicate module content - work with summaries only
17
17
  - Single-module shortcut: auto-approve consolidation if only 1 module
18
18
 
19
+ ## Context Recovery
20
+
21
+ Re-read session variables from `.business-analyse/config.json`:
22
+ ```javascript
23
+ const config = readJSON('.business-analyse/config.json').currentFeature;
24
+ const { id: feature_id, docsDir: docs_dir, application: application_name,
25
+ applicationCode, workflowMode: workflow_mode, language } = config;
26
+ ```
27
+
19
28
  ## YOUR TASK
20
- Consolidate all modules by validating cross-module interactions, permission coherence, data model integrity, E2E flows, and global risks. Obtain client approval and write consolidation data to validation.json.
29
+ Consolidate all modules by validating cross-module interactions, permission coherence, data model integrity, E2E flows, and global risks. Obtain client approval and write consolidation data.
21
30
 
22
31
  ---
23
32
 
@@ -35,7 +44,7 @@ ba-reader.readApplicationContext({feature_id})
35
44
 
36
45
  IF status already "consolidated":
37
46
  Display: "Consolidation already completed. BA workflow finished."
38
- Display: "Next: invoke /ba-generate-html then /ba-review for client cycle."
47
+ Display: "Next: invoke /business-analyse-design to design interfaces, then /business-analyse-html for client review."
39
48
  STOP
40
49
  ```
41
50
 
@@ -294,8 +303,33 @@ const risks = [
294
303
  riskMetrics.sharedEntities > 5 ? {risk: "Many shared entities", severity: "medium"} : null,
295
304
  riskMetrics.maxE2EFlowLength > 8 ? {risk: "Long E2E flow", severity: "medium"} : null
296
305
  ].filter(r => r !== null);
306
+
307
+ // OBLIGATOIRE : risks[] ne peut pas être vide
308
+ if (risks.length === 0) {
309
+ // Force au minimum un risque auto-détecté basé sur les métriques
310
+ risks.push({
311
+ risk: `Complexity baseline: ${riskMetrics.totalEntities} entities, ${riskMetrics.totalBRs} BRs, ${riskMetrics.crossModuleDependencies} cross-module deps`,
312
+ severity: "low",
313
+ mitigation: "Monitor implementation velocity and adjust estimates if needed"
314
+ });
315
+ }
297
316
  ```
298
317
 
318
+ ### 7bis. Critères d'acceptation globaux
319
+
320
+ > **OBLIGATOIRE** : Générer au minimum 1 critère d'acceptation par module.
321
+
322
+ ```json
323
+ "acceptanceCriteria": [
324
+ { "module": "Invoices", "criteria": "Une facture créée depuis un devis reprend automatiquement le client, les lignes et le montant", "type": "functional" },
325
+ { "module": "Invoices", "criteria": "Le statut passe automatiquement à 'Paid' quand paidAmount >= total", "type": "business-rule" }
326
+ ]
327
+ ```
328
+
329
+ Les types possibles : `functional`, `business-rule`, `performance`, `security`.
330
+
331
+ Les critères d'acceptation sont écrits dans `validation.json` au même niveau que `globalRiskAssessment`.
332
+
299
333
  ### 8. Consolidation Summary Display
300
334
 
301
335
  ```
@@ -448,9 +482,10 @@ Display final summary:
448
482
  ✓ Status: consolidated
449
483
 
450
484
  BA workflow complete. Next steps:
451
- → Invoke /ba-generate-html to generate the interactive HTML
452
- → Invoke /ba-review to apply client corrections
453
- → Invoke /derive-prd /ralph-loop for implementation
485
+ → Invoke /business-analyse-design to design interfaces (screens, wireframes, navigation)
486
+ → Invoke /business-analyse-html to generate the interactive HTML for client review
487
+ → Invoke /business-analyse-review to apply client corrections (if needed)
488
+ → Invoke /business-analyse-handoff → /business-analyse-develop for implementation
454
489
  ```
455
490
 
456
491
  ---
@@ -483,6 +518,7 @@ BA workflow complete. Next steps:
483
518
  ## NEXT STEPS
484
519
 
485
520
  BA workflow ends here. After consolidation:
486
- 1. Invoke `/ba-generate-html` to generate the interactive HTML document
487
- 2. Invoke `/ba-review` to apply client corrections (if needed)
488
- 3. Invoke `/derive-prd` then `/ralph-loop` for implementation
521
+ 1. Invoke `/business-analyse-design` to design interfaces (screens, wireframes, navigation)
522
+ 2. Invoke `/business-analyse-html` to generate the interactive HTML document
523
+ 3. Invoke `/business-analyse-review` to apply client corrections (if needed)
524
+ 4. Invoke `/business-analyse-handoff` then `/business-analyse-develop` for implementation
@@ -1,6 +1,6 @@
1
1
  # Template Development Handoff
2
2
 
3
- > **Usage:** Template for /derive-prd
3
+ > **Usage:** Template for /business-analyse-handoff
4
4
  > **Data source:** index.json (sections: metadata, analysis, specification, handoff)
5
5
 
6
6
  ---
@@ -12,7 +12,7 @@
12
12
  > **Version:** {version}
13
13
  > **Validated Specs:** index.json (validation.decision = APPROVED)
14
14
  > **Source:** `docs/{app}/{module}/business-analyse/v{version}/index.json`
15
- > **Implementation:** `/ralph-loop`
15
+ > **Implementation:** `/business-analyse-develop`
16
16
 
17
17
  ## DEVELOPER INSTRUCTIONS
18
18
 
@@ -20,10 +20,10 @@ This document is a self-contained prompt for Claude Code.
20
20
 
21
21
  **Lancement:**
22
22
  ```
23
- /ralph-loop
23
+ /business-analyse-develop
24
24
  ```
25
25
  > Ralph-loop auto-detects BA artifacts and derives PRD task breakdowns.
26
- > Use `/ralph-loop -r` only to resume an interrupted loop.
26
+ > Use `/business-analyse-develop -r` only to resume an interrupted loop.
27
27
 
28
28
  ---
29
29
 
@@ -184,6 +184,6 @@ From: `index.json.specification.seedDataCore` and `index.json.specification.perm
184
184
 
185
185
  **Lancement:**
186
186
  ```bash
187
- /ralph-loop
187
+ /business-analyse-develop
188
188
  ```
189
189
  ```
@@ -1,6 +1,6 @@
1
1
  # Skill Launch Display Templates (templates/tpl-launch-displays.md)
2
2
 
3
- > **Used by:** /ba-generate-html (Completion Summary)
3
+ > **Used by:** /business-analyse-html (Completion Summary)
4
4
  > **Purpose:** User-facing display templates for BA completion
5
5
  > **Note:** No emojis - uses text markers per Claude Code conventions
6
6
 
@@ -34,10 +34,10 @@ Effort: {total_days} days ({total_hours} hours)
34
34
  3. Si retours --> relancer /business-analyse pour une nouvelle itération
35
35
  4. Une fois validé, lancer le développement:
36
36
 
37
- /ralph-loop
37
+ /business-analyse-develop
38
38
 
39
- Note: /ralph-loop -r sert UNIQUEMENT à reprendre une boucle interrompue.
40
- Après un /business-analyse, toujours utiliser /ralph-loop (sans -r).
39
+ Note: /business-analyse-develop -r sert UNIQUEMENT à reprendre une boucle interrompue.
40
+ Après un /business-analyse, toujours utiliser /business-analyse-develop (sans -r).
41
41
 
42
42
  ═══════════════════════════════════════════════════════════════
43
43
  ```
@@ -353,7 +353,7 @@ Feature: {FEAT-XXX} {Feature Name}
353
353
  > **Module:** business/{application}/{module}
354
354
  > **Version:** 1.0
355
355
  > **Validated Specs:** Specification v1.0 (validation.json)
356
- > **Implementation:** `/ralph-loop`
356
+ > **Implementation:** `/business-analyse-develop`
357
357
 
358
358
  ## DEVELOPER INSTRUCTIONS
359
359
 
@@ -361,10 +361,10 @@ This document is a self-contained prompt for Claude Code.
361
361
 
362
362
  **Lancement:**
363
363
  ```
364
- /ralph-loop
364
+ /business-analyse-develop
365
365
  ```
366
366
  > Ralph-loop auto-detects BA artifacts and derives PRD task breakdowns.
367
- > Use `/ralph-loop -r` only to resume an interrupted loop.
367
+ > Use `/business-analyse-develop -r` only to resume an interrupted loop.
368
368
 
369
369
  ---
370
370
 
@@ -460,7 +460,7 @@ FRONTEND:
460
460
 
461
461
  **Lancement:**
462
462
  ```bash
463
- /ralph-loop
463
+ /business-analyse-develop
464
464
  ```
465
465
  ```
466
466
 
@@ -1,19 +1,19 @@
1
1
  ---
2
- name: ba-design-ui
2
+ name: business-analyse-design
3
3
  description: "Design user interfaces for each module: screens, wireframes, and navigation tree from Phase 1 analysis data."
4
4
  model: opus
5
5
  user_invocable: true
6
6
  ---
7
7
 
8
- # /ba-design-ui
8
+ # /business-analyse-design
9
9
 
10
10
  Design user interfaces for each module based on the business analysis data (entities, use cases, permissions) produced by `/business-analyse`.
11
11
 
12
12
  ## Triggers
13
13
 
14
- - Explicit invocation: `/ba-design-ui <feature-id>`
14
+ - Explicit invocation: `/business-analyse-design <feature-id>`
15
15
  - After `/business-analyse` step-04 (consolidation complete)
16
- - After `/ba-review` when corrections target UI/screens
16
+ - After `/business-analyse-review` when corrections target UI/screens
17
17
 
18
18
  ## Parameters
19
19
 
@@ -66,16 +66,16 @@ Project-level:
66
66
  ## Post-Design Workflow
67
67
 
68
68
  ```
69
- /ba-design-ui completes
69
+ /business-analyse-design completes
70
70
  |
71
71
  v
72
- /ba-generate-html (generates interactive HTML with mockups, ERD, permission matrix)
72
+ /business-analyse-html (generates interactive HTML with mockups, ERD, permission matrix)
73
73
  |
74
74
  v
75
75
  Client reviews HTML
76
76
  |
77
77
  v
78
- /ba-review (apply corrections, route back to /business-analyse or /ba-design-ui)
78
+ /business-analyse-review (apply corrections, route back to /business-analyse or /business-analyse-design)
79
79
  ```
80
80
 
81
81
  ## References
@@ -83,8 +83,8 @@ Client reviews HTML
83
83
  | File | Content |
84
84
  |------|---------|
85
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 |
86
+ | `/business-analyse-html` skill | HTML generation consuming screens.json |
87
+ | `business-analyse-html/references/data-mapping.md` | JSON to FEATURE_DATA field mapping |
88
88
 
89
89
  ## Entry Point
90
90
 
@@ -11,6 +11,15 @@ next_step: steps/step-02-wireframes.md
11
11
 
12
12
  For each module, define all sections and resources with detailed interface specifications: SmartTable columns, SmartForm fields with types, SmartDashboard KPIs, SmartKanban columns.
13
13
 
14
+ ## Context Recovery
15
+
16
+ Re-read session variables (do NOT rely on LLM memory from prior skill invocation):
17
+ ```javascript
18
+ const config = readJSON('.business-analyse/config.json').currentFeature;
19
+ const { id: feature_id, docsDir: docs_dir, application: application_name,
20
+ applicationCode, language } = config;
21
+ ```
22
+
14
23
  ## Prerequisites
15
24
 
16
25
  - `/business-analyse` completed (entities, usecases, permissions exist)
@@ -127,8 +127,15 @@ Write via ba-writer at project level (alongside master index.json). Update index
127
127
  | navigation.json | {project-path}/navigation.json |
128
128
 
129
129
  NEXT STEPS:
130
- 1. Run /ba-generate-html to produce the interactive HTML with mockups
130
+ 1. Run /business-analyse-html to produce the interactive HTML with mockups
131
131
  2. Client reviews the HTML (mockups, ERD, permission matrix)
132
- 3. Run /ba-review to apply corrections
132
+ 3. Run /business-analyse-review to apply corrections
133
133
  ================================================================
134
134
  ```
135
+
136
+ ## Status Update
137
+
138
+ After writing all screens and navigation, update the application status:
139
+ ```javascript
140
+ ba-writer.updateStatus({feature_id}, "designed")
141
+ ```