@atlashub/smartstack-cli 3.32.0 → 3.34.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 (55) hide show
  1. package/.documentation/agents.html +5 -1
  2. package/.documentation/apex.html +644 -0
  3. package/.documentation/business-analyse.html +81 -1
  4. package/.documentation/cli-commands.html +5 -1
  5. package/.documentation/commands.html +5 -1
  6. package/.documentation/efcore.html +5 -1
  7. package/.documentation/gitflow.html +5 -1
  8. package/.documentation/hooks.html +5 -1
  9. package/.documentation/index.html +60 -2
  10. package/.documentation/init.html +5 -1
  11. package/.documentation/installation.html +5 -1
  12. package/.documentation/ralph-loop.html +365 -216
  13. package/.documentation/test-web.html +5 -1
  14. package/package.json +1 -1
  15. package/templates/agents/ba-writer.md +142 -15
  16. package/templates/skills/apex/SKILL.md +7 -1
  17. package/templates/skills/apex/_shared.md +49 -4
  18. package/templates/skills/{ralph-loop → apex}/references/core-seed-data.md +20 -11
  19. package/templates/skills/{ralph-loop → apex}/references/error-classification.md +2 -1
  20. package/templates/skills/apex/references/post-checks.md +238 -3
  21. package/templates/skills/apex/references/smartstack-api.md +47 -7
  22. package/templates/skills/apex/references/smartstack-frontend.md +47 -1
  23. package/templates/skills/apex/references/smartstack-layers.md +3 -1
  24. package/templates/skills/apex/steps/step-00-init.md +48 -1
  25. package/templates/skills/apex/steps/step-01-analyze.md +37 -0
  26. package/templates/skills/apex/steps/step-02-plan.md +36 -0
  27. package/templates/skills/apex/steps/step-03-execute.md +42 -2
  28. package/templates/skills/apex/steps/step-04-examine.md +110 -2
  29. package/templates/skills/business-analyse/SKILL.md +29 -19
  30. package/templates/skills/business-analyse/_module-loop.md +68 -9
  31. package/templates/skills/business-analyse/_shared.md +71 -21
  32. package/templates/skills/business-analyse/questionnaire/00-application.md +4 -2
  33. package/templates/skills/business-analyse/questionnaire/00b-project.md +85 -0
  34. package/templates/skills/business-analyse/references/deploy-modes.md +69 -0
  35. package/templates/skills/business-analyse/references/team-orchestration.md +158 -7
  36. package/templates/skills/business-analyse/schemas/application-schema.json +2 -1
  37. package/templates/skills/business-analyse/schemas/project-schema.json +490 -0
  38. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -1
  39. package/templates/skills/business-analyse/steps/step-00-init.md +30 -4
  40. package/templates/skills/business-analyse/steps/step-01-cadrage.md +62 -2
  41. package/templates/skills/business-analyse/steps/step-01b-applications.md +252 -0
  42. package/templates/skills/business-analyse/steps/step-02-decomposition.md +23 -6
  43. package/templates/skills/business-analyse/steps/step-03d-validate.md +27 -6
  44. package/templates/skills/business-analyse/steps/step-04a-collect.md +111 -0
  45. package/templates/skills/business-analyse/steps/step-05a-handoff.md +296 -103
  46. package/templates/skills/business-analyse/steps/step-05b-deploy.md +46 -14
  47. package/templates/skills/documentation/SKILL.md +92 -2
  48. package/templates/skills/ralph-loop/SKILL.md +9 -17
  49. package/templates/skills/ralph-loop/references/category-rules.md +43 -692
  50. package/templates/skills/ralph-loop/references/compact-loop.md +104 -427
  51. package/templates/skills/ralph-loop/references/team-orchestration.md +13 -14
  52. package/templates/skills/ralph-loop/steps/step-02-execute.md +49 -704
  53. package/templates/skills/ralph-loop/steps/step-03-commit.md +38 -79
  54. package/templates/skills/ralph-loop/steps/step-04-check.md +39 -58
  55. package/templates/skills/ralph-loop/steps/step-05-report.md +12 -123
@@ -0,0 +1,490 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "project-schema.json",
4
+ "title": "SmartStack Business Analysis - Project Level",
5
+ "description": "Master feature.json for multi-application project analysis. Published to docs/business-analyse/v{X.Y}/feature.json. Only created when 2+ applications are identified.",
6
+ "type": "object",
7
+ "required": ["id", "version", "status", "scope", "metadata"],
8
+ "properties": {
9
+ "id": {
10
+ "type": "string",
11
+ "pattern": "^PROJ-\\d{3,}$",
12
+ "description": "Unique project identifier (e.g., PROJ-001)"
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "pattern": "^\\d+\\.\\d+$",
17
+ "description": "Document version (e.g., 1.0, 1.1)"
18
+ },
19
+ "status": {
20
+ "type": "string",
21
+ "enum": ["draft", "framed", "decomposed", "specified", "consolidated", "handed-off"],
22
+ "description": "Project-level lifecycle status"
23
+ },
24
+ "scope": {
25
+ "type": "string",
26
+ "const": "project",
27
+ "description": "Marks this as a project-level feature.json (multi-application)"
28
+ },
29
+
30
+ "metadata": {
31
+ "type": "object",
32
+ "required": ["createdAt", "updatedAt", "projectName", "language"],
33
+ "properties": {
34
+ "createdAt": { "type": "string", "format": "date-time" },
35
+ "updatedAt": { "type": "string", "format": "date-time" },
36
+ "projectName": { "type": "string", "description": "Project name (e.g., Enterprise HR Platform)" },
37
+ "language": { "type": "string", "enum": ["fr", "en", "it", "de"] },
38
+ "featureDescription": { "type": "string", "description": "Original user description/brief" },
39
+ "workflowType": {
40
+ "type": "string",
41
+ "enum": ["new", "update"],
42
+ "description": "Whether this is a new project or an update"
43
+ },
44
+ "mcpAvailable": { "type": "boolean" },
45
+ "analysisMode": {
46
+ "type": "string",
47
+ "const": "interactive",
48
+ "description": "Analysis mode — always interactive"
49
+ },
50
+ "workflow": {
51
+ "type": "object",
52
+ "description": "Multi-application loop state",
53
+ "properties": {
54
+ "mode": { "type": "string", "const": "project" },
55
+ "applicationOrder": {
56
+ "type": "array",
57
+ "items": { "type": "string" },
58
+ "description": "Topologically sorted application codes"
59
+ },
60
+ "currentApplicationIndex": {
61
+ "type": "integer",
62
+ "minimum": 0,
63
+ "description": "Index into applicationOrder for current application being processed"
64
+ },
65
+ "completedApplications": {
66
+ "type": "array",
67
+ "items": { "type": "string" },
68
+ "description": "Application codes that have been fully specified (all modules done)"
69
+ },
70
+ "currentApplication": {
71
+ "type": ["string", "null"],
72
+ "description": "Code of the application currently being processed"
73
+ }
74
+ }
75
+ },
76
+ "steps": {
77
+ "type": "object",
78
+ "description": "Progress tracking per step",
79
+ "properties": {
80
+ "init": { "$ref": "#/$defs/stepStatus" },
81
+ "cadrage": { "$ref": "#/$defs/stepStatus" },
82
+ "applicationDecomposition": { "$ref": "#/$defs/stepStatus" },
83
+ "specify": { "$ref": "#/$defs/stepStatus" },
84
+ "consolidation": { "$ref": "#/$defs/stepStatus" },
85
+ "handoff": { "$ref": "#/$defs/stepStatus" }
86
+ }
87
+ }
88
+ }
89
+ },
90
+
91
+ "cadrage": {
92
+ "type": "object",
93
+ "description": "Enriched by step-01-cadrage: project-level global framing",
94
+ "properties": {
95
+ "problem": { "type": "string", "description": "Global business problem to solve" },
96
+ "asIs": { "type": "string", "description": "Current situation across all domains" },
97
+ "toBe": { "type": "string", "description": "Target situation for the full project" },
98
+ "trigger": { "type": "string", "description": "What triggered this project" },
99
+ "stakeholders": {
100
+ "type": "array",
101
+ "items": {
102
+ "type": "object",
103
+ "required": ["role"],
104
+ "properties": {
105
+ "role": { "type": "string" },
106
+ "function": { "type": "string" },
107
+ "involvement": { "type": "string", "enum": ["approver", "decision-maker", "consulted", "informed", "end-user"] },
108
+ "tasks": { "type": "array", "items": { "type": "string" } },
109
+ "frequency": { "type": "string" },
110
+ "painPoints": { "type": "array", "items": { "type": "string" } },
111
+ "applications": {
112
+ "type": "array",
113
+ "items": { "type": "string" },
114
+ "description": "Application codes this stakeholder is involved in (empty = all)"
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "globalScope": {
120
+ "type": "object",
121
+ "description": "Project-wide MoSCoW scope",
122
+ "properties": {
123
+ "mustHave": { "type": "array", "items": { "type": "string" } },
124
+ "shouldHave": { "type": "array", "items": { "type": "string" } },
125
+ "couldHave": { "type": "array", "items": { "type": "string" } },
126
+ "outOfScope": { "type": "array", "items": { "type": "string" } }
127
+ }
128
+ },
129
+ "globalRoles": {
130
+ "type": "array",
131
+ "description": "Cross-application roles (may span multiple applications)",
132
+ "items": {
133
+ "type": "object",
134
+ "required": ["role", "level"],
135
+ "properties": {
136
+ "role": { "type": "string", "description": "Role name (e.g., System Admin)" },
137
+ "description": { "type": "string" },
138
+ "level": { "type": "string", "enum": ["admin", "manager", "contributor", "viewer"] },
139
+ "applications": {
140
+ "type": "array",
141
+ "items": { "type": "string" },
142
+ "description": "Application codes this role applies to (empty = all)"
143
+ }
144
+ }
145
+ }
146
+ },
147
+ "risks": {
148
+ "type": "array",
149
+ "items": {
150
+ "type": "object",
151
+ "required": ["id", "type", "description"],
152
+ "properties": {
153
+ "id": { "type": "string", "pattern": "^RISK-\\d{3}$" },
154
+ "type": { "type": "string", "enum": ["business", "technical", "organizational"] },
155
+ "description": { "type": "string" },
156
+ "probability": { "type": "string", "enum": ["high", "medium", "low"] },
157
+ "impact": { "type": "string", "enum": ["high", "medium", "low"] },
158
+ "priority": { "type": "string", "enum": ["critical", "medium", "low"] },
159
+ "mitigation": { "type": "string" },
160
+ "applications": {
161
+ "type": "array",
162
+ "items": { "type": "string" },
163
+ "description": "Affected application codes (empty = project-wide)"
164
+ }
165
+ }
166
+ }
167
+ },
168
+ "acceptanceCriteria": {
169
+ "type": "array",
170
+ "items": {
171
+ "type": "object",
172
+ "required": ["id", "criterion"],
173
+ "properties": {
174
+ "id": { "type": "string", "pattern": "^AC-\\d{3}$" },
175
+ "criterion": { "type": "string" },
176
+ "validated": { "type": "boolean", "default": false }
177
+ }
178
+ }
179
+ },
180
+ "codebaseContext": {
181
+ "type": "string",
182
+ "description": "Summary of existing applications/modules found during pre-research"
183
+ },
184
+ "coverageMatrix": {
185
+ "type": "array",
186
+ "description": "Maps every requirement to an application and optionally a module",
187
+ "items": {
188
+ "type": "object",
189
+ "required": ["item", "category"],
190
+ "properties": {
191
+ "item": { "type": "string", "description": "Requirement from the original brief" },
192
+ "category": { "type": "string", "enum": ["mustHave", "shouldHave", "couldHave", "outOfScope", "implicit"] },
193
+ "application": { "type": ["string", "null"], "description": "Application code (null if cross-cutting)" },
194
+ "module": { "type": ["string", "null"], "description": "Module code (null if application-level)" },
195
+ "notes": { "type": "string" },
196
+ "anticipatedSections": {
197
+ "type": "array",
198
+ "items": { "type": "string" }
199
+ },
200
+ "anticipatedResources": {
201
+ "type": "array",
202
+ "items": { "type": "string" }
203
+ }
204
+ }
205
+ }
206
+ },
207
+ "deploymentModel": {
208
+ "type": "string",
209
+ "enum": ["together", "phased"],
210
+ "description": "Whether applications are deployed together or in phases"
211
+ },
212
+ "sharedInfrastructure": {
213
+ "type": "array",
214
+ "items": { "type": "string" },
215
+ "description": "Shared infrastructure concerns (e.g., SSO, notifications, shared DB)"
216
+ }
217
+ }
218
+ },
219
+
220
+ "applications": {
221
+ "type": "array",
222
+ "description": "Enriched by step-01b-applications: application registry",
223
+ "items": {
224
+ "type": "object",
225
+ "required": ["code", "name", "context"],
226
+ "properties": {
227
+ "code": { "type": "string", "description": "Application code (PascalCase, e.g., HumanResources)" },
228
+ "name": { "type": "string", "description": "Display name (e.g., Ressources Humaines)" },
229
+ "context": {
230
+ "type": "string",
231
+ "enum": ["business", "platform", "personal"],
232
+ "description": "Navigation context for this application"
233
+ },
234
+ "tablePrefix": {
235
+ "type": "string",
236
+ "pattern": "^[a-z]{2,5}_$",
237
+ "description": "Table prefix for this application (e.g., rh_, ess_)"
238
+ },
239
+ "icon": { "type": "string", "description": "Icon identifier for navigation" },
240
+ "description": { "type": "string" },
241
+ "applicationRoles": {
242
+ "type": "array",
243
+ "description": "Application-specific roles (inherited from globalRoles + specialized)",
244
+ "items": {
245
+ "type": "object",
246
+ "required": ["role", "level"],
247
+ "properties": {
248
+ "role": { "type": "string" },
249
+ "description": { "type": "string" },
250
+ "level": { "type": "string", "enum": ["admin", "manager", "contributor", "viewer"] },
251
+ "permissionPattern": { "type": "string" }
252
+ }
253
+ }
254
+ },
255
+ "scope": {
256
+ "type": "object",
257
+ "description": "Application-specific scope (subset of global scope)",
258
+ "properties": {
259
+ "mustHave": { "type": "array", "items": { "type": "string" } },
260
+ "shouldHave": { "type": "array", "items": { "type": "string" } },
261
+ "couldHave": { "type": "array", "items": { "type": "string" } }
262
+ }
263
+ },
264
+ "modules": {
265
+ "type": "array",
266
+ "items": { "type": "string" },
267
+ "description": "Module codes belonging to this application (populated during step-02)"
268
+ },
269
+ "dependencies": {
270
+ "type": "array",
271
+ "items": { "type": "string" },
272
+ "description": "Application codes this application depends on"
273
+ },
274
+ "status": {
275
+ "type": "string",
276
+ "enum": ["pending", "in-progress", "decomposed", "specified", "consolidated"],
277
+ "description": "Application processing status within the project"
278
+ },
279
+ "featureJsonPath": {
280
+ "type": ["string", "null"],
281
+ "description": "Path to the application-level feature.json once created"
282
+ },
283
+ "estimatedComplexity": {
284
+ "type": "string",
285
+ "enum": ["simple", "medium", "complex"]
286
+ }
287
+ }
288
+ }
289
+ },
290
+
291
+ "applicationDependencyGraph": {
292
+ "type": "object",
293
+ "description": "Enriched by step-01b-applications: inter-application dependency graph",
294
+ "properties": {
295
+ "edges": {
296
+ "type": "array",
297
+ "items": {
298
+ "type": "object",
299
+ "required": ["from", "to", "type"],
300
+ "properties": {
301
+ "from": { "type": "string", "description": "Dependent application code" },
302
+ "to": { "type": "string", "description": "Dependency application code" },
303
+ "type": {
304
+ "type": "string",
305
+ "enum": ["data-dependency", "shared-entity", "event", "auth-dependency"],
306
+ "description": "Nature of the inter-application dependency"
307
+ },
308
+ "description": { "type": "string" }
309
+ }
310
+ }
311
+ },
312
+ "topologicalOrder": {
313
+ "type": "array",
314
+ "items": { "type": "string" },
315
+ "description": "Applications sorted by dependency (foundations first)"
316
+ },
317
+ "layers": {
318
+ "type": "array",
319
+ "description": "Applications grouped by dependency depth",
320
+ "items": {
321
+ "type": "object",
322
+ "properties": {
323
+ "layer": { "type": "integer" },
324
+ "applications": { "type": "array", "items": { "type": "string" } }
325
+ }
326
+ }
327
+ }
328
+ }
329
+ },
330
+
331
+ "consolidation": {
332
+ "type": "object",
333
+ "description": "Enriched by step-04: cross-application and cross-module validation",
334
+ "properties": {
335
+ "crossApplicationInteractions": {
336
+ "type": "array",
337
+ "description": "Interactions between different applications",
338
+ "items": {
339
+ "type": "object",
340
+ "properties": {
341
+ "fromApplication": { "type": "string" },
342
+ "toApplication": { "type": "string" },
343
+ "interactionType": { "type": "string", "enum": ["shared-entity", "FK-reference", "event", "auth-delegation", "data-sync"] },
344
+ "description": { "type": "string" },
345
+ "entities": { "type": "array", "items": { "type": "string" } }
346
+ }
347
+ }
348
+ },
349
+ "crossModuleInteractions": {
350
+ "type": "array",
351
+ "items": {
352
+ "type": "object",
353
+ "properties": {
354
+ "fromApplication": { "type": "string" },
355
+ "fromModule": { "type": "string" },
356
+ "toApplication": { "type": "string" },
357
+ "toModule": { "type": "string" },
358
+ "interactionType": { "type": "string", "enum": ["FK-reference", "event-publish", "event-subscribe", "shared-lookup", "cascade-delete", "cascade-update"] },
359
+ "description": { "type": "string" },
360
+ "entities": { "type": "array", "items": { "type": "string" } }
361
+ }
362
+ }
363
+ },
364
+ "sharedEntities": {
365
+ "type": "array",
366
+ "items": {
367
+ "type": "object",
368
+ "properties": {
369
+ "entity": { "type": "string" },
370
+ "ownerApplication": { "type": "string" },
371
+ "ownerModule": { "type": "string" },
372
+ "referencedBy": {
373
+ "type": "array",
374
+ "items": {
375
+ "type": "object",
376
+ "properties": {
377
+ "application": { "type": "string" },
378
+ "module": { "type": "string" }
379
+ }
380
+ }
381
+ },
382
+ "sharedFields": { "type": "array", "items": { "type": "string" } }
383
+ }
384
+ }
385
+ },
386
+ "permissionCoherence": {
387
+ "type": "object",
388
+ "properties": {
389
+ "rolesConsistent": { "type": "boolean" },
390
+ "pathFormatConsistent": { "type": "boolean" },
391
+ "hierarchyRespected": { "type": "boolean" },
392
+ "crossAppConflicts": { "type": "array", "items": { "type": "string" } },
393
+ "warnings": { "type": "array", "items": { "type": "string" } }
394
+ }
395
+ },
396
+ "e2eFlows": {
397
+ "type": "array",
398
+ "items": {
399
+ "type": "object",
400
+ "properties": {
401
+ "name": { "type": "string" },
402
+ "applications": { "type": "array", "items": { "type": "string" } },
403
+ "modules": { "type": "array", "items": { "type": "string" } },
404
+ "steps": {
405
+ "type": "array",
406
+ "items": {
407
+ "type": "object",
408
+ "properties": {
409
+ "application": { "type": "string" },
410
+ "module": { "type": "string" },
411
+ "action": { "type": "string" },
412
+ "permission": { "type": "string" },
413
+ "dataFlow": { "type": "string" }
414
+ }
415
+ }
416
+ }
417
+ }
418
+ }
419
+ },
420
+ "globalRiskAssessment": {
421
+ "type": "array",
422
+ "items": {
423
+ "type": "object",
424
+ "properties": {
425
+ "risk": { "type": "string" },
426
+ "category": { "type": "string", "enum": ["coupling", "complexity", "dependency-chain", "security", "scope", "cross-app-coupling"] },
427
+ "severity": { "type": "string", "enum": ["critical", "high", "medium", "low"] },
428
+ "mitigation": { "type": "string" }
429
+ }
430
+ }
431
+ },
432
+ "decision": {
433
+ "type": "object",
434
+ "properties": {
435
+ "approved": { "type": "boolean" },
436
+ "reason": { "type": "string" },
437
+ "approvedBy": { "type": "string" },
438
+ "approvedAt": { "type": "string", "format": "date-time" }
439
+ }
440
+ }
441
+ }
442
+ },
443
+
444
+ "suggestions": {
445
+ "type": "array",
446
+ "description": "Proactive AI suggestions for complementary applications/modules",
447
+ "items": {
448
+ "type": "object",
449
+ "required": ["type", "code", "reason"],
450
+ "properties": {
451
+ "type": { "type": "string", "enum": ["application", "module", "integration", "enhancement"] },
452
+ "code": { "type": "string" },
453
+ "title": { "type": "string" },
454
+ "reason": { "type": "string" },
455
+ "targetApplication": { "type": ["string", "null"], "description": "Application code for module-level suggestions" },
456
+ "accepted": { "type": ["boolean", "null"] }
457
+ }
458
+ }
459
+ },
460
+
461
+ "changelog": {
462
+ "type": "array",
463
+ "description": "Version history and change tracking",
464
+ "items": {
465
+ "type": "object",
466
+ "required": ["timestamp", "changes"],
467
+ "properties": {
468
+ "step": { "type": "string" },
469
+ "version": { "type": "string" },
470
+ "timestamp": { "type": "string", "format": "date-time" },
471
+ "author": { "type": "string" },
472
+ "changes": { "type": "array", "items": { "type": "string" } },
473
+ "warnings": { "type": "array", "items": { "type": "string" } },
474
+ "decision": { "type": "string" }
475
+ }
476
+ }
477
+ }
478
+ },
479
+
480
+ "$defs": {
481
+ "stepStatus": {
482
+ "type": "object",
483
+ "properties": {
484
+ "status": { "type": "string", "enum": ["pending", "in-progress", "completed", "skipped"] },
485
+ "startedAt": { "type": ["string", "null"], "format": "date-time" },
486
+ "completedAt": { "type": ["string", "null"], "format": "date-time" }
487
+ }
488
+ }
489
+ }
490
+ }
@@ -13,7 +13,8 @@
13
13
  "updatedAt": { "type": "string", "format": "date-time" },
14
14
  "application": { "type": "string", "description": "Application name (PascalCase)" },
15
15
  "module": { "type": "string", "description": "Module name (PascalCase)" },
16
- "context": { "type": "string", "const": "business" },
16
+ "context": { "type": "string", "enum": ["business", "platform", "personal"], "description": "Navigation context (inherited from application)" },
17
+ "projectRef": { "type": ["string", "null"], "description": "Parent project ID (PROJ-XXX) when part of a multi-application project" },
17
18
  "language": { "type": "string", "enum": ["fr", "en", "it", "de"] },
18
19
  "featureDescription": { "type": "string" },
19
20
  "featureType": {
@@ -85,7 +85,8 @@ mcp__smartstack__validate_conventions({ checks: ["tables"] })
85
85
 
86
86
  Execute workflow detection algorithm:
87
87
  1. **Review Mode Detection:** Check if `{feature_description}` starts with `-review`
88
- 2. **Existing Applications Scanner:** Glob `docs/business/*/business-analyse/*/feature.json`
88
+ 2. **Existing Projects Scanner:** Glob `docs/business-analyse/*/feature.json` (project-level)
89
+ 2b. **Existing Applications Scanner:** Glob `docs/business/*/business-analyse/*/feature.json` + `docs/platform/*/business-analyse/*/feature.json` + `docs/personal/*/business-analyse/*/feature.json`
89
90
  3. **Similarity Analysis:** Score user intent against existing apps (>= 80 = strong match)
90
91
  4. **Decision Tree:** Prompt user with relevant options
91
92
 
@@ -119,11 +120,15 @@ ELSE:
119
120
  ```yaml
120
121
  workflow_type: "new" | "update" | "review"
121
122
  existing_feature_id: string | null
123
+ existing_project_id: string | null # PROJ-NNN if resuming a project
122
124
  version: "1.0" (new) | "1.1"+ (update)
123
125
  review_json_path: string | null (review only)
124
126
  existing_apps: array of { app, featureId, description, version }
127
+ existing_projects: array of { projectName, projectId, applications[], version }
125
128
  ```
126
129
 
130
+ > **Project Resume Detection:** If a project-level feature.json is found at `docs/business-analyse/*/feature.json`, check its `metadata.workflow` to determine resume point. The project may have partially completed applications.
131
+
127
132
  ## Step 4: Determine Application Name
128
133
 
129
134
  ```
@@ -372,9 +377,11 @@ version: string
372
377
 
373
378
  If initialization was interrupted:
374
379
 
375
- 1. Check `.business-analyse/config.json` for currentFeature
376
- 2. If feature ID exists, search for feature.json in `docs/business/`
377
- 3. If found, check status and `metadata.workflow.lastCompletedStep`:
380
+ 1. Check `.business-analyse/config.json` for currentFeature or currentProject
381
+ 2. If project ID exists, search for project feature.json in `docs/business-analyse/`
382
+ - If found with scope = "project": resume project mode (see Project Resume below)
383
+ 3. If feature ID exists, search for feature.json in `docs/business/`, `docs/platform/`, `docs/personal/`
384
+ 4. If found, check status and `metadata.workflow.lastCompletedStep`:
378
385
 
379
386
  **Status-based resume routing (check in this order):**
380
387
 
@@ -401,3 +408,22 @@ If initialization was interrupted:
401
408
  - Otherwise: offer to resume from last completed step
402
409
 
403
410
  4. If not found, create fresh feature.json
411
+
412
+ **Project Resume (project mode):**
413
+
414
+ If a project-level feature.json is found (scope = "project"):
415
+
416
+ - If status = `"draft"` or `"framed"`:
417
+ → Resume at `step-01-cadrage.md` or `step-01b-applications.md`
418
+
419
+ - If status = `"decomposed"`:
420
+ → Check `metadata.workflow.currentApplicationIndex` and `completedApplications[]`
421
+ → Resume module specification for current application (step-02 or step-03)
422
+
423
+ - If status = `"specified"`:
424
+ → All applications specified → Resume at `step-04a-collect.md`
425
+
426
+ - If status = `"consolidated"`:
427
+ → Resume at `step-05a-handoff.md`
428
+
429
+ Follow `_module-loop.md` "Project Mode (multi app)" resume logic for detailed routing.
@@ -720,7 +720,66 @@ ba-writer.enrichSection({
720
720
  ba-writer.updateStatus({feature_id}, "framed")
721
721
  ```
722
722
 
723
- ### 9. Display Summary
723
+ ### 9. Multi-Application Detection (NEW)
724
+
725
+ > **Analyze whether the project spans multiple independent applications.**
726
+
727
+ After coverage matrix is validated, check if the identified functional domains suggest multiple applications:
728
+
729
+ **Detection triggers (ANY of these = suggest multi-app):**
730
+ - Coverage matrix entries reference different navigation contexts (business + personal + platform)
731
+ - User mentioned "multiple applications", "several apps", "cross-platform"
732
+ - Functional domains form clearly independent applications with separate user bases
733
+ - Stakeholders only interact with specific domains (not shared across all)
734
+
735
+ **IF detection triggers matched:**
736
+
737
+ Display analysis as markdown:
738
+ ```
739
+ {language == "fr"
740
+ ? "### Analyse multi-application\n\nD'après mon analyse, ce projet couvre plusieurs domaines fonctionnels qui pourraient former des applications indépendantes :\n\n"
741
+ : "### Multi-Application Analysis\n\nBased on my analysis, this project spans multiple functional domains that could form independent applications:\n\n"}
742
+
743
+ | Domain | Suggested Context | Suggested Application | Key Modules |
744
+ |--------|-------------------|----------------------|-------------|
745
+ {for each identified domain: domain name | business/platform/personal | PascalCase name | top modules}
746
+ ```
747
+
748
+ Ask via AskUserQuestion:
749
+ ```
750
+ question: "{language == 'fr' ? 'Ce projet constitue-t-il une seule application ou plusieurs applications distinctes ?' : 'Is this a single application or multiple independent applications?'}"
751
+ header: "Architecture"
752
+ options:
753
+ - label: "{language == 'fr' ? 'Application unique' : 'Single application'}"
754
+ description: "{language == 'fr' ? 'Tous les domaines forment une seule application avec plusieurs modules' : 'All domains form one application with multiple modules'}"
755
+ - label: "{language == 'fr' ? 'Applications multiples' : 'Multiple applications'}"
756
+ description: "{language == 'fr' ? 'Chaque domaine est une application indépendante (navigation, rôles et préfixe de table séparés)' : 'Each domain is an independent application (separate navigation, roles, and table prefix)'}"
757
+ ```
758
+
759
+ **IF "Multiple applications":**
760
+ 1. Create project-level feature.json:
761
+ ```
762
+ ba-writer.createProjectFeature({
763
+ metadata: {
764
+ projectName: {project_name derived from feature_description},
765
+ language: {language},
766
+ featureDescription: {feature_description}
767
+ },
768
+ cadrage: {cadrage data already collected in this step}
769
+ })
770
+ ```
771
+ 2. Set `workflow.mode = "project"` in project feature.json
772
+ 3. Load `questionnaire/00b-project.md` for additional project-level questions
773
+ 4. Load `steps/step-01b-applications.md` for application decomposition
774
+ 5. **STOP — DO NOT load step-02**
775
+
776
+ **IF "Single application":**
777
+ → Continue to step 10 (display summary) and step-02 as usual.
778
+
779
+ **IF no detection triggers matched:**
780
+ → Skip this section entirely — continue to step 10 (display summary).
781
+
782
+ ### 10. Display Summary
724
783
 
725
784
  ```
726
785
  ## Cadrage Complete - {feature_id}
@@ -748,4 +807,5 @@ ba-writer.updateStatus({feature_id}, "framed")
748
807
 
749
808
  ## NEXT STEP
750
809
 
751
- Load: `./step-02-decomposition.md`
810
+ **IF workflow.mode === "project":** Load: `./step-01b-applications.md`
811
+ **ELSE:** Load: `./step-02-decomposition.md`