@atlashub/smartstack-cli 3.12.0 → 3.14.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 (27) hide show
  1. package/package.json +2 -2
  2. package/templates/skills/business-analyse/SKILL.md +3 -2
  3. package/templates/skills/business-analyse/_module-loop.md +5 -5
  4. package/templates/skills/business-analyse/questionnaire.md +1 -1
  5. package/templates/skills/business-analyse/references/cache-warming-strategy.md +11 -23
  6. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +112 -0
  7. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +6 -1
  8. package/templates/skills/business-analyse/references/deploy-data-build.md +1 -1
  9. package/templates/skills/business-analyse/references/html-data-mapping.md +1 -1
  10. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  11. package/templates/skills/business-analyse/references/spec-auto-inference.md +1 -1
  12. package/templates/skills/business-analyse/schemas/application-schema.json +33 -1
  13. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +1 -1
  14. package/templates/skills/business-analyse/steps/step-00-init.md +18 -22
  15. package/templates/skills/business-analyse/steps/step-01-cadrage.md +300 -135
  16. package/templates/skills/business-analyse/steps/step-02-decomposition.md +38 -16
  17. package/templates/skills/business-analyse/steps/step-03a-data.md +5 -31
  18. package/templates/skills/business-analyse/steps/step-03a1-setup.md +2 -2
  19. package/templates/skills/business-analyse/steps/step-03b-ui.md +20 -11
  20. package/templates/skills/business-analyse/steps/step-03d-validate.md +6 -6
  21. package/templates/skills/business-analyse/steps/step-04-consolidation.md +5 -31
  22. package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
  23. package/templates/skills/business-analyse/steps/step-05a-handoff.md +1 -1
  24. package/templates/skills/business-analyse/steps/step-05b-deploy.md +3 -3
  25. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +1 -1
  26. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  27. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +0 -87
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: step-01-cadrage
3
- description: Application/module framing - context, problem, stakeholders, scope, application roles
3
+ description: Application/module framing - listen, reformulate, challenge, anticipate, bound scope
4
4
  model: opus
5
5
  next_step: steps/step-02-decomposition.md
6
6
  ---
@@ -12,21 +12,35 @@ next_step: steps/step-02-decomposition.md
12
12
  ## MANDATORY EXECUTION RULES
13
13
 
14
14
  - ALWAYS use ULTRATHINK mode for this step
15
- - ALWAYS apply the 5 Elicitation Techniques from `_shared.md`
15
+ - ALWAYS apply the Elicitation Techniques from `_elicitation.md`
16
16
  - NEVER accept vague answers — probe deeper
17
17
  - NEVER define entities or business rules here — that's per-module in step-03
18
18
  - ALL questions via AskUserQuestion tool (NEVER as text dumps)
19
19
  - ALL communication in `{language}` (from feature.json.metadata.language)
20
+ - **NEVER skip the reformulation phase** — it is the foundation of good analysis
21
+ - **NEVER auto-infer cadrage data without client validation** — every key decision is confirmed
20
22
 
21
23
  ## YOUR TASK
22
24
 
23
- Frame the analysis scope at the **application level**: understand the problem, stakeholders, scope, and define application-level roles. This step works for both multi-module applications and single modules.
25
+ Frame the analysis scope at the **application level** through an interactive conversation with the client: understand the problem, stakeholders, scope, and define application-level roles. The analysis phase is ALWAYS interactive the AI listens, reformulates, challenges, and validates with the user.
24
26
 
25
- **Key difference from old step-01-analyse:** This step does NOT define entities, business rules, or process flows. Those are per-module and handled in step-03.
27
+ **Key difference from step-03:** This step does NOT define entities, business rules, or process flows. Those are per-module and handled in step-03.
26
28
 
27
29
  ---
28
30
 
29
- ## EXECUTION SEQUENCE
31
+ ## EXECUTION FLOW — 5 PHASES
32
+
33
+ ```
34
+ Phase 1: ECOUTE → Read brief + codebase pre-research + silent pre-analysis
35
+ Phase 2: REFORMULATION → Rephrase the need back to the client for validation
36
+ Phase 3: APPROFONDISSEMENT → Challenge assumptions with targeted questionnaires
37
+ Phase 4: ANTICIPATION → Suggest unexpressed needs from domain expertise
38
+ Phase 5: PERIMETRE → Bound scope with roles, coverage matrix (sections + resources)
39
+ ```
40
+
41
+ ---
42
+
43
+ ## PHASE 1: ECOUTE (Listen)
30
44
 
31
45
  ### 1. Read Current State
32
46
 
@@ -43,7 +57,7 @@ IF cadrage already completed (status = "framed"):
43
57
 
44
58
  ### 2. Codebase Pre-Research
45
59
 
46
- > **Same pattern as previous step-01-analyse.** Understand what already exists.
60
+ > **Understand what already exists before engaging the client.**
47
61
 
48
62
  **Phase 2a: MCP Tools (if available)**
49
63
  ```
@@ -70,100 +84,244 @@ Launch 3 agents in parallel:
70
84
  Merge findings into {codebase_context}
71
85
  ```
72
86
 
73
- ### 3. VIBE CODING FLOW (always2 lots)
87
+ ### 2b. Silent Pre-Analysis (ULTRATHINKno output to client)
88
+
89
+ > **The AI prepares the conversation before speaking.** This is NOT output — it's internal reasoning.
74
90
 
75
- > **The developer IS the product owner, the user, and the builder.**
76
- > Skip organizational questions (adoption, change management, governance, KPIs).
77
- > Focus on functional decisions and technical challenges.
78
- > **Always optimize for high traffic and production-grade performance.**
91
+ Load: [references/cadrage-pre-analysis.md](../references/cadrage-pre-analysis.md)
79
92
 
80
- See [references/cadrage-vibe-coding.md](../references/cadrage-vibe-coding.md) for the 2-lot questionnaire:
81
- - **Lot 1 (3v):** Problem & Scope — capture core need + must-have features
82
- - **Lot 2 (4v):** Technical Challenges — risks specific to AI-assisted dev + auto-inferred cadrage data
93
+ Analyze `{feature_description}` silently:
83
94
 
84
- **Users & Permissions:** Always auto-set to Organisation (500+ users) with standard 4-tier roles (Admin, Manager, Contributor, Viewer) and 3 stakeholders. No question needed. Pagination, caching, indexed queries, and async operations are mandatory defaults — not optimizations to discuss.
95
+ 1. **Identify problem type** from keywords (replace, automate, centralize, new tool)
96
+ 2. **Extract explicit modules/features** mentioned in the description
97
+ 3. **Detect shadow zones** — what is NOT said but should be:
98
+ - Missing stakeholders (who else would use this?)
99
+ - Missing sections (reports mentioned but no details?)
100
+ - Implicit relationships (1:1, 1:N — why this cardinality?)
101
+ - Missing non-functional needs (security, performance, compliance)
102
+ 4. **Prepare challenge questions** — specific to this brief, not generic
103
+ 5. **Pre-identify anticipated sections and resources** per detected module
85
104
 
86
- **After Lot 2:** Go directly to **section 9 (Coverage Matrix)**.
105
+ Store in `{pre_analysis}` (internal use only, NOT written to feature.json):
106
+ ```yaml
107
+ pre_analysis:
108
+ problem_type: "new_tool|replace|automate|centralize"
109
+ detected_modules: [{name, description, detected_sections}]
110
+ shadow_zones: [{topic, why_it_matters, challenge_question}]
111
+ anticipated_suggestions: [{suggestion, justification, module}]
112
+ ```
87
113
 
88
114
  ---
89
115
 
90
- ## STANDARD FLOW (full questionnaire — sections 3s through 8s)
116
+ ## PHASE 2: REFORMULATION (Rephrase & Validate)
91
117
 
92
- ### 3s. Application-Level Questionnaire (application mode)
118
+ ### 3. Reformulation du besoin (MANDATORY — NEVER SKIP)
93
119
 
94
- > **Only loaded when workflow.mode = "application"**
120
+ > **Golden rule of requirements analysis: NEVER proceed without reformulating.**
121
+ > The analyst must prove they understood before digging deeper.
122
+ > This is what distinguishes a professional analysis from a superficial one.
95
123
 
96
- Load: `questionnaire/00-application.md`
124
+ **Process:**
97
125
 
98
- Ask questions in batches of max 4 via AskUserQuestion:
126
+ 1. From `{feature_description}` and `{pre_analysis}`, build a structured reformulation.
99
127
 
100
- **Batch 1 (Q0.1-Q0.2): Application Identity**
101
- - Application name (PascalCase)
102
- - Application purpose (1-2 sentences)
128
+ 2. **Display as markdown** (direct text output, NOT inside AskUserQuestion):
129
+
130
+ ```
131
+ ## {language == "fr" ? "Voici ce que j'ai compris de votre besoin" : "Here is my understanding of your need"}
132
+
133
+ **Application :** {detected application name}
134
+ **Objectif :** {reformulation in 2-3 sentences of the global need — in the client's own words, not technical jargon}
135
+
136
+ **Modules identifiés :**
137
+ - **{Module 1}** : {functional description}
138
+ - Sections pressenties : {list, detail, create, edit...}
139
+ - Resources clés : {grid, form, card, chart...}
140
+ - **{Module 2}** : {functional description}
141
+ - Sections pressenties : {list, create...}
142
+ - Resources clés : {grid, form...}
143
+
144
+ **Points que j'ai notés :**
145
+ - {specific point 1 from the brief, quoted verbatim when possible}
146
+ - {specific point 2}
147
+
148
+ **Points qui me semblent ambigus ou non précisés :**
149
+ - {shadow zone 1 — what I don't know yet}
150
+ - {shadow zone 2}
151
+ ```
152
+
153
+ 3. Then ask via AskUserQuestion:
154
+ ```
155
+ question: "{language == 'fr' ? 'Cette reformulation correspond-elle à votre besoin ?' : 'Does this reformulation match your need?'}"
156
+ header: "Validation"
157
+ options:
158
+ - label: "{language == 'fr' ? 'Oui, c\'est correct' : 'Yes, correct'}"
159
+ description: "{language == 'fr' ? 'La reformulation reflète bien mon besoin' : 'The reformulation accurately reflects my need'}"
160
+ - label: "{language == 'fr' ? 'Partiellement' : 'Partially'}"
161
+ description: "{language == 'fr' ? 'Certains points sont corrects mais d\'autres à ajuster' : 'Some points are correct but others need adjustment'}"
162
+ - label: "{language == 'fr' ? 'Non, à revoir' : 'No, needs revision'}"
163
+ description: "{language == 'fr' ? 'La reformulation ne correspond pas à mon besoin' : 'The reformulation does not match my need'}"
164
+ ```
165
+
166
+ 4. IF "Partially" or "No":
167
+ - Ask for corrections via AskUserQuestion (open-ended "Other" option)
168
+ - Re-reformulate and re-validate (loop until confirmed)
169
+
170
+ 5. Once confirmed, update `{pre_analysis}` with any corrections.
171
+
172
+ ---
103
173
 
104
- **Batch 2 (Q0.3-Q0.4): Module Landscape**
105
- - How many modules envisioned
106
- - Which are must-have for first release
174
+ ## PHASE 3: APPROFONDISSEMENT (Challenge & Deepen)
107
175
 
108
- **Batch 3 (Q0.5-Q0.6): Application Roles**
109
- - Standard 4-tier roles or customize
110
- - Module-specific role restrictions
176
+ ### 4. Targeted Questionnaires
111
177
 
112
- **Batch 4 (Q0.7-Q0.8): Cross-Module**
113
- - Business processes spanning modules
114
- - Default role for new users
178
+ > **Principle: Do NOT ask ALL questions from ALL questionnaires.**
179
+ > Select the RELEVANT questions based on the pre-analysis and detected shadow zones.
180
+ > Apply elicitation techniques from `_elicitation.md` after each batch.
181
+ > The goal is a CONVERSATION, not an interrogation.
115
182
 
116
- After each batch: Apply ULTRATHINK + Elicitation Techniques.
183
+ #### 4a. Business Context (ALWAYS from `questionnaire/01-context.md`)
117
184
 
118
- ### 4s. Core Questionnaires (always in standard mode)
185
+ > Load the full questionnaire reference for elicitation guides and alert signals.
119
186
 
120
- Load these categories in order. Each questionnaire contains its own batching strategy and elicitation guide.
187
+ Select the most relevant questions from Q1.1-Q1.12.
188
+ **Mandatory minimum:** Q1.1 (problem), Q1.4 (current tools), Q1.8 (vision), Q1.11 (trigger).
121
189
 
122
- **Categorie 01 - Contexte metier** (`questionnaire/01-context.md`)
123
- - Q1.1-Q1.12 : Probleme, situation actuelle, vision, declencheur
124
- - 3 lots AskUserQuestion (probleme, processus actuel, vision et urgence)
125
- - ULTRATHINK : Identifier la douleur reelle, pas la solution imaginee
190
+ Ask in 1-2 batches via AskUserQuestion (max 4 questions per batch).
126
191
 
127
- **Categorie 02 - Parties prenantes** (`questionnaire/02-stakeholders.md`)
128
- - Q2.1-Q2.14 : Utilisateurs, taches, acces, conduite du changement
129
- - 4 lots AskUserQuestion
130
- - ULTRATHINK : Mapper les parties prenantes vers les profils d'acces
192
+ Apply ULTRATHINK after each batch:
193
+ - If answer is vague probe deeper using the elicitation guide from 01-context.md
194
+ - If answer is solution-oriented → apply Technique 1 (reformulate as need)
195
+ - If answer is superficial apply Technique 2 (chain of whys)
196
+ - If answer is excellent → record and move on
131
197
 
132
- **Categorie 03 - Perimetre fonctionnel** (`questionnaire/03-scope.md`)
133
- - Q3.1-Q3.12 : Priorites (indispensable/important/optionnel/hors perimetre), parcours, besoins transversaux
134
- - 3 lots AskUserQuestion
135
- - ULTRATHINK : S'assurer que le perimetre couvre les besoins identifies
198
+ #### 4b. Stakeholders (ALWAYS from `questionnaire/02-stakeholders.md`)
136
199
 
137
- **Categorie 14 - Risques et hypotheses** (`questionnaire/14-risk-assumptions.md`)
138
- - Q14.1-Q14.8 : Risques, hypotheses non verifiees, lecons du passe
139
- - 2 lots AskUserQuestion
140
- - TOUJOURS charge (noyau) - ne jamais sauter cette categorie
200
+ **Mandatory minimum:** Q2.1 (users), Q2.5 (tasks per profile), Q2.9 (access levels).
141
201
 
142
- **Categorie 15 - Criteres de reussite** (`questionnaire/15-success-metrics.md`)
143
- - Q15.1-Q15.8 : Definition du succes, objectifs mesurables, conditions d'acceptation
144
- - 2 lots AskUserQuestion
145
- - TOUJOURS charge (noyau) - ne jamais sauter cette categorie
202
+ Ask in 1-2 batches. After each batch:
203
+ - If only 1 user type mentioned → probe: "Who else interacts? Managers? Admins? External users?"
204
+ - If "everyone sees everything" → challenge: "Even interns? Contractors? Salary data?"
205
+ - If tasks are generic ask for a concrete scenario: "Walk me through a typical day"
146
206
 
147
- ### 5s. Conditional Questionnaires
207
+ #### 4c. Functional Scope (ALWAYS — from `questionnaire/03-scope.md`)
148
208
 
149
- Based on feature description analysis, load additional categories:
209
+ **Mandatory minimum:** Q3.2 (must-have), Q3.4 (exclusions), Q3.5 (main journey).
210
+
211
+ Ask in 1-2 batches. After each batch:
212
+ - If everything is "must-have" → apply priority test: "If you could only keep 3 features, which ones?"
213
+ - If no exclusions → probe: "What should this system explicitly NOT do?"
214
+ - If journey is too simple → detail: "What happens when something goes wrong? When someone cancels?"
215
+
216
+ #### 4d. Challenge Implicit Assumptions (CRITICAL)
217
+
218
+ > **Apply elicitation techniques to challenge what the client considers "obvious".**
219
+ > This is what separates a deep analysis from a shallow one.
220
+
221
+ For EACH specific point from the brief, prepare a targeted challenge question.
222
+
223
+ **Rules for challenge questions:**
224
+ 1. Identify the assumption (what the client stated as fact)
225
+ 2. Formulate a "what if the opposite?" question
226
+ 3. Use Technique 4 (absence test) or Technique 7 (contradiction test)
227
+
228
+ **Examples by domain pattern:**
229
+
230
+ | Brief statement | Implicit assumption | Challenge question |
231
+ |----------------|--------------------|--------------------|
232
+ | "Entities are 1:1 extensions of X" | Cardinality is always 1:1 | "Can a user be linked to multiple employee records (temp contracts, part-time multi-position)? Can an employee NOT have a user account?" |
233
+ | "Entry split into activity and absence" | Binary decomposition is sufficient | "What granularity? Day, half-day, hour? Are activities linked to projects or clients? Are there other entry types (training, travel, on-call)?" |
234
+ | "A reports section" | Reports are a simple addition | "Which reports exactly? For whom? How often? PDF/Excel export? Real-time dashboards? Aggregated or detailed?" |
235
+ | "Module X manages Y" | The scope of "manages" is clear | "What does 'manage' mean concretely? Create, read, update, delete? Approve? Archive? Import/export?" |
236
+
237
+ Use these techniques:
238
+ - **Technique 3** (concrete scenario): "Walk me through a typical day of [role] using this module"
239
+ - **Technique 4** (absence test): "If [feature] didn't exist, how would you handle it?"
240
+ - **Technique 8** (impact escalation): "With 50 records this works, but with 500? 5000? Does the process stay the same?"
241
+
242
+ Ask challenge questions via AskUserQuestion (1-2 batches of max 4).
243
+
244
+ #### 4e. Risks & Success Criteria (ALWAYS — from `questionnaire/14-risk-assumptions.md` and `questionnaire/15-success-metrics.md`)
245
+
246
+ Select the most pertinent questions:
247
+ - **14-risk-assumptions.md:** Q14.1 (identified risks), Q14.4 (unvalidated assumptions)
248
+ - **15-success-metrics.md:** Q15.1 (success definition), Q15.4 (measurable objectives)
249
+
250
+ Ask in 1 batch via AskUserQuestion.
251
+
252
+ #### 4f. Conditional Deep-Dives
253
+
254
+ Based on brief analysis, load additional categories if relevant:
255
+
256
+ | Condition | Category | Questionnaire |
257
+ |-----------|----------|---------------|
258
+ | Security or compliance mentioned | 06 | `questionnaire/06-security.md` |
259
+ | External system integration | 05 | `questionnaire/05-integrations.md` |
260
+ | Performance requirements | 08 | `questionnaire/08-performance.md` |
261
+ | Technical constraints | 09 | `questionnaire/09-constraints.md` |
262
+ | Documentation needs | 10 | `questionnaire/10-documentation.md` |
263
+
264
+ > **Categories 04 (data), 07 (UI), 11 (lifecycle), 12 (migration), 13 (cross-module) are per-module and loaded in step-03.**
265
+
266
+ ---
150
267
 
151
- | Condition | Categorie | Questionnaire |
152
- |-----------|-----------|---------------|
153
- | Securite ou conformite mentionnee | 06 | `questionnaire/06-security.md` |
154
- | Integration avec des systemes externes | 05 | `questionnaire/05-integrations.md` |
155
- | Exigences de performance | 08 | `questionnaire/08-performance.md` |
156
- | Contraintes techniques | 09 | `questionnaire/09-constraints.md` |
157
- | Besoins de documentation | 10 | `questionnaire/10-documentation.md` |
268
+ ## PHASE 4: ANTICIPATION (Suggest Unexpressed Needs)
158
269
 
159
- > **Categories 04 (donnees), 07 (interface), 11 (cycle de vie), 12 (migration), 13 (inter-modules) sont par module et chargees dans step-03.**
270
+ ### 5. Proactive Suggestions
160
271
 
161
- ### 6s. Application Roles Definition
272
+ > **An expert analyst doesn't just capture what is said.**
273
+ > They anticipate what the client hasn't thought to ask for.
274
+
275
+ **Process:**
276
+
277
+ 1. Load: `patterns/suggestion-catalog.md`
278
+ 2. Match suggestion patterns against the project context (domain, modules, features)
279
+ 3. Add implicit needs for this type of system that weren't mentioned
280
+
281
+ 4. **Display as markdown** (direct text, NOT inside AskUserQuestion):
282
+
283
+ ```
284
+ ## {language == "fr" ? "Besoins complémentaires que je vous suggère" : "Complementary needs I suggest"}
285
+
286
+ {language == "fr"
287
+ ? "D'après mon analyse de votre besoin, voici des aspects que vous n'avez peut-être pas mentionnés mais qui sont souvent nécessaires pour ce type d'application :"
288
+ : "Based on my analysis of your need, here are aspects you may not have mentioned but that are often necessary for this type of application:"}
289
+
290
+ | # | Suggestion | Justification | Module concerné |
291
+ |---|-----------|---------------|-----------------|
292
+ | 1 | {suggestion} | {why it's relevant for THIS project} | {module} |
293
+ | 2 | {suggestion} | {why} | {module} |
294
+ | 3 | {suggestion} | {why} | {module} |
295
+ | ... | ... | ... | ... |
296
+ ```
297
+
298
+ 5. Then ask via AskUserQuestion (multiSelect: true):
299
+ ```
300
+ question: "{language == 'fr' ? 'Quelles suggestions souhaitez-vous inclure dans le périmètre ?' : 'Which suggestions would you like to include in scope?'}"
301
+ header: "Suggestions"
302
+ multiSelect: true
303
+ options:
304
+ - label: "{suggestion 1 short name}"
305
+ description: "{justification in 1 sentence}"
306
+ - label: "{suggestion 2 short name}"
307
+ description: "{justification in 1 sentence}"
308
+ - label: "{suggestion 3 short name}"
309
+ description: "{justification in 1 sentence}"
310
+ - label: "{language == 'fr' ? 'Aucune' : 'None'}"
311
+ description: "{language == 'fr' ? 'Je n\'ai pas besoin de ces suggestions' : 'I don\'t need any of these suggestions'}"
312
+ ```
313
+
314
+ 6. Accepted suggestions enrich `coverageMatrix` and `globalScope`.
315
+
316
+ ---
317
+
318
+ ## PHASE 5: PERIMETRE (Bound Scope)
319
+
320
+ ### 6. Application Roles Definition
162
321
 
163
322
  > **Define roles at the APPLICATION level, not per-module.**
164
323
 
165
- IF application mode AND roles not yet defined from Q0.5:
166
- Propose the standard 4-tier roles:
324
+ Propose the standard 4-tier roles:
167
325
 
168
326
  ```
169
327
  Application Roles for {application_name}:
@@ -178,79 +336,82 @@ Application Roles for {application_name}:
178
336
 
179
337
  Ask via AskUserQuestion:
180
338
  ```
181
- question: "Ces 4 rôles conviennent-ils pour {application_name} ?"
339
+ question: "{language == 'fr' ? 'Ces 4 rôles conviennent-ils pour votre application ?' : 'Do these 4 roles suit your application?'}"
182
340
  header: "Rôles"
183
341
  options:
184
- - label: "Oui, parfait"
185
- description: "Utiliser les 4 rôles standards tels quels"
186
- - label: "Renommer"
187
- description: "Garder 4 niveaux mais personnaliser les noms"
188
- - label: "Personnaliser"
189
- description: "Modifier le nombre ou les permissions des rôles"
342
+ - label: "{language == 'fr' ? 'Oui, parfait' : 'Yes, perfect'}"
343
+ description: "{language == 'fr' ? 'Utiliser les 4 rôles standards tels quels' : 'Use the 4 standard roles as-is'}"
344
+ - label: "{language == 'fr' ? 'Renommer' : 'Rename'}"
345
+ description: "{language == 'fr' ? 'Garder 4 niveaux mais personnaliser les noms' : 'Keep 4 levels but customize names'}"
346
+ - label: "{language == 'fr' ? 'Personnaliser' : 'Customize'}"
347
+ description: "{language == 'fr' ? 'Modifier le nombre ou les permissions des rôles' : 'Modify number or permissions of roles'}"
190
348
  ```
191
349
 
192
350
  IF single-module mode:
193
351
  Same role definition but inferred from stakeholders
194
352
 
195
- ### 7s. Proactive Suggestions
353
+ ### 7. Coverage Matrix with Sections & Resources (MANDATORY)
354
+
355
+ > **ENRICHMENT: The coverage matrix now includes anticipated sections (Level 4) and resources (Level 5).**
356
+ > This gives downstream steps (step-02, step-03) a concrete starting point.
357
+
358
+ BEFORE transitioning to step-02:
196
359
 
197
- > **Same pattern as previous step-01.** Load suggestion catalog.
360
+ 1. Re-read the original prompt/brief in its entirety
361
+ 2. Re-read ALL answers collected during phases 2-4
362
+ 3. For EACH distinct feature/requirement identified:
363
+ a. Create an entry in `cadrage.coverageMatrix[]`
364
+ b. Assign it to mustHave, shouldHave, couldHave, or outOfScope
365
+ c. Assign the module that will cover it (or null if cross-cutting)
366
+ d. **List anticipated sections** (Level 4) based on module type and feature needs
367
+ e. **List anticipated resources** (Level 5) for each section
198
368
 
199
- Load: `patterns/suggestion-catalog.md`
369
+ 4. **OUTPUT the matrix as text** (do NOT put it inside AskUserQuestion — it won't render):
200
370
 
201
- 1. Analyze scope items and stakeholder needs
202
- 2. Match against catalog patterns
203
- 3. Present top 3-4 suggestions via AskUserQuestion (multiSelect: true)
204
- 4. Store accepted suggestions in `suggestions[]`
371
+ Print a markdown table with columns: **Fonctionnalité | Priorité | Module | Sections pressenties | Resources clés**
205
372
 
206
- ### 8s. Risk Analysis
373
+ Example:
374
+ ```
375
+ {language == "fr"
376
+ ? "Voici la matrice de couverture enrichie. J'ai identifié {N} fonctionnalités :"
377
+ : "Here is the enriched coverage matrix. I identified {N} features:"}
378
+
379
+ | Fonctionnalité | Priorité | Module | Sections pressenties | Resources clés |
380
+ |---|---|---|---|---|
381
+ | Gestion des employés | mustHave | Employees | list, detail, create, edit | employee-grid, employee-form, employee-card |
382
+ | Saisie d'activités | mustHave | TimeTracking | list, create, edit | activity-grid, activity-form |
383
+ | Saisie d'absences | mustHave | TimeTracking | list, create | absence-grid, absence-form, absence-calendar |
384
+ | Rapports temps | mustHave | TimeTracking | dashboard, export | time-summary-chart, time-export-panel |
385
+ | Soldes de congés | shouldHave | TimeTracking | detail | leave-balance-card |
386
+ ```
207
387
 
208
- Ask via AskUserQuestion:
388
+ 5. **THEN** (after the table is displayed) ask via AskUserQuestion:
209
389
  ```
210
- question: "Quels sont les principaux risques pour ce projet ?"
211
- header: "Risques"
212
- multiSelect: true
390
+ question: "{language == 'fr' ? 'Cette matrice de couverture vous convient-elle ?' : 'Does this coverage matrix suit you?'}"
391
+ header: "Couverture"
213
392
  options:
214
- - label: "Adoption utilisateur"
215
- description: "Risque que les utilisateurs n'adoptent pas le système"
216
- - label: "Qualité des données"
217
- description: "Données existantes incomplètes ou incohérentes à migrer"
218
- - label: "Dépendances techniques"
219
- description: "Dépendance à des systèmes externes ou des APIs"
220
- - label: "Complexité fonctionnelle"
221
- description: "Règles métier complexes ou mal documentées"
393
+ - label: "{language == 'fr' ? 'Oui, parfait' : 'Yes, perfect'}"
394
+ description: "{language == 'fr' ? 'La classification et les sections sont correctes' : 'Classification and sections are correct'}"
395
+ - label: "{language == 'fr' ? 'Ajouter des éléments' : 'Add items'}"
396
+ description: "{language == 'fr' ? 'Il manque des fonctionnalités ou des sections' : 'Missing features or sections'}"
397
+ - label: "{language == 'fr' ? 'Réajuster' : 'Readjust'}"
398
+ description: "{language == 'fr' ? 'Modifier les priorités, modules ou sections' : 'Change priorities, modules, or sections'}"
222
399
  ```
223
400
 
224
- Classify per probability/impact:
225
- - High/High → Critical (mitigation required)
226
- - High/Low or Low/High → Medium (monitor)
227
- - Low/Low → Low (accept)
228
-
229
- ---
230
-
231
- ## COMMON FLOW (both modes rejoin here)
401
+ 6. Iterate until the client confirms.
232
402
 
233
- ### 9. Coverage Matrix (MANDATORY)
403
+ **VALIDATION:**
404
+ - Every line of the original prompt must map to at least one coverageMatrix entry.
405
+ - If a feature is in mustHave → it MUST have at least one anticipated section.
406
+ - Accepted suggestions from Phase 4 must appear in the matrix.
234
407
 
235
- BEFORE transitioning to step-02:
236
-
237
- 1. Re-read the original prompt/brief in its entirety
238
- 2. For EACH distinct feature/requirement mentioned:
239
- a. Create an entry in cadrage.coverageMatrix[]
240
- b. Assign it to mustHave, shouldHave, couldHave, or outOfScope
241
- c. Assign the module that will cover it (or null if cross-cutting)
242
- 3. Present the matrix to the client:
243
- "Voici la matrice de couverture de votre brief. {N} fonctionnalités identifiées :"
244
- (show as markdown table)
245
- 4. Ask: "Y a-t-il des éléments que j'ai oublié ou mal classé ?"
246
- 5. Iterate until the client confirms
408
+ ---
247
409
 
248
- **VALIDATION:** Every line of the original prompt must map to at least one coverageMatrix entry.
249
- If a feature is in mustHave → it MUST have at least one UC in the corresponding module (verified in step-03).
410
+ ## WRITE & SUMMARY
250
411
 
251
- ### 10. Write Cadrage to Feature.json
412
+ ### 8. Write Cadrage to Feature.json
252
413
 
253
- Use ba-writer to enrich master feature.json. **Follow the STRUCTURE CARDS below exactly.**
414
+ Use ba-writer to enrich master feature.json. **Follow the STRUCTURE CARDS exactly.**
254
415
 
255
416
  See [references/cadrage-structure-cards.md](../references/cadrage-structure-cards.md) for exact JSON formats of: `stakeholders[]`, `applicationRoles[]`, `risks[]`, `acceptanceCriteria[]`, `coverageMatrix[]`, `codebaseContext`.
256
417
 
@@ -259,21 +420,21 @@ ba-writer.enrichSection({
259
420
  featureId: {feature_id},
260
421
  section: "cadrage",
261
422
  data: {
262
- problem: {Q1.1 answer},
263
- asIs: {Q1.2 answer},
264
- toBe: {Q1.3 answer},
265
- trigger: {Q1.4 answer},
266
- stakeholders: [{mapped from Q2.x — use STRUCTURE CARD format}],
423
+ problem: {from Phase 3, section 4a — Q1.1 answer or refined problem},
424
+ asIs: {from Phase 3, section 4a — Q1.4 answer},
425
+ toBe: {from Phase 3, section 4a — Q1.8 answer},
426
+ trigger: {from Phase 3, section 4a — Q1.11 answer},
427
+ stakeholders: [{from Phase 3, section 4b — use STRUCTURE CARD format}],
267
428
  globalScope: {
268
- mustHave: [{from Q3.x}],
269
- shouldHave: [{from Q3.x}],
270
- couldHave: [{from Q3.x}],
271
- outOfScope: [{from Q3.x}]
429
+ mustHave: [{from Phase 3, section 4c + Phase 4 accepted suggestions}],
430
+ shouldHave: [{from coverage matrix}],
431
+ couldHave: [{from coverage matrix}],
432
+ outOfScope: [{from Phase 3, section 4c — Q3.4 exclusions}]
272
433
  },
273
- applicationRoles: [{from section 6 — use STRUCTURE CARD format}],
274
- risks: [{from section 8 — use STRUCTURE CARD format}],
275
- acceptanceCriteria: [{derived from scope — use STRUCTURE CARD format}],
276
- coverageMatrix: [{from section 9 — use STRUCTURE CARD format}],
434
+ applicationRoles: [{from Phase 5, section 6 — use STRUCTURE CARD format}],
435
+ risks: [{from Phase 3, section 4e — use STRUCTURE CARD format}],
436
+ acceptanceCriteria: [{from Phase 3, section 4e — use STRUCTURE CARD format}],
437
+ coverageMatrix: [{from Phase 5, section 7 — use STRUCTURE CARD format with anticipatedSections and anticipatedResources}],
277
438
  codebaseContext: "{string summary of codebase findings}"
278
439
  }
279
440
  })
@@ -281,7 +442,7 @@ ba-writer.enrichSection({
281
442
  ba-writer.updateStatus({feature_id}, "framed")
282
443
  ```
283
444
 
284
- ### 11. Display Summary
445
+ ### 9. Display Summary
285
446
 
286
447
  ```
287
448
  ## Cadrage Complete - {feature_id}
@@ -293,10 +454,14 @@ ba-writer.updateStatus({feature_id}, "framed")
293
454
  | Application roles | {count} |
294
455
  | Risks identified | {count} |
295
456
  | Suggestions accepted | {count} |
457
+ | Anticipated sections | {total across all modules} |
296
458
 
297
459
  ### Application Roles
298
460
  {table of roles with permission levels}
299
461
 
462
+ ### Coverage Highlights
463
+ {top 3-5 must-have items with their anticipated sections}
464
+
300
465
  ### Next Step
301
466
  → Module decomposition (step-02-decomposition.md)
302
467
  ```