@atlashub/smartstack-cli 4.18.0 → 4.20.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 (164) 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 +706 -85
  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 +32 -6
  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/07-render-handoff.js +1 -1
  51. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
  52. package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
  53. package/templates/skills/business-analyse/html/src/template.html +1 -1
  54. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
  55. package/templates/skills/business-analyse/questionnaire/01-context.md +11 -157
  56. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +101 -0
  57. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +92 -0
  58. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +6 -0
  59. package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
  60. package/templates/skills/business-analyse/questionnaire.md +22 -280
  61. package/templates/skills/business-analyse/react/application-viewer.md +2 -2
  62. package/templates/skills/business-analyse/react/components.md +4 -4
  63. package/templates/skills/business-analyse/react/i18n-template.md +1 -1
  64. package/templates/skills/business-analyse/react/schema.md +14 -14
  65. package/templates/skills/business-analyse/references/acceptance-criteria.md +21 -21
  66. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
  67. package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
  68. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +5 -5
  69. package/templates/skills/business-analyse/references/deploy-data-build.md +12 -11
  70. package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
  71. package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
  72. package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
  73. package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
  74. package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
  75. package/templates/skills/business-analyse/references/robustness-checks.md +36 -36
  76. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  77. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  78. package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
  79. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  80. package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
  81. package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
  82. package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
  83. package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
  84. package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
  85. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  86. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
  87. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
  88. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  89. package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -4
  90. package/templates/skills/business-analyse/steps/step-00-init.md +68 -77
  91. package/templates/skills/business-analyse/steps/step-01-cadrage.md +50 -216
  92. package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
  93. package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
  94. package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
  95. package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
  96. package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
  97. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  98. package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
  99. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
  100. package/templates/skills/business-analyse/templates-react.md +2 -2
  101. package/templates/skills/derive-prd/SKILL.md +92 -0
  102. package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
  103. package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
  104. package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
  105. package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
  106. package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
  107. package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -263
  108. package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
  109. package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
  110. package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
  111. package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
  112. package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
  113. package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
  114. package/templates/skills/documentation/SKILL.md +7 -0
  115. package/templates/skills/ralph-loop/SKILL.md +2 -1
  116. package/templates/skills/ralph-loop/references/init-resume-recovery.md +1 -1
  117. package/templates/skills/ralph-loop/steps/step-01-task.md +2 -2
  118. package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
  119. package/templates/skills/business-analyse/_architecture.md +0 -124
  120. package/templates/skills/business-analyse/_elicitation.md +0 -206
  121. package/templates/skills/business-analyse/_module-loop.md +0 -115
  122. package/templates/skills/business-analyse/_rules.md +0 -142
  123. package/templates/skills/business-analyse/_suggestions.md +0 -34
  124. package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
  125. package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
  126. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
  127. package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
  128. package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
  129. package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
  130. package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
  131. package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
  132. package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
  133. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
  134. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -58
  135. package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
  136. package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
  137. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
  138. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
  139. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
  140. package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -366
  141. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
  142. package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
  143. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
  144. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
  145. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
  146. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
  147. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
  148. package/templates/skills/business-analyse/references/team-orchestration.md +0 -1093
  149. package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
  150. package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
  151. package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
  152. package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
  153. package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -486
  154. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -300
  155. package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -405
  156. package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -516
  157. package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -691
  158. package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
  159. package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
  160. package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
  161. package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
  162. package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -937
  163. package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
  164. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
@@ -1,121 +0,0 @@
1
- # Validate: Incremental Interactive HTML Deployment
2
-
3
- > Reference for step-03d-validate.md — section 11-bis incremental HTML deploy after each module.
4
-
5
- ## Why Incremental?
6
-
7
- The client doesn't have to wait until handoff to start reviewing.
8
- While module 2 is being specified, the client can already give feedback on module 1.
9
- Each incremental deployment OVERWRITES the previous HTML (latest state always).
10
- The FINAL deployment at step-05 (handoff) will include consolidation and handoff data.
11
-
12
- ## Deployment Steps
13
-
14
- **Source:** `html/ba-interactive.html` (relative to skill root = `~/.claude/skills/business-analyse/html/`)
15
-
16
- **Destination:** `docs/{app}/business-analyse/v{version}/ba-interactive.html`
17
-
18
- ### Step 1: Read Sources
19
-
20
- - Read the HTML template from skill directory
21
- - Read the master feature.json (application level — now updated with current module status)
22
- - Read EACH completed module's feature.json (including the one just specified)
23
-
24
- ### Step 2: Build FEATURE_DATA Object
25
-
26
- > **Use the EXACT SAME mapping defined in step-05b-deploy.md and references/html-data-mapping.md.**
27
- > The mapping is identical — the only difference is that `moduleSpecs` only includes completed modules.
28
- > Modules not yet specified will NOT appear in `moduleSpecs` (their entry in `modules[]` will show `status: "pending"`).
29
-
30
- Follow step-05 section 9d "Step 2: Build FEATURE_DATA object" for the complete mapping pseudocode:
31
- - `metadata`, `cadrage`, `modules[]`, `dependencies[]` → from master feature.json
32
- - `moduleSpecs[moduleCode]` → only for modules with status "specified" (completed so far)
33
- - `consolidation` → empty `{ interactions: [], e2eFlows: [] }` (not yet consolidated)
34
- - `handoff` → empty `{}` (not yet handed off)
35
-
36
- ### Step 3: Build EMBEDDED_ARTIFACTS Object
37
-
38
- > **CRITICAL: Without EMBEDDED_ARTIFACTS, the Maquettes tab will show EMPTY mockups.**
39
- > Use the EXACT SAME mapping defined in references/deploy-data-build.md and references/html-data-mapping.md.
40
-
41
- Build EMBEDDED_ARTIFACTS with wireframes for completed modules only:
42
-
43
- ```javascript
44
- const EMBEDDED_ARTIFACTS = {
45
- wireframes: {
46
- // FOR EACH completed module: extract wireframes with RENAMED fields
47
- // SAFETY NET: check BOTH key names (agent may use either)
48
- [moduleCode]: (moduleFeature.specification.uiWireframes || moduleFeature.specification.wireframes || []).map(wf => ({
49
- screen: wf.screen || wf.name || wf.title || wf.id || "", // SAFETY NET: fallback name/title/id → screen
50
- section: wf.section || "",
51
- format: wf.mockupFormat || "ascii", // RENAME: mockupFormat → format
52
- content: wf.mockup || wf.ascii || wf.content || "", // SAFETY NET: mockup/ascii/content → content
53
- svgContent: null, // Populated by Step 3-bis SVG generation
54
- description: wf.description || "",
55
- elements: wf.elements || [],
56
- actions: wf.actions || [],
57
- componentMapping: wf.componentMapping || [],
58
- layout: wf.layout || null,
59
- permissionsRequired: wf.permissionsRequired || []
60
- }))
61
- },
62
- e2eFlows: [], // Empty — not yet consolidated
63
- dependencyGraph: {
64
- nodes: (master.modules || []).map(m => ({
65
- id: m.code, label: m.code, type: m.featureType || "data-centric"
66
- })),
67
- edges: (master.dependencyGraph?.edges || []).map(e => ({
68
- from: e.from, to: e.to, description: e.description || ""
69
- }))
70
- }
71
- };
72
- ```
73
-
74
- > **FIELD RENAME WARNING:** feature.json uses `mockupFormat` and `mockup`.
75
- > The HTML renderer reads `format` and `content`. You MUST rename these fields.
76
- > Failure to rename = empty mockup display in the browser.
77
-
78
- ### Step 3-bis: Generate SVG Wireframes (Parallel Task Agents)
79
-
80
- > **Purpose:** Enrich each ASCII wireframe with a professional SVG version for dual-view rendering.
81
- > **Cost:** ~$0.01 per wireframe (Sonnet model). Negligible for 2-6 wireframes per module.
82
- > **Fallback:** If ANY SVG generation fails, proceed with ASCII only (svgContent stays null).
83
-
84
- See [references/wireframe-svg-style-guide.md](wireframe-svg-style-guide.md) for the complete SVG style specification, prompt template, and orchestration process.
85
-
86
- **Process summary:**
87
-
88
- 1. **Read** `references/wireframe-svg-style-guide.md` to get the prompt template
89
- 2. **Collect** all wireframes in `EMBEDDED_ARTIFACTS.wireframes` where `content` exists and `svgContent` is null
90
- 3. **Spawn parallel Task(sonnet) agents** — ONE per wireframe, ALL in a single message
91
- 4. **Collect and validate** results: strip markdown fences if present, verify SVG starts with `<svg` and contains `</svg>`
92
- 5. **Inject** valid SVGs into `EMBEDDED_ARTIFACTS.wireframes[moduleCode][index].svgContent`
93
- 6. **Display** summary: `SVG wireframes: {generated}/{total} generated successfully`
94
-
95
- > **CRITICAL:** This step is NEVER blocking. If all SVG generations fail, deployment
96
- > continues with ASCII-only wireframes. The HTML renderer checks for `svgContent` before
97
- > showing the SVG view. SVG is an enhancement, not a requirement.
98
-
99
- ### Step 4: Replace Placeholders in Template
100
-
101
- - Serialize the FEATURE_DATA object as JSON (2-space indentation)
102
- - Serialize the EMBEDDED_ARTIFACTS object as JSON (2-space indentation)
103
- - Replace `{{FEATURE_DATA}}` with the serialized FEATURE_DATA JSON
104
- - Replace `{{EMBEDDED_ARTIFACTS}}` with the serialized EMBEDDED_ARTIFACTS JSON
105
- - Replace `{{APPLICATION_NAME}}` → `{application_name}`
106
- - Replace `{{APPLICATION_ID}}` → `{feature_id}`
107
- - Replace `{{VERSION}}` → `{version}`
108
- - Replace `{{CREATED_AT}}` → `{ISO timestamp}`
109
-
110
- ### Step 5: Write and Confirm
111
-
112
- ```
113
- ✓ Interactive HTML updated (incremental):
114
- Path: docs/{app}/business-analyse/v{version}/ba-interactive.html
115
- Modules included: {completedModules.length}/{totalModules} specified
116
- - {completedModule1}: {uc_count} UCs, {br_count} BRs, {wireframe_count} wireframes
117
- - {completedModule2}: ...
118
- Visual artifacts: {total_wireframes} wireframes embedded ({svg_count} with SVG, {ascii_only_count} ASCII only)
119
- Remaining: {pendingModules.join(', ')} (will be added after specification)
120
- → Client can open in browser to review completed modules now.
121
- ```
@@ -1,419 +0,0 @@
1
- ---
2
- name: step-01b-applications
3
- description: Application identity confirmation (single-app) or full application decomposition (multi-app)
4
- model: opus
5
- next_step: steps/step-02-decomposition.md
6
- ---
7
-
8
- > **Context files:** `_shared.md`
9
-
10
- # Step 1b: Application Identity & Decomposition
11
-
12
- ## MANDATORY EXECUTION RULES
13
-
14
- - ALWAYS use ULTRATHINK mode
15
- - ALL communication in `{language}`
16
- - This step ALWAYS runs. It has two modes:
17
- - **Single-app mode** (`workflow.mode !== "project"`): Lightweight application identity confirmation — name, code, context, route, icon, table prefix validation, application roles recap. Creates the `seedDataCore.navigationApplications` entry.
18
- - **Multi-app mode** (`workflow.mode === "project"`): Full application decomposition as defined in sections 1-7 below.
19
-
20
- ---
21
-
22
- ## MODE GATE
23
-
24
- ```
25
- IF workflow.mode === "project":
26
- → Execute FULL multi-app flow (sections 1-7 below)
27
- ELSE:
28
- → Execute LIGHTWEIGHT single-app identity (sections 0a-0f below)
29
- ```
30
-
31
- ---
32
-
33
- ## SINGLE-APP PATH (sections 0a-0f)
34
-
35
- > This path runs when `workflow.mode !== "project"` (single application, most common case).
36
- > It confirms the application-level identity (Level 2 of the navigation hierarchy) before proceeding to module decomposition.
37
-
38
- ### 0a. Read Application Context
39
-
40
- ```
41
- appFeature = ba-reader.findFeature({feature_id})
42
- → Read metadata: application, context, tablePrefix
43
- → Read cadrage: applicationRoles, coverageMatrix, globalScope
44
- → Read cadrage.codebaseContext (if exists)
45
- ```
46
-
47
- ### 0b. Derive Application Identity
48
-
49
- From the cadrage data, derive the formal application identity:
50
-
51
- ```javascript
52
- applicationCode = toPascalCase(metadata.application) // e.g., "HumanResources"
53
- applicationLabel = metadata.application // e.g., "Ressources Humaines" (human-readable)
54
- applicationRoute = `/${toKebabCase(applicationCode)}` // e.g., "/human-resources"
55
- applicationIcon = suggestIconFromDomain(applicationCode) // e.g., "users" for HR, "shopping-cart" for Sales
56
- tablePrefix = metadata.tablePrefix // e.g., "rh_" (already defined in step-01)
57
- sort = 1 // First (and only) application
58
- ```
59
-
60
- **Icon suggestion heuristics:**
61
- | Domain pattern | Suggested icon |
62
- |---------------|---------------|
63
- | HR, Employee, Staff, Personnel | `users` |
64
- | Sales, Commerce, Revenue | `shopping-cart` |
65
- | Finance, Accounting, Budget | `wallet` |
66
- | Inventory, Stock, Warehouse | `package` |
67
- | CRM, Customer, Client | `contact` |
68
- | Project, Task, Planning | `clipboard-list` |
69
- | Support, Ticket, Help | `headphones` |
70
- | Reporting, Analytics, Dashboard | `bar-chart-2` |
71
- | Other | `layout-grid` |
72
-
73
- ### 0c. Confirm Application Identity (BLOCKING)
74
-
75
- Display the application identity:
76
-
77
- ```
78
- {language == "fr"
79
- ? "## Identité de l'application\n\nVoici l'identité de votre application dans la hiérarchie de navigation SmartStack :"
80
- : "## Application Identity\n\nHere is your application's identity in the SmartStack navigation hierarchy:"}
81
-
82
- | {language == "fr" ? "Niveau" : "Level"} | {language == "fr" ? "Valeur" : "Value"} |
83
- |-------|-------|
84
- | Application Code | `{applicationCode}` |
85
- | Application Name | `{applicationLabel}` |
86
- | Route | `{applicationRoute}` |
87
- | Icon | `{applicationIcon}` |
88
- | Table Prefix | `{tablePrefix}` |
89
- | Sort Order | `{sort}` |
90
-
91
- {language == "fr"
92
- ? "### Rôles applicatifs\n\nCes rôles seront hérités par tous les modules :"
93
- : "### Application Roles\n\nThese roles will be inherited by all modules:"}
94
-
95
- | Role | Level | Permission Pattern |
96
- |------|-------|--------------------|
97
- {for each role in cadrage.applicationRoles: role.role | role.level | {kebab(applicationCode)}.* }
98
- ```
99
-
100
- Ask via AskUserQuestion:
101
- ```
102
- question: "{language == 'fr' ? 'Cette identité d\'application est-elle correcte ?' : 'Is this application identity correct?'}"
103
- header: "Application"
104
- options:
105
- - label: "{language == 'fr' ? 'Oui, parfait' : 'Yes, perfect'}"
106
- description: "{language == 'fr' ? 'Code, route, icône et rôles sont corrects' : 'Code, route, icon and roles are correct'}"
107
- - label: "{language == 'fr' ? 'Modifier' : 'Modify'}"
108
- description: "{language == 'fr' ? 'Changer le code, la route, l\'icône ou les rôles' : 'Change code, route, icon or roles'}"
109
- ```
110
-
111
- **IF "Modify":**
112
- → Ask which field(s) to change via follow-up AskUserQuestion
113
- → Apply changes
114
- → Re-display and re-confirm (loop until validated)
115
-
116
- ### 0d. Build Application SeedData Entries
117
-
118
- Create the `navigationApplications` entry (Level 1 hierarchy entry):
119
-
120
- ```json
121
- {
122
- "navigationApplications": [
123
- {
124
- "code": "{applicationCode}",
125
- "label": "{applicationLabel}",
126
- "icon": "{applicationIcon}",
127
- "route": "{applicationRoute}",
128
- "sort": 1
129
- }
130
- ]
131
- }
132
- ```
133
-
134
- Create the `applicationRoles` entries (from cadrage.applicationRoles):
135
-
136
- ```json
137
- {
138
- "applicationRoles": [
139
- { "code": "admin", "name": "{applicationLabel} Admin", "permissions": "*" },
140
- { "code": "manager", "name": "{applicationLabel} Manager", "permissions": "CRU" },
141
- { "code": "contributor", "name": "{applicationLabel} Contributor", "permissions": "CR" },
142
- { "code": "viewer", "name": "{applicationLabel} Viewer", "permissions": "R" }
143
- ]
144
- }
145
- ```
146
-
147
- > **NOTE:** The roles map from `cadrage.applicationRoles` levels. If the cadrage defined custom roles beyond the standard 4, include them here too.
148
-
149
- ### 0e. Write Application Identity to Feature.json
150
-
151
- ```
152
- ba-writer.enrichSection({
153
- featureId: {feature_id},
154
- section: "metadata",
155
- data: {
156
- applicationCode: "{applicationCode}",
157
- applicationRoute: "{applicationRoute}",
158
- applicationIcon: "{applicationIcon}"
159
- }
160
- })
161
- ```
162
-
163
- > **NOTE:** The full `seedDataCore` arrays (`navigationApplications`, `applicationRoles`) will be written in step-03c when compiling the first module's specification. Here we only persist the identity fields in metadata so they are available to step-02 and step-03.
164
-
165
- ### 0f. Summary and Continue
166
-
167
- ```
168
- {language == "fr"
169
- ? "✅ Application **{applicationCode}** identifiée\n\n- Route : `{applicationRoute}`\n- Icône : `{applicationIcon}`\n- Préfixe : `{tablePrefix}`\n- Rôles : {roleCount} rôles applicatifs définis\n\n→ Prochaine étape : décomposition en modules"
170
- : "✅ Application **{applicationCode}** identified\n\n- Route: `{applicationRoute}`\n- Icon: `{applicationIcon}`\n- Prefix: `{tablePrefix}`\n- Roles: {roleCount} application roles defined\n\n→ Next step: module decomposition"}
171
- ```
172
-
173
- → Load `steps/step-02-decomposition.md`
174
-
175
- ---
176
-
177
- ## MULTI-APP PATH (sections 1-7)
178
-
179
- > This path runs when `workflow.mode === "project"` (multi-application mode).
180
- > It takes the candidate applications identified during cadrage and formalizes them.
181
-
182
- ### 1. Load Project Context
183
-
184
- ```
185
- projectFeature = ba-reader.findProjectFeature()
186
- globalRoles = projectFeature.cadrage.globalRoles (if defined)
187
- globalScope = projectFeature.cadrage.globalScope
188
-
189
- // Candidate applications: PRE-IDENTIFIED from step-00 prompt analysis + enriched by step-01 cadrage
190
- candidateApps = projectFeature.metadata.candidateApplications
191
- // These candidates already have: name, description, modules[], context, dependencies[]
192
- // They may also include transversal apps extracted from shared modules (step-01 section 5b)
193
-
194
- IF candidateApps is null or empty:
195
- // Fallback: derive from coverage matrix (legacy path)
196
- candidateApps = projectFeature.cadrage.coverageMatrix grouped by domain
197
- ```
198
-
199
- ### 2. Application Identity (per candidate)
200
-
201
- For EACH candidate application from the cadrage analysis:
202
-
203
- #### 2a. Confirm Application Name and Context
204
-
205
- Display proposed application:
206
- ```
207
- {language == "fr"
208
- ? "### Application : {suggestedName}\n\n**Description :** {description based on coverage matrix items}"
209
- : "### Application: {suggestedName}\n\n**Description:** {description based on coverage matrix items}"}
210
- ```
211
-
212
- Ask via AskUserQuestion:
213
- ```
214
- question: "{language == 'fr' ? 'Cette application vous convient-elle ?' : 'Does this application suit you?'}"
215
- header: "{appName}"
216
- options:
217
- - label: "{language == 'fr' ? 'Oui, parfait' : 'Yes, perfect'}"
218
- description: "{language == 'fr' ? 'Nom et description corrects' : 'Name and description are correct'}"
219
- - label: "{language == 'fr' ? 'Modifier' : 'Modify'}"
220
- description: "{language == 'fr' ? 'Changer le nom ou la description' : 'Change name or description'}"
221
- ```
222
-
223
- #### 2b. Table Prefix (per application)
224
-
225
- Each application MUST have its own unique table prefix.
226
-
227
- 1. Derive suggested prefix from application name (2-5 lowercase letters + `_`)
228
- 2. Validate:
229
- - Format: `^[a-z]{2,5}_$`
230
- - No collision with platform prefixes: `auth_`, `nav_`, `usr_`, `ai_`, `cfg_`, `wkf_`, `support_`, `entra_`, `ref_`, `loc_`, `lic_`, `tenant_`
231
- - No collision with other applications in this project
232
- 3. Ask via AskUserQuestion for confirmation
233
-
234
- #### 2c. Application-Specific Roles
235
-
236
- Based on global roles from cadrage + application-specific needs:
237
-
238
- ```
239
- {language == "fr"
240
- ? "### Rôles pour {appName}\n\nVoici les rôles hérités des rôles globaux, adaptés à cette application :"
241
- : "### Roles for {appName}\n\nHere are the roles inherited from global roles, adapted for this application:"}
242
-
243
- | Role | Level | Permission Pattern |
244
- |------|-------|--------------------|
245
- {for each role: name | admin/manager/contributor/viewer | app.* pattern}
246
- ```
247
-
248
- Ask via AskUserQuestion if additional roles are needed for this specific application.
249
-
250
- #### 2d. Application Scope
251
-
252
- Extract the subset of global scope that applies to this application:
253
-
254
- ```
255
- applicationScope = {
256
- mustHave: globalScope.mustHave.filter(item => belongsToApp(item, appCode)),
257
- shouldHave: globalScope.shouldHave.filter(item => belongsToApp(item, appCode)),
258
- couldHave: globalScope.couldHave.filter(item => belongsToApp(item, appCode))
259
- }
260
- ```
261
-
262
- Display and confirm with user.
263
-
264
- ### 3. Inter-Application Dependency Analysis
265
-
266
- After all applications are defined:
267
-
268
- 1. **Identify dependencies:** For each pair of applications:
269
- - Shared entities (e.g., Employee defined in HR, referenced by Self-Service)
270
- - Event flows (e.g., HR publishes "EmployeeCreated", Self-Service subscribes)
271
- - Authentication delegation (e.g., Self-Service uses HR's employee data for auth)
272
- - Data dependencies (e.g., Self-Service reads HR data)
273
-
274
- 2. **Build dependency graph:**
275
- ```
276
- applicationDependencyGraph = {
277
- edges: [
278
- { from: "EmployeeSelfService", to: "HumanResources", type: "data-dependency", description: "Reads employee data" }
279
- ],
280
- topologicalOrder: ["HumanResources", "EmployeeSelfService"],
281
- layers: [
282
- { layer: 0, applications: ["HumanResources"] },
283
- { layer: 1, applications: ["EmployeeSelfService"] }
284
- ]
285
- }
286
- ```
287
-
288
- 3. **Cycle detection:** If circular dependencies detected → BLOCKING ERROR
289
- - Display the cycle
290
- - Ask user to resolve (merge applications or remove dependency)
291
-
292
- ### 4. Client Checkpoint (BLOCKING)
293
-
294
- Display the full application structure:
295
-
296
- ```
297
- {language == "fr"
298
- ? "### Structure du projet\n\nVoici les applications identifiées :"
299
- : "### Project Structure\n\nHere are the identified applications:"}
300
-
301
- | # | Application | Préfixe | Rôles | Dépendances |
302
- |---|-------------|---------|-------|-------------|
303
- {for each app: index | name | prefix | role count | dependency list}
304
-
305
- {language == "fr"
306
- ? "### Ordre de traitement\n\nLes applications seront traitées dans cet ordre (fondations d'abord) :"
307
- : "### Processing Order\n\nApplications will be processed in this order (foundations first):"}
308
-
309
- {for each layer: "Layer {n}: {app1}, {app2}, ..."}
310
- ```
311
-
312
- Ask via AskUserQuestion:
313
- ```
314
- question: "{language == 'fr' ? 'Cette structure de projet vous convient-elle ?' : 'Does this project structure suit you?'}"
315
- header: "Validation"
316
- options:
317
- - label: "{language == 'fr' ? 'Oui, continuer' : 'Yes, continue'}"
318
- description: "{language == 'fr' ? 'Passer à la décomposition en modules' : 'Proceed to module decomposition'}"
319
- - label: "{language == 'fr' ? 'Modifier' : 'Modify'}"
320
- description: "{language == 'fr' ? 'Ajouter, supprimer ou modifier des applications' : 'Add, remove, or modify applications'}"
321
- - label: "{language == 'fr' ? 'Fusionner en une seule' : 'Merge into one'}"
322
- description: "{language == 'fr' ? 'Finalement, c\'est une seule application avec plusieurs modules' : 'Actually, this is one application with multiple modules'}"
323
- ```
324
-
325
- **IF "Merge into one":**
326
- → Convert back to single-application mode
327
- → Delete project-level feature.json
328
- → Create application-level feature.json with all scope items
329
- → Execute single-app path (sections 0a-0f above)
330
-
331
- ### 5. Create Per-Application Feature.json Files
332
-
333
- For EACH application in topological order:
334
-
335
- ```
336
- ba-writer.createApplicationFeature({
337
- id: generate_feature_id(),
338
- version: "1.0",
339
- scope: "application",
340
- status: "draft",
341
- metadata: {
342
- application: {app.code},
343
- applicationCode: {toPascalCase(app.code)},
344
- applicationRoute: {`/${toKebabCase(app.code)}`},
345
- applicationIcon: {app.icon},
346
- language: {language},
347
- featureDescription: {app.description},
348
- workflowType: "new",
349
- analysisMode: "interactive",
350
- mcpAvailable: true,
351
- tablePrefix: {app.tablePrefix},
352
- projectRef: {project_id},
353
- workflow: {
354
- mode: "application",
355
- moduleOrder: [],
356
- currentModuleIndex: 0,
357
- completedModules: [],
358
- currentModule: null
359
- }
360
- }
361
- })
362
- ```
363
-
364
- Store the created feature.json path in the project feature.json `applications[].featureJsonPath`.
365
-
366
- ### 6. Write to Project Feature.json
367
-
368
- ```
369
- ba-writer.enrichApplicationRegistry({
370
- projectId: {project_id},
371
- applications: [
372
- {
373
- code: {app1.code},
374
- name: {app1.name},
375
- tablePrefix: {app1.tablePrefix},
376
- icon: {app1.icon},
377
- route: {app1.route},
378
- description: {app1.description},
379
- applicationRoles: [{...}],
380
- scope: { mustHave: [...], shouldHave: [...], couldHave: [...] },
381
- modules: [],
382
- dependencies: [{...}],
383
- status: "pending",
384
- featureJsonPath: {app1.featureJsonPath},
385
- estimatedComplexity: {app1.estimatedComplexity}
386
- },
387
- // ... more applications
388
- ],
389
- applicationDependencyGraph: {
390
- edges: [...],
391
- topologicalOrder: [...],
392
- layers: [...]
393
- }
394
- })
395
-
396
- ba-writer.updateStatus({project_id}, "decomposed")
397
- ```
398
-
399
- ### 7. Display Summary
400
-
401
- ```
402
- {language == "fr"
403
- ? "### Décomposition en applications terminée\n\n"
404
- : "### Application decomposition complete\n\n"}
405
-
406
- | Application | Préfixe | Route | Feature ID |
407
- |-------------|---------|-------|------------|
408
- {for each app: name | prefix | route | FEAT-NNN}
409
-
410
- {language == "fr"
411
- ? "→ Prochaine étape : décomposition en modules pour **{firstApp}** (application {1}/{total})"
412
- : "→ Next step: module decomposition for **{firstApp}** (application {1}/{total})"}
413
- ```
414
-
415
- ---
416
-
417
- ## NEXT STEP
418
-
419
- Load: `./step-02-decomposition.md` (for the first application in topological order, or the single application)