@atlashub/smartstack-cli 3.32.0 → 3.34.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 (55) 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 +5 -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/package.json +1 -1
  15. package/templates/agents/ba-writer.md +142 -15
  16. package/templates/skills/apex/SKILL.md +7 -1
  17. package/templates/skills/apex/_shared.md +49 -4
  18. package/templates/skills/{ralph-loop → apex}/references/core-seed-data.md +20 -11
  19. package/templates/skills/{ralph-loop → apex}/references/error-classification.md +2 -1
  20. package/templates/skills/apex/references/post-checks.md +238 -3
  21. package/templates/skills/apex/references/smartstack-api.md +47 -7
  22. package/templates/skills/apex/references/smartstack-frontend.md +47 -1
  23. package/templates/skills/apex/references/smartstack-layers.md +3 -1
  24. package/templates/skills/apex/steps/step-00-init.md +48 -1
  25. package/templates/skills/apex/steps/step-01-analyze.md +37 -0
  26. package/templates/skills/apex/steps/step-02-plan.md +36 -0
  27. package/templates/skills/apex/steps/step-03-execute.md +42 -2
  28. package/templates/skills/apex/steps/step-04-examine.md +110 -2
  29. package/templates/skills/business-analyse/SKILL.md +29 -19
  30. package/templates/skills/business-analyse/_module-loop.md +68 -9
  31. package/templates/skills/business-analyse/_shared.md +71 -21
  32. package/templates/skills/business-analyse/questionnaire/00-application.md +4 -2
  33. package/templates/skills/business-analyse/questionnaire/00b-project.md +85 -0
  34. package/templates/skills/business-analyse/references/deploy-modes.md +69 -0
  35. package/templates/skills/business-analyse/references/team-orchestration.md +158 -7
  36. package/templates/skills/business-analyse/schemas/application-schema.json +2 -1
  37. package/templates/skills/business-analyse/schemas/project-schema.json +490 -0
  38. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -1
  39. package/templates/skills/business-analyse/steps/step-00-init.md +30 -4
  40. package/templates/skills/business-analyse/steps/step-01-cadrage.md +62 -2
  41. package/templates/skills/business-analyse/steps/step-01b-applications.md +252 -0
  42. package/templates/skills/business-analyse/steps/step-02-decomposition.md +23 -6
  43. package/templates/skills/business-analyse/steps/step-03d-validate.md +27 -6
  44. package/templates/skills/business-analyse/steps/step-04a-collect.md +111 -0
  45. package/templates/skills/business-analyse/steps/step-05a-handoff.md +296 -103
  46. package/templates/skills/business-analyse/steps/step-05b-deploy.md +46 -14
  47. package/templates/skills/documentation/SKILL.md +92 -2
  48. package/templates/skills/ralph-loop/SKILL.md +9 -17
  49. package/templates/skills/ralph-loop/references/category-rules.md +43 -692
  50. package/templates/skills/ralph-loop/references/compact-loop.md +104 -427
  51. package/templates/skills/ralph-loop/references/team-orchestration.md +13 -14
  52. package/templates/skills/ralph-loop/steps/step-02-execute.md +49 -704
  53. package/templates/skills/ralph-loop/steps/step-03-commit.md +38 -79
  54. package/templates/skills/ralph-loop/steps/step-04-check.md +39 -58
  55. package/templates/skills/ralph-loop/steps/step-05-report.md +12 -123
@@ -0,0 +1,85 @@
1
+ # Questionnaire Category 00b: Project-Level Questions
2
+
3
+ > **Loaded by:** step-01-cadrage (when multi-application mode detected)
4
+ > **Condition:** Only loaded when user confirms "Multiple applications"
5
+ > **Purpose:** Gather project-level information that spans all applications
6
+
7
+ ---
8
+
9
+ ## Questions
10
+
11
+ ### Q0b.1: Project Name
12
+ ```
13
+ question: "{language == 'fr' ? 'Quel nom souhaitez-vous donner au projet global ?' : 'What name would you like for the overall project?'}"
14
+ header: "Projet"
15
+ options:
16
+ - label: "{suggested_project_name}"
17
+ description: "{language == 'fr' ? 'Nom suggéré basé sur votre description' : 'Suggested name based on your description'}"
18
+ - label: "{language == 'fr' ? 'Personnaliser' : 'Customize'}"
19
+ description: "{language == 'fr' ? 'Choisir un autre nom' : 'Choose another name'}"
20
+ ```
21
+
22
+ ### Q0b.2: Deployment Model
23
+ ```
24
+ question: "{language == 'fr' ? 'Comment ces applications seront-elles déployées ?' : 'How will these applications be deployed?'}"
25
+ header: "Déploiement"
26
+ options:
27
+ - label: "{language == 'fr' ? 'Ensemble' : 'Together'}"
28
+ description: "{language == 'fr' ? 'Toutes les applications sont déployées en même temps' : 'All applications deployed at the same time'}"
29
+ - label: "{language == 'fr' ? 'Par phases' : 'Phased'}"
30
+ description: "{language == 'fr' ? 'Chaque application est livrée séparément, par priorité' : 'Each application delivered separately, by priority'}"
31
+ ```
32
+
33
+ ### Q0b.3: Cross-Application Data Flows
34
+ ```
35
+ question: "{language == 'fr' ? 'Existe-t-il des flux de données entre les applications identifiées ?' : 'Are there data flows between the identified applications?'}"
36
+ header: "Flux"
37
+ options:
38
+ - label: "{language == 'fr' ? 'Oui, plusieurs' : 'Yes, several'}"
39
+ description: "{language == 'fr' ? 'Des données sont partagées entre applications (ex: employés RH utilisés par le self-service)' : 'Data is shared between applications (e.g., HR employees used by self-service)'}"
40
+ - label: "{language == 'fr' ? 'Quelques liens' : 'A few links'}"
41
+ description: "{language == 'fr' ? 'Peu de dépendances entre applications' : 'Few dependencies between applications'}"
42
+ - label: "{language == 'fr' ? 'Indépendantes' : 'Independent'}"
43
+ description: "{language == 'fr' ? 'Les applications sont autonomes, pas de données partagées' : 'Applications are autonomous, no shared data'}"
44
+ ```
45
+
46
+ ### Q0b.4: Global vs Per-Application Roles
47
+ ```
48
+ question: "{language == 'fr' ? 'Les rôles utilisateur sont-ils partagés entre applications ?' : 'Are user roles shared across applications?'}"
49
+ header: "Rôles"
50
+ options:
51
+ - label: "{language == 'fr' ? 'Rôles globaux' : 'Global roles'}"
52
+ description: "{language == 'fr' ? 'Les mêmes rôles (admin, manager...) s'appliquent à toutes les applications' : 'Same roles (admin, manager...) apply to all applications'}"
53
+ - label: "{language == 'fr' ? 'Rôles spécifiques' : 'Specific roles'}"
54
+ description: "{language == 'fr' ? 'Chaque application a ses propres rôles (ex: RH Admin vs Employee)' : 'Each application has its own roles (e.g., HR Admin vs Employee)'}"
55
+ - label: "{language == 'fr' ? 'Mixte' : 'Mixed'}"
56
+ description: "{language == 'fr' ? 'Certains rôles sont globaux, d'autres spécifiques à une application' : 'Some roles are global, others are application-specific'}"
57
+ ```
58
+
59
+ ### Q0b.5: Shared Infrastructure
60
+ ```
61
+ question: "{language == 'fr' ? 'Quelles infrastructures partagées doivent être prises en compte ?' : 'What shared infrastructure needs to be considered?'}"
62
+ header: "Infra"
63
+ multiSelect: true
64
+ options:
65
+ - label: "SSO / Auth"
66
+ description: "{language == 'fr' ? 'Authentification unique entre applications' : 'Single sign-on between applications'}"
67
+ - label: "Notifications"
68
+ description: "{language == 'fr' ? 'Service de notification partagé (email, in-app)' : 'Shared notification service (email, in-app)'}"
69
+ - label: "{language == 'fr' ? 'Base de données partagée' : 'Shared database'}"
70
+ description: "{language == 'fr' ? 'Toutes les applications partagent la même base de données' : 'All applications share the same database'}"
71
+ - label: "{language == 'fr' ? 'Aucune' : 'None'}"
72
+ description: "{language == 'fr' ? 'Chaque application est autonome' : 'Each application is autonomous'}"
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Mapping to Project Feature.json
78
+
79
+ | Question | Target Field |
80
+ |----------|-------------|
81
+ | Q0b.1 | `metadata.projectName` |
82
+ | Q0b.2 | `cadrage.deploymentModel` |
83
+ | Q0b.3 | Informs `applicationDependencyGraph.edges[]` |
84
+ | Q0b.4 | Informs `cadrage.globalRoles[]` vs per-app `applications[].applicationRoles[]` |
85
+ | Q0b.5 | `cadrage.sharedInfrastructure[]` |
@@ -31,6 +31,75 @@ Focused handoff for changes:
31
31
  - Update only affected prd.json sections
32
32
  - Progress tracker shows only delta tasks
33
33
 
34
+ ### Multi-Application Mode (workflow.mode = "project")
35
+
36
+ Full handoff across multiple applications within a project:
37
+
38
+ **Artifacts generated:**
39
+ - Per-module: `.ralph/prd-{moduleCode}.json` (one per module across all applications)
40
+ - Per-application cross-module: `.ralph/prd-CrossModule-{appCode}.json` (if app has 2+ modules)
41
+ - Cross-application: `.ralph/prd-CrossApplication.json` (integration tests between applications)
42
+ - Progress tracker: `.ralph/progress.txt` (grouped by application, then by module)
43
+ - BA manifest: `docs/business/index.json` (project-level entry + per-application + per-module entries)
44
+ - Interactive HTML: one HTML file per application at `docs/{context}/{app}/business-analyse/v{version}/ba-interactive.html`
45
+
46
+ **Project-level manifest entry:**
47
+ ```json
48
+ {
49
+ "scope": "project",
50
+ "projectId": "PROJ-001",
51
+ "projectName": "HR Platform",
52
+ "version": "1.0",
53
+ "status": "handed-off",
54
+ "applications": ["HumanResources", "EmployeeSelfService"],
55
+ "path": "business-analyse/v1.0/feature.json",
56
+ "updatedAt": "2026-02-16T..."
57
+ }
58
+ ```
59
+
60
+ **Progress tracker structure (multi-app):**
61
+ ```
62
+ # Progress Tracker — {projectName}
63
+
64
+ ## Application: {app1Name} ({app1Context})
65
+
66
+ ### Module: {module1} (Layer 0 — simple)
67
+ - [ ] Domain: Entity1.cs
68
+ - [ ] Application: Entity1Service.cs
69
+ ...
70
+
71
+ ### Module: {module2} (Layer 1 — medium)
72
+ ...
73
+
74
+ ## Application: {app2Name} ({app2Context})
75
+ ...
76
+
77
+ ## Cross-Application Integration
78
+ - [ ] SharedEntityValidationTests.cs
79
+ - [ ] CrossAppPermissionTests.cs
80
+ - [ ] CrossAppE2EFlowTests.cs
81
+
82
+ ## Summary
83
+ | Application | Modules | Files | Tasks | Complexity |
84
+ |-------------|---------|-------|-------|------------|
85
+ | {app1} | {n} | {n} | {n} | {level} |
86
+ | {app2} | {n} | {n} | {n} | {level} |
87
+ | Cross-App | — | 3 | 3 | — |
88
+ | **Total** | {n} | {n} | {n} | {global} |
89
+ ```
90
+
91
+ **seedDataCore differences:**
92
+ - `navigationApplications[]` has one entry per application (different contexts possible)
93
+ - `navigationModules[]` includes `applicationCode` field for each module
94
+ - `permissions[]` use per-application context prefixes (e.g., `business.hr.*` vs `platform.admin.*`)
95
+ - `rolePermissions[]` are scoped per application (same role can have different permissions per app)
96
+ - Seed data order: applications in topological order, then modules within each application
97
+
98
+ **ralph-loop execution (recommended):**
99
+ - Run `/ralph-loop` once per application (module-by-module within each app)
100
+ - Cross-application PRD runs last after all applications are implemented
101
+ - Application order follows `applicationDependencyGraph.topologicalOrder`
102
+
34
103
  ## Troubleshooting
35
104
 
36
105
  | Issue | Resolution |
@@ -7,6 +7,57 @@
7
7
 
8
8
  ---
9
9
 
10
+ ## Multi-Application Team Structure (Project Mode)
11
+
12
+ > **Only applies when `workflow.mode === "project"`** (multiple applications in a single BA session).
13
+ > In single-application mode, skip this section entirely.
14
+
15
+ When the project contains multiple applications, the team structure adds an **application-level outer loop** around the existing module-level inner loop:
16
+
17
+ ```
18
+ Team Lead (project level)
19
+ ├── Application 1 (in topological order)
20
+ │ ├── mod-{app1-module1} (parallel per dependency layer)
21
+ │ ├── mod-{app1-module2}
22
+ │ └── consolidation-{app1}
23
+ ├── Application 2
24
+ │ ├── mod-{app2-module1}
25
+ │ ├── mod-{app2-module2}
26
+ │ └── consolidation-{app2}
27
+ ├── Cross-Application Consolidation Agent
28
+ └── Handoff Agent (all applications)
29
+ ```
30
+
31
+ **Application Loop Protocol:**
32
+
33
+ ```
34
+ FOR each application in projectFeature.applicationDependencyGraph.topologicalOrder:
35
+ 1. Load application feature.json
36
+ 2. Read module decomposition for this application
37
+ 3. Execute §1-§4 (team setup → module specification → review → layer completion)
38
+ - Team name: "ba-{projectName}-{appCode}"
39
+ - Agent names: "mod-{appCode}-{moduleCode}"
40
+ - Context passed to agents includes application-specific: context, tablePrefix, applicationRoles
41
+ 4. After all modules in this application are specified:
42
+ - Run per-application consolidation (§5 — scoped to this application's modules)
43
+ - Mark application as "specified" in project feature.json
44
+ - Clean up application team
45
+
46
+ AFTER all applications specified:
47
+ 5. Run cross-application consolidation (§5-bis)
48
+ 6. Run unified handoff (§6 — all applications at once)
49
+ 7. Cleanup (§7)
50
+ ```
51
+
52
+ **Key differences from single-application mode:**
53
+ - Team names include application code to avoid collisions
54
+ - Agent prompts include application context (not just module context)
55
+ - Cross-application consolidation runs AFTER all per-application consolidations
56
+ - Handoff generates one PRD per module + one cross-application PRD
57
+ - The team lead tracks both `completedApplications[]` and `completedModules[]`
58
+
59
+ ---
60
+
10
61
  ## 1. Team Setup
11
62
 
12
63
  After step-02 decomposition is complete and client has approved the module structure:
@@ -612,13 +663,101 @@ AskUserQuestion: "Approuvez-vous la consolidation ?"
612
663
  - "Approuver" → send APPROVED to agent → agent writes consolidation to master feature.json
613
664
  - "Réviser" → send feedback → agent adjusts
614
665
 
615
- After approval → shutdown consolidation agent → proceed to §6.
666
+ After approval → shutdown consolidation agent.
667
+
668
+ **IF `workflow.mode === "project"`:** proceed to §5-bis (cross-application consolidation).
669
+ **ELSE:** proceed to §6 (handoff).
670
+
671
+ ---
672
+
673
+ ## 5-bis. Cross-Application Consolidation (Project Mode Only)
674
+
675
+ > **Only runs when `workflow.mode === "project"` AND all applications have been consolidated.**
676
+ > This step validates interactions BETWEEN applications, not just between modules within one application.
677
+
678
+ ```javascript
679
+ Task({
680
+ subagent_type: "general-purpose",
681
+ team_name: teamContext.teamName,
682
+ name: "cross-app-consolidation",
683
+ model: "opus",
684
+ mode: "bypassPermissions",
685
+ prompt: `
686
+ You are a cross-application consolidation agent for project "{projectName}".
687
+
688
+ ## Your Mission
689
+ Validate interactions between ALL applications in the project:
690
+
691
+ 1. Cross-application shared entities
692
+ → Entity defined in App A, referenced by App B via data dependency
693
+ 2. Cross-application permission path consistency
694
+ → Each app uses its own context prefix (e.g., business.hr.* vs business.selfservice.*)
695
+ 3. Cross-application role consistency
696
+ → Same role names have compatible permission levels across apps
697
+ 4. Cross-application navigation coherence
698
+ → Applications appear in correct contexts with non-colliding routes
699
+ 5. Cross-application seed data ordering
700
+ → Foundation applications must seed first (NavigationApplication order)
701
+
702
+ ## Context
703
+ - Project ID: {projectId}
704
+ - Applications: ${JSON.stringify(projectFeature.applications.map(a => ({
705
+ code: a.code, context: a.context, modules: a.modules.map(m => m.code)
706
+ })))}
707
+ - Application dependency graph: ${JSON.stringify(projectFeature.applicationDependencyGraph)}
708
+
709
+ ## Output
710
+ Send CROSS_APP_CONSOLIDATION_READY with:
711
+ - Cross-application interactions found
712
+ - Permission path conflicts (if any)
713
+ - Role inconsistencies (if any)
714
+ - Recommended seed data order
715
+ `,
716
+ description: "Cross-app consolidation"
717
+ });
718
+ ```
719
+
720
+ When CROSS_APP_CONSOLIDATION_READY received:
721
+
722
+ ```
723
+ ═══════════════════════════════════════════════════════════
724
+ Cross-Application Consolidation — {projectName}
725
+ ═══════════════════════════════════════════════════════════
726
+
727
+ {cross-application consolidation report}
728
+
729
+ ─────────────────────────────────────────────────────────
730
+ ```
731
+
732
+ AskUserQuestion: "Approuvez-vous la consolidation inter-applications ?"
733
+ - "Approuver" → write cross-application interactions to project feature.json → proceed to §6
734
+ - "Réviser" → send feedback → agent adjusts
735
+
736
+ After approval → shutdown agent → proceed to §6.
616
737
 
617
738
  ---
618
739
 
619
740
  ## 6. Handoff Phase
620
741
 
621
742
  ```javascript
743
+ // Project mode: handoff agent processes ALL applications at once
744
+ // Single-app mode: handoff agent processes one application
745
+ const handoffContext = workflow.mode === "project"
746
+ ? {
747
+ scope: "project",
748
+ projectId: projectId,
749
+ applications: projectFeature.applications.map(a => ({
750
+ code: a.code, context: a.context, featureId: a.featureJsonPath,
751
+ modules: a.modules.map(m => m.code)
752
+ })),
753
+ totalModules: projectFeature.applications.reduce((sum, a) => sum + a.modules.length, 0)
754
+ }
755
+ : {
756
+ scope: "application",
757
+ featureId: featureId,
758
+ modules: moduleOrder
759
+ };
760
+
622
761
  Task({
623
762
  subagent_type: "general-purpose",
624
763
  team_name: teamContext.teamName, // ← ACTUAL name from TeamCreate result
@@ -626,7 +765,7 @@ Task({
626
765
  model: "sonnet",
627
766
  mode: "bypassPermissions",
628
767
  prompt: `
629
- You are a handoff agent for business-analyse application "{appName}".
768
+ You are a handoff agent for business-analyse ${workflow.mode === "project" ? `project "${projectName}"` : `application "${appName}"`}.
630
769
 
631
770
  ## Your Mission
632
771
  Execute the handoff sequence (steps 05a + 05b + 05c):
@@ -635,9 +774,17 @@ Execute the handoff sequence (steps 05a + 05b + 05c):
635
774
  3. Load steps/step-05c-ralph-readiness.md and execute (quality gate)
636
775
 
637
776
  ## Context
638
- - Feature ID: {featureId}
639
- - Modules: {moduleOrder.join(", ")}
777
+ ${workflow.mode === "project" ? `
778
+ - Project ID: ${projectId}
779
+ - Applications: ${JSON.stringify(handoffContext.applications)}
780
+ - Total modules: ${handoffContext.totalModules}
781
+ - Workflow mode: project
782
+ - All applications and modules consolidated
783
+ ` : `
784
+ - Feature ID: ${featureId}
785
+ - Modules: ${moduleOrder.join(", ")}
640
786
  - All modules consolidated
787
+ `}
641
788
 
642
789
  ## Output
643
790
  Send HANDOFF_READY with:
@@ -646,8 +793,8 @@ Send HANDOFF_READY with:
646
793
  - Quality gate result (PASS/FAIL with details)
647
794
 
648
795
  ## Communication
649
- - HANDOFF_READY:{appName}\n{report} → when all artifacts deployed
650
- - ERROR:{appName}:{description} → on blocking issue
796
+ - HANDOFF_READY:${workflow.mode === "project" ? projectName : appName}\n{report} → when all artifacts deployed
797
+ - ERROR:${workflow.mode === "project" ? projectName : appName}:{description} → on blocking issue
651
798
  `,
652
799
  description: "Handoff & deploy"
653
800
  });
@@ -760,7 +907,8 @@ If the entire session crashes:
760
907
  | Condition | Action |
761
908
  |-----------|--------|
762
909
  | 1 module | NO team, classic inline execution |
763
- | 2+ modules | Team mode (Propose & Review) |
910
+ | 2+ modules (single app) | Team mode (Propose & Review) |
911
+ | 2+ applications (project mode) | Application loop + per-app team mode |
764
912
  | Modules in same dependency layer | Spawn ALL in parallel (single message) |
765
913
  | Modules in different layers | Sequential — complete layer N before spawning layer N+1 |
766
914
  | Layer with 1 module | Standard single-agent propose-review |
@@ -774,6 +922,9 @@ If the entire session crashes:
774
922
  | Layer consistency check fails | Auto-fix via targeted REVISION |
775
923
  | Context > 50% on team lead | Minimize presentation, suggest auto-approve |
776
924
  | Session crash | Resume from feature.json + completedModules state |
925
+ | Project mode + all app modules done | Run per-app consolidation → advance to next app |
926
+ | Project mode + all apps done | Run cross-app consolidation (§5-bis) → unified handoff |
927
+ | Project mode + app has 1 module | Inline mode for that app (no team) |
777
928
 
778
929
  ---
779
930
 
@@ -34,7 +34,8 @@
34
34
  "createdAt": { "type": "string", "format": "date-time" },
35
35
  "updatedAt": { "type": "string", "format": "date-time" },
36
36
  "application": { "type": "string", "description": "Application name (PascalCase)" },
37
- "context": { "type": "string", "const": "business" },
37
+ "context": { "type": "string", "enum": ["business", "platform", "personal"], "description": "Navigation context (business by default, other contexts allowed in project mode)" },
38
+ "projectRef": { "type": ["string", "null"], "description": "Parent project ID (PROJ-XXX) when part of a multi-application project, null for standalone" },
38
39
  "language": { "type": "string", "enum": ["fr", "en", "it", "de"] },
39
40
  "featureDescription": { "type": "string" },
40
41
  "workflowType": {