@atlashub/smartstack-cli 4.18.0 → 4.19.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 (160) hide show
  1. package/package.json +1 -1
  2. package/templates/agents/ba-reader.md +86 -80
  3. package/templates/agents/ba-writer.md +318 -415
  4. package/templates/agents/docs-context-reader.md +3 -3
  5. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
  6. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +126 -0
  7. package/templates/skills/apex/SKILL.md +29 -16
  8. package/templates/skills/apex/_shared.md +62 -9
  9. package/templates/skills/apex/references/analysis-methods.md +8 -6
  10. package/templates/skills/apex/references/challenge-questions.md +5 -5
  11. package/templates/skills/apex/references/core-seed-data.md +68 -45
  12. package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +26 -21
  13. package/templates/skills/apex/references/parallel-execution.md +156 -0
  14. package/templates/skills/apex/references/person-extension-pattern.md +12 -12
  15. package/templates/skills/apex/references/post-checks.md +1748 -1726
  16. package/templates/skills/apex/references/smartstack-api.md +63 -57
  17. package/templates/skills/apex/references/smartstack-frontend-compliance.md +594 -0
  18. package/templates/skills/apex/references/smartstack-frontend.md +1246 -1842
  19. package/templates/skills/apex/references/smartstack-layers.md +98 -145
  20. package/templates/skills/apex/steps/step-00-init.md +30 -6
  21. package/templates/skills/apex/steps/step-01-analyze.md +27 -23
  22. package/templates/skills/apex/steps/step-02-plan.md +12 -12
  23. package/templates/skills/apex/steps/step-03-execute.md +198 -143
  24. package/templates/skills/apex/steps/step-04-examine.md +24 -93
  25. package/templates/skills/apex/steps/step-05-deep-review.md +16 -16
  26. package/templates/skills/apex/steps/step-06-resolve.md +9 -9
  27. package/templates/skills/apex/steps/step-07-tests.md +3 -1
  28. package/templates/skills/apex/steps/step-08-run-tests.md +1 -1
  29. package/templates/skills/business-analyse/SKILL.md +182 -301
  30. package/templates/skills/business-analyse/_shared.md +119 -336
  31. package/templates/skills/business-analyse/html/ba-interactive.html +703 -82
  32. package/templates/skills/business-analyse/html/build-html.js +41 -3
  33. package/templates/skills/business-analyse/html/src/partials/cadrage-context.html +34 -0
  34. package/templates/skills/business-analyse/html/src/partials/cadrage-risks.html +48 -0
  35. package/templates/skills/business-analyse/html/src/partials/cadrage-scope.html +49 -0
  36. package/templates/skills/business-analyse/html/src/partials/cadrage-stakeholders.html +55 -0
  37. package/templates/skills/business-analyse/html/src/partials/cadrage-success.html +34 -0
  38. package/templates/skills/business-analyse/html/src/partials/consol-datamodel.html +8 -0
  39. package/templates/skills/business-analyse/html/src/partials/consol-flows.html +29 -0
  40. package/templates/skills/business-analyse/html/src/partials/consol-interactions.html +8 -0
  41. package/templates/skills/business-analyse/html/src/partials/consol-permissions.html +8 -0
  42. package/templates/skills/business-analyse/html/src/partials/decomp-dependencies.html +38 -0
  43. package/templates/skills/business-analyse/html/src/partials/decomp-modules.html +51 -0
  44. package/templates/skills/business-analyse/html/src/partials/handoff-summary.html +24 -0
  45. package/templates/skills/business-analyse/html/src/partials/module-spec-container.html +4 -0
  46. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +17 -1
  47. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +31 -5
  48. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +100 -63
  49. package/templates/skills/business-analyse/html/src/scripts/06-render-mockups.js +372 -0
  50. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
  51. package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
  52. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
  53. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +142 -0
  54. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +94 -0
  55. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +150 -0
  56. package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
  57. package/templates/skills/business-analyse/questionnaire.md +23 -280
  58. package/templates/skills/business-analyse/react/application-viewer.md +2 -2
  59. package/templates/skills/business-analyse/react/components.md +4 -4
  60. package/templates/skills/business-analyse/react/i18n-template.md +1 -1
  61. package/templates/skills/business-analyse/react/schema.md +14 -14
  62. package/templates/skills/business-analyse/references/acceptance-criteria.md +21 -21
  63. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
  64. package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
  65. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +5 -5
  66. package/templates/skills/business-analyse/references/deploy-data-build.md +12 -11
  67. package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
  68. package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
  69. package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
  70. package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
  71. package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
  72. package/templates/skills/business-analyse/references/robustness-checks.md +36 -36
  73. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  74. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  75. package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
  76. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  77. package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
  78. package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
  79. package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
  80. package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
  81. package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
  82. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  83. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
  84. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
  85. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  86. package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -4
  87. package/templates/skills/business-analyse/steps/step-00-init.md +68 -77
  88. package/templates/skills/business-analyse/steps/step-01-cadrage.md +54 -180
  89. package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
  90. package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
  91. package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
  92. package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
  93. package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
  94. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  95. package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
  96. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
  97. package/templates/skills/business-analyse/templates-react.md +2 -2
  98. package/templates/skills/derive-prd/SKILL.md +92 -0
  99. package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
  100. package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
  101. package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
  102. package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
  103. package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
  104. package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -263
  105. package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
  106. package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
  107. package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
  108. package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
  109. package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
  110. package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
  111. package/templates/skills/ralph-loop/SKILL.md +2 -1
  112. package/templates/skills/ralph-loop/references/init-resume-recovery.md +1 -1
  113. package/templates/skills/ralph-loop/steps/step-01-task.md +2 -2
  114. package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
  115. package/templates/skills/business-analyse/_architecture.md +0 -124
  116. package/templates/skills/business-analyse/_elicitation.md +0 -206
  117. package/templates/skills/business-analyse/_module-loop.md +0 -115
  118. package/templates/skills/business-analyse/_rules.md +0 -142
  119. package/templates/skills/business-analyse/_suggestions.md +0 -34
  120. package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
  121. package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
  122. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
  123. package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
  124. package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
  125. package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
  126. package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
  127. package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
  128. package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
  129. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
  130. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -58
  131. package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
  132. package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
  133. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
  134. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
  135. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
  136. package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -366
  137. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
  138. package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
  139. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
  140. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
  141. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
  142. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
  143. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
  144. package/templates/skills/business-analyse/references/team-orchestration.md +0 -1093
  145. package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
  146. package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
  147. package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
  148. package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
  149. package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -486
  150. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -300
  151. package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -405
  152. package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -516
  153. package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -691
  154. package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
  155. package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
  156. package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
  157. package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
  158. package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -937
  159. package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
  160. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
@@ -2,10 +2,10 @@
2
2
  name: step-01-cadrage
3
3
  description: Application/module framing - listen, reformulate, challenge, anticipate, bound scope
4
4
  model: opus
5
- next_step: steps/step-01b-applications.md
5
+ next_step: steps/step-02-structure.md
6
6
  ---
7
7
 
8
- > **Context files:** `_shared.md` | `_elicitation.md` | `_architecture.md` | `_suggestions.md`
8
+ > **Context files:** `_shared.md`
9
9
  > **Reference (4d-bis):** `references/entity-architecture-decision.md` — Entity scoring, domain coherence, section patterns
10
10
 
11
11
  # Step 1: Cadrage (Framing)
@@ -13,11 +13,11 @@ next_step: steps/step-01b-applications.md
13
13
  ## MANDATORY EXECUTION RULES
14
14
 
15
15
  - ALWAYS use ULTRATHINK mode for this step
16
- - ALWAYS apply the Elicitation Techniques from `_elicitation.md`
16
+ - ALWAYS apply the Elicitation Techniques from `_shared.md`
17
17
  - NEVER accept vague answers — probe deeper
18
18
  - NEVER define entities or business rules here — that's per-module in step-03
19
19
  - ALL questions via AskUserQuestion tool (NEVER as text dumps)
20
- - ALL communication in `{language}` (from feature.json.metadata.language)
20
+ - ALL communication in `{language}` (from index.json metadata.language)
21
21
  - **NEVER skip the reformulation phase** — it is the foundation of good analysis
22
22
  - **NEVER auto-infer cadrage data without client validation** — every key decision is confirmed
23
23
 
@@ -41,36 +41,19 @@ Phase 5: PERIMETRE → Bound scope with roles, coverage matrix (sections
41
41
 
42
42
  ---
43
43
 
44
- ## PROJECT vs APPLICATION MODE
45
-
46
- > **When `workflow_mode = "project"` (detected in step-00 from prompt structure):**
47
- > The cadrage operates at the **PROJECT level**, not at a single application level.
48
- > - Phase 1-3: Gather requirements for the ENTIRE project (all applications combined)
49
- > - Phase 4: ANTICIPATION analyzes cross-application shared modules and suggests extracting them as dedicated applications
50
- > - Phase 5: Coverage matrix maps requirements to APPLICATIONS first, then modules within each application
51
- > - `candidate_applications` from step-00 are used as starting structure (can be modified during cadrage)
52
- >
53
- > **When `workflow_mode = "application"` (single-app):**
54
- > The cadrage operates at the application level as before.
55
-
56
44
  ## PHASE 1: ECOUTE (Listen)
57
45
 
58
46
  ### 1. Read Current State
59
47
 
60
48
  ```
61
- IF workflow_mode === "project":
62
- ba-reader.findProjectFeature({project_id})
63
- → Read metadata: projectName, language, candidateApplications
64
- → Read cadrage section (if resuming)
65
- ELSE:
66
- ba-reader.findFeature({feature_id})
67
- → Read metadata: application, language, workflow.mode, useCase
68
- → Read cadrage section (if resuming)
49
+ ba-reader.findFeature({feature_id})
50
+ → Read metadata: application, language, workflow.mode, useCase
51
+ → Read cadrage section (if resuming)
69
52
  ```
70
53
 
71
54
  IF cadrage already completed (status = "framed"):
72
55
  Display: "Cadrage already completed. Loading next step."
73
- Load: steps/step-02-decomposition.md
56
+ Load: steps/step-02-structure.md
74
57
  STOP
75
58
 
76
59
  ### 2. Codebase Pre-Research
@@ -98,7 +81,7 @@ Launch 4 agents in parallel:
98
81
  Agent 1: Search for existing domain entities (Glob: **/Domain/**/*.cs)
99
82
  Agent 2: Search for existing services/integrations (Grep: IService, IRepository)
100
83
  Agent 3: Search for existing page patterns (Glob: **/pages/**/*.tsx)
101
- Agent 4: Scan existing BA documentation (Glob: docs/**/business-analyse/**/feature.json)
84
+ Agent 4: Scan existing BA documentation (Glob: docs/**/business-analyse/**/index.json)
102
85
  → For each found file: read metadata.application, metadata.module, status, modules[].code
103
86
  → Also scan: docs/**/*.md (ERD, guides, specs)
104
87
 
@@ -111,7 +94,7 @@ Merge findings into {codebase_context}
111
94
  > This prevents re-specifying what already exists and surfaces integration constraints early.
112
95
 
113
96
  ```
114
- IF Agent 4 found existing feature.json files:
97
+ IF Agent 4 found existing index.json files:
115
98
  For each file found:
116
99
  → Extract: application, modules[], entities[], status, version
117
100
  → Store as {existing_ba_context}: list of existing applications with their modules and key entities
@@ -123,16 +106,14 @@ IF docs/**/*.md files found:
123
106
  → Store relevant findings in {codebase_context}
124
107
  ```
125
108
 
126
- **Use in pre-analysis (§2b):**
109
+ **Use in pre-analysis:**
127
110
  - Cross-reference detected modules against `{existing_ba_context}` — flag modules that already exist
128
111
  - Pre-identify integration points: new feature may depend on or extend existing modules
129
112
  - NEVER re-specify what's already handed-off (status = "handed-off") — reference it instead
130
113
 
131
114
  ### 2b. Silent Pre-Analysis (ULTRATHINK — no output to client)
132
115
 
133
- > **The AI prepares the conversation before speaking.** This is NOT output — it's internal reasoning.
134
-
135
- Load: [references/cadrage-pre-analysis.md](../references/cadrage-pre-analysis.md)
116
+ > **The AI prepares the conversation before speaking. This is NOT output — it's internal reasoning.**
136
117
 
137
118
  Analyze `{feature_description}` silently:
138
119
 
@@ -146,7 +127,7 @@ Analyze `{feature_description}` silently:
146
127
  4. **Prepare challenge questions** — specific to this brief, not generic
147
128
  5. **Pre-identify anticipated sections and resources** per detected module
148
129
 
149
- Store in `{pre_analysis}` (internal use only, NOT written to feature.json):
130
+ Store in `{pre_analysis}` (internal use only, NOT written to index.json):
150
131
  ```yaml
151
132
  pre_analysis:
152
133
  problem_type: "new_tool|replace|automate|centralize"
@@ -222,7 +203,7 @@ options:
222
203
 
223
204
  > **Principle: Do NOT ask ALL questions from ALL questionnaires.**
224
205
  > Select the RELEVANT questions based on the pre-analysis and detected shadow zones.
225
- > Apply elicitation techniques from `_elicitation.md` after each batch.
206
+ > Apply elicitation techniques from `_shared.md` after each batch.
226
207
  > The goal is a CONVERSATION, not an interrogation.
227
208
 
228
209
  #### 4a. Business Context (ALWAYS — from `questionnaire/01-context.md`)
@@ -240,7 +221,7 @@ Apply ULTRATHINK after each batch:
240
221
  - If answer is superficial → apply Technique 2 (chain of whys)
241
222
  - If answer is excellent → record and move on
242
223
 
243
- #### 4b. Stakeholders (ALWAYS — from `questionnaire/02-stakeholders.md`)
224
+ #### 4b. Stakeholders (ALWAYS — from `questionnaire/02-stakeholders-scope.md`)
244
225
 
245
226
  **Mandatory minimum:** Q2.1 (users), Q2.5 (tasks per profile), Q2.9 (access levels).
246
227
 
@@ -249,7 +230,7 @@ Ask in 1-2 batches. After each batch:
249
230
  - If "everyone sees everything" → challenge: "Even interns? Contractors? Salary data?"
250
231
  - If tasks are generic → ask for a concrete scenario: "Walk me through a typical day"
251
232
 
252
- #### 4c. Functional Scope (ALWAYS — from `questionnaire/03-scope.md`)
233
+ #### 4c. Functional Scope (ALWAYS — from `questionnaire/02-stakeholders-scope.md`)
253
234
 
254
235
  **Mandatory minimum:** Q3.2 (must-have), Q3.4 (exclusions), Q3.5 (main journey).
255
236
 
@@ -270,16 +251,15 @@ Ask in 1-2 batches. After each batch:
270
251
  > { "scenario": "...", "trigger": "...", "notification": "...", "recovery": "rollback|partial|manual" }
271
252
  > ```
272
253
  >
273
- > These error flows become **Business Rules** in step-03a2 (BR-WF category: workflow/guard conditions).
274
-
254
+ > These error flows become **Business Rules** in step-03 (BR-WF category: workflow/guard conditions).
255
+ >
275
256
  > **BLOCKING RULE — MoSCoW DISTRIBUTION:**
276
257
  > If the client classifies ALL features as "must-have", you MUST challenge this BEFORE proceeding.
277
- > **Reference:** Load `references/cadrage-challenge-patterns.md` § "MoSCoW Prioritization Template" for the exact question format.
278
258
  > If client moves items → update categories. If client confirms ALL mustHave → accept but log in changelog.
279
259
 
280
260
  #### 4d. Challenge Implicit Assumptions (CRITICAL)
281
261
 
282
- > **Reference:** Load `references/cadrage-challenge-patterns.md` for domain-specific patterns and elicitation techniques.
262
+ > **Load reference material from `_shared.md` for domain-specific patterns and elicitation techniques.**
283
263
 
284
264
  Apply elicitation techniques to challenge what the client considers "obvious".
285
265
  This is what separates a deep analysis from a shallow one.
@@ -456,44 +436,42 @@ options:
456
436
  |--------|--------|
457
437
  | **Géré dans l'app** | Entity becomes a sub-entity of the parent module. Add as a **tab in the detail page** of the referencing module. Note in coverageMatrix with `parentModule` field. |
458
438
  | **Nouveau module dédié** | **Add new module to `{pre_analysis}.detected_modules[]`** with the proposed architecture (sections, detail tabs, dependencies). Add to `coverageMatrix` as mustHave. The `list` section is ALWAYS the main section. Additional sections ONLY for distinct functional zones (dashboard, approve, import...). `create` and `edit` are ACTIONS within `list` and detail pages, NEVER standalone sections. |
459
- | **Système externe** | Flag for integration specification. Add to `coverageMatrix` as integration. Load `questionnaire/05-integrations.md` if not already loaded. |
439
+ | **Système externe** | Flag for integration specification. Add to `coverageMatrix` as integration. Load questionnaire materials on integrations if not already covered. |
460
440
  | **Liste simple en config** | Entity becomes a lookup/reference table (no dedicated module, no section). Note in coverageMatrix as config data. |
461
441
 
462
442
  > **CRITICAL:** The intelligence of this step is in the ULTRATHINK analysis. The AI must REASON about domain coherence, score the entity, and recommend — not just present 4 neutral options. The client can always override the recommendation, but they should benefit from expert architectural guidance.
463
443
 
464
- #### 4e. Risks & Success Criteria (ALWAYS — from `questionnaire/14-risk-assumptions.md` and `questionnaire/15-success-metrics.md`)
444
+ #### 4e. Risks & Success Criteria (ALWAYS — from `questionnaire/04-risks-metrics.md`)
465
445
 
466
446
  Select the most pertinent questions:
467
- - **14-risk-assumptions.md:** Q14.1 (identified risks), Q14.4 (unvalidated assumptions)
468
- - **15-success-metrics.md:** Q15.1 (success definition), Q15.4 (measurable objectives)
447
+ - **04-risks-metrics.md:** Risk identification, assumptions validation
448
+ - **04-risks-metrics.md:** Success definition, measurable objectives
469
449
 
470
450
  Ask in 1 batch via AskUserQuestion.
471
451
 
472
452
  #### 4f. Conditional Deep-Dives
473
453
 
474
- Based on brief analysis, load additional categories if relevant:
454
+ Based on brief analysis, load additional materials if relevant:
475
455
 
476
- | Condition | Category | Questionnaire |
477
- |-----------|----------|---------------|
478
- | Security or compliance mentioned | 06 | `questionnaire/06-security.md` |
479
- | External system integration | 05 | `questionnaire/05-integrations.md` |
480
- | Performance requirements | 08 | `questionnaire/08-performance.md` |
481
- | Technical constraints | 09 | `questionnaire/09-constraints.md` |
456
+ | Condition | Questionnaire |
457
+ |-----------|---------------|
458
+ | Security or compliance mentioned | `questionnaire/03-data-ui.md` (security section) |
459
+ | External system integration | `questionnaire/05-cross-module.md` (integration section) |
460
+ | Performance requirements | Additional probing on non-functional needs |
461
+ | Technical constraints | Additional probing on platform constraints |
482
462
 
483
- > **Categories 04 (data), 07 (UI), 11 (lifecycle), 12 (migration), 13 (cross-module) are per-module and loaded in step-03.**
484
-
485
- #### 4g. Documentation Needs (ALWAYS — from `questionnaire/10-documentation.md`)
463
+ #### 4g. Documentation Needs (ALWAYS from `questionnaire/03-data-ui.md`)
486
464
 
487
465
  > **Every application requires documentation decisions made upfront, not as an afterthought.**
488
- > Load `questionnaire/10-documentation.md` unconditionally — 7 questions, mandatory minimum 2 (Q10.1 + Q10.2).
466
+ > Load relevant documentation section from questionnaire/03-data-ui.md
489
467
 
490
468
  Ask in 1 batch via AskUserQuestion (max 3 questions):
491
- - Q10.1: Will users need documentation (guide, FAQ, in-app tooltips)?
492
- - Q10.2: Is technical documentation required (API docs, ERD, developer guide)?
493
- - Q10.3: Who is responsible for maintaining documentation after delivery?
469
+ - Will users need documentation (guide, FAQ, in-app tooltips)?
470
+ - Is technical documentation required (API docs, ERD, developer guide)?
471
+ - Who is responsible for maintaining documentation after delivery?
494
472
 
495
473
  After the batch:
496
- - If "Non" to Q10.1 AND Q10.2 → probe: "Pas même les docs API ou un guide d'accueil pour les nouveaux utilisateurs ?"
474
+ - If "Non" to both → probe: "Pas même les docs API ou un guide d'accueil pour les nouveaux utilisateurs ?"
497
475
  - If "Oui" without detail → ask format: "Tooltips intégrés ? Guide PDF ? Wiki ? Portail dédié ?"
498
476
  - If "La doc se fera après" → challenge: "La documentation est planifiée maintenant et générée par `/documentation` après `/ralph-loop`. Quel niveau souhaitez-vous ?"
499
477
 
@@ -507,7 +485,7 @@ After the batch:
507
485
  }
508
486
  ```
509
487
 
510
- This feeds directly into handoff step-05a category `documentation` in `filesToCreate`.
488
+ This feeds directly into handoff step-05 category `documentation` in `filesToCreate`.
511
489
 
512
490
  ---
513
491
 
@@ -520,7 +498,7 @@ This feeds directly into handoff step-05a category `documentation` in `filesToCr
520
498
 
521
499
  **Process:**
522
500
 
523
- 1. Load: `patterns/suggestion-catalog.md`
501
+ 1. Load pattern guidance from `_shared.md`
524
502
  2. Match suggestion patterns against the project context (domain, modules, features)
525
503
  3. Add implicit needs for this type of system that weren't mentioned
526
504
 
@@ -559,21 +537,6 @@ options:
559
537
 
560
538
  6. Accepted suggestions enrich `coverageMatrix` and `globalScope`.
561
539
 
562
- ### 5b. Cross-Application Shared Module Detection (PROJECT MODE ONLY)
563
-
564
- > **When `workflow_mode = "project"`, analyze candidate applications for shared modules.**
565
- > A module that appears in 2+ applications should be extracted as a dedicated transversal application.
566
-
567
- **This section is SKIPPED if `workflow_mode !== "project"`.**
568
-
569
- **Reference:** Load `references/cadrage-shared-modules.md` for detection algorithm, extraction logic, and question template.
570
-
571
- The detection process:
572
- 1. Build module inventory per candidate application
573
- 2. Detect modules appearing in 2+ applications
574
- 3. Propose extraction to user with the template from the reference
575
- 4. IF "Yes" → Extract and update `candidate_applications` in the project feature.json
576
-
577
540
  ---
578
541
 
579
542
  ## PHASE 5: PERIMETRE (Bound Scope)
@@ -608,9 +571,6 @@ options:
608
571
  description: "{language == 'fr' ? 'Modifier le nombre ou les permissions des rôles' : 'Modify number or permissions of roles'}"
609
572
  ```
610
573
 
611
- IF single-module mode:
612
- Same role definition but inferred from stakeholders
613
-
614
574
  ### 6b. Table Prefix Definition (MANDATORY)
615
575
 
616
576
  > **Every business application MUST define a table prefix.**
@@ -652,8 +612,6 @@ options:
652
612
 
653
613
  ### 7. Coverage Matrix with Sections & Resources (MANDATORY)
654
614
 
655
- > **Reference:** Load `references/cadrage-coverage-matrix.md` for complete coverage matrix building and validation rules.
656
-
657
615
  **ENRICHMENT:** The coverage matrix now includes anticipated sections (Level 4) and resources (Level 5).
658
616
  This gives downstream steps (step-02, step-03) a concrete starting point.
659
617
 
@@ -699,49 +657,40 @@ BEFORE transitioning to step-02:
699
657
 
700
658
  7. Iterate until the client confirms
701
659
 
702
- **The reference file includes:**
703
- - Section rule clarification (list, detail, create, edit, dashboard, etc.)
704
- - Priority distribution POST-CHECK (BLOCKING)
705
- - Cross-cutting coverage POST-CHECK (WARNING)
706
-
707
660
  ---
708
661
 
709
662
  ## WRITE & SUMMARY
710
663
 
711
664
  ### 8. Write Cadrage to Feature.json
712
665
 
713
- Use ba-writer to enrich master feature.json. **Follow the STRUCTURE CARDS exactly.**
714
-
715
- See [references/cadrage-structure-cards.md](../references/cadrage-structure-cards.md) for exact JSON formats of: `stakeholders[]`, `applicationRoles[]`, `risks[]`, `acceptanceCriteria[]`, `coverageMatrix[]`, `codebaseContext`.
666
+ Use ba-writer with granular JSON approach. Write to `cadrage.json` section:
716
667
 
717
668
  ```
718
- ba-writer.enrichSection({
719
- featureId: {feature_id},
720
- section: "metadata",
721
- data: {
722
- tablePrefix: "{from Phase 5, section 6b — validated prefix, e.g., rh_}"
723
- }
724
- })
725
-
726
669
  ba-writer.enrichSection({
727
670
  featureId: {feature_id},
728
671
  section: "cadrage",
672
+ subsection: "cadrage.json",
729
673
  data: {
674
+ metadata: {
675
+ tablePrefix: "{from Phase 5, section 6b — validated prefix, e.g., rh_}"
676
+ },
730
677
  problem: {from Phase 3, section 4a — Q1.1 answer or refined problem},
731
678
  asIs: {from Phase 3, section 4a — Q1.4 answer},
732
679
  toBe: {from Phase 3, section 4a — Q1.8 answer},
733
680
  trigger: {from Phase 3, section 4a — Q1.11 answer},
734
- stakeholders: [{from Phase 3, section 4b — use STRUCTURE CARD format}],
681
+ stakeholders: [{from Phase 3, section 4b}],
735
682
  globalScope: {
736
683
  mustHave: [{from Phase 3, section 4c + Phase 4 accepted suggestions}],
737
684
  shouldHave: [{from coverage matrix}],
738
685
  couldHave: [{from coverage matrix}],
739
686
  outOfScope: [{from Phase 3, section 4c — Q3.4 exclusions}]
740
687
  },
741
- applicationRoles: [{from Phase 5, section 6 — use STRUCTURE CARD format}],
742
- risks: [{from Phase 3, section 4e — use STRUCTURE CARD format}],
743
- acceptanceCriteria: [{from Phase 3, section 4e — use STRUCTURE CARD format}],
744
- coverageMatrix: [{from Phase 5, section 7 — use STRUCTURE CARD format with anticipatedSections and anticipatedResources}],
688
+ applicationRoles: [{from Phase 5, section 6}],
689
+ errorFlows: [{from Phase 3, section 4c}],
690
+ risks: [{from Phase 3, section 4e}],
691
+ acceptanceCriteria: [{from Phase 3, section 4e}],
692
+ coverageMatrix: [{from Phase 5, section 7 — with anticipatedSections and anticipatedResources}],
693
+ documentation: {from Phase 3, section 4g},
745
694
  codebaseContext: "{string summary of codebase findings}"
746
695
  }
747
696
  })
@@ -749,82 +698,7 @@ ba-writer.enrichSection({
749
698
  ba-writer.updateStatus({feature_id}, "framed")
750
699
  ```
751
700
 
752
- ### 9. Multi-Application Detection
753
-
754
- > **Analyze whether the project spans multiple independent applications.**
755
- > **SKIP this section entirely if `workflow_mode = "project"`** — multi-app was already detected in step-00
756
- > and cross-app analysis was done in section 5b above.
757
-
758
- **IF `workflow_mode === "project"`:**
759
- → SKIP section 9 entirely. Candidate applications are already identified and enriched.
760
- → Write cadrage data to project-level feature.json:
761
- ```
762
- ba-writer.enrichSection({
763
- projectId: {project_id},
764
- section: "cadrage",
765
- data: {cadrage data collected in phases 1-5 above}
766
- })
767
- ```
768
- → Continue to section 10 (summary).
769
-
770
- **IF `workflow_mode === "application"` (single-app mode):**
771
-
772
- After coverage matrix is validated, check if the identified functional domains suggest multiple applications:
773
-
774
- **Detection triggers (ANY of these = suggest multi-app):**
775
- - Coverage matrix entries reference different application scopes (administration, support, myspace, etc.)
776
- - User mentioned "multiple applications", "several apps", "cross-platform"
777
- - Functional domains form clearly independent applications with separate user bases
778
- - Stakeholders only interact with specific domains (not shared across all)
779
-
780
- **IF detection triggers matched:**
781
-
782
- Display analysis as markdown:
783
- ```
784
- {language == "fr"
785
- ? "### Analyse multi-application\n\nD'après mon analyse, ce projet couvre plusieurs domaines fonctionnels qui pourraient former des applications indépendantes :\n\n"
786
- : "### Multi-Application Analysis\n\nBased on my analysis, this project spans multiple functional domains that could form independent applications:\n\n"}
787
-
788
- | Domain | Suggested Application | Key Modules |
789
- |--------|----------------------|-------------|
790
- {for each identified domain: domain name | PascalCase name | top modules}
791
- ```
792
-
793
- Ask via AskUserQuestion:
794
- ```
795
- question: "{language == 'fr' ? 'Ce projet constitue-t-il une seule application ou plusieurs applications distinctes ?' : 'Is this a single application or multiple independent applications?'}"
796
- header: "Architecture"
797
- options:
798
- - label: "{language == 'fr' ? 'Application unique' : 'Single application'}"
799
- description: "{language == 'fr' ? 'Tous les domaines forment une seule application avec plusieurs modules' : 'All domains form one application with multiple modules'}"
800
- - label: "{language == 'fr' ? 'Applications multiples' : 'Multiple applications'}"
801
- 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)'}"
802
- ```
803
-
804
- **IF "Multiple applications":**
805
- 1. Create project-level feature.json:
806
- ```
807
- ba-writer.createProjectFeature({
808
- metadata: {
809
- projectName: {project_name derived from feature_description},
810
- language: {language},
811
- featureDescription: {feature_description},
812
- candidateApplications: [{detected candidates}]
813
- },
814
- cadrage: {cadrage data already collected in this step}
815
- })
816
- ```
817
- 2. Set `workflow_mode = "project"` and `project_id = PROJ-NNN`
818
- 3. Load `questionnaire/00b-project.md` for additional project-level questions
819
- 4. Continue to section 10 and then step-01b
820
-
821
- **IF "Single application":**
822
- → Continue to step 10 (display summary) and step-02 as usual.
823
-
824
- **IF no detection triggers matched:**
825
- → Skip this section entirely — continue to step 10 (display summary).
826
-
827
- ### 10. Display Summary
701
+ ### 9. Display Summary
828
702
 
829
703
  ```
830
704
  ## Cadrage Complete - {feature_id}
@@ -845,13 +719,13 @@ ba-writer.createProjectFeature({
845
719
  {top 3-5 must-have items with their anticipated sections}
846
720
 
847
721
  ### Next Step
848
- → Module decomposition (step-02-decomposition.md)
722
+ → Module structure analysis (step-02-structure.md)
849
723
  ```
850
724
 
851
725
  ---
852
726
 
853
727
  ## NEXT STEP
854
728
 
855
- Load: `./step-01b-applications.md`
729
+ Load: `./step-02-structure.md`
856
730
 
857
- > step-01b handles both single-app (lightweight identity confirmation) and multi-app (full application decomposition).
731
+ > step-02 handles module structure analysis and entity/section definition.
@@ -0,0 +1,175 @@
1
+ ---
2
+ name: step-02-structure
3
+ description: Identify and challenge hierarchy - App > Module > Section > Resource
4
+ model: opus
5
+ next_step: steps/step-03-specify.md
6
+ ---
7
+
8
+ # Step 02 — Structure (Identify & Challenge)
9
+
10
+ ## Objective
11
+
12
+ Identify the complete hierarchy **Application > Module > Section > Resource** from the cadrage data, then CHALLENGE each element to ensure nothing is missing or superfluous.
13
+
14
+ ## Prerequisites
15
+
16
+ - Step 01 (cadrage) completed
17
+ - `cadrage.json` available with context, stakeholders, scope, risks
18
+
19
+ ## Input
20
+
21
+ Load via ba-reader:
22
+ - `cadrage.json` — framing data from step 01
23
+
24
+ ## Process
25
+
26
+ ### 1. Application Detection
27
+
28
+ Analyze the cadrage scope to determine if this is single-app or multi-app:
29
+
30
+ **Single-app indicators:**
31
+ - All scope items relate to one domain
32
+ - Single set of stakeholders
33
+ - No mention of separate systems
34
+
35
+ **Multi-app indicators:**
36
+ - Scope items spanning distinct domains (e.g., HR + CRM + Accounting)
37
+ - Different stakeholder groups per domain
38
+ - Mentions of separate applications or systems
39
+
40
+ If multi-app:
41
+ ```
42
+ For each application:
43
+ - Code (PascalCase)
44
+ - Name (display name)
45
+ - Route (URL prefix)
46
+ - Icon (optional)
47
+ - Description
48
+ ```
49
+
50
+ If single-app: derive application from project context.
51
+
52
+ ### 2. Module Identification
53
+
54
+ For each application, identify functional modules:
55
+
56
+ ```
57
+ For each module:
58
+ - Code (PascalCase)
59
+ - Name (display name)
60
+ - ApplicationCode (parent app)
61
+ - Description
62
+ - FeatureType (data-centric | workflow | reporting | integration | full-module)
63
+ - Priority (must | should | could)
64
+ - Entities (preliminary list)
65
+ ```
66
+
67
+ ### 3. Section & Resource Anticipation
68
+
69
+ For each module, anticipate the navigation structure:
70
+
71
+ ```
72
+ For each section:
73
+ - code (kebab-case, e.g., "list", "detail", "dashboard")
74
+ - label (display name)
75
+ - resources: [
76
+ { code, type (SmartTable|SmartForm|SmartCard|SmartKanban|SmartDashboard|SmartFilter), label }
77
+ ]
78
+ ```
79
+
80
+ Common patterns:
81
+ - **Data-centric module**: list (SmartTable) + detail (SmartForm)
82
+ - **Workflow module**: list + detail + kanban (SmartKanban)
83
+ - **Reporting module**: dashboard (SmartDashboard) + detail
84
+ - **Full module**: list + detail + dashboard
85
+
86
+ ### 4. Dependency Graph
87
+
88
+ Map dependencies between modules:
89
+ ```
90
+ For each dependency:
91
+ - from: module code
92
+ - to: module code (depends on)
93
+ - description: nature of dependency
94
+ ```
95
+
96
+ ### 5. CHALLENGE Phase
97
+
98
+ For EACH identified element, ask yourself:
99
+
100
+ **Applications:**
101
+ - Is this really a separate application or should it be a module?
102
+ - Are there shared users between applications?
103
+
104
+ **Modules:**
105
+ - Is this module too large? Should it be split?
106
+ - Is this module too small? Should it merge with another?
107
+ - Does every scope item have at least one module covering it?
108
+ - Are there scope items NOT covered by any module?
109
+
110
+ **Sections:**
111
+ - Does this module need a dashboard?
112
+ - Is the list/detail pattern sufficient or are there other views?
113
+ - Are there workflow steps that need dedicated sections?
114
+
115
+ **Resources:**
116
+ - Is SmartTable the right component for this list?
117
+ - Does the form need tabs?
118
+ - Are there missing filter components?
119
+
120
+ ### 6. Present to User
121
+
122
+ Display the complete hierarchy for validation:
123
+
124
+ ```
125
+ [App: HumanResources]
126
+ ├── [Module: Employees] (must)
127
+ │ ├── list → SmartTable (employees-grid)
128
+ │ └── detail → SmartForm (employee-form)
129
+ ├── [Module: Absences] (must)
130
+ │ ├── list → SmartTable (absences-grid)
131
+ │ ├── detail → SmartForm (absence-form)
132
+ │ └── calendar → SmartKanban (absences-calendar)
133
+ └── [Module: Reports] (should)
134
+ └── dashboard → SmartDashboard (hr-dashboard)
135
+ ```
136
+
137
+ Ask: "Does this structure match your vision? Any missing modules, sections, or resources?"
138
+
139
+ ## Output
140
+
141
+ Write via ba-writer:
142
+ 1. **Application index** (`docs/{app}/business-analyse/v1.0/index.json`) with modules list
143
+ 2. **Module registrations** in application index
144
+ 3. **Each module's anticipated sections** as `anticipatedSections` in module data
145
+
146
+ ### Data written
147
+
148
+ ```json
149
+ {
150
+ "applications": [
151
+ { "code": "HumanResources", "name": "Ressources Humaines", "route": "/hr", "modules": ["Employees", "Absences"] }
152
+ ],
153
+ "modules": [
154
+ {
155
+ "code": "Employees",
156
+ "applicationCode": "HumanResources",
157
+ "name": "Employes",
158
+ "featureType": "data-centric",
159
+ "priority": "must",
160
+ "entities": ["Employee", "Contract"],
161
+ "anticipatedSections": [
162
+ { "code": "list", "label": "Liste", "resources": [{ "code": "employees-grid", "type": "SmartTable" }] },
163
+ { "code": "detail", "label": "Fiche", "resources": [{ "code": "employee-form", "type": "SmartForm" }] }
164
+ ]
165
+ }
166
+ ],
167
+ "dependencies": [
168
+ { "from": "Absences", "to": "Employees", "description": "Une absence reference un employe" }
169
+ ]
170
+ }
171
+ ```
172
+
173
+ ## Transition
174
+
175
+ → Step 03 (specify) — Sequential module specification