@atlashub/smartstack-cli 3.33.0 → 3.35.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 (65) hide show
  1. package/.documentation/agents.html +5 -1
  2. package/.documentation/apex.html +644 -0
  3. package/.documentation/business-analyse.html +81 -1
  4. package/.documentation/cli-commands.html +5 -1
  5. package/.documentation/commands.html +5 -1
  6. package/.documentation/efcore.html +5 -1
  7. package/.documentation/gitflow.html +5 -1
  8. package/.documentation/hooks.html +5 -1
  9. package/.documentation/index.html +60 -2
  10. package/.documentation/init.html +414 -1
  11. package/.documentation/installation.html +5 -1
  12. package/.documentation/ralph-loop.html +365 -216
  13. package/.documentation/test-web.html +5 -1
  14. package/dist/index.js +32 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/mcp-entry.mjs +7 -24
  17. package/dist/mcp-entry.mjs.map +1 -1
  18. package/package.json +1 -2
  19. package/templates/agents/ba-writer.md +142 -15
  20. package/templates/mcp-scaffolding/controller.cs.hbs +5 -1
  21. package/templates/skills/apex/SKILL.md +9 -3
  22. package/templates/skills/apex/_shared.md +49 -4
  23. package/templates/skills/{ralph-loop → apex}/references/core-seed-data.md +20 -11
  24. package/templates/skills/{ralph-loop → apex}/references/error-classification.md +2 -1
  25. package/templates/skills/apex/references/post-checks.md +463 -3
  26. package/templates/skills/apex/references/smartstack-api.md +76 -8
  27. package/templates/skills/apex/references/smartstack-frontend.md +74 -1
  28. package/templates/skills/apex/references/smartstack-layers.md +21 -3
  29. package/templates/skills/apex/steps/step-00-init.md +121 -1
  30. package/templates/skills/apex/steps/step-01-analyze.md +58 -0
  31. package/templates/skills/apex/steps/step-02-plan.md +36 -0
  32. package/templates/skills/apex/steps/step-03-execute.md +114 -7
  33. package/templates/skills/apex/steps/step-04-examine.md +116 -2
  34. package/templates/skills/business-analyse/SKILL.md +31 -20
  35. package/templates/skills/business-analyse/_module-loop.md +68 -9
  36. package/templates/skills/business-analyse/_shared.md +80 -21
  37. package/templates/skills/business-analyse/questionnaire/00-application.md +4 -2
  38. package/templates/skills/business-analyse/questionnaire/00b-project.md +85 -0
  39. package/templates/skills/business-analyse/references/deploy-modes.md +69 -0
  40. package/templates/skills/business-analyse/references/team-orchestration.md +158 -7
  41. package/templates/skills/business-analyse/schemas/application-schema.json +15 -1
  42. package/templates/skills/business-analyse/schemas/project-schema.json +490 -0
  43. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -1
  44. package/templates/skills/business-analyse/steps/step-00-init.md +220 -38
  45. package/templates/skills/business-analyse/steps/step-01-cadrage.md +184 -5
  46. package/templates/skills/business-analyse/steps/step-01b-applications.md +423 -0
  47. package/templates/skills/business-analyse/steps/step-02-decomposition.md +23 -6
  48. package/templates/skills/business-analyse/steps/step-03c-compile.md +14 -2
  49. package/templates/skills/business-analyse/steps/step-03d-validate.md +32 -7
  50. package/templates/skills/business-analyse/steps/step-04a-collect.md +111 -0
  51. package/templates/skills/business-analyse/steps/step-05a-handoff.md +296 -103
  52. package/templates/skills/business-analyse/steps/step-05b-deploy.md +46 -14
  53. package/templates/skills/documentation/SKILL.md +92 -2
  54. package/templates/skills/ralph-loop/SKILL.md +14 -17
  55. package/templates/skills/ralph-loop/references/category-rules.md +63 -683
  56. package/templates/skills/ralph-loop/references/compact-loop.md +188 -428
  57. package/templates/skills/ralph-loop/references/section-splitting.md +439 -0
  58. package/templates/skills/ralph-loop/references/team-orchestration.md +13 -14
  59. package/templates/skills/ralph-loop/steps/step-01-task.md +27 -0
  60. package/templates/skills/ralph-loop/steps/step-02-execute.md +80 -691
  61. package/templates/skills/ralph-loop/steps/step-03-commit.md +38 -79
  62. package/templates/skills/ralph-loop/steps/step-04-check.md +39 -58
  63. package/templates/skills/ralph-loop/steps/step-05-report.md +31 -123
  64. package/scripts/health-check.sh +0 -168
  65. package/scripts/postinstall.js +0 -18
@@ -176,21 +176,38 @@ IF ANY category shows FAIL → **STOP AND RE-RUN `ss derive-prd`**. DO NOT proce
176
176
  **Update logic:**
177
177
 
178
178
  1. Read existing manifest at `docs/business/index.json` (or create empty `{ "version": "1.0", "updatedAt": "", "analyses": [] }`)
179
- 2. For the APPLICATION-level feature.json:
180
- - Find existing entry where `appCode == {app_code}` AND `moduleCode == null` AND `version == {version}`
181
- - If found: update `status`, `updatedAt`, `featureDescription`
182
- - If not found: append new entry with `moduleCode: null` and `path: "{app_code}/business-analyse/v{version}/feature.json"`
183
- 3. For EACH MODULE-level feature.json:
184
- - Find existing entry where `appCode == {app_code}` AND `moduleCode == {module_code}` AND `version == {version}`
185
- - If found: update `status`, `updatedAt`, `featureDescription`
186
- - If not found: append new entry with `moduleCode: "{module_code}"` and `path: "{app_code}/{module_code}/business-analyse/v{version}/feature.json"`
179
+
180
+ 2. **PROJECT MODE (`workflow.mode === "project"`):**
181
+ a. Add/update PROJECT-level entry:
182
+ - Find existing entry where `projectId == {project_id}` AND `scope == "project"`
183
+ - If found: update `status`, `updatedAt`
184
+ - If not found: append new entry with `scope: "project"`, `projectId: "{project_id}"`, `path: "business-analyse/v{version}/feature.json"`
185
+ b. For EACH APPLICATION:
186
+ - Find existing entry where `appCode == {app_code}` AND `moduleCode == null` AND `version == {version}`
187
+ - If found: update `status`, `updatedAt`, `featureDescription`
188
+ - If not found: append new entry with `moduleCode: null`, `context: "{app.context}"`, and `path: "{context}/{app_code}/business-analyse/v{version}/feature.json"`
189
+ c. For EACH MODULE within each application:
190
+ - Find existing entry where `appCode == {app_code}` AND `moduleCode == {module_code}` AND `version == {version}`
191
+ - If found: update `status`, `updatedAt`, `featureDescription`
192
+ - If not found: append new entry with `path: "{context}/{app_code}/{module_code}/business-analyse/v{version}/feature.json"`
193
+
194
+ 3. **SINGLE-APP MODE (default):**
195
+ a. For the APPLICATION-level feature.json:
196
+ - Find existing entry where `appCode == {app_code}` AND `moduleCode == null` AND `version == {version}`
197
+ - If found: update `status`, `updatedAt`, `featureDescription`
198
+ - If not found: append new entry with `moduleCode: null` and `path: "{app_code}/business-analyse/v{version}/feature.json"`
199
+ b. For EACH MODULE-level feature.json:
200
+ - Find existing entry where `appCode == {app_code}` AND `moduleCode == {module_code}` AND `version == {version}`
201
+ - If found: update `status`, `updatedAt`, `featureDescription`
202
+ - If not found: append new entry with `moduleCode: "{module_code}"` and `path: "{app_code}/{module_code}/business-analyse/v{version}/feature.json"`
203
+
187
204
  4. Update root `updatedAt` to current timestamp
188
205
  5. Write manifest back to `docs/business/index.json`
189
206
 
190
207
  **Display confirmation:**
191
208
  ```
192
209
  ✓ BA manifest updated: docs/business/index.json
193
- Entries: {total_count} ({app_count} applications, {module_count} modules)
210
+ Entries: {total_count} ({project_count} projects, {app_count} applications, {module_count} modules)
194
211
  Web viewer: /system/docs/ba
195
212
  ```
196
213
 
@@ -205,20 +222,28 @@ IF ANY category shows FAIL → **STOP AND RE-RUN `ss derive-prd`**. DO NOT proce
205
222
  ### 4. Read Source Data for HTML
206
223
 
207
224
  1. Read the HTML template from skill directory: `html/ba-interactive.html` (relative to `~/.claude/skills/business-analyse/`)
208
- 2. Read the master feature.json (application level)
209
- 3. Read EACH module feature.json (module level)
225
+ 2. **SINGLE-APP MODE:** Read the master feature.json (application level)
226
+ 3. **PROJECT MODE:** Read the project feature.json + ALL application feature.json files
227
+ 4. Read EACH module feature.json (module level, across all applications in project mode)
210
228
 
211
229
  > **Reference:** Read `references/html-data-mapping.md` for the complete FEATURE_DATA and EMBEDDED_ARTIFACTS mapping specification.
212
230
 
213
231
  **Key requirements:**
214
232
  - FEATURE_DATA must be pre-populated with ALL analysis data (empty data = BUG)
215
- - FEATURE_DATA.**moduleSpecs** MUST be populated for EACH module (use cases, business rules, entities, permissions) — empty moduleSpecs = BROKEN specification tabs
233
+ - FEATURE_DATA.**moduleSpecs** MUST be populated for EACH module across ALL applications (use cases, business rules, entities, permissions) — empty moduleSpecs = BROKEN specification tabs
216
234
  - FEATURE_DATA.**cadrage.scope** must use HTML keys (vital/important/optional/excluded) NOT feature.json keys (mustHave/shouldHave/couldHave/outOfScope)
217
235
  - FEATURE_DATA.**metadata.analysisMode** must be set from `master.metadata.analysisMode` (always "interactive")
218
236
  - EMBEDDED_ARTIFACTS contains wireframes, E2E diagrams, dependency graph
219
237
  - Both objects are serialized as JSON with 2-space indentation
220
238
  - All data mapped from master and module feature.json files — follow `html-data-mapping.md` EXACTLY
221
239
 
240
+ **PROJECT MODE additions to FEATURE_DATA:**
241
+ - `FEATURE_DATA.project` — project-level metadata (name, applicationCount, applicationOrder)
242
+ - `FEATURE_DATA.applications` — array of application summaries with their modules
243
+ - `FEATURE_DATA.modules` — flattened list of ALL modules across ALL applications (each with `applicationCode` field)
244
+ - `FEATURE_DATA.consolidation.crossApplicationInteractions` — from project feature.json
245
+ - FEATURE_DATA.**metadata.workflowMode** must be `"project"` (enables multi-app tabs in HTML)
246
+
222
247
  ---
223
248
 
224
249
  ### 5-7. Build FEATURE_DATA, EMBEDDED_ARTIFACTS & Replace Placeholders
@@ -426,9 +451,13 @@ Display completion using the template from `templates/tpl-launch-displays.md`:
426
451
 
427
452
  ```
428
453
  ═══════════════════════════════════════════════════════════════
429
- [OK] BUSINESS ANALYSE TERMINEE - {application_name}
454
+ [OK] BUSINESS ANALYSE TERMINEE - {application_name OR project_name}
430
455
  ═══════════════════════════════════════════════════════════════
431
456
 
457
+ {IF workflow.mode === "project":}
458
+ Project: {project_name}
459
+ Apps: {app_count} ({app_names})
460
+ {ENDIF}
432
461
  Modules: {count} ({names})
433
462
  Strategy: {strategy}
434
463
  Files: {total files across all modules}
@@ -437,8 +466,11 @@ Complexity: {complexity}
437
466
  Effort: {total_days} days ({total_hours} hours)
438
467
 
439
468
  [DIR] Artefacts générés:
440
- ✓ feature.json (master + per-module) - spécification complète
469
+ ✓ feature.json ({IF project: "project + " ENDIF}master + per-module) - spécification complète
441
470
  ✓ .ralph/prd-{module}.json - task breakdown per module
471
+ {IF workflow.mode === "project":}
472
+ ✓ .ralph/prd-CrossApplication.json - cross-application integration tests
473
+ {ENDIF}
442
474
  ✓ .ralph/progress.txt - tracker de progression
443
475
  ✓ ba-interactive.html - document de revue interactif
444
476
 
@@ -88,10 +88,11 @@ Follow the data-driven workflow from [templates.md](templates.md):
88
88
  ```
89
89
  1. Read source data (feature.json, code patterns)
90
90
  2. Generate doc-data.ts (data file, ~50 lines)
91
- 3. Generate index.tsx (page wrapper, ~10 lines)
91
+ 3. Generate index.tsx (page wrapper, ~10 lines) with i18nNamespace prop
92
92
  4. Generate i18n FR file (source language only)
93
93
  5. Update docs-manifest.json
94
94
  6. Update App.tsx routing and parent indexes
95
+ 7. Update DocPanelContext.tsx mapping (contextual doc panel)
95
96
  ```
96
97
 
97
98
  **For UPDATE documentation (type = update):**
@@ -118,16 +119,20 @@ Follow the data-driven workflow from [templates.md](templates.md):
118
119
  4. **ALWAYS** confirm before creating
119
120
  5. **ALWAYS** update App.tsx and parent indexes
120
121
  6. **ALWAYS** add module in `UserIndexPage.tsx` (IF type == `user`)
122
+ 7. **ALWAYS** update `DocPanelContext.tsx` mapping (IF type == `user`)
123
+ 8. **ALWAYS** pass `i18nNamespace` prop to DocRenderer in index.tsx
121
124
  </execution_rules>
122
125
 
123
126
  ---
124
127
 
125
128
  <success_criteria>
126
129
  - Documentation page renders correctly in React app
127
- - i18n files created for all 4 languages (FR, EN, IT, DE)
130
+ - i18n FR file created (EN/IT/DE deferred to translation pipeline)
128
131
  - Route registered in App.tsx
129
132
  - docs-manifest.json updated
130
133
  - Module appears in UserIndexPage (if type = user)
134
+ - DocPanelContext.tsx mapping updated (if type = user)
135
+ - BookOpen edge button opens correct doc for the module's routes
131
136
  </success_criteria>
132
137
 
133
138
  ---
@@ -151,6 +156,87 @@ Follow the data-driven workflow from [templates.md](templates.md):
151
156
 
152
157
  ---
153
158
 
159
+ ## DocPanelContext Integration (TYPE: user)
160
+
161
+ **MANDATORY** for `user` modules: Update the contextual documentation panel mapping.
162
+
163
+ ### How it works
164
+
165
+ When a user clicks the BookOpen icon (edge button) on any application page, the `DocPanelContext` resolves the current route to the matching documentation URL and opens it in an iframe panel.
166
+
167
+ ### File to update
168
+
169
+ `web/smartstack-web/src/contexts/DocPanelContext.tsx`
170
+
171
+ ### What to add
172
+
173
+ For each module, add entries in the `docMapping` object for ALL the module's routes:
174
+
175
+ ```typescript
176
+ const docMapping: Record<string, string> = {
177
+ // Platform > Administration > {Module}
178
+ '{module}': '/docs/business/platform/administration/{module}',
179
+ '{module}/list': '/docs/business/platform/administration/{module}',
180
+ '{module}/create': '/docs/business/platform/administration/{module}',
181
+ '{module}/dashboard': '/docs/business/platform/administration/{module}',
182
+ // ... add ALL sub-routes that exist for the module
183
+ };
184
+ ```
185
+
186
+ ### Key resolution logic
187
+
188
+ The `getDocUrlForPath()` function extracts segments from the pathname:
189
+ - `/platform/administration/users/list` → tries `users/list`, then `users`
190
+ - `/platform/support/tickets/123` → tries `tickets/123`, then `tickets`
191
+
192
+ **Also update `appDocMapping`** if the module is the "default" for its application:
193
+
194
+ ```typescript
195
+ const appDocMapping: Record<string, string> = {
196
+ 'administration': '/docs/business/platform/administration/users', // default for admin
197
+ };
198
+ ```
199
+
200
+ ### index.tsx must pass i18nNamespace
201
+
202
+ Each doc page wrapper MUST pass the correct i18n namespace to DocRenderer:
203
+
204
+ ```tsx
205
+ import { DocRenderer } from '@/components/docs';
206
+ import { docData } from './doc-data';
207
+
208
+ export default function {Module}DocPage() {
209
+ return (
210
+ <DocRenderer
211
+ data={docData}
212
+ backPath="/docs/business/platform"
213
+ backLabel="nav.backToAdministration"
214
+ i18nNamespace="docsAdministration{Module}"
215
+ />
216
+ );
217
+ }
218
+ ```
219
+
220
+ ### i18n namespace naming convention
221
+
222
+ | Module | Namespace | File |
223
+ |--------|-----------|------|
224
+ | users | `docsAdministrationUsers` | `docs-administration-users.json` |
225
+ | permissions | `docsAdministrationPermissions` | `docs-administration-permissions.json` |
226
+ | tenants | `docsAdministrationTenants` | `docs-administration-tenants.json` |
227
+
228
+ The JSON file root key MUST match the namespace: `{ "docsAdministration{Module}": { ... } }`
229
+
230
+ ### i18n config update
231
+
232
+ Add the new namespace to `web/smartstack-web/src/i18n/config.ts`:
233
+ 1. Add to the destructured imports in `loadLanguageResources`
234
+ 2. Add the dynamic import with `.catch(() => ({ default: {} }))`
235
+ 3. Add to the return object
236
+ 4. Add to the `ns` array in `i18n.init()`
237
+
238
+ ---
239
+
154
240
  ## DATA SOURCES
155
241
 
156
242
  | Data | Source |
@@ -168,5 +254,9 @@ Follow the data-driven workflow from [templates.md](templates.md):
168
254
  - **Data Schema:** [data-schema.md](data-schema.md)
169
255
  - **DocRenderer:** `web/smartstack-web/src/components/docs/DocRenderer.tsx`
170
256
  - **Types:** `web/smartstack-web/src/components/docs/types.ts`
257
+ - **DocPanelContext:** `web/smartstack-web/src/contexts/DocPanelContext.tsx`
258
+ - **DocEdgeButton:** `web/smartstack-web/src/components/ui/DocEdgeButton.tsx`
259
+ - **DocPanel:** `web/smartstack-web/src/components/ui/DocPanel.tsx`
260
+ - **i18n Config:** `web/smartstack-web/src/i18n/config.ts`
171
261
  - **Manifest Schema:** `_resources/docs-manifest-schema.md`
172
262
  - **Complete Command:** `.claude/commands/documentation-module.md`
@@ -5,7 +5,9 @@ argument-hint: "[-m N] [-c TEXT] [-v] <task description>"
5
5
  ---
6
6
 
7
7
  <objective>
8
- Execute the Ralph Weegund technique — iterative development where the same prompt is fed repeatedly until completion. Uses progressive step loading with MCP validation, progress persistence, and Agent Teams for multi-module parallelization.
8
+ Execute the Ralph Weegund technique — iterative module orchestration. Ralph reads PRDs from `/business-analyse`, resolves task dependencies, and delegates all code generation to `/apex -d`. Uses progress persistence and Agent Teams for multi-module parallelization.
9
+
10
+ **Key principle:** Ralph ORCHESTRATES (task selection, module sequencing, PRD state, reporting). All code generation is delegated to `/apex`.
9
11
  </objective>
10
12
 
11
13
  <quick_start>
@@ -63,8 +65,7 @@ Execute the Ralph Weegund technique — iterative development where the same pro
63
65
 
64
66
  **Task execution cycle:**
65
67
  ```
66
- LOAD → GENERATE COMPILE TEST [FAIL?] FIXRE-TEST [PASS!] COMMIT → NEXT
67
- ↑___________________________|
68
+ LOAD → DELEGATE TO /apex -dVERIFY PRD STATECOMMIT PRDNEXT MODULE
68
69
  ```
69
70
 
70
71
  </workflow>
@@ -78,6 +79,8 @@ LOAD → GENERATE → COMPILE → TEST → [FAIL?] → FIX → RE-TEST → [PASS
78
79
  | `{current_iteration}` | number | Current iteration |
79
80
  | `{current_module}` | string\|null | Current module (multi-module) |
80
81
  | `{modules_queue}` | object\|null | Module queue (multi-module) |
82
+ | `{section_split_mode}` | boolean | Section splitting active for current module (>4 entities + >1 section) |
83
+ | `{section_phases}` | SectionPhase[] | Phase execution plan (Phase 0: foundation, Phase 1..N: per-section) |
81
84
  </state_variables>
82
85
 
83
86
  <mcp_requirements>
@@ -85,14 +88,7 @@ LOAD → GENERATE → COMPILE → TEST → [FAIL?] → FIX → RE-TEST → [PASS
85
88
  1. `mcp__smartstack__validate_conventions` — verify connectivity
86
89
  2. `mcp__context7__resolve-library-id` — verify connectivity
87
90
 
88
- **During work:**
89
- - `validate_conventions` — before commits
90
- - `check_migrations` — before EF Core changes
91
- - `suggest_migration` — migration naming
92
- - `generate_permissions` — RBAC seed data
93
- - `scaffold_api_client` — frontend API client
94
- - `scaffold_routes` — frontend routing
95
- - `scaffold_tests` — test generation
91
+ **During work:** All MCP tool calls are handled by `/apex` during delegation. Ralph only uses `validate_conventions` for initial connectivity check.
96
92
  </mcp_requirements>
97
93
 
98
94
  <execution_guarantee>
@@ -116,7 +112,7 @@ When the user invokes `/ralph-loop`, they are giving you the instruction to:
116
112
  - Ask the user to choose between supervised/autonomous mode
117
113
  - Ask the user to choose a completion promise
118
114
  - Wait for user input between iterations
119
- - Delegate the loop to sub-agents (except team mode)
115
+ - Delegate the loop to sub-agents (except team mode and /apex delegation)
120
116
 
121
117
  **The ONLY valid stop conditions are:**
122
118
  - ALL tasks completed (→ step-05 report)
@@ -137,7 +133,7 @@ When the user invokes `/ralph-loop`, they are giving you the instruction to:
137
133
  |------|------|---------|-------------|
138
134
  | 00 | `steps/step-00-init.md` | Parse args, verify MCP, init state, team setup | ~150 |
139
135
  | 01 | `steps/step-01-task.md` | Load/create tasks from prd.json | ~365 |
140
- | 02 | `steps/step-02-execute.md` | Execute ONE task (first iteration) | ~140 |
136
+ | 02 | `steps/step-02-execute.md` | Delegate module to /apex -d | ~120 |
141
137
  | 03 | `steps/step-03-commit.md` | Commit, update prd.json/progress.txt | ~135 |
142
138
  | 04 | `steps/step-04-check.md` | Check completion, compact loop entry | ~185 |
143
139
  | 05 | `steps/step-05-report.md` | Generate final report | ~150 |
@@ -145,10 +141,9 @@ When the user invokes `/ralph-loop`, they are giving you the instruction to:
145
141
  **Reference files (loaded conditionally):**
146
142
  | File | Loaded when |
147
143
  |------|-------------|
148
- | `references/category-rules.md` | Step-02 and compact loop (execution rules per category) |
149
- | `references/compact-loop.md` | Step-04 section 5 (inline execution after first iteration) |
150
- | `references/core-seed-data.md` | Infrastructure task with seed data keywords |
151
- | `references/error-classification.md` | Build failure in compact loop or validation (error diagnosis) |
144
+ | `references/category-rules.md` | Step-01 and compact loop (category ordering and dependency rules) |
145
+ | `references/compact-loop.md` | Step-04 section 5 (module loop with /apex delegation) |
146
+ | `references/section-splitting.md` | Step-01 section 4c when module has >4 entities + >1 section |
152
147
  | `references/team-orchestration.md` | Step-00 when multi-module detected (2+ PRDs) |
153
148
  </step_files>
154
149
 
@@ -159,6 +154,8 @@ When the user invokes `/ralph-loop`, they are giving you the instruction to:
159
154
  ├── progress.txt # Persistent memory
160
155
  ├── modules-queue.json # Multi-module tracking (if applicable)
161
156
  ├── prd-{module}.json # Per-module PRDs (from ss derive-prd, unified v3 format)
157
+ ├── prd-{module}-phase0.json # Section split: Foundation (domain+infra+migration)
158
+ ├── prd-{module}-section-{code}.json # Section split: Per-section (app+api+seed+frontend+tests)
162
159
  ├── logs/
163
160
  └── reports/
164
161
  └── {feature}.md