@atlashub/smartstack-cli 3.4.0 → 3.4.1

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: step-00-init
3
- description: Initialize Business Analysis - Parse flags, route use case, create feature.json
3
+ description: Initialize Business Analysis - Auto-detect new/update, create feature.json
4
4
  next_step: steps/step-01-cadrage.md
5
5
  ---
6
6
 
@@ -8,182 +8,24 @@ next_step: steps/step-01-cadrage.md
8
8
 
9
9
  # Step 00: Initialize Business Analysis
10
10
 
11
- Initialize the business analysis workflow by parsing input flags, routing to the appropriate use case handler, and creating the initial feature.json structure.
11
+ Initialize the business analysis workflow by auto-detecting whether this is a new application or an update to an existing one, then creating the initial feature.json structure.
12
12
 
13
13
  ## Flow
14
14
 
15
- 1. Parse command flags and determine use case
16
- 2. Route to specialized handler (question, refactoring, micro, or new feature)
17
- 3. MCP health check (non-blocking)
18
- 4. Interactive mode (if enabled)
19
- 5. Validate business context
20
- 6. Determine application and module
21
- 7. Select language
22
- 8. Generate feature ID
23
- 9. Create output directory structure
24
- 10. Create initial feature.json
25
- 11. Update config
26
- 12. Display summary
27
- 13. Load next step
28
-
29
- ## Step 1: Parse Command Flags
30
-
31
- Parse all command-line arguments to determine execution mode and routing.
32
-
33
- ### Default Values
34
- ```yaml
35
- auto_mode: false
36
- economy_mode: false
37
- context: business
38
- question_mode: false
39
- refactor_mode: false
40
- micro_mode: false
41
- extract_mode: false
42
- application_mode: false # Multi-module application analysis
43
- ```
44
-
45
- ### Flag Parsing Rules
46
-
47
- | Flag | Long Form | Effect | Argument |
48
- |------|-----------|--------|----------|
49
- | `-a` | `--auto` | Enable auto mode | none |
50
- | `-e` | `--economy` | Enable economy mode | none |
51
- | `-A` | `--no-auto` | Disable auto mode | none |
52
- | `-E` | `--no-economy` | Disable economy mode | none |
53
- | `-q` | `--question` | Question mode | next arg = FEAT-ID, remaining = question text |
54
- | `-r` | `--refactor` | Refactoring mode | next arg = FEAT-ID, remaining = change description |
55
- | `-m` | `--micro` | Micro feature mode | none |
56
- | `-x` | `--extract` | Extract mode: import from interactive HTML export | next arg = JSON file path |
57
- | `-app` | `--application` | Application mode: multi-module analysis | none |
58
-
59
- **Remaining arguments after flag removal = feature_description**
60
-
61
- ### Set Use Case
62
- ```
63
- IF question_mode = true:
64
- use_case = "question"
65
- ELSE IF refactor_mode = true:
66
- use_case = "refactoring"
67
- ELSE IF extract_mode = true:
68
- use_case = "extract"
69
- ELSE IF micro_mode = true:
70
- use_case = "micro"
71
- ELSE:
72
- use_case = "new"
73
- ```
74
-
75
- ## Step 2: Use Case Routing
76
-
77
- Route execution based on the detected use case.
78
-
79
- ### Question Mode (-q)
80
- ```
81
- 1. Parse: question_mode = true, feat_id = first remaining arg, question_text = rest
82
- 2. Call ba-reader agent:
83
- - ba-reader.findFeatureByID(feat_id)
84
- - Retrieve existing feature.json
85
- 3. Call ba-reader.answerQuestion(feat_id, question_text)
86
- - Answer question from context
87
- 4. Display answer in user session
88
- 5. EXIT - no further steps
89
- ```
90
-
91
- **Example:**
92
- ```
93
- ba -q FEAT-001 "What are the main actors in this feature?"
94
- ```
95
-
96
- ### Refactoring Mode (-r)
97
- ```
98
- 1. Parse: refactor_mode = true, feat_id = first remaining arg, change_description = rest
99
- 2. Call ba-reader agent:
100
- - ba-reader.findFeatureByID(feat_id)
101
- - Load existing feature.json
102
- 3. Call ba-writer agent:
103
- - ba-writer.createVersion(feat_id, change_description)
104
- - Increment version (e.g., 1.0 -> 1.1)
105
- - Mark changeReason
106
- 4. Set use_case = "refactoring"
107
- 5. Set version = new version number
108
- 6. Set feature_id from loaded feature
109
- 7. Continue to Step 5 (context validation)
110
- 8. Continue to Step 9 (create output structure at new version)
111
- 9. Load step-01-analyse in delta mode (compare old vs new)
112
- ```
113
-
114
- **Example:**
115
- ```
116
- ba -r FEAT-001 "Add support for multi-language feature names"
117
- ```
118
-
119
- ### Micro Feature Mode (-m)
120
- ```
121
- 1. Set use_case = "micro"
122
- 2. Set feature_type = "micro"
123
- 3. Continue to standard init flow (Steps 5-9)
124
- 4. Load step-01-analyse in micro mode (simplified analysis)
125
- ```
126
-
127
- **Example:**
128
- ```
129
- ba -m "Add email notification on approval"
130
- ```
131
-
132
- ### Extract Mode (-x)
133
- ```
134
- 1. Parse: extract_mode = true, json_path = first remaining arg
135
- 2. Validate JSON file exists at {json_path}
136
- 3. Read JSON file content
137
- 4. Load step-06-extract.md with {json_data} = parsed content
138
- 5. EXIT after extraction — step-06 handles everything
139
- ```
140
-
141
- **Example:**
142
- ```
143
- ba -x ./docs/business/MyApp/ba-export.json
144
- ```
145
-
146
- > **Note:** The JSON file is the export from the interactive HTML document (`ba-interactive.html`).
147
- > The extract step maps ALL client data to feature.json format with zero information loss.
148
-
149
- ### Default Mode (New Feature)
150
- ```
151
- 1. Set use_case = "new"
152
- 2. Continue to standard init flow (Steps 5-9)
153
- 3. Load step-01-analyse in full mode
154
- ```
155
-
156
- **Example:**
157
- ```
158
- ba "Create order management system"
159
- ```
160
-
161
- ## Step 2B: Application Mode Detection
162
-
163
- **IF `-app` flag is set:**
164
- - Set `{workflow_mode}` = "application"
165
- - Set `{use_case}` = "application"
166
-
167
- **ELSE IF no explicit mode flag:**
168
- - Analyze `{feature_description}` for multi-module signals:
169
- - Keywords: "application", "system", "platform", "suite", "complet", "ensemble"
170
- - Multiple module mentions (3+ distinct functional areas)
171
- - Scope description spanning multiple domains
172
- - IF multi-module signals detected:
173
- ```
174
- AskUserQuestion:
175
- question: "Votre description semble couvrir plusieurs modules. Voulez-vous une analyse multi-module (application complète) ?"
176
- header: "Mode"
177
- options:
178
- - label: "Oui, analyse application"
179
- description: "Identifier les modules, les analyser un par un avec validation client"
180
- - label: "Non, module unique"
181
- description: "Traiter comme un seul module"
182
- ```
183
- - IF user confirms multi-module: Set `{workflow_mode}` = "application"
184
- - ELSE: Set `{workflow_mode}` = "module"
185
-
186
- ## Step 3: MCP Prerequisite Check (BLOCKING)
15
+ 1. MCP health check (blocking)
16
+ 2. Scan existing applications in `docs/business/`
17
+ 3. Auto-detect: new application or update
18
+ 4. Determine application name
19
+ 5. Select language
20
+ 6. Generate feature ID
21
+ 7. Create output directory structure
22
+ 8. Deploy JSON schemas
23
+ 9. Create master feature.json
24
+ 10. Update config
25
+ 11. Display summary
26
+ 12. Load next step
27
+
28
+ ## Step 1: MCP Prerequisite Check (BLOCKING)
187
29
 
188
30
  Verify MCP availability. **This check is BLOCKING** - the skill cannot proceed without MCP.
189
31
 
@@ -199,14 +41,9 @@ mcp__smartstack__validate_conventions({ checks: ["tables"] })
199
41
 
200
42
  | Result | Action |
201
43
  |--------|--------|
202
- | Success response | Set `mcp_available = true`, continue to Step 4 |
44
+ | Success response | Set `mcp_available = true`, continue to Step 2 |
203
45
  | Connection error / tool not found | **STOP EXECUTION** - display error below |
204
46
 
205
- **On success:**
206
- - Set `mcp_available = true`
207
- - Update `.claude/mcp-status.json` cache
208
- - Continue workflow
209
-
210
47
  **On failure (STOP):**
211
48
 
212
49
  ```
@@ -228,77 +65,105 @@ mcp__smartstack__validate_conventions({ checks: ["tables"] })
228
65
  ═══════════════════════════════════════════════════════════════
229
66
  ```
230
67
 
231
- **DO NOT** offer fallback modes, economy mode workarounds, or degraded execution.
232
- **DO NOT** continue to Step 4 or any subsequent step.
68
+ **DO NOT** continue to any subsequent step.
233
69
  **STOP the skill immediately.**
234
70
 
235
- ## Step 4: Validate Business Context
236
-
237
- Verify that the business context is properly configured.
71
+ ## Step 2: Scan Existing Applications
238
72
 
239
- **Check:**
240
- 1. Does `.business-analyse/config.json` exist?
241
- 2. Does it contain `businessContext` section?
242
- 3. Are required fields present?
73
+ Scan `docs/business/` for existing business analysis features.
243
74
 
244
- **If missing:**
245
- 1. Create fresh config with defaults
246
- 2. Prompt for business context (only in interactive mode)
247
- 3. Save to `.business-analyse/config.json`
75
+ ```
76
+ 1. Glob: docs/business/*/business-analyse/*/feature.json
77
+ 2. For each feature.json found:
78
+ - Read metadata.application, metadata.featureDescription
79
+ - Store: { app: string, featureId: string, description: string, version: string }
80
+ 3. Build list of existing applications
81
+ ```
248
82
 
249
- **Required config structure:**
250
- ```json
251
- {
252
- "businessContext": {
253
- "organization": "string",
254
- "domain": "string",
255
- "language": "string"
256
- }
257
- }
83
+ **Store:**
84
+ ```yaml
85
+ existing_apps: array of { app, featureId, description, version }
258
86
  ```
259
87
 
260
- ## Step 5: Determine Application and Module
88
+ ## Step 3: Auto-Detect New vs Update
89
+
90
+ Compare the user's `{feature_description}` with existing applications.
261
91
 
262
- Scan for existing applications and modules.
92
+ ```
93
+ IF existing_apps is empty:
94
+ workflow_type = "new"
95
+ → Go to Step 4
263
96
 
264
- **Scan location:** `docs/business/` (modern structure only)
97
+ IF existing_apps has entries:
98
+ Analyze {feature_description} for similarity with existing apps:
99
+ - Same application domain?
100
+ - References an existing module name?
101
+ - Mentions adding/changing/modifying something existing?
265
102
 
103
+ Ask via AskUserQuestion:
104
+ question: "J'ai trouvé des analyses existantes. Que souhaitez-vous faire ?"
105
+ header: "Mode"
106
+ options:
107
+ - label: "Nouvelle application"
108
+ description: "Créer une nouvelle analyse complète"
109
+ - label: "Mise à jour de {appName} (FEAT-NNN)"
110
+ description: "Enrichir ou modifier l'application existante (crée v{next})"
111
+ (repeat for each existing app, max 3 options + "Nouvelle application")
112
+
113
+ IF user selects "Nouvelle application":
114
+ workflow_type = "new"
115
+ ELSE:
116
+ workflow_type = "update"
117
+ existing_feature_id = selected app's featureId
118
+ Call ba-writer.createVersion(existing_feature_id, {feature_description})
119
+ version = new version number
266
120
  ```
267
- 1. List subdirectories in `docs/business/` = applications
268
- 2. For each app, list subdirectories = modules
269
- 3. IF no applications found:
270
- Will create new under docs/business/
121
+
122
+ **Store:**
123
+ ```yaml
124
+ workflow_type: "new" | "update"
125
+ existing_feature_id: string | null
126
+ version: "1.0" (new) | "1.1"+ (update)
271
127
  ```
272
128
 
273
- **Legacy structure (`.business-analyse/business/`) is NO LONGER SUPPORTED.**
129
+ ## Step 4: Determine Application Name
274
130
 
275
- **Logic:**
276
131
  ```
277
- IF auto_mode = true:
278
- application_name = first found app OR "default"
279
- module_name = first found module OR "default"
132
+ IF workflow_type = "update":
133
+ application_name = existing app name (from step 3)
280
134
  ELSE:
281
- Prompt: "Select application: [list]"
282
- Prompt: "Select module: [list]"
283
- OR: "Create new application: {name}"
284
- OR: "Create new module: {name}"
135
+ Analyze {feature_description} to extract application name
136
+ Ask via AskUserQuestion:
137
+ question: "Quel nom pour cette application ?"
138
+ header: "Application"
139
+ options:
140
+ - label: "{detected_name}"
141
+ description: "Nom détecté depuis votre description"
142
+ - label: "Autre"
143
+ description: "Saisir un nom personnalisé"
144
+ ```
145
+
146
+ **Validate business context:**
147
+ ```
148
+ validate_business_context("business")
149
+ → BA restricted to 'business' context only
285
150
  ```
286
151
 
287
152
  **Store:**
288
153
  ```yaml
289
154
  application_name: string
290
- module_name: string
155
+ context: "business"
291
156
  ```
292
157
 
293
- ## Step 6: Select Language
158
+ ## Step 5: Select Language
294
159
 
295
160
  Determine the language for analysis and code generation.
296
161
 
297
162
  **Check config:**
298
- - Retrieve `businessContext.language` from config
163
+ - Retrieve `language` from `.business-analyse/config.json`
299
164
  - Default: "fr" (Francais)
300
165
 
301
- **If not in config OR auto_mode = false:**
166
+ **If not in config:**
302
167
  ```
303
168
  Ask via AskUserQuestion:
304
169
  question: "Quelle langue pour l'analyse ?"
@@ -315,18 +180,17 @@ Ask via AskUserQuestion:
315
180
  language: string (code, e.g., "en", "fr")
316
181
  ```
317
182
 
318
- ## Step 7: Generate Feature ID
183
+ ## Step 6: Generate Feature ID
319
184
 
320
185
  Create a unique feature identifier.
321
186
 
322
- **Logic:**
323
187
  ```
324
- IF use_case = "question" OR "refactoring":
325
- feature_id = use provided feat_id (already parsed)
188
+ IF workflow_type = "update":
189
+ feature_id = existing_feature_id (from step 3)
326
190
  ELSE:
327
- feature_id = generate using pattern: FEAT-{timestamp-based}-{random}
328
- OR: FEAT-{app-short}-{seq-number}
329
- Example: FEAT-001, FEAT-002, ...
191
+ feature_id = generate_feature_id()
192
+ Read .business-analyse/config.json → lastFeatureId
193
+ Increment and format as FEAT-NNN
330
194
  ```
331
195
 
332
196
  **Store:**
@@ -334,32 +198,21 @@ ELSE:
334
198
  feature_id: string
335
199
  ```
336
200
 
337
- ## Step 8: Create Output Directory Structure
338
-
339
- Create the directory hierarchy for feature documentation.
201
+ ## Step 7: Create Output Directory Structure
340
202
 
341
- **For new features / micro / refactoring:**
342
203
  ```
343
- docs/business/{application_name}/{module_name}/business-analyse/v{version}/
344
- ```
345
-
346
- **Where version:**
347
- - New feature: "1.0"
348
- - Refactoring: from ba-writer (e.g., "1.1", "1.2")
349
- - Micro: "1.0"
350
-
351
- **Create directories:**
352
- ```bash
353
- mkdir -p docs/business/{app}/{module}/business-analyse/v{version}
204
+ IF workflow_type = "new":
205
+ mkdir -p docs/business/{application_name}/business-analyse/v1.0
206
+ ELSE:
207
+ Directory already exists from ba-writer.createVersion()
354
208
  ```
355
209
 
356
210
  **Store:**
357
211
  ```yaml
358
- docs_dir: "docs/business/{app}/{module}/business-analyse/v{version}"
359
- output_dir: same as docs_dir
212
+ docs_dir: "docs/business/{app}/business-analyse/v{version}"
360
213
  ```
361
214
 
362
- ## Step 8-bis: Deploy JSON Schemas to Project (MANDATORY)
215
+ ## Step 8: Deploy JSON Schemas to Project (MANDATORY)
363
216
 
364
217
  > **The JSON Schemas MUST be present in the project alongside the generated feature.json files.**
365
218
  > Without schemas, feature.json files cannot be validated and have no structural reference.
@@ -376,11 +229,11 @@ Cache file location: `docs/business/{app}/business-analyse/.schema-cache.json`
376
229
  IF EXISTS docs/business/{app}/business-analyse/.schema-cache.json:
377
230
  Read cache file
378
231
  IF cache.version == "{CLI_VERSION}" (from package.json):
379
- Display: "Schemas already deployed ({CLI_VERSION}) - skipping"
232
+ Display: "Schemas already deployed ({CLI_VERSION}) - skipping"
380
233
  SKIP deployment (trust cache)
381
- → Go to Step 10
234
+ → Go to Step 9
382
235
  ELSE:
383
- Display: "Schema version mismatch (cache: {cache.version}, current: {CLI_VERSION})"
236
+ Display: "Schema version mismatch (cache: {cache.version}, current: {CLI_VERSION})"
384
237
  Proceed to deployment
385
238
  ELSE:
386
239
  Display: "Deploying schemas (first time)..."
@@ -396,27 +249,21 @@ Destination: `docs/business/{app}/business-analyse/schemas/`
396
249
  Read and Write each file (preserving directory structure):
397
250
 
398
251
  docs/business/{app}/business-analyse/schemas/
399
- ├── feature-schema.json ← from schemas/feature-schema.json
400
- ├── application-schema.json ← from schemas/application-schema.json
252
+ ├── feature-schema.json
253
+ ├── application-schema.json
401
254
  ├── sections/
402
- │ ├── metadata-schema.json ← from schemas/sections/metadata-schema.json
403
- │ ├── discovery-schema.json ← from schemas/sections/discovery-schema.json
404
- │ ├── analysis-schema.json ← from schemas/sections/analysis-schema.json
405
- │ ├── specification-schema.json ← from schemas/sections/specification-schema.json
406
- │ ├── validation-schema.json ← from schemas/sections/validation-schema.json
407
- │ └── handoff-schema.json ← from schemas/sections/handoff-schema.json
255
+ │ ├── metadata-schema.json
256
+ │ ├── discovery-schema.json
257
+ │ ├── analysis-schema.json
258
+ │ ├── specification-schema.json
259
+ │ ├── validation-schema.json
260
+ │ └── handoff-schema.json
408
261
  └── shared/
409
- └── common-defs.json ← from schemas/shared/common-defs.json
262
+ └── common-defs.json
410
263
  ```
411
264
 
412
265
  **Total: 9 files to deploy.**
413
266
 
414
- **Implementation:**
415
- 1. Use Glob to find all `.json` files in `schemas/` directory (skill-relative)
416
- 2. For each file, Read from skill directory and Write to project directory
417
- 3. Preserve the subdirectory structure (sections/, shared/)
418
- 4. Display progress: "Deploying schema {i}/{total}: {filename}"
419
-
420
267
  **Step 3: Write cache file (after successful deployment)**
421
268
 
422
269
  ```json
@@ -437,30 +284,14 @@ docs/business/{app}/business-analyse/schemas/
437
284
  }
438
285
  ```
439
286
 
440
- Write to: `docs/business/{app}/business-analyse/.schema-cache.json`
441
-
442
- Display: "✓ Schemas deployed successfully (9 files)"
443
-
444
- **Store:**
445
- ```yaml
446
- schemas_dir: "docs/business/{app}/business-analyse/schemas"
447
- ```
448
-
449
- **Performance gain:**
450
- - First deployment: ~12 seconds (unchanged)
451
- - Subsequent deployments: **~0 seconds (skipped via cache)** ✨
452
- - Cache invalidation: automatic on skill version upgrade
453
-
454
287
  ## Step 9: Create Master feature.json
455
288
 
456
289
  Create the master feature document using ba-writer agent.
457
290
 
458
- **Use ba-writer agent:**
459
-
460
291
  ```
461
292
  ba-writer.createApplicationFeature({
462
293
  id: {feature_id},
463
- version: "1.0",
294
+ version: {version},
464
295
  scope: "application",
465
296
  status: "draft",
466
297
  metadata: {
@@ -468,11 +299,10 @@ ba-writer.createApplicationFeature({
468
299
  context: "business",
469
300
  language: {language},
470
301
  featureDescription: {feature_description},
471
- useCase: {use_case},
472
- mcpAvailable: {mcp_available},
473
- economyMode: {economy_mode},
302
+ workflowType: {workflow_type},
303
+ mcpAvailable: true,
474
304
  workflow: {
475
- mode: {workflow_mode},
305
+ mode: "application",
476
306
  moduleOrder: [],
477
307
  currentModuleIndex: 0,
478
308
  completedModules: [],
@@ -483,109 +313,29 @@ ba-writer.createApplicationFeature({
483
313
  ```
484
314
 
485
315
  **Output path:**
486
- - Application mode: `docs/business/{app}/business-analyse/v1.0/feature.json`
487
- - Module mode: `docs/business/{app}/business-analyse/v1.0/feature.json` (same - always create master first)
316
+ `docs/business/{app}/business-analyse/v{version}/feature.json`
488
317
 
489
- > **Note:** Even in single-module mode, we create the master feature.json. The decomposition step will trivially identify one module.
490
-
491
- **Result structure:**
492
- ```json
493
- {
494
- "$schema": "../schemas/application-schema.json",
495
- "id": "{feature_id}",
496
- "version": "1.0",
497
- "status": "draft",
498
- "metadata": {
499
- "createdAt": "{ISO timestamp}",
500
- "updatedAt": "{ISO timestamp}",
501
- "application": "{application_name}",
502
- "module": "{module_name}",
503
- "context": "business",
504
- "language": "{language}",
505
- "featureDescription": "{feature_description}",
506
- "featureType": null,
507
- "useCase": "{use_case}",
508
- "permissionBase": "business.{app}.{module}",
509
- "previousVersion": null,
510
- "changeReason": null,
511
- "mcpAvailable": {mcp_available},
512
- "economyMode": {economy_mode},
513
- "steps": {
514
- "init": {
515
- "status": "completed",
516
- "startedAt": "{ISO timestamp}",
517
- "completedAt": "{ISO timestamp}"
518
- },
519
- "analyse": {
520
- "status": "pending",
521
- "startedAt": null,
522
- "completedAt": null
523
- },
524
- "specify": {
525
- "status": "pending",
526
- "startedAt": null,
527
- "completedAt": null
528
- },
529
- "validate": {
530
- "status": "pending",
531
- "startedAt": null,
532
- "completedAt": null
533
- },
534
- "handoff": {
535
- "status": "pending",
536
- "startedAt": null,
537
- "completedAt": null
538
- }
539
- }
540
- },
541
- "discovery": {},
542
- "analysis": {},
543
- "specification": {},
544
- "validation": {},
545
- "handoff": {},
546
- "suggestions": [],
547
- "changelog": [
548
- {
549
- "version": "1.0",
550
- "timestamp": "{ISO timestamp}",
551
- "author": "BA Skill",
552
- "changes": ["Initial feature.json created"]
553
- }
554
- ]
555
- }
556
- ```
557
-
558
- **Write to:**
559
- ```
560
- {docs_dir}/feature.json
561
- ```
318
+ > **Note:** Always create the master feature.json first. Step-02 (decomposition) determines if it's single or multi-module.
562
319
 
563
320
  ## Step 10: Update Config
564
321
 
565
322
  Update `.business-analyse/config.json` with new feature information.
566
323
 
567
- **Update fields:**
568
324
  ```json
569
325
  {
570
326
  "currentFeature": {
571
327
  "id": "{feature_id}",
572
- "version": "1.0",
328
+ "version": "{version}",
573
329
  "docsDir": "{docs_dir}",
574
- "useCase": "{use_case}",
575
- "application": "{application_name}",
576
- "module": "{module_name}"
330
+ "workflowType": "{workflow_type}",
331
+ "application": "{application_name}"
577
332
  },
578
- "lastInitialized": "{ISO timestamp}",
579
- "autoMode": {auto_mode},
580
- "economyMode": {economy_mode}
333
+ "lastInitialized": "{ISO timestamp}"
581
334
  }
582
335
  ```
583
336
 
584
337
  ## Step 11: Display Summary
585
338
 
586
- Show initialization results in a clear table format.
587
-
588
- **Output:**
589
339
  ```
590
340
  ═══════════════════════════════════════════════════════════════
591
341
  BUSINESS ANALYSIS INITIALIZATION COMPLETE
@@ -593,67 +343,49 @@ Show initialization results in a clear table format.
593
343
 
594
344
  | Field | Value |
595
345
  |--------------------|----------------------------------------------|
596
- | Step | INIT (00) |
597
346
  | Feature ID | {feature_id} |
598
- | Use Case | {use_case} |
347
+ | Workflow | {workflow_type} |
599
348
  | Application | business/{application_name} |
600
- | Module | {module_name} |
601
349
  | Output Path | {docs_dir}/feature.json |
602
350
  | Language | {language} |
603
- | Auto Mode | {auto_mode} |
604
- | Economy Mode | {economy_mode} |
605
- | MCP Available | {mcp_available} |
606
- | Timestamp | {ISO timestamp} |
351
+ | Version | {version} |
352
+ | MCP Available | true |
607
353
 
608
- NEXT STEP: step-01-analyse ({use_case} mode)
354
+ NEXT STEP: step-01-cadrage
609
355
  ═══════════════════════════════════════════════════════════════
610
356
  ```
611
357
 
612
358
  ## Step 12: Load Next Step
613
359
 
614
- **All modes except question (-q), micro (-m), and extract (-x):**
615
360
  After showing initialization summary, proceed to `./step-01-cadrage.md`
616
361
 
617
- **Question mode (-q):** EXIT after ba-reader answers the question.
618
- **Micro mode (-m):** Load `./step-05a-handoff.md` directly.
619
- **Extract mode (-x):** Load `./step-06-extract.md` with `{json_data}` from parsed JSON file.
620
-
621
362
  **Pass context variables:**
622
363
  ```yaml
623
364
  feature_id: string
624
365
  feature_description: string
625
- use_case: "new" | "question" | "refactoring" | "micro" | "extract" | "application"
366
+ workflow_type: "new" | "update"
626
367
  application_name: string
627
- module_name: string
628
368
  language: string
629
369
  docs_dir: string
630
- auto_mode: boolean
631
- economy_mode: boolean
632
370
  mcp_available: boolean
633
- workflow_mode: string
371
+ workflow_mode: "application"
372
+ version: string
634
373
  ```
635
374
 
636
375
  ## Error Handling
637
376
 
638
- Handle common initialization failures gracefully.
639
-
640
377
  | Error | Action |
641
378
  |-------|--------|
642
379
  | Config missing | Create fresh with defaults, continue |
643
380
  | Directory creation fails | Check permissions, display error, EXIT |
644
381
  | feature.json creation fails | Validate ba-writer, retry or fallback |
645
- | Legacy structure detected | Offer migration to new docs/business/ structure |
646
382
  | Feature ID not unique | Generate new ID, retry |
647
- | Invalid language | Default to "en", warn user |
648
383
 
649
384
  ### Resume After Interruption
650
385
 
651
386
  If initialization was interrupted:
652
387
 
653
388
  1. Check `.business-analyse/config.json` for currentFeature
654
- 2. If feature ID exists, search for feature.json:
655
- - Primary: `docs/business/{app}/{module}/business-analyse/v{version}/`
656
- - Fallback: `.business-analyse/{app}/{module}/`
389
+ 2. If feature ID exists, search for feature.json in `docs/business/`
657
390
  3. If found, offer to resume from last completed step
658
391
  4. If not found, create fresh feature.json
659
-