@atlashub/smartstack-cli 2.0.0 → 2.2.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 (59) hide show
  1. package/.documentation/agents.html +147 -40
  2. package/.documentation/apex.html +1 -1
  3. package/.documentation/business-analyse.html +3 -3
  4. package/.documentation/cli-commands.html +2 -2
  5. package/.documentation/commands.html +14 -14
  6. package/.documentation/efcore.html +14 -14
  7. package/.documentation/gitflow.html +12 -12
  8. package/.documentation/hooks.html +41 -3
  9. package/.documentation/index.html +1 -1
  10. package/.documentation/init.html +2 -2
  11. package/.documentation/installation.html +11 -11
  12. package/.documentation/js/app.js +1 -1
  13. package/.documentation/ralph-loop.html +1 -1
  14. package/.documentation/test-web.html +4 -4
  15. package/dist/index.js +19 -11
  16. package/dist/index.js.map +1 -1
  17. package/dist/mcp-entry.mjs +57595 -4569
  18. package/dist/mcp-entry.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/templates/agents/ba-reader.md +250 -0
  21. package/templates/agents/ba-writer.md +210 -0
  22. package/templates/agents/docs-context-reader.md +51 -33
  23. package/templates/skills/_shared.md +2 -0
  24. package/templates/skills/business-analyse/SKILL.md +120 -108
  25. package/templates/skills/business-analyse/_shared.md +191 -160
  26. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +478 -0
  27. package/templates/skills/business-analyse/questionnaire/01-context.md +3 -15
  28. package/templates/skills/business-analyse/questionnaire/08-performance.md +7 -21
  29. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -13
  30. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -13
  31. package/templates/skills/business-analyse/questionnaire.md +72 -76
  32. package/templates/skills/business-analyse/react/components.md +317 -154
  33. package/templates/skills/business-analyse/react/i18n-template.md +167 -106
  34. package/templates/skills/business-analyse/react/schema.md +325 -106
  35. package/templates/skills/business-analyse/schemas/feature-schema.json +690 -0
  36. package/templates/skills/business-analyse/steps/step-00-init.md +395 -285
  37. package/templates/skills/business-analyse/steps/step-01-analyse.md +505 -0
  38. package/templates/skills/business-analyse/steps/step-02-specify.md +833 -0
  39. package/templates/skills/business-analyse/steps/step-03-validate.md +862 -0
  40. package/templates/skills/business-analyse/steps/step-04-handoff.md +1593 -0
  41. package/templates/skills/business-analyse/templates/tpl-handoff.md +95 -43
  42. package/templates/skills/controller/templates.md +82 -0
  43. package/templates/skills/efcore/references/zero-downtime-patterns.md +227 -0
  44. package/templates/skills/efcore/steps/migration/step-03-validate.md +19 -0
  45. package/templates/skills/review-code/SKILL.md +4 -2
  46. package/templates/skills/review-code/references/owasp-api-top10.md +243 -0
  47. package/templates/skills/review-code/references/security-checklist.md +86 -1
  48. package/templates/skills/review-code/references/smartstack-conventions.md +166 -0
  49. package/templates/skills/workflow/SKILL.md +27 -0
  50. package/templates/skills/business-analyse/steps/step-01-discover.md +0 -737
  51. package/templates/skills/business-analyse/steps/step-02-analyse.md +0 -299
  52. package/templates/skills/business-analyse/steps/step-03-specify.md +0 -409
  53. package/templates/skills/business-analyse/steps/step-04-validate.md +0 -313
  54. package/templates/skills/business-analyse/steps/step-05-handoff.md +0 -658
  55. package/templates/skills/business-analyse/steps/step-06-doc-html.md +0 -320
  56. package/templates/skills/business-analyse/templates/00-context.md +0 -105
  57. package/templates/skills/business-analyse/templates/tpl-brd.md +0 -97
  58. package/templates/skills/business-analyse/templates/tpl-discovery.md +0 -78
  59. package/templates/skills/business-analyse/tracking/change-template.md +0 -30
@@ -1,36 +1,85 @@
1
- # Business Analysis - Shared Functions (v2 - Progressive Loading)
1
+ # Business Analysis - Shared Functions (v3 - JSON-First Progressive Loading)
2
2
 
3
3
  > **Ref:** This file contains common functions for all BA phases.
4
- > **Version:** 2.0 - Optimized for progressive loading
4
+ > **Version:** 3.0 - JSON-First architecture with progressive loading
5
5
 
6
6
  ---
7
7
 
8
8
  ## Architecture Progressive
9
9
 
10
- Le skill BusinessAnalyse utilise le **chargement progressif** pour minimiser le contexte:
10
+ The BusinessAnalyse skill uses **progressive loading** to minimize context:
11
11
 
12
12
  ```
13
- SKILL.md (entry point)
13
+ SKILL.md (entry point) → routes to use case
14
14
 
15
- steps/step-00-init.md (parse flags, create state)
15
+ steps/step-00-init.md (parse flags, create feature.json via ba-writer)
16
16
 
17
- steps/step-01-discover.md (charge questionnaire/XX.md on-demand)
17
+ steps/step-01-analyse.md (merged discovery+BRD, loads questionnaire/*.md)
18
18
 
19
- steps/step-02-analyse.md (charge templates/tpl-brd.md)
19
+ steps/step-02-specify.md (FRD + use cases + permissions)
20
20
 
21
- steps/step-03-specify.md (charge templates/tpl-frd.md)
21
+ steps/step-03-validate.md (validation gate)
22
22
 
23
- steps/step-04-validate.md (validation gate)
24
-
25
- steps/step-05-handoff.md (charge templates/tpl-handoff.md)
26
-
27
- steps/step-06-doc-html.md (charge react/*.md on-demand)
23
+ steps/step-04-handoff.md (generates ralph prd.json)
28
24
  ```
29
25
 
26
+ **No digest files needed** — each step reads/writes `feature.json` directly via `ba-writer` and `ba-reader` agents.
27
+
30
28
  **Benefit:** ~70% context reduction per phase
31
29
 
32
30
  ---
33
31
 
32
+ ## JSON-First Architecture
33
+
34
+ All BA outputs are stored in a single `feature.json` file, enriched progressively:
35
+
36
+ | Step | Section enriched | Status after |
37
+ |------|-----------------|--------------|
38
+ | 00-init | metadata | draft |
39
+ | 01-analyse | discovery + analysis + suggestions | analysed |
40
+ | 02-specify | specification | specified |
41
+ | 03-validate | validation | approved |
42
+ | 04-handoff | handoff | handed-off |
43
+
44
+ **Agents:**
45
+ - **ba-writer**: Writes/updates feature.json (create, enrichSection, updateStatus, createVersion)
46
+ - **ba-reader**: Reads feature.json (findFeature, readSection, answerQuestion, getSummaryForSkill)
47
+
48
+ **Schema:** `schemas/feature-schema.json`
49
+
50
+ **Cross-references in JSON:**
51
+ - `specification.useCases[].linkedRules` → `analysis.businessRules[].id`
52
+ - `specification.functionalRequirements[].linkedUseCases` → `specification.useCases[].id`
53
+ - `specification.functionalRequirements[].linkedRules` → `analysis.businessRules[].id`
54
+ - `handoff.brToCodeMapping[].ruleId` → `analysis.businessRules[].id`
55
+
56
+ ---
57
+
58
+ ## Use Case Routing
59
+
60
+ | Flag | Use Case | Workflow |
61
+ |------|----------|---------|
62
+ | (none) | New feature | step-00 → step-01 → step-02 → step-03 → step-04 |
63
+ | `-q FEAT-ID "question"` | Question | ba-reader.answerQuestion → EXIT |
64
+ | `-r FEAT-ID "change"` | Refactoring | ba-writer.createVersion → step-01 (delta) → step-02 → step-03 → step-04 |
65
+ | `-m` | Micro-feature | step-00 (minimal) → step-01 (micro) → step-02 (minimal) → step-03 (auto) → step-04 (simplified) |
66
+
67
+ ### Delta Mode (Refactoring)
68
+ - ba-reader loads existing feature.json
69
+ - ba-writer creates new version folder (v{X.Y+1})
70
+ - step-01 only asks questions about the CHANGE, not the entire module
71
+ - step-02 only adds/modifies affected UCs, FRs, permissions
72
+ - Existing data preserved, only delta applied
73
+
74
+ ### Micro Mode
75
+ - Questions: entity, fields, values, who can change (4-6 questions max)
76
+ - step-01: simplified analysis (no ULTRATHINK, no proactive suggestions)
77
+ - step-02: minimal specification (1-2 UCs, standard CRUD)
78
+ - step-03: auto-validation (structural check only)
79
+ - step-04: simplified handoff
80
+
81
+ ---
82
+
34
83
  ## Business Context Validation
35
84
 
36
85
  ```
@@ -70,14 +119,15 @@ Route pattern : `/business/{application}/{module}/{section}`
70
119
 
71
120
  ### Classes de Base des Entités
72
121
 
73
- | Classe | Champs auto-inclus | Quand utiliser |
74
- |--------|--------------------|----------------|
75
- | `Entity` | `Id` (Guid) | Entité simple sans audit |
76
- | `AuditableEntity` | + `CreatedBy`, `CreatedDate`, `ModifiedBy`, `ModifiedDate` | **Défaut pour toute entité métier** |
77
- | `SoftDeletableEntity` | + `IsDeleted`, `DeletedBy`, `DeletedDate` | Entité avec suppression logique |
78
- | `HierarchicalEntity` | + `ParentId`, `Level`, `Path` | Arborescences (catégories, menus) |
122
+ | Classe | Interface | Champs auto-inclus | Quand utiliser |
123
+ |--------|-----------|---------------------|----------------|
124
+ | `BaseEntity` | - | `Id` (Guid), `TenantId`, `CreatedAt`, `UpdatedAt` | **Défaut pour toute entité métier** |
125
+ | `BaseEntity` | `IAuditableEntity` | + `CreatedBy`, `UpdatedBy` | Entité avec audit complet |
126
+ | `SystemEntity` | - | `Id` (Guid), `CreatedAt` (pas de TenantId) | Entités système (navigation, permissions) |
127
+ | `BaseEntity` | `ISoftDeletable` | + `IsDeleted`, `DeletedBy`, `DeletedAt` | Entité avec suppression logique |
128
+ | `HierarchicalEntity` | - | + `ParentId`, `Level`, `Path` | Arborescences (catégories, menus) |
79
129
 
80
- > **IMPORTANT :** Ne JAMAIS proposer `CreatedBy`, `ModifiedBy`, `IsDeleted` comme champs explicites — ils sont AUTOMATIQUES via la classe de base.
130
+ > **IMPORTANT :** Ne JAMAIS proposer `CreatedBy`, `UpdatedBy`, `IsDeleted`, `TenantId` comme champs explicites — ils sont AUTOMATIQUES via la classe de base ou l'interface.
81
131
 
82
132
  ### Services d'Intégration Disponibles
83
133
 
@@ -91,13 +141,53 @@ Route pattern : `/business/{application}/{module}/{section}`
91
141
 
92
142
  ### Conventions Base de Données
93
143
 
94
- | Aspect | Convention |
95
- |--------|------------|
96
- | Schema | `core` (socle) vs `ext` (extensions/métier) |
97
- | Tables | PascalCase au pluriel (`Orders`, `OrderLines`) |
98
- | FK | `{Entity}Id` (ex: `ClientId`, `OrderId`) |
99
- | Index | `IX_{Table}_{Column}` |
100
- | Migration | 1 migration par feature, nommée via MCP |
144
+ | Aspect | Convention | Exemple |
145
+ |--------|------------|---------|
146
+ | Schema | `core` (socle SmartStack) vs `extensions` (entités client/métier) | `core.auth_Roles`, `extensions.bik_FreeBickes` |
147
+ | Tables | `{prefix}_{EntityPlural}` (préfixe domaine + PascalCase pluriel) | `auth_Users`, `nav_Applications`, `supp_Tickets` |
148
+ | Préfixes domaine | `auth_` (auth), `nav_` (navigation), `cfg_` (config), `ref_` (références), `wkf_` (workflows), `ai_` (IA), `loc_` (i18n), `lic_` (licences), `tenant_` (tenants), `support_` (support) | Pour un nouveau module métier : choisir un préfixe court (3-5 chars) |
149
+ | FK | `{Entity}Id` (ex: `ClientId`, `OrderId`) | |
150
+ | Index | `IX_{Table}_{Column}` | `IX_bik_FreeBickes_TenantId_Code` |
151
+ | Migration | 1 migration par feature, nommée via MCP (`suggest_migration`) | `extensions_v1.0.0_001_AddFreeBicke` |
152
+
153
+ ### Conventions de Dossiers (Clean Architecture)
154
+
155
+ | Couche | Pattern de dossiers | Exemple (module FreeBicke dans business > operations) |
156
+ |--------|--------------------|---------------------------------------------------------|
157
+ | **Domain** | `{Project}.Domain/Business/{Application}/{Module}/` | `Domain/Business/Operations/FreeBicke/FreeBicke.cs` |
158
+ | **Application/DTOs** | `{Project}.Application/Business/{Application}/{Module}/DTOs/` | `Application/Business/Operations/FreeBicke/DTOs/FreeBickeDto.cs` |
159
+ | **Application/Interfaces** | `{Project}.Application/Common/Interfaces/` | `Application/Common/Interfaces/IFreeBickeService.cs` |
160
+ | **Infrastructure/Config** | `{Project}.Infrastructure/Persistence/Configurations/{Module}/` | `Configurations/FreeBicke/FreeBickeConfiguration.cs` |
161
+ | **Infrastructure/Services** | `{Project}.Infrastructure/Services/{Module}/` | `Services/FreeBicke/FreeBickeService.cs` |
162
+ | **Infrastructure/SeedData** | `{Project}.Infrastructure/Persistence/Seeding/Data/{Module}/` | `Seeding/Data/FreeBicke/FreeBickeSeedData.cs` |
163
+ | **API/Controllers** | `{Project}.Api/Controllers/Business/{Application}/` | `Controllers/Business/Operations/FreeBickeController.cs` |
164
+ | **Frontend/Pages** | `web/src/pages/business/{application}/{module}/` | `pages/business/operations/freebicke/page.tsx` |
165
+ | **Frontend/i18n** | `web/src/i18n/locales/{lang}/{module}.json` | `locales/fr/freebicke.json` |
166
+
167
+ > **IMPORTANT :** Chaque module a son **propre sous-dossier** dans chaque couche. Ne JAMAIS mettre tous les fichiers à la racine d'une couche.
168
+
169
+ ### SeedData Core (Obligatoire pour chaque feature)
170
+
171
+ > **Chaque nouvelle feature nécessite des SeedData dans 5 fichiers core** pour être fonctionnelle (navigation visible, permissions actives, rôles assignés).
172
+
173
+ | # | Fichier | Contenu | Mécanisme |
174
+ |---|---------|---------|-----------|
175
+ | 1 | `NavigationModuleConfiguration.cs` | Entrée module dans `nav_Modules` (HasData) | EF Core Migration |
176
+ | 2 | `NavigationTranslationConfiguration.cs` | Traductions du module (4 langues × chaque entité nav) | EF Core Migration |
177
+ | 3 | `PermissionConfiguration.cs` | Permissions CRUD + wildcards dans `nav_Permissions` (HasData) | EF Core Migration |
178
+ | 4 | `Permissions.cs` (Application layer) | Constantes compile-time pour `[RequirePermission]` | Code |
179
+ | 5 | `RolePermissionConfiguration.cs` | Associations rôle-permission dans `auth_RolePermissions` (HasData) | EF Core Migration |
180
+
181
+ **Rôles par défaut pour chaque application (4 niveaux) :**
182
+
183
+ | Rôle | Permissions | Description |
184
+ |------|-------------|-------------|
185
+ | **{App} Admin** | `{context}.{app}.*` (wildcard) | Accès complet à l'application |
186
+ | **{App} Manager** | `read`, `create`, `update`, `assign` | Gestion complète sans suppression |
187
+ | **{App} Contributor** | `read`, `create`, `update` | Contribution active |
188
+ | **{App} Viewer** | `read` uniquement | Consultation seule |
189
+
190
+ > **CRITIQUE :** Si les SeedData ne sont pas créés, le module sera invisible dans la navigation et les permissions retourneront 403.
101
191
 
102
192
  ### Contraintes Non-Négociables
103
193
 
@@ -125,29 +215,21 @@ Route pattern : `/business/{application}/{module}/{section}`
125
215
  ## Feature Directory Structure
126
216
 
127
217
  ```
128
- .business-analyse/
129
- ├── config.json # Global config
130
- └── business/
131
- └── {application}/
132
- └── modules/
133
- └── {module}/
134
- └── features/
135
- └── {FEAT-NNN}/
136
- ├── 00-context.md # State persistence
137
- ├── 1-discovery.md
138
- ├── 2-business-requirements.md
139
- ├── 3-functional-specification.md
140
- ├── validation.json
141
- ├── 4-development-handoff.md
142
- └── tracking/
143
- ├── changes/
144
- │ └── CHANGE-NNN.md
145
- ├── bugs/
146
- ├── hotfixes/
147
- └── docs-manifest-entry.json
218
+ docs/
219
+ ├── business/
220
+ └── {application}/
221
+ └── {module}/
222
+ │ ├── business-analyse/
223
+ │ │ ├── v1.0/
224
+ │ │ │ └── feature.json
225
+ │ │ └── v1.1/
226
+ │ │ └── feature.json
227
+ │ └── user-guide/ ← post-development (separate skill)
228
+ │ └── v1.0/
229
+ │ └── guide.json
148
230
  ```
149
231
 
150
- **Ralph Loop Integration (generated by step-05):**
232
+ **Ralph Loop Integration (generated by step-04):**
151
233
 
152
234
  ```
153
235
  .ralph/
@@ -157,7 +239,7 @@ Route pattern : `/business/{application}/{module}/{section}`
157
239
  └── reports/
158
240
  ```
159
241
 
160
- > **Note:** `.ralph/prd.json` is generated by step-05-handoff from the file mapping, business rules, and test requirements. It provides an atomic task list following the SmartStack layer order (Domain -> Application -> Infrastructure -> API -> Frontend -> i18n -> Tests -> Validation).
242
+ > **Note:** `.ralph/prd.json` is generated by step-04-handoff from the feature.json mapping, business rules, and test requirements. It provides an atomic task list following the SmartStack layer order (Domain Application Infrastructure API Frontend i18n Tests Validation).
161
243
 
162
244
  ---
163
245
 
@@ -178,12 +260,10 @@ generate_feature_id():
178
260
  | Step | Model | Reason |
179
261
  |------|-------|--------|
180
262
  | 00-init | Haiku | Quick structure setup |
181
- | 01-discover | **Opus** | ULTRATHINK elicitation |
182
- | 02-analyse | Sonnet | BRD modeling |
183
- | 03-specify | Sonnet | FRD + Use Cases |
184
- | 04-validate | Haiku | Binary gate |
185
- | 05-handoff | **Opus** | Zero-ambiguity prompt |
186
- | 06-doc-html | Sonnet | React + Context7 |
263
+ | 01-analyse | **Opus** | ULTRATHINK merged discovery+BRD |
264
+ | 02-specify | Sonnet | FRD + Use Cases |
265
+ | 03-validate | Haiku | Binary gate |
266
+ | 04-handoff | **Opus** | Zero-ambiguity prompt |
187
267
 
188
268
  ---
189
269
 
@@ -204,13 +284,19 @@ generate_feature_id():
204
284
 
205
285
  | Category | Questions | Batches |
206
286
  |----------|-----------|---------|
207
- | 01-context | Q1.1-Q1.8 | 2 calls (Q1.1-Q1.4 then Q1.5-Q1.8) |
208
- | 02-stakeholders | Q2.1-Q2.8 | 2 calls (Q2.1-Q2.4 then Q2.5-Q2.8) |
209
- | 03-scope | Q3.1-Q3.8 | 2 calls (Q3.1-Q3.4 then Q3.5-Q3.8) |
210
- | 04-data | Q4.1-Q4.8 | 2 calls (Q4.1-Q4.4 then Q4.5-Q4.8) |
211
- | 05-integrations | Q5.1-Q5.8 | 2 calls (Q5.1-Q5.4 then Q5.5-Q5.8) |
212
- | 06-security | Q6.1-Q6.8 | 2 calls (Q6.1-Q6.4 then Q6.5-Q6.8) |
213
- | 07-10 | Q7-Q10 | 1-2 calls each |
287
+ | 01-context | Q1.1-Q1.4 | 1 call |
288
+ | 02-stakeholders | Q2.1-Q2.8 | 2 calls |
289
+ | 03-scope | Q3.1-Q3.8 | 2 calls |
290
+ | 04-data | Q4.1-Q4.8 | 2 calls |
291
+ | 05-integrations | Q5.1-Q5.8 | 2 calls |
292
+ | 06-security | Q6.1-Q6.8 | 2 calls |
293
+ | 07-ui | Q7.1-Q7.8 | 2 calls |
294
+ | 08-performance | Q8.1-Q8.4 | 1 call |
295
+ | 09-constraints | Q9.1-Q9.4 | 1 call |
296
+ | 10-documentation | Q10.1-Q10.4 | 1 call |
297
+ | 11-data-lifecycle | Q11.1-Q11.8 | 2 calls |
298
+ | 12-migration | Q12.1-Q12.8 | 2 calls |
299
+ | 13-cross-module | Q13.1-Q13.8 | 2 calls |
214
300
 
215
301
  ### AskUserQuestion Format
216
302
 
@@ -265,7 +351,7 @@ AskUserQuestion({
265
351
 
266
352
  ## Elicitation Techniques
267
353
 
268
- > **Loaded by:** step-01-discover (Opus ULTRATHINK)
354
+ > **Loaded by:** step-01-analyse (Opus ULTRATHINK)
269
355
  > **Purpose:** Guide HOW to question, not just WHAT to ask.
270
356
 
271
357
  ### Technique 1: Solution → Problem Reframing
@@ -332,7 +418,7 @@ For every list answer, challenge completeness:
332
418
 
333
419
  ## ULTRATHINK
334
420
 
335
- Behavioral mode for critical phases (01, 02, 03, 05):
421
+ Behavioral mode for critical phases (01, 02, 04):
336
422
 
337
423
  ```
338
424
  ULTRATHINK MODE:
@@ -353,7 +439,21 @@ DO NOT:
353
439
 
354
440
  ---
355
441
 
356
- ## Context7 (Step 06)
442
+ ## Proactive Suggestions
443
+
444
+ After scope definition in step-01, the skill suggests complementary modules/sections:
445
+
446
+ 1. Analyze feature type and scope from questionnaire answers
447
+ 2. Load `patterns/suggestion-catalog.md`
448
+ 3. Match against catalog patterns
449
+ 4. Present suggestions via AskUserQuestion (accept/reject per suggestion)
450
+ 5. Store in feature.json.suggestions[]
451
+
452
+ Accepted suggestions become candidates for future /business-analyse runs.
453
+
454
+ ---
455
+
456
+ ## Context7 (Step 04)
357
457
 
358
458
  ```
359
459
  Prompt pattern:
@@ -400,53 +500,40 @@ Libraries:
400
500
 
401
501
  | Type | Path |
402
502
  |------|------|
403
- | Documentation | `web/smartstack-web/src/pages/docs/business/{app}/{module}/` |
503
+ | BA Feature | `docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json` |
504
+ | User Guide | `docs/business/{app}/{module}/user-guide/v{X.Y}/guide.json` |
404
505
  | i18n | `web/smartstack-web/src/i18n/locales/{lang}/` |
405
- | Route | `/docs/business/{app}/{module}` |
406
506
 
407
507
  ---
408
508
 
409
509
  ## State Persistence
410
510
 
411
- The `00-context.md` file persists state between steps:
412
-
413
- ```markdown
414
- # Business Analysis: {{feature_id}}
511
+ State is persisted in `feature.json.metadata` and `feature.json.metadata.steps`. Each step reads/writes via `ba-writer` and `ba-reader` agents.
415
512
 
416
- ## Progress
417
- | Step | Status | Started | Completed |
418
- |------|--------|---------|-----------|
419
- | 00-init | Complete | ... | ... |
420
- | 01-discover | In Progress | ... | - |
421
- ...
422
-
423
- ## State Variables
424
- | Variable | Value |
425
- |----------|-------|
426
- | feature_id | FEAT-001 |
427
- | application_name | Sales |
428
- ...
513
+ ```json
514
+ {
515
+ "metadata": {
516
+ "featureId": "FEAT-001",
517
+ "status": "analysed",
518
+ "steps": {
519
+ "00-init": { "completed": "2025-02-01T10:00:00Z" },
520
+ "01-analyse": { "completed": "2025-02-01T11:30:00Z" },
521
+ "02-specify": { "inProgress": true }
522
+ }
523
+ }
524
+ }
429
525
  ```
430
526
 
431
- **Read:** Each step starts by reading 00-context.md
432
- **Write:** Each step updates 00-context.md at the end
433
-
434
527
  ---
435
528
 
436
529
  ## Resume Workflow
437
530
 
438
531
  ```
439
- resume_workflow(task_id):
440
- 1. Search .business-analyse/ for matching feature
441
- 2. Read 00-context.md
442
- 3. Find last "Complete" step in Progress table
443
- 4. Return next step to load
444
-
445
- Example:
446
- /business-analyse -r FEAT-001
447
- → Reads .business-analyse/.../FEAT-001/00-context.md
448
- → Finds "01-discover: Complete, 02-analyse: Pending"
449
- → Loads step-02-analyse.md
532
+ resume_workflow(feat_id):
533
+ 1. ba-reader.findFeature(feat_id) latest feature.json
534
+ 2. Read feature.json.metadata.steps → find last completed step
535
+ 3. Load next step file
536
+ 4. If not found in docs/: fallback to .business-analyse/ (legacy)
450
537
  ```
451
538
 
452
539
  ---
@@ -455,9 +542,9 @@ Example:
455
542
 
456
543
  ```
457
544
  {STEP_NAME} - {feature_id}
458
- ├── Status: {Complete/In Progress}
459
- ├── Key metric: {value}
460
- ├── Output: {file created}
545
+ ├── Status: {status in feature.json}
546
+ ├── Section enriched: {discovery|analysis|specification|validation|handoff}
547
+ ├── feature.json: {path}
461
548
  └── Next: {next step name}
462
549
  ```
463
550
 
@@ -471,7 +558,7 @@ Example:
471
558
 
472
559
  ### Configuration
473
560
 
474
- Le champ `language` dans `.business-analyse/config.json` définit la langue :
561
+ Le champ `language` dans `feature.json.metadata.language` définit la langue :
475
562
 
476
563
  | Langue | Code | Défaut |
477
564
  |--------|------|--------|
@@ -487,14 +574,14 @@ Le champ `language` dans `.business-analyse/config.json` définit la langue :
487
574
  | Questions `AskUserQuestion` (labels, descriptions, options) | **OUI** — toujours dans `{language}` |
488
575
  | Reformulations et résumés de catégorie | **OUI** — toujours dans `{language}` |
489
576
  | Relances et follow-ups (Elicitation Guide) | **OUI** — traduire les probes à la volée |
490
- | Documents générés (discovery, BRD, FRD, handoff) | **OUI** — rédigés dans `{language}` |
577
+ | Documents générés (discovery, analysis, specification, handoff) | **OUI** — rédigés dans `{language}` |
491
578
  | Référence technique interne (patterns, architecture) | NON — reste en langue du fichier |
492
579
  | Noms de code (entités, permissions, paths) | NON — toujours en anglais (convention plateforme) |
493
580
 
494
581
  ### Règle
495
582
 
496
583
  ```
497
- 1. Lire {language} depuis 00-context.md (défaut: "fr")
584
+ 1. Lire {language} depuis feature.json.metadata.language (défaut: "fr")
498
585
  2. Adapter TOUTE communication AskUserQuestion dans {language}
499
586
  3. Les exemples de probes/relances dans les questionnaires sont en français
500
587
  → Si {language} ≠ "fr", les traduire à la volée
@@ -522,62 +609,6 @@ Le champ `language` dans `.business-analyse/config.json` définit la langue :
522
609
 
523
610
  ---
524
611
 
525
- ## Progressive Loading Benefits
526
-
527
- | Aspect | Before | After | Gain |
528
- |--------|--------|-------|------|
529
- | Questionnaire | 283 L (all) | 40-60 L (per category) | ~75% |
530
- | FRD Templates | 477 L (all) | 80-150 L (per type) | ~70% |
531
- | React Templates | 580 L (all) | 250-350 L (per need) | ~45% |
532
- | **Total/step** | ~1,340 L | ~300-400 L | **~70%** |
533
-
534
- ---
535
-
536
- ## Context Digest (Between Steps)
537
-
538
- Each step produces a compressed digest file (max 50 lines) at completion to reduce token usage in the next step.
539
-
540
- **File naming:** `{output_dir}/digest-{step_number}.md` (e.g., `digest-01.md`, `digest-02.md`)
541
-
542
- | Section | Max Lines | Content |
543
- |---------|-----------|---------|
544
- | Changes | 10 | Files modified with brief description |
545
- | Decisions | 10 | Key architectural decisions |
546
- | Findings | 10 | Issues found, patterns identified |
547
- | State | 5 | Updated state variables |
548
- | Next | 5 | What the next step needs to know |
549
-
550
- **Protocol:**
551
- - **Generate:** Each step writes `digest-{step_number}.md` before completing
552
- - **Read:** Next step reads `digest-{prev_step_number}.md` instead of full output files
553
- - **Resume mode (`-r`):** Reads full output files directly (digest is for progressive loading only)
554
- - **Step-00:** Does not read a digest (it is the first step)
555
- - **Step-00:** Generates `digest-00.md` with initial state variables and configuration
556
-
557
- **Template:**
558
- ```markdown
559
- # Digest: Step {NN} - {Step Name}
560
-
561
- ## Changes
562
- - {file}: {brief description}
563
-
564
- ## Decisions
565
- - {decision and rationale}
566
-
567
- ## Findings
568
- - {finding}
569
-
570
- ## State Updates
571
- | Variable | New Value |
572
- |----------|-----------|
573
- | {var} | {value} |
574
-
575
- ## For Next Step
576
- - {what the next step needs to know}
577
- ```
578
-
579
- ---
580
-
581
612
  ## Support
582
613
 
583
614
  Contact: **support@atlshub.ch**