@atlashub/smartstack-cli 2.3.0 → 2.4.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 (33) hide show
  1. package/.documentation/cli-commands.html +1 -1
  2. package/.documentation/init.html +1 -1
  3. package/.documentation/installation.html +1 -1
  4. package/dist/index.js +2 -2
  5. package/dist/index.js.map +1 -1
  6. package/package.json +1 -1
  7. package/templates/agents/ba-reader.md +114 -9
  8. package/templates/agents/ba-writer.md +108 -27
  9. package/templates/agents/mcp-healthcheck.md +1 -1
  10. package/templates/ralph/README.md +1 -1
  11. package/templates/ralph/ralph.config.yaml +1 -1
  12. package/templates/skills/_shared.md +60 -0
  13. package/templates/skills/application/steps/step-00-init.md +32 -8
  14. package/templates/skills/business-analyse/SKILL.md +65 -42
  15. package/templates/skills/business-analyse/_shared.md +161 -51
  16. package/templates/skills/business-analyse/questionnaire/00-application.md +166 -0
  17. package/templates/skills/business-analyse/questionnaire.md +63 -19
  18. package/templates/skills/business-analyse/react/application-viewer.md +242 -0
  19. package/templates/skills/business-analyse/react/components.md +60 -8
  20. package/templates/skills/business-analyse/react/schema.md +238 -7
  21. package/templates/skills/business-analyse/schemas/application-schema.json +389 -0
  22. package/templates/skills/business-analyse/schemas/feature-schema.json +74 -3
  23. package/templates/skills/business-analyse/steps/step-00-init.md +110 -44
  24. package/templates/skills/business-analyse/steps/step-01-cadrage.md +259 -0
  25. package/templates/skills/business-analyse/steps/step-02-decomposition.md +282 -0
  26. package/templates/skills/business-analyse/steps/step-03-specify.md +489 -0
  27. package/templates/skills/business-analyse/steps/step-04-consolidation.md +336 -0
  28. package/templates/skills/business-analyse/steps/step-05-handoff.md +1119 -0
  29. package/templates/skills/mcp/SKILL.md +2 -2
  30. package/templates/skills/business-analyse/steps/step-01-analyse.md +0 -523
  31. package/templates/skills/business-analyse/steps/step-02-specify.md +0 -899
  32. package/templates/skills/business-analyse/steps/step-03-validate.md +0 -1009
  33. package/templates/skills/business-analyse/steps/step-04-handoff.md +0 -1802
@@ -1,8 +1,9 @@
1
1
  # TypeScript Schema - Feature JSON Types
2
2
 
3
- > **Usage:** TypeScript interfaces aligned with feature-schema.json
4
- > **Loaded in:** step-04-handoff.md (for web app rendering)
5
- > **Source:** `docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json`
3
+ > **Usage:** TypeScript interfaces aligned with feature-schema.json and application-schema.json
4
+ > **Loaded in:** step-05-handoff.md (for web app rendering)
5
+ > **Source (module):** `docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json`
6
+ > **Source (application):** `docs/business/{app}/business-analyse/v{X.Y}/feature.json`
6
7
 
7
8
  ---
8
9
 
@@ -11,8 +12,179 @@
11
12
  ```typescript
12
13
  // web/smartstack-web/src/types/business-analyse.ts
13
14
 
15
+ // ===================================================================
16
+ // APPLICATION-LEVEL TYPES (master feature.json, scope: "application")
17
+ // ===================================================================
18
+
19
+ /**
20
+ * Application-level Feature JSON structure
21
+ * Matches schemas/application-schema.json
22
+ * Master document for multi-module BA
23
+ */
24
+ export interface ApplicationFeatureJson {
25
+ id: string; // FEAT-XXX
26
+ version: string;
27
+ status: ApplicationStatus;
28
+ scope: 'application';
29
+ metadata: ApplicationMetadata;
30
+ cadrage: ApplicationCadrage;
31
+ modules: ApplicationModule[];
32
+ dependencyGraph: DependencyGraph;
33
+ consolidation: ApplicationConsolidation;
34
+ suggestions: FeatureSuggestion[];
35
+ changelog: ChangelogEntry[];
36
+ }
37
+
38
+ export type ApplicationStatus = 'draft' | 'framed' | 'decomposed' | 'specified' | 'consolidated' | 'handed-off';
39
+
40
+ export interface ApplicationMetadata {
41
+ application: string;
42
+ language: string;
43
+ featureDescription: string;
44
+ scope: 'application';
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ workflow: WorkflowState;
48
+ }
49
+
50
+ export interface WorkflowState {
51
+ mode: 'application' | 'module';
52
+ moduleOrder: string[];
53
+ currentModuleIndex: number;
54
+ completedModules: string[];
55
+ currentModule: string | null;
56
+ }
57
+
58
+ export interface ApplicationCadrage {
59
+ problem: string;
60
+ asIs: string;
61
+ toBe: string;
62
+ trigger: string;
63
+ stakeholders: Stakeholder[];
64
+ globalScope: GlobalScope;
65
+ applicationRoles: ApplicationRole[];
66
+ risks: Risk[];
67
+ acceptanceCriteria: AcceptanceCriterion[];
68
+ codebaseContext?: Record<string, unknown>;
69
+ }
70
+
71
+ export interface GlobalScope {
72
+ mustHave: string[];
73
+ shouldHave: string[];
74
+ couldHave: string[];
75
+ outOfScope: string[];
76
+ }
77
+
78
+ export interface ApplicationRole {
79
+ name: string;
80
+ level: 'admin' | 'manager' | 'contributor' | 'viewer';
81
+ description: string;
82
+ defaultPermissions: string[];
83
+ moduleRestrictions?: string[];
84
+ }
85
+
86
+ export interface ApplicationModule {
87
+ code: string;
88
+ description: string;
89
+ featureType: string;
90
+ entities: string[];
91
+ priority: 'must' | 'should' | 'could';
92
+ estimatedComplexity: 'simple' | 'medium' | 'complex';
93
+ status: 'pending' | 'in-progress' | 'specified' | 'validated';
94
+ featureJsonPath?: string;
95
+ sortOrder: number;
96
+ dependencies: string[];
97
+ dependents: string[];
98
+ }
99
+
100
+ export interface DependencyGraph {
101
+ edges: DependencyEdge[];
102
+ topologicalOrder: string[];
103
+ layers: DependencyLayer[];
104
+ }
105
+
106
+ export interface DependencyEdge {
107
+ from: string;
108
+ to: string;
109
+ type: 'FK' | 'Event' | 'Shared-entity' | 'Lookup';
110
+ description: string;
111
+ }
112
+
113
+ export interface DependencyLayer {
114
+ layer: number;
115
+ modules: string[];
116
+ }
117
+
118
+ export interface ApplicationConsolidation {
119
+ crossModuleInteractions: CrossModuleInteractions;
120
+ permissionCoherence: PermissionCoherence;
121
+ e2eFlows: E2EFlow[];
122
+ globalRiskAssessment: Record<string, unknown>;
123
+ }
124
+
125
+ export interface CrossModuleInteractions {
126
+ fkReferences: FKReference[];
127
+ sharedEntities: SharedEntity[];
128
+ events: ModuleEvent[];
129
+ sharedReferenceData: SharedReferenceData[];
130
+ }
131
+
132
+ export interface FKReference {
133
+ sourceModule: string;
134
+ sourceEntity: string;
135
+ sourceField: string;
136
+ targetModule: string;
137
+ targetEntity: string;
138
+ targetField: string;
139
+ required: boolean;
140
+ }
141
+
142
+ export interface SharedEntity {
143
+ entity: string;
144
+ definedIn: string;
145
+ referencedBy: string[];
146
+ referenceType: string;
147
+ }
148
+
149
+ export interface ModuleEvent {
150
+ producer: string;
151
+ event: string;
152
+ consumers: string[];
153
+ description: string;
154
+ }
155
+
156
+ export interface SharedReferenceData {
157
+ table: string;
158
+ usedBy: string[];
159
+ owner: string;
160
+ }
161
+
162
+ export interface PermissionCoherence {
163
+ roleConsistency: boolean;
164
+ pathFormatValid: boolean;
165
+ hierarchyRespected: boolean;
166
+ conflictsResolved: number;
167
+ }
168
+
169
+ export interface E2EFlow {
170
+ name: string;
171
+ steps: E2EFlowStep[];
172
+ actors: string[];
173
+ data: string;
174
+ }
175
+
176
+ export interface E2EFlowStep {
177
+ module: string;
178
+ action: string;
179
+ permission: string;
180
+ }
181
+
182
+ // ===================================================================
183
+ // MODULE-LEVEL TYPES (per-module feature.json, scope: "module")
184
+ // ===================================================================
185
+
14
186
  /**
15
- * Complete Feature JSON structure
187
+ * Module-level Feature JSON structure
16
188
  * Matches schemas/feature-schema.json
17
189
  * Progressively enriched by each BA step
18
190
  */
@@ -20,7 +192,9 @@ export interface FeatureJson {
20
192
  id: string; // FEAT-XXX
21
193
  version: string; // 1.0, 1.1, etc.
22
194
  status: FeatureStatus;
195
+ scope?: 'module';
23
196
  metadata: FeatureMetadata;
197
+ applicationContext?: ApplicationContext;
24
198
  discovery: FeatureDiscovery;
25
199
  analysis: FeatureAnalysis;
26
200
  specification: FeatureSpecification;
@@ -30,18 +204,27 @@ export interface FeatureJson {
30
204
  changelog: ChangelogEntry[];
31
205
  }
32
206
 
33
- export type FeatureStatus = 'draft' | 'analysed' | 'specified' | 'approved' | 'handed-off';
207
+ export type FeatureStatus = 'draft' | 'framed' | 'analysed' | 'decomposed' | 'specified' | 'consolidated' | 'approved' | 'handed-off';
34
208
 
35
209
  export interface FeatureMetadata {
36
210
  application: string;
37
211
  module: string;
38
212
  language: string;
39
213
  featureType: 'new' | 'refactoring' | 'micro';
214
+ scope?: 'application' | 'module';
215
+ applicationRef?: string | null;
216
+ moduleIndex?: number | null;
40
217
  createdAt: string;
41
218
  updatedAt: string;
42
219
  previousVersion: string | null;
43
220
  }
44
221
 
222
+ export interface ApplicationContext {
223
+ applicationRoles: ApplicationRole[];
224
+ permissionBase: string;
225
+ relatedModules: string[];
226
+ }
227
+
45
228
  // --- Discovery ---
46
229
 
47
230
  export interface FeatureDiscovery {
@@ -174,7 +357,10 @@ export interface ValidationRule {
174
357
 
175
358
  export interface Wireframe {
176
359
  screen: string;
360
+ section?: string; // Section code (list, detail, create, etc.)
177
361
  description: string;
362
+ mockupFormat?: 'ascii' | 'svg'; // Format of the mockup
363
+ mockup?: string; // ASCII art or inline SVG content
178
364
  elements: string[];
179
365
  actions: string[];
180
366
  permissionsRequired: string[];
@@ -453,10 +639,10 @@ export interface ChangelogEntry {
453
639
  ```typescript
454
640
  // web/smartstack-web/src/services/businessAnalyse.ts
455
641
 
456
- import type { FeatureJson } from '../types/business-analyse';
642
+ import type { FeatureJson, ApplicationFeatureJson } from '../types/business-analyse';
457
643
 
458
644
  /**
459
- * Load feature.json from docs path
645
+ * Load module-level feature.json from docs path
460
646
  * The web app reads the JSON directly - no transformation needed
461
647
  */
462
648
  export async function loadFeature(
@@ -470,6 +656,19 @@ export async function loadFeature(
470
656
  return response.json();
471
657
  }
472
658
 
659
+ /**
660
+ * Load application-level (master) feature.json
661
+ */
662
+ export async function loadApplicationFeature(
663
+ app: string,
664
+ version: string
665
+ ): Promise<ApplicationFeatureJson> {
666
+ const response = await fetch(
667
+ `/docs/business/${app}/business-analyse/v${version}/feature.json`
668
+ );
669
+ return response.json();
670
+ }
671
+
473
672
  /**
474
673
  * List available versions for a module
475
674
  */
@@ -482,6 +681,18 @@ export async function listVersions(
482
681
  );
483
682
  return response.json();
484
683
  }
684
+
685
+ /**
686
+ * List available versions for an application (master)
687
+ */
688
+ export async function listApplicationVersions(
689
+ app: string
690
+ ): Promise<string[]> {
691
+ const response = await fetch(
692
+ `/api/docs/business/${app}/business-analyse/versions`
693
+ );
694
+ return response.json();
695
+ }
485
696
  ```
486
697
 
487
698
  ---
@@ -492,9 +703,28 @@ export async function listVersions(
492
703
  // web/smartstack-web/src/types/index.ts
493
704
 
494
705
  export type {
706
+ // Application-level types
707
+ ApplicationFeatureJson,
708
+ ApplicationStatus,
709
+ ApplicationMetadata,
710
+ WorkflowState,
711
+ ApplicationCadrage,
712
+ GlobalScope,
713
+ ApplicationRole,
714
+ ApplicationModule,
715
+ DependencyGraph,
716
+ DependencyEdge,
717
+ DependencyLayer,
718
+ ApplicationConsolidation,
719
+ CrossModuleInteractions,
720
+ E2EFlow,
721
+ PermissionCoherence,
722
+
723
+ // Module-level types
495
724
  FeatureJson,
496
725
  FeatureStatus,
497
726
  FeatureMetadata,
727
+ ApplicationContext,
498
728
  FeatureDiscovery,
499
729
  FeatureAnalysis,
500
730
  FeatureSpecification,
@@ -505,6 +735,7 @@ export type {
505
735
  FunctionalRequirement,
506
736
  Entity,
507
737
  PermissionMatrix,
738
+ Wireframe,
508
739
  BusinessMessage,
509
740
  EntityLifeCycle,
510
741
  SeedDataCore,