@atlashub/smartstack-cli 3.2.0 → 3.3.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.
Files changed (33) hide show
  1. package/dist/index.js +605 -25
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/agents/ba-reader.md +1 -1
  5. package/templates/agents/ba-writer.md +8 -1
  6. package/templates/skills/business-analyse/SKILL.md +21 -23
  7. package/templates/skills/business-analyse/_architecture.md +123 -0
  8. package/templates/skills/business-analyse/_elicitation.md +206 -0
  9. package/templates/skills/business-analyse/_module-loop.md +56 -0
  10. package/templates/skills/business-analyse/_shared.md +75 -531
  11. package/templates/skills/business-analyse/_suggestions.md +34 -0
  12. package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
  13. package/templates/skills/business-analyse/questionnaire.md +2 -2
  14. package/templates/skills/business-analyse/react/components.md +1 -1
  15. package/templates/skills/business-analyse/react/schema.md +1 -1
  16. package/templates/skills/business-analyse/references/html-data-mapping.md +294 -0
  17. package/templates/skills/business-analyse/schemas/feature-schema.json +1 -1
  18. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  19. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +1 -1
  20. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  21. package/templates/skills/business-analyse/steps/step-00-init.md +13 -10
  22. package/templates/skills/business-analyse/steps/step-01-cadrage.md +2 -0
  23. package/templates/skills/business-analyse/steps/step-02-decomposition.md +5 -3
  24. package/templates/skills/business-analyse/steps/{step-03-specify.md → step-03a-specify.md} +16 -606
  25. package/templates/skills/business-analyse/steps/step-03b-compile.md +670 -0
  26. package/templates/skills/business-analyse/steps/step-04-consolidation.md +7 -5
  27. package/templates/skills/business-analyse/steps/step-05a-handoff.md +727 -0
  28. package/templates/skills/business-analyse/steps/step-05b-deploy.md +479 -0
  29. package/templates/skills/business-analyse/steps/step-06-extract.md +4 -2
  30. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  31. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +161 -0
  32. package/templates/skills/business-analyse/templates/tpl-progress.md +171 -0
  33. package/templates/skills/business-analyse/steps/step-05-handoff.md +0 -1682
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -357,7 +357,7 @@ This agent provides context for:
357
357
  - **feature-full**: Source for comprehensive feature documentation
358
358
  - **Code generation**: Permission paths and entity definitions
359
359
  - **ba-writer**: Finding features for enrichment operations
360
- - **step-03-specify**: Completed module summaries for cross-module references
360
+ - **step-03a-specify**: Completed module summaries for cross-module references
361
361
  - **step-04-consolidation**: Application context and module summaries for cross-module validation
362
362
  - Other skills needing business analysis context
363
363
 
@@ -44,6 +44,13 @@ Create an initial feature.json with metadata and draft status.
44
44
  - For module scope: discovery: {}, analysis: {}, specification: {}, validation: {}, handoff: {}, suggestions: [], applicationContext: {}
45
45
  5. Update `.business-analyse/config.json` with new lastFeatureId
46
46
  6. Append entry to changelog
47
+ 7. IF scope = "module" AND applicationRef provided AND moduleCode provided:
48
+ a. Read master feature.json (via applicationRef FEAT-NNN)
49
+ b. Find module in modules[] where code === moduleCode
50
+ c. Set module.featureJsonPath to the relative path of the created feature.json
51
+ (relative from BA root, e.g. "modules/{moduleCode}/business-analyse/v{X.Y}/feature.json")
52
+ d. Write master feature.json back
53
+ 8. Return feature ID, path, and confirmation
47
54
 
48
55
  ### createApplicationFeature
49
56
  Create a master application-level feature.json. Shorthand for `create` with `scope: "application"`.
@@ -152,7 +159,7 @@ Update the status of a specific module in the master feature.json.
152
159
  **Input:**
153
160
  - featureId: FEAT-NNN of the master
154
161
  - moduleCode: string (PascalCase module code)
155
- - status: "pending" | "in-progress" | "specified" | "validated"
162
+ - status: "pending" | "in-progress" | "specified" | "validated" | "handed-off"
156
163
 
157
164
  **Process:**
158
165
  1. Find master feature.json
@@ -1,17 +1,16 @@
1
1
  ---
2
2
  name: business-analyse
3
- description: Business Analysis v6.1 - Iterative multi-module workflow with optimized performance (schema caching), automatic skill launch transition, and streamlined execution.
3
+ description: Iterative multi-module business analysis with progressive context loading, JSON-first architecture, and interactive HTML deliverables.
4
4
  argument-hint: "[-a] [-e] [-q <FEAT-ID> \"question\"] [-r <FEAT-ID> \"change\"] [-m] [-x <json-path>] <feature description>"
5
5
  ---
6
6
 
7
7
  <objective>
8
8
  Execute VibeCoding-focused business analysis workflows. This skill produces a single feature.json progressively enriched at each step, published to docs/business/ for web app rendering. Supports 5 use cases: new feature analysis, questions about existing features, feature refactoring, one-shot micro-features, and extraction from interactive HTML documentation.
9
9
 
10
- **New in v6.1:**
11
- - **Performance:** Schema deployment caching (~75% faster subsequent runs)
12
- - 🚀 **Seamless transition:** Automatic launch of chosen development approach (Ralph Loop / Feature Full)
13
- - 🎯 **Simplified:** Removed interactive mode (-i flag), streamlined execution
14
- - 📂 **Modern only:** Legacy `.business-analyse/` structure no longer supported
10
+ **Architecture highlights:**
11
+ - Conditional context loading: each step loads only the shared files it needs (~54% context reduction)
12
+ - Split long steps for reliability: 03→03a+03b, 05→05a+05b with self-verification at transitions
13
+ - Templates and references extracted to separate files, loaded on demand
15
14
  </objective>
16
15
 
17
16
  <quick_start>
@@ -174,16 +173,13 @@ When provided, step-00 will:
174
173
  - **Step 00:** Parse flags, create master feature.json (draft)
175
174
  - **Step 01:** Cadrage: context, stakeholders, scope, application roles (framed)
176
175
  - **Step 02:** Decomposition: modules, dependencies, client checkpoint (decomposed)
177
- - **Step 03:** Iterative specification per module (specified)
178
- - For each module in dependency order:
179
- - Walk through sections & resources with client
180
- - Propose ASCII/SVG mockups per section
181
- - Define entities + business rules
182
- - Generate specification (UC, FR, permissions, SeedData)
183
- - Per-module validation + client confirmation
176
+ - **Step 03a:** Interactive specification per module: sections, wireframes, entities, BR, use cases
177
+ - **Step 03b:** Compilation: write spec to feature.json, validate, deploy HTML, loop decision
178
+ - Loop: 03a 03b 03a (next module) until all specified (specified)
184
179
  - **Step 04:** Cross-module consolidation (consolidated)
185
- - **Step 05:** Handoff with per-module prd.json (handed-off)
186
- - **NEW v6.1:** User chooses development approach (AskUserQuestion)
180
+ - **Step 05a:** Build handoff data: file mapping, BR-to-code, API summary, write to feature.json
181
+ - **Step 05b:** Deploy artifacts: prd.json, progress.txt, HTML, manifest, user choice (handed-off)
182
+ - User chooses development approach (AskUserQuestion)
187
183
  - **If "Ralph Loop":** Automatic launch → `/ralph-loop` (seamless transition)
188
184
  - **If "Feature Full":** Automatic launch → `/feature-full` (parallel generation)
189
185
  - **If "Terminer":** BA ends, manual development
@@ -192,15 +188,13 @@ When provided, step-00 will:
192
188
  - **Step 00:** Parse flags, create master feature.json (draft)
193
189
  - **Step 01:** Cadrage: context, stakeholders, scope, roles (framed)
194
190
  - **Step 02:** Decomposition: trivial (1 module), quick checkpoint (decomposed)
195
- - **Step 03:** Specification: single iteration (specified)
191
+ - **Step 03a → 03b:** Specification: single iteration (specified)
196
192
  - **Step 04:** Consolidation: auto-pass (consolidated)
197
- - **Step 05:** Handoff (handed-off)
198
- - **NEW v6.1:** Automatic skill launch based on user choice
193
+ - **Step 05a → 05b:** Handoff + deploy (handed-off)
199
194
 
200
195
  **Micro workflow:**
201
196
  - **Step 00:** Create minimal feature.json
202
- - **Step 05:** Direct handoff (skip 01-04)
203
- - **NEW v6.1:** Automatic skill launch
197
+ - **Step 05a → 05b:** Direct handoff + deploy (skip 01-04)
204
198
 
205
199
  **Extract workflow (from interactive HTML):**
206
200
  - **Step 00:** Parse `-x` flag, validate JSON file
@@ -241,9 +235,11 @@ When provided, step-00 will:
241
235
  | 00 | `steps/step-00-init.md` | Haiku | Parse flags, route use case, create master feature.json |
242
236
  | 01 | `steps/step-01-cadrage.md` | Opus | Framing: context, stakeholders, scope, application roles |
243
237
  | 02 | `steps/step-02-decomposition.md` | Sonnet | Module decomposition, dependency graph, client checkpoint |
244
- | 03 | `steps/step-03-specify.md` | Opus | Iterative per-module specification + validation |
238
+ | 03a | `steps/step-03a-specify.md` | Opus | Per-module specification: interactive phase (sections, entities, BR, wireframes, use cases) |
239
+ | 03b | `steps/step-03b-compile.md` | Opus | Per-module compilation: write spec, validate, HTML deploy, loop decision |
245
240
  | 04 | `steps/step-04-consolidation.md` | Sonnet | Cross-module validation, E2E flows, permissions coherence |
246
- | 05 | `steps/step-05-handoff.md` | Opus | Development prompt + Ralph Loop prd.json |
241
+ | 05a | `steps/step-05a-handoff.md` | Sonnet | Build handoff data, write to module + master feature.json |
242
+ | 05b | `steps/step-05b-deploy.md` | Sonnet | Generate prd.json, progress.txt, deploy HTML, manifest, user choice |
247
243
  | 06 | `steps/step-06-extract.md` | Sonnet | Extract interactive HTML export → feature.json |
248
244
 
249
245
  </step_files>
@@ -288,13 +284,15 @@ Load ONLY relevant categories based on feature type:
288
284
  | spec | `templates/tpl-frd.md` | 02 |
289
285
  | handoff | `templates/tpl-handoff.md` | 04 |
290
286
  | suggestions | `patterns/suggestion-catalog.md` | 01 |
291
- | interactive | `html/ba-interactive.html` | 05 (deploy) |
287
+ | interactive | `html/ba-interactive.html` | 03b (incremental), 05b (final deploy) |
292
288
 
293
289
  </template_files>
294
290
 
295
291
  <execution_rules>
296
292
 
297
293
  - **Load one step at a time** - Only load the current step file
294
+ - **Load shared files conditionally** - Each step loads only the _shared files it needs (see step headers)
295
+ - **Reference files on demand** - Templates and mappings in references/ and templates/ are loaded only when needed
298
296
  - **ULTRATHINK** for steps 01, 02, 04 (critical thinking)
299
297
  - **State persisted in feature.json** (NOT markdown files)
300
298
  - **Use ba-writer agent** for all JSON writes
@@ -0,0 +1,123 @@
1
+ # Business Analysis - SmartStack Architecture Reference (_architecture.md)
2
+
3
+ > **Loaded by:** step-01-cadrage, step-03a-specify, step-05a-handoff
4
+ > **Purpose:** Provide architectural context for relevant questions and aligned recommendations
5
+
6
+ ---
7
+
8
+ ## 5 Couches (Clean Architecture)
9
+
10
+ | Couche | Projet | Contenu | Impact BA |
11
+ |--------|--------|---------|-----------|
12
+ | **Domain** | `SmartStack.Domain` | Entites, enums, interfaces | Entites identifiees en discovery |
13
+ | **Application** | `SmartStack.Application` | CQRS (Commands/Queries), validations, DTOs | Use cases de la specification |
14
+ | **Infrastructure** | `SmartStack.Infrastructure` | EF Core, services externes, jobs | Integrations et contraintes techniques |
15
+ | **API** | `SmartStack.API` | Controllers REST, permissions | Endpoints et securite |
16
+ | **Web** | `smartstack-web` | React 19, pages, composants | UI/UX et navigation |
17
+
18
+ ---
19
+
20
+ ## Classes de Base des Entites
21
+
22
+ | Classe | Interface | Champs auto-inclus | Quand utiliser |
23
+ |--------|-----------|---------------------|----------------|
24
+ | `BaseEntity` | - | `Id` (Guid), `TenantId`, `CreatedAt`, `UpdatedAt` | **Defaut pour toute entite metier** |
25
+ | `BaseEntity` | `IAuditableEntity` | + `CreatedBy`, `UpdatedBy` | Entite avec audit complet |
26
+ | `SystemEntity` | - | `Id` (Guid), `CreatedAt` (pas de TenantId) | Entites systeme (navigation, permissions) |
27
+ | `BaseEntity` | `ISoftDeletable` | + `IsDeleted`, `DeletedBy`, `DeletedAt` | Entite avec suppression logique |
28
+ | `HierarchicalEntity` | - | + `ParentId`, `Level`, `Path` | Arborescences (categories, menus) |
29
+
30
+ > **IMPORTANT :** Ne JAMAIS proposer `CreatedBy`, `UpdatedBy`, `IsDeleted`, `TenantId` comme champs explicites — ils sont AUTOMATIQUES via la classe de base ou l'interface.
31
+
32
+ ---
33
+
34
+ ## Services d'Integration Disponibles
35
+
36
+ | Service | Interface | Quand le proposer |
37
+ |---------|-----------|-------------------|
38
+ | Notifications in-app | `INotificationService` | Alertes, evenements, rappels |
39
+ | Workflow automatise | `IWorkflowService` | Emails transactionnels, webhooks, actions chainees |
40
+ | Completion IA | `IAICompletionService` | Suggestions, classification, generation contenu |
41
+ | SignalR temps reel | `IHubContext<BusinessHub>` | Mises a jour en temps reel |
42
+ | Jobs planifies | Hangfire `IBackgroundJobClient` | Traitements differes, purges, imports |
43
+
44
+ ---
45
+
46
+ ## Conventions Base de Donnees
47
+
48
+ | Aspect | Convention | Exemple |
49
+ |--------|------------|---------|
50
+ | Schema | `core` (socle SmartStack) vs `extensions` (entites client/metier) | `core.auth_Roles`, `nav_Applications`, `supp_Tickets` |
51
+ | Tables | `{prefix}_{EntityPlural}` (prefixe domaine + PascalCase pluriel) | `auth_Users`, `nav_Applications`, `supp_Tickets` |
52
+ | Prefixes domaine | `auth_`, `nav_`, `cfg_`, `ref_`, `wkf_`, `ai_`, `loc_`, `lic_`, `tenant_`, `support_` | Pour un nouveau module metier : choisir un prefixe court (3-5 chars) |
53
+ | FK | `{Entity}Id` (ex: `ClientId`, `OrderId`) | |
54
+ | Index | `IX_{Table}_{Column}` | `IX_bik_FreeBickes_TenantId_Code` |
55
+ | Migration | 1 migration par feature, nommee via MCP (`suggest_migration`) | `extensions_v1.0.0_001_AddFreeBicke` |
56
+
57
+ ---
58
+
59
+ ## Conventions de Dossiers (Clean Architecture)
60
+
61
+ | Couche | Pattern de dossiers | Exemple (module FreeBicke dans business > operations) |
62
+ |--------|--------------------|---------------------------------------------------------|
63
+ | **Domain** | `{Project}.Domain/Business/{Application}/{Module}/` | `Domain/Business/Operations/FreeBicke/FreeBicke.cs` |
64
+ | **Application/DTOs** | `{Project}.Application/Business/{Application}/{Module}/DTOs/` | `Application/Business/Operations/FreeBicke/DTOs/FreeBickeDto.cs` |
65
+ | **Application/Interfaces** | `{Project}.Application/Common/Interfaces/` | `Application/Common/Interfaces/IFreeBickeService.cs` |
66
+ | **Infrastructure/Config** | `{Project}.Infrastructure/Persistence/Configurations/{Module}/` | `Configurations/FreeBicke/FreeBickeConfiguration.cs` |
67
+ | **Infrastructure/Services** | `{Project}.Infrastructure/Services/{Module}/` | `Services/FreeBicke/FreeBickeService.cs` |
68
+ | **Infrastructure/SeedData** | `{Project}.Infrastructure/Persistence/Seeding/Data/{Module}/` | `Seeding/Data/FreeBicke/FreeBickeSeedData.cs` |
69
+ | **API/Controllers** | `{Project}.Api/Controllers/Business/{Application}/` | `Controllers/Business/Operations/FreeBickeController.cs` |
70
+ | **Frontend/Pages** | `web/src/pages/business/{application}/{module}/` | `pages/business/operations/freebicke/page.tsx` |
71
+ | **Frontend/i18n** | `web/src/i18n/locales/{lang}/{module}.json` | `locales/fr/freebicke.json` |
72
+
73
+ > **IMPORTANT :** Chaque module a son **propre sous-dossier** dans chaque couche. Ne JAMAIS mettre tous les fichiers a la racine d'une couche.
74
+
75
+ ---
76
+
77
+ ## SeedData Core (Obligatoire pour chaque feature)
78
+
79
+ > **Chaque nouvelle feature necessite des SeedData dans 5 fichiers core** pour etre fonctionnelle (navigation visible, permissions actives, roles assignes).
80
+
81
+ | # | Fichier | Contenu | Mecanisme |
82
+ |---|---------|---------|-----------|
83
+ | 1 | `NavigationModuleConfiguration.cs` | Entree module dans `nav_Modules` (HasData) | EF Core Migration |
84
+ | 2 | `NavigationTranslationConfiguration.cs` | Traductions du module (4 langues x chaque entite nav) | EF Core Migration |
85
+ | 3 | `PermissionConfiguration.cs` | Permissions CRUD + wildcards dans `nav_Permissions` (HasData) | EF Core Migration |
86
+ | 4 | `Permissions.cs` (Application layer) | Constantes compile-time pour `[RequirePermission]` | Code |
87
+ | 5 | `RolePermissionConfiguration.cs` | Associations role-permission dans `auth_RolePermissions` (HasData) | EF Core Migration |
88
+
89
+ **Roles par defaut pour chaque application (4 niveaux) :**
90
+
91
+ | Role | Permissions | Description |
92
+ |------|-------------|-------------|
93
+ | **{App} Admin** | `{context}.{app}.*` (wildcard) | Acces complet a l'application |
94
+ | **{App} Manager** | `read`, `create`, `update`, `assign` | Gestion complete sans suppression |
95
+ | **{App} Contributor** | `read`, `create`, `update` | Contribution active |
96
+ | **{App} Viewer** | `read` uniquement | Consultation seule |
97
+
98
+ > **CRITIQUE :** Si les SeedData ne sont pas crees, le module sera invisible dans la navigation et les permissions retourneront 403.
99
+
100
+ ---
101
+
102
+ ## Contraintes Non-Negociables
103
+
104
+ | Contrainte | Detail |
105
+ |------------|--------|
106
+ | **Multi-tenant** | `TenantId` sur toute entite metier, isolation automatique |
107
+ | **RBAC** | Permissions `business.{app}.{module}.{action}`, HasData pattern |
108
+ | **CQRS** | Commands (write) et Queries (read) separes via MediatR |
109
+ | **Validation** | FluentValidation pour toute commande |
110
+ | **i18n** | 4 langues obligatoires (fr, en, it, de) |
111
+ | **Soft Delete** | Pas de DELETE physique sauf purge RGPD planifiee |
112
+
113
+ ---
114
+
115
+ ## Outils MCP Pertinents pour le BA
116
+
117
+ | Phase BA | Outil MCP | Usage |
118
+ |----------|-----------|-------|
119
+ | Pre-research (01) | `analyze_extension_points` | Decouvrir modules/entites existants |
120
+ | Pre-research (01) | `api_docs` | Consulter la documentation API existante |
121
+ | Analyse (02) | `validate_conventions` | Verifier les noms d'entites proposes |
122
+ | Specification (03) | `generate_permissions` | Generer la matrice de permissions |
123
+ | Handoff (05) | `scaffold_extension` | Preparer le scaffolding |
@@ -0,0 +1,206 @@
1
+ # Business Analysis - Elicitation & Interaction (_elicitation.md)
2
+
3
+ > **Loaded by:** step-01-cadrage, step-03a-specify
4
+ > **Purpose:** Interactive questioning techniques, AskUserQuestion formatting, ULTRATHINK mode
5
+
6
+ ---
7
+
8
+ ## Interactive Elicitation Protocol
9
+
10
+ > **RULE: ALL questions MUST be asked interactively using `AskUserQuestion`.**
11
+ > **NEVER dump a list of questions as text. ALWAYS use the tool.**
12
+
13
+ ### Protocol
14
+
15
+ 1. **Group questions by theme** — max 4 questions per `AskUserQuestion` call (tool limit)
16
+ 2. **Propose predefined options** — for questions with predictable answers, provide 2-4 options
17
+ 3. **The user can always choose "Other"** — the tool adds this automatically for free-text answers
18
+ 4. **Process answers immediately** — apply ULTRATHINK + follow-ups before moving to next group
19
+ 5. **Adapt next questions** — based on previous answers, skip irrelevant questions
20
+
21
+ ### Batching Strategy
22
+
23
+ | Category | Questions | Batches |
24
+ |----------|-----------|---------|
25
+ | 01-context | Q1.1-Q1.4 | 1 call |
26
+ | 02-stakeholders | Q2.1-Q2.8 | 2 calls |
27
+ | 03-scope | Q3.1-Q3.8 | 2 calls |
28
+ | 04-data | Q4.1-Q4.8 | 2 calls |
29
+ | 05-integrations | Q5.1-Q5.8 | 2 calls |
30
+ | 06-security | Q6.1-Q6.8 | 2 calls |
31
+ | 07-ui | Q7.1-Q7.8 | 2 calls |
32
+ | 08-performance | Q8.1-Q8.4 | 1 call |
33
+ | 09-constraints | Q9.1-Q9.4 | 1 call |
34
+ | 10-documentation | Q10.1-Q10.4 | 1 call |
35
+ | 11-data-lifecycle | Q11.1-Q11.8 | 2 calls |
36
+ | 12-migration | Q12.1-Q12.8 | 2 calls |
37
+ | 13-cross-module | Q13.1-Q13.8 | 2 calls |
38
+
39
+ ### AskUserQuestion Format
40
+
41
+ > **FORMATTING CRITICAL: `AskUserQuestion` does NOT support markdown or line breaks.**
42
+ > Le champ `question` est rendu en texte brut (plain text). Il n'y a pas de retour a la ligne,
43
+ > pas de gras, pas de puces. Une question simple reste lisible meme longue. Mais du contenu
44
+ > structure (listes, resumes multi-points, tableaux) devient un mur de texte illisible.
45
+
46
+ | Field | Rule |
47
+ |-------|------|
48
+ | `question` | **1 question ou 1 phrase.** Jamais de liste, resume multi-points ou contenu structure. |
49
+ | `header` | 1-2 mots (max 12 chars) |
50
+ | `label` (option) | Court et clair (~20 chars) |
51
+ | `description` (option) | 1 phrase explicative (~60 chars) |
52
+
53
+ > **Pour afficher du contenu structure** (resumes, listes, tableaux, syntheses) :
54
+ > **TOUJOURS** utiliser du **texte direct** (output text) AVANT l'appel `AskUserQuestion`.
55
+ > Le texte direct supporte le markdown et sera correctement formate avec titres, puces, gras, etc.
56
+ >
57
+ > **Exemple — Validation de synthese :**
58
+ > 1. Afficher le resume structure en markdown (texte direct)
59
+ > 2. Puis poser une question courte : "Cette synthese est-elle correcte ?"
60
+
61
+ ```
62
+ AskUserQuestion({
63
+ questions: [
64
+ {
65
+ question: "Quel probleme metier ce module doit-il resoudre ?",
66
+ header: "Probleme", // max 12 chars
67
+ options: [
68
+ { label: "Processus manuel", description: "Automatiser un processus existant fait manuellement" },
69
+ { label: "Donnees dispersees", description: "Centraliser des donnees eparpillees dans plusieurs outils" },
70
+ { label: "Manque visibilite", description: "Obtenir des indicateurs et du suivi inexistants aujourd'hui" },
71
+ { label: "Conformite", description: "Repondre a une obligation reglementaire ou de securite" }
72
+ ],
73
+ multiSelect: false
74
+ },
75
+ // ... up to 4 questions per call
76
+ ]
77
+ })
78
+ ```
79
+
80
+ ### After Each Batch
81
+
82
+ 1. **Evaluate answer quality** (see Answer Quality Indicators)
83
+ 2. **If insufficient** -> follow-up AskUserQuestion with targeted probes from the Elicitation Guide
84
+ 3. **If solution-oriented** -> reframe using Technique 1 before proceeding
85
+ 4. **If sufficient/excellent** -> record and move to next batch
86
+ 5. **Summarize** what was understood before moving to the next category
87
+
88
+ ---
89
+
90
+ ## Techniques d'elicitation
91
+
92
+ > **Objectif :** Guider COMMENT questionner, pas seulement QUOI demander.
93
+ > **Principe :** Chaque technique doit etre appliquee naturellement dans le flux de la conversation,
94
+ > pas comme un outil supplementaire. L'analyste choisit la technique adaptee a la situation.
95
+
96
+ ### Technique 1 : Reformulation du besoin
97
+
98
+ Quand le client decrit une **solution** (bouton, ecran, champ, outil), reformuler en **besoin** :
99
+
100
+ | Le client dit | L'analyste demande |
101
+ |---------------|-------------------|
102
+ | "Il me faut un menu deroulant pour les roles" | "Quel probleme rencontrez-vous aujourd'hui avec la gestion des acces ? Pourquoi certaines personnes doivent-elles avoir des acces differents ?" |
103
+ | "On a besoin d'un bouton d'export" | "Que faites-vous avec les donnees une fois exportees ? Qui en a besoin et pourquoi ?" |
104
+ | "Ajoutez un champ statut" | "Quel parcours suit cet element du debut a la fin ? Quels evenements declenchent un changement d'etat ?" |
105
+
106
+ ### Technique 2 : Chaine des pourquoi
107
+
108
+ Quand le besoin semble superficiel, enchainez jusqu'a 5 "Pourquoi ?" pour trouver la cause racine :
109
+
110
+ ```
111
+ Client : "On a besoin de suivre l'activite des utilisateurs"
112
+ -> Pourquoi ? "Pour savoir qui a modifie quoi"
113
+ -> Pourquoi ? "Parce qu'on a eu des problemes de donnees incorrectes"
114
+ -> Pourquoi ? "Parce que plusieurs personnes modifient les memes fiches"
115
+ -> CAUSE RACINE : Conflit d'edition simultanee -> Besoin de journal d'activite + protection des modifications
116
+ ```
117
+
118
+ ### Technique 3 : Extraction de scenario concret
119
+
120
+ Ne jamais accepter de descriptions abstraites. Toujours demander un **scenario de vie reelle** :
121
+
122
+ ```
123
+ "Racontez-moi une journee type : vous arrivez au bureau, vous ouvrez l'application.
124
+ Quelle est la PREMIERE chose que vous devez faire ?
125
+ Puis ensuite ? Quelles informations consultez-vous ? Quelles decisions prenez-vous ?"
126
+ ```
127
+
128
+ ### Technique 4 : Test d'absence
129
+
130
+ Valider la necessite en demandant ce qui se passe SANS :
131
+
132
+ ```
133
+ "Si cette fonctionnalite N'EXISTAIT PAS, que feriez-vous a la place ?
134
+ Combien de temps ou d'argent le contournement actuel coute-t-il ?"
135
+ ```
136
+
137
+ ### Technique 5 : Verification de completude
138
+
139
+ Pour chaque reponse sous forme de liste, verifier qu'il ne manque rien :
140
+
141
+ | Type de reponse | Relance |
142
+ |-----------------|---------|
143
+ | "Il y a 3 types d'utilisateurs" | "Y a-t-il des acteurs externes ? Des auditeurs ? Des administrateurs systeme ? Des processus automatiques ?" |
144
+ | "Le flux principal est A puis B puis C" | "Que se passe-t-il si l'utilisateur annule a l'etape B ? Si l'etape C echoue ? S'il veut revenir a A ?" |
145
+ | "Champs obligatoires : nom et email" | "Quelles contraintes d'unicite ? Quel format ? Que se passe-t-il en cas de doublon ?" |
146
+
147
+ ### Technique 6 : Projection dans le futur
148
+
149
+ Demander au client de se projeter pour decouvrir des besoins non exprimes :
150
+
151
+ ```
152
+ "Imaginons que nous sommes 2 ans dans le futur et que l'application fonctionne parfaitement.
153
+ Qu'est-ce qui a change dans votre facon de travailler ?
154
+ Quels nouveaux besoins sont apparus auxquels vous ne pensez pas aujourd'hui ?"
155
+ ```
156
+
157
+ ### Technique 7 : Test de contradiction
158
+
159
+ Quand deux reponses semblent contradictoires, les confronter pour clarifier :
160
+
161
+ ```
162
+ "Vous avez mentionne que [affirmation A], mais vous dites aussi que [affirmation B].
163
+ Ces deux elements semblent en tension. Pouvez-vous m'aider a comprendre
164
+ comment ils coexistent dans la realite ?"
165
+ ```
166
+
167
+ ### Technique 8 : Escalade d'impact
168
+
169
+ Augmenter progressivement l'echelle pour tester les limites :
170
+
171
+ ```
172
+ "Aujourd'hui vous avez 50 fiches. Que se passe-t-il avec 500 ? Avec 5000 ?
173
+ Est-ce que le processus reste le meme ou faudrait-il faire differemment ?"
174
+ ```
175
+
176
+ ### Indicateurs de qualite des reponses
177
+
178
+ | Qualite | Signal | Action |
179
+ |---------|--------|--------|
180
+ | **Insuffisante** | Moins d'une phrase, "je ne sais pas", adjectif vague | Appliquer les techniques 1 a 8, demander un exemple concret |
181
+ | **Orientee solution** | Contient des termes d'interface ou techniques (bouton, champ, base de donnees) | Appliquer la technique 1 (reformuler en besoin) |
182
+ | **Suffisante** | Contient QUI, QUOI, POURQUOI et un exemple concret | Continuer, noter le niveau de confiance |
183
+ | **Excellente** | Inclut les cas limites, les contraintes et des criteres mesurables | Continuer, marquer comme "Confirme" |
184
+
185
+ ---
186
+
187
+ ## ULTRATHINK
188
+
189
+ Behavioral mode for critical phases (01, 03a):
190
+
191
+ ```
192
+ ULTRATHINK MODE:
193
+ - Consider ALL edge cases
194
+ - Challenge EVERY assumption
195
+ - Anticipate UNEXPRESSED needs
196
+ - Validate completeness before output
197
+ - Apply Elicitation Techniques (see above)
198
+
199
+ DO NOT:
200
+ - Accept vague answers
201
+ - Skip question categories
202
+ - Assume stakeholder thought of everything
203
+ - Accept solutions without understanding the problem first
204
+ ```
205
+
206
+ **DO NOT invoke** as a skill/tool - it is a thinking mode.
@@ -0,0 +1,56 @@
1
+ # Business Analysis - Module Loop Protocol (_module-loop.md)
2
+
3
+ > **Loaded by:** step-03a-specify, step-03b-compile
4
+ > **Purpose:** State management and iteration logic for multi-module specification loop
5
+
6
+ ---
7
+
8
+ ## State Management
9
+
10
+ ```json
11
+ {
12
+ "metadata": {
13
+ "workflow": {
14
+ "mode": "application",
15
+ "moduleOrder": ["Customers", "Products", "Orders", "Invoices"],
16
+ "currentModuleIndex": 2,
17
+ "completedModules": ["Customers", "Products"],
18
+ "currentModule": "Orders"
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ ## Loop Logic (end of each step-03 iteration)
25
+
26
+ ```
27
+ 1. Mark current module as "validated" in master feature.json
28
+ 2. Add to completedModules[]
29
+ 3. IF currentModuleIndex + 1 < moduleOrder.length:
30
+ currentModuleIndex++
31
+ currentModule = moduleOrder[currentModuleIndex]
32
+ Write master feature.json
33
+ Display: "Module {name} complete. Next: {next_name} ({N}/{total})"
34
+ RE-LOAD: steps/step-03a-specify.md
35
+ 4. ELSE:
36
+ master.status = "specified"
37
+ Load: steps/step-04-consolidation.md
38
+ ```
39
+
40
+ ## Context Management During Loop
41
+
42
+ To prevent context explosion as modules accumulate:
43
+ - **Current module:** Load full module feature.json
44
+ - **Completed modules:** Only load compact summary via `ba-reader.getCompletedModulesSummary()` (max 100 lines)
45
+ - **Master feature.json:** Only read workflow state + application roles
46
+
47
+ ## Resume After Interruption
48
+
49
+ ```
50
+ 1. ba-reader.findApplicationFeature() -> locate master feature.json
51
+ 2. Read metadata.workflow.currentModuleIndex
52
+ 3. IF currentModule has a feature.json with status != "validated":
53
+ Resume step-03a-specify for that module
54
+ 4. ELSE:
55
+ Start step-03a-specify for next module
56
+ ```