@atlashub/smartstack-cli 2.2.0 → 2.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, APEX, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -76,20 +76,20 @@
76
76
  "test:mcp:coverage": "vitest run --config vitest.mcp.config.ts --coverage"
77
77
  },
78
78
  "dependencies": {
79
+ "@modelcontextprotocol/sdk": "^1.0.0",
80
+ "axios": "^1.7.0",
79
81
  "bcryptjs": "^2.4.3",
80
82
  "chalk": "^5.3.0",
81
83
  "cli-table3": "^0.6.3",
82
84
  "commander": "^12.0.0",
83
85
  "fs-extra": "^11.2.0",
84
86
  "glob": "^11.0.0",
87
+ "handlebars": "^4.7.8",
85
88
  "inquirer": "^9.2.12",
86
89
  "jsonwebtoken": "^9.0.3",
87
90
  "mssql": "^11.0.1",
88
91
  "ora": "^8.0.1",
89
- "zod": "^3.25.0",
90
- "@modelcontextprotocol/sdk": "^1.0.0",
91
- "handlebars": "^4.7.8",
92
- "axios": "^1.7.0"
92
+ "zod": "^3.25.0"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@types/bcryptjs": "^2.4.6",
@@ -100,11 +100,14 @@
100
100
  "@types/node": "^20.10.6",
101
101
  "@typescript-eslint/eslint-plugin": "^6.18.0",
102
102
  "@typescript-eslint/parser": "^6.18.0",
103
+ "@vitest/coverage-v8": "^2.1.0",
103
104
  "eslint": "^8.56.0",
104
105
  "prettier": "^3.2.4",
105
106
  "tsup": "^8.0.1",
106
107
  "typescript": "^5.3.3",
107
- "vitest": "^2.1.0",
108
- "@vitest/coverage-v8": "^2.1.0"
108
+ "vitest": "^2.1.0"
109
+ },
110
+ "optionalDependencies": {
111
+ "msnodesqlv8": "^5.1.3"
109
112
  }
110
113
  }
@@ -12,7 +12,7 @@
12
12
  | Q3.1 | List ESSENTIAL features (Must-Have) | List |
13
13
  | Q3.2 | List DESIRED features (Should-Have) | List |
14
14
  | Q3.3 | List OPTIONAL features (Could-Have) | List |
15
- | Q3.4 | Any known constraints limiting v1 scope? | List of constraints |
15
+ | Q3.4 | Any known constraints limiting scope? | List of constraints |
16
16
 
17
17
  ## 3.2 Business Process
18
18
 
@@ -29,10 +29,10 @@
29
29
 
30
30
  | Priority | Criterion |
31
31
  |----------|-----------|
32
- | Must | Without this feature, the module has no value |
33
- | Should | Brings significant value but can wait for v2 |
34
- | Could | Nice-to-have, can be implemented if time available |
35
- | Won't | Deferredwill be considered for future versions |
32
+ | Must | Without this feature, the module has no value — implement first |
33
+ | Should | Brings significant value implement right after Must items |
34
+ | Could | Nice-to-have implement if no technical blocker |
35
+ | Won't | Out of scope for this feature belongs to a different module or feature |
36
36
 
37
37
  ## Elicitation Guide
38
38
 
@@ -40,9 +40,9 @@
40
40
 
41
41
  | Question | If answer is vague/insufficient | Probe |
42
42
  |----------|-------------------------------|-------|
43
- | Q3.1 (Must-Have) | > 10 items listed | "Si vous ne pouviez en garder que 3 pour la v1, lesquels ? Les autres sont peut-être Should-Have." |
43
+ | Q3.1 (Must-Have) | > 10 items listed | "Si vous ne pouviez en garder que 3 à implémenter en premier, lesquels ? Les autres sont peut-être Should-Have." |
44
44
  | Q3.1 (Must-Have) | Mélange CRUD + complexe | "Le CRUD de base (liste, création, modification, suppression) est-il un Must, ou certaines actions sont Could ?" |
45
- | Q3.2 (Should-Have) | Vide | "Y a-t-il des fonctionnalités utiles mais qui peuvent attendre une v2 ? Export, filtres avancés, notifications ?" |
45
+ | Q3.2 (Should-Have) | Vide | "Y a-t-il des fonctionnalités utiles mais moins critiques ? Export, filtres avancés, notifications ?" |
46
46
  | Q3.4 (limites) | Vide | "Y a-t-il des contraintes connues qui pourraient limiter le périmètre ? (budget, délai, dépendance)" |
47
47
  | Q3.5 (main flow) | < 3 étapes | "Détaillez : l'utilisateur arrive sur l'écran → que voit-il ? → que clique-t-il ? → que se passe-t-il ?" |
48
48
  | Q3.7 (alt flows) | "Il n'y en a pas" | "Que se passe-t-il si l'utilisateur annule ? S'il n'a pas la permission ? Si les données sont invalides ?" |
@@ -55,4 +55,4 @@
55
55
  | "On saisira tout à la main" | **Migration non planifiée** | Si > 100 enregistrements, l'import automatisé est indispensable |
56
56
  | Pas de validation post-migration | **Données non vérifiées** | Prévoir un rapport de migration : importés / rejetés / à corriger |
57
57
  | Aucun rollback plan | **Risque de perte de données** | Toujours faire un backup avant migration + possibilité de rollback |
58
- | "On migrera plus tard" | **Dette technique** | Si la migration est nécessaire, la planifier dès la v1 même si simplifiée |
58
+ | "On migrera plus tard" | **Dette technique** | Si la migration est nécessaire, la planifier dès le départ même si simplifiée |
@@ -137,7 +137,7 @@ export interface EntityAttribute {
137
137
 
138
138
  export interface EntityRelationship {
139
139
  target: string;
140
- type: 'OneToMany' | 'ManyToOne' | 'ManyToMany' | 'OneToOne';
140
+ type: '1:1' | '1:N' | 'N:1' | 'N:M';
141
141
  description: string;
142
142
  }
143
143
 
@@ -158,9 +158,88 @@ export interface FeatureSpecification {
158
158
  navigation: NavigationHierarchy;
159
159
  gherkinScenarios: GherkinScenario[];
160
160
  apiEndpoints: ApiEndpoint[];
161
+ validations: ValidationRule[];
162
+ wireframes: Wireframe[];
163
+ messages: BusinessMessage[];
164
+ lifeCycles: EntityLifeCycle[];
165
+ seedDataCore: SeedDataCore;
161
166
  i18nKeys: I18nKey[];
162
167
  }
163
168
 
169
+ export interface ValidationRule {
170
+ field: string;
171
+ rules: string;
172
+ errorMessage: string;
173
+ }
174
+
175
+ export interface Wireframe {
176
+ screen: string;
177
+ description: string;
178
+ elements: string[];
179
+ actions: string[];
180
+ permissionsRequired: string[];
181
+ }
182
+
183
+ export interface BusinessMessage {
184
+ code: string; // SCREAMING_SNAKE_CASE
185
+ type: 'success' | 'error' | 'warning' | 'info';
186
+ title: string;
187
+ message: string; // User-facing with {placeholders}
188
+ i18nKey: string; // Dot-separated key
189
+ }
190
+
191
+ export interface EntityLifeCycle {
192
+ entity: string; // PascalCase entity name
193
+ states: LifeCycleState[];
194
+ }
195
+
196
+ export interface LifeCycleState {
197
+ id: string; // State code (Draft, Active, etc.)
198
+ displayName: string;
199
+ description?: string;
200
+ allowedTransitions: string[];
201
+ isTerminal: boolean;
202
+ }
203
+
204
+ export interface SeedDataCore {
205
+ navigationModules: SeedDataNavModule[];
206
+ navigationTranslations: SeedDataNavTranslation[];
207
+ permissions: SeedDataPermission[];
208
+ rolePermissions: SeedDataRolePermission[];
209
+ permissionConstants: SeedDataPermissionConstant[];
210
+ }
211
+
212
+ export interface SeedDataNavModule {
213
+ code: string;
214
+ label: string;
215
+ icon: string;
216
+ route: string;
217
+ parentCode: string | null;
218
+ sort: number;
219
+ }
220
+
221
+ export interface SeedDataNavTranslation {
222
+ moduleCode: string;
223
+ language: 'fr' | 'en' | 'it' | 'de';
224
+ label: string;
225
+ }
226
+
227
+ export interface SeedDataPermission {
228
+ path: string; // Full path: business.{app}.{module}.{resource}.{action}
229
+ action: string;
230
+ description?: string;
231
+ }
232
+
233
+ export interface SeedDataRolePermission {
234
+ role: string;
235
+ permissionPath: string; // Must match permissions[].path
236
+ }
237
+
238
+ export interface SeedDataPermissionConstant {
239
+ constantName: string; // PascalCase (e.g., VehiclesRead)
240
+ path: string; // Matching permission path
241
+ }
242
+
164
243
  export interface Actor {
165
244
  name: string;
166
245
  description: string;
@@ -244,54 +323,112 @@ export interface I18nKey {
244
323
  // --- Validation ---
245
324
 
246
325
  export interface FeatureValidation {
247
- decision: 'APPROVED' | 'REJECTED';
248
- completeness: Record<string, { score: string; issues: string[] }>;
249
- consistency: Record<string, 'OK' | 'FAIL'>;
250
- conventions: Record<string, 'OK' | 'FAIL'>;
251
- risks: ValidatedRisk[];
252
- issues: ValidationIssue[];
326
+ validatedAt: string | null;
327
+ completenessChecks: CompletenessCheck[];
328
+ consistencyChecks: ConsistencyCheck[];
329
+ conventionChecks: ConventionCheck[];
330
+ riskAssessments: RiskAssessment[];
331
+ warnings: string[];
332
+ decision: ValidationDecision;
253
333
  }
254
334
 
255
- export interface ValidatedRisk {
335
+ export interface CompletenessCheck {
336
+ section: string;
337
+ count: number;
338
+ minimum: number;
339
+ status: 'PASS' | 'FAIL' | 'WARNING';
340
+ }
341
+
342
+ export interface ConsistencyCheck {
343
+ check: string;
344
+ passed: number;
345
+ warnings: number;
346
+ errors: number;
347
+ status: 'PASS' | 'FAIL' | 'WARNING';
348
+ }
349
+
350
+ export interface ConventionCheck {
351
+ check: string;
352
+ status: 'PASS' | 'FAIL' | 'WARNING';
353
+ details: string;
354
+ }
355
+
356
+ export interface RiskAssessment {
256
357
  risk: string;
257
- severity: 'High' | 'Medium' | 'Low';
258
- mitigation: string;
259
- status: 'Mitigated' | 'Accepted' | 'Open';
358
+ value: number;
359
+ threshold: number;
360
+ status: 'ACCEPTABLE' | 'WARNING' | 'CRITICAL' | 'MONITORED';
260
361
  }
261
362
 
262
- export interface ValidationIssue {
263
- severity: 'critical' | 'warning' | 'info';
264
- section: string;
265
- message: string;
363
+ export interface ValidationDecision {
364
+ approved: boolean;
365
+ reason: string;
366
+ approvalMode: 'standard' | 'micro' | 'delta' | 'force';
367
+ approvedBy: string;
368
+ approvedAt: string;
266
369
  }
267
370
 
268
371
  // --- Handoff ---
269
372
 
270
373
  export interface FeatureHandoff {
271
- complexity: 'Simple' | 'Medium' | 'Complex';
272
- filesToCreate: FileSpec[];
374
+ complexity: 'simple' | 'medium' | 'complex';
375
+ complexityDetails?: {
376
+ entities: number;
377
+ useCases: number;
378
+ businessRules: number;
379
+ calculated: string;
380
+ };
381
+ filesToCreate: FilesToCreate;
273
382
  brToCodeMapping: BrToCodeMapping[];
274
- ralphPrd: object | null; // .ralph/prd.json content
383
+ apiEndpointSummary: ApiEndpointSummaryEntry[];
384
+ ralphPrd: object | null; // .ralph/prd.json content
385
+ }
386
+
387
+ export interface FilesToCreate {
388
+ domain: FileSpec[];
389
+ application: FileSpec[];
390
+ infrastructure: FileSpec[];
391
+ api: FileSpec[];
392
+ frontend: FileSpec[];
393
+ seedData: FileSpec[];
394
+ tests: FileSpec[];
275
395
  }
276
396
 
277
397
  export interface FileSpec {
278
398
  path: string;
279
- layer: string;
280
- type: string;
281
- description: string;
399
+ type: string; // Entity, Service, DTO, HasData, Constants, ApiController, Page, Component, etc.
400
+ linkedFRs?: string[]; // FR-XXX references
401
+ linkedUCs?: string[]; // UC-XXX references
402
+ category?: 'core' | 'business'; // For seedData files
403
+ source?: string; // Derivation source in feature.json
404
+ description?: string;
282
405
  }
283
406
 
284
407
  export interface BrToCodeMapping {
285
- brId: string;
286
- rule: string;
287
- implementation: string;
288
- file: string;
408
+ ruleId: string; // BR-XXX from analysis.businessRules
409
+ title: string;
410
+ implementationPoints: ImplementationPoint[];
411
+ }
412
+
413
+ export interface ImplementationPoint {
414
+ layer: string; // Domain, Application, Infrastructure, API, Frontend
415
+ component: string; // File name
416
+ method: string; // Method or attribute
417
+ implementation: string; // How the rule is enforced
418
+ }
419
+
420
+ export interface ApiEndpointSummaryEntry {
421
+ operation: string;
422
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
423
+ route: string; // MUST match specification.apiEndpoints[].path
424
+ linkedUC: string;
425
+ permissions: string;
289
426
  }
290
427
 
291
428
  // --- Suggestions & Changelog ---
292
429
 
293
430
  export interface FeatureSuggestion {
294
- type: 'module' | 'section' | 'integration';
431
+ type: 'module' | 'section' | 'integration' | 'enhancement';
295
432
  code: string;
296
433
  title: string;
297
434
  reason: string;
@@ -299,9 +436,13 @@ export interface FeatureSuggestion {
299
436
  }
300
437
 
301
438
  export interface ChangelogEntry {
302
- version: string;
439
+ step?: string; // step-01-analyse, step-02-specify, etc.
440
+ version?: string;
303
441
  timestamp: string;
442
+ author?: string;
304
443
  changes: string[];
444
+ warnings?: string[];
445
+ decision?: string;
305
446
  }
306
447
  ```
307
448
 
@@ -364,6 +505,13 @@ export type {
364
505
  FunctionalRequirement,
365
506
  Entity,
366
507
  PermissionMatrix,
508
+ BusinessMessage,
509
+ EntityLifeCycle,
510
+ SeedDataCore,
511
+ FilesToCreate,
512
+ FileSpec,
513
+ BrToCodeMapping,
514
+ ValidationDecision,
367
515
  FeatureSuggestion,
368
516
  ChangelogEntry
369
517
  } from './business-analyse';