@atlashub/smartstack-cli 2.1.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.
Files changed (38) hide show
  1. package/.documentation/business-analyse.html +1503 -1058
  2. package/dist/index.js +92 -55
  3. package/dist/index.js.map +1 -1
  4. package/package.json +10 -7
  5. package/templates/agents/ba-reader.md +250 -0
  6. package/templates/agents/ba-writer.md +210 -0
  7. package/templates/agents/docs-context-reader.md +51 -33
  8. package/templates/skills/_shared.md +2 -0
  9. package/templates/skills/business-analyse/SKILL.md +120 -108
  10. package/templates/skills/business-analyse/_shared.md +136 -146
  11. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +478 -0
  12. package/templates/skills/business-analyse/questionnaire/01-context.md +3 -15
  13. package/templates/skills/business-analyse/questionnaire/03-scope.md +7 -7
  14. package/templates/skills/business-analyse/questionnaire/08-performance.md +7 -21
  15. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -13
  16. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -13
  17. package/templates/skills/business-analyse/questionnaire/12-migration.md +1 -1
  18. package/templates/skills/business-analyse/questionnaire.md +72 -76
  19. package/templates/skills/business-analyse/react/components.md +317 -154
  20. package/templates/skills/business-analyse/react/i18n-template.md +167 -106
  21. package/templates/skills/business-analyse/react/schema.md +474 -107
  22. package/templates/skills/business-analyse/schemas/feature-schema.json +860 -0
  23. package/templates/skills/business-analyse/steps/step-00-init.md +395 -285
  24. package/templates/skills/business-analyse/steps/step-01-analyse.md +523 -0
  25. package/templates/skills/business-analyse/steps/step-02-specify.md +899 -0
  26. package/templates/skills/business-analyse/steps/step-03-validate.md +1009 -0
  27. package/templates/skills/business-analyse/steps/step-04-handoff.md +1802 -0
  28. package/templates/skills/business-analyse/templates/tpl-handoff.md +49 -64
  29. package/templates/skills/business-analyse/steps/step-01-discover.md +0 -737
  30. package/templates/skills/business-analyse/steps/step-02-analyse.md +0 -299
  31. package/templates/skills/business-analyse/steps/step-03-specify.md +0 -472
  32. package/templates/skills/business-analyse/steps/step-04-validate.md +0 -335
  33. package/templates/skills/business-analyse/steps/step-05-handoff.md +0 -741
  34. package/templates/skills/business-analyse/steps/step-06-doc-html.md +0 -320
  35. package/templates/skills/business-analyse/templates/00-context.md +0 -105
  36. package/templates/skills/business-analyse/templates/tpl-brd.md +0 -97
  37. package/templates/skills/business-analyse/templates/tpl-discovery.md +0 -78
  38. package/templates/skills/business-analyse/tracking/change-template.md +0 -30
@@ -0,0 +1,860 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "feature.json",
4
+ "title": "SmartStack Business Analysis Feature",
5
+ "description": "Single JSON file enriched progressively by each BA step. Published to docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json",
6
+ "type": "object",
7
+ "required": ["id", "version", "status", "metadata"],
8
+ "properties": {
9
+ "id": {
10
+ "type": "string",
11
+ "pattern": "^FEAT-\\d{3,}$",
12
+ "description": "Unique feature identifier (e.g., FEAT-001)"
13
+ },
14
+ "version": {
15
+ "type": "string",
16
+ "pattern": "^\\d+\\.\\d+$",
17
+ "description": "Document version (e.g., 1.0, 1.1)"
18
+ },
19
+ "status": {
20
+ "type": "string",
21
+ "enum": ["draft", "analysed", "specified", "approved", "handed-off"],
22
+ "description": "Current lifecycle status, enriched by each step"
23
+ },
24
+
25
+ "metadata": {
26
+ "type": "object",
27
+ "required": ["createdAt", "updatedAt", "application", "module", "context", "language", "featureDescription"],
28
+ "properties": {
29
+ "createdAt": { "type": "string", "format": "date-time" },
30
+ "updatedAt": { "type": "string", "format": "date-time" },
31
+ "application": { "type": "string", "description": "Application name (PascalCase)" },
32
+ "module": { "type": "string", "description": "Module name (PascalCase)" },
33
+ "context": { "type": "string", "const": "business" },
34
+ "language": { "type": "string", "enum": ["fr", "en", "it", "de"] },
35
+ "featureDescription": { "type": "string" },
36
+ "featureType": {
37
+ "type": "string",
38
+ "enum": ["data-centric", "integration", "ui-centric", "workflow", "reporting", "full-module", "micro"],
39
+ "description": "Auto-classified from feature description"
40
+ },
41
+ "useCase": {
42
+ "type": "string",
43
+ "enum": ["new", "refactoring", "micro"],
44
+ "description": "Which use case triggered this analysis"
45
+ },
46
+ "permissionBase": {
47
+ "type": "string",
48
+ "description": "e.g., business.sales.orders"
49
+ },
50
+ "previousVersion": {
51
+ "type": ["string", "null"],
52
+ "description": "Reference to previous version (for refactoring)"
53
+ },
54
+ "changeReason": {
55
+ "type": ["string", "null"],
56
+ "description": "Why this version was created (refactoring delta)"
57
+ },
58
+ "mcpAvailable": { "type": "boolean" },
59
+ "economyMode": { "type": "boolean" },
60
+ "steps": {
61
+ "type": "object",
62
+ "description": "Progress tracking per step",
63
+ "properties": {
64
+ "init": { "$ref": "#/$defs/stepStatus" },
65
+ "analyse": { "$ref": "#/$defs/stepStatus" },
66
+ "specify": { "$ref": "#/$defs/stepStatus" },
67
+ "validate": { "$ref": "#/$defs/stepStatus" },
68
+ "handoff": { "$ref": "#/$defs/stepStatus" }
69
+ }
70
+ }
71
+ }
72
+ },
73
+
74
+ "discovery": {
75
+ "type": "object",
76
+ "description": "Enriched by step-01-analyse (discovery part)",
77
+ "properties": {
78
+ "problem": { "type": "string", "description": "Q1.1 - Business problem to solve" },
79
+ "asIs": { "type": "string", "description": "Q1.2 - Current situation" },
80
+ "toBe": { "type": "string", "description": "Q1.3 - Target situation" },
81
+ "trigger": { "type": "string", "description": "Q1.4 - What triggered this need" },
82
+ "stakeholders": {
83
+ "type": "array",
84
+ "items": {
85
+ "type": "object",
86
+ "required": ["role"],
87
+ "properties": {
88
+ "role": { "type": "string" },
89
+ "function": { "type": "string" },
90
+ "involvement": { "type": "string", "enum": ["approver", "decision-maker", "consulted", "informed", "end-user"] },
91
+ "tasks": { "type": "array", "items": { "type": "string" } },
92
+ "frequency": { "type": "string" },
93
+ "painPoints": { "type": "array", "items": { "type": "string" } }
94
+ }
95
+ }
96
+ },
97
+ "scope": {
98
+ "type": "object",
99
+ "properties": {
100
+ "mustHave": { "type": "array", "items": { "type": "string" } },
101
+ "shouldHave": { "type": "array", "items": { "type": "string" } },
102
+ "couldHave": { "type": "array", "items": { "type": "string" } },
103
+ "outOfScope": { "type": "array", "items": { "type": "string" } },
104
+ "mainFlow": { "type": "string" },
105
+ "decisionPoints": { "type": "array", "items": { "type": "string" } },
106
+ "alternativeFlows": { "type": "array", "items": { "type": "string" } },
107
+ "errorCases": { "type": "array", "items": { "type": "string" } }
108
+ }
109
+ },
110
+ "risks": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "object",
114
+ "required": ["id", "type", "description"],
115
+ "properties": {
116
+ "id": { "type": "string", "pattern": "^RISK-\\d{3}$" },
117
+ "type": { "type": "string", "enum": ["business", "technical", "organizational"] },
118
+ "description": { "type": "string" },
119
+ "probability": { "type": "string", "enum": ["high", "medium", "low"] },
120
+ "impact": { "type": "string", "enum": ["high", "medium", "low"] },
121
+ "priority": { "type": "string", "enum": ["critical", "medium", "low"] },
122
+ "mitigation": { "type": "string" }
123
+ }
124
+ }
125
+ },
126
+ "acceptanceCriteria": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "object",
130
+ "required": ["id", "criterion"],
131
+ "properties": {
132
+ "id": { "type": "string", "pattern": "^AC-\\d{3}$" },
133
+ "criterion": { "type": "string" },
134
+ "validated": { "type": "boolean", "default": false }
135
+ }
136
+ }
137
+ },
138
+ "codebaseContext": {
139
+ "type": "string",
140
+ "description": "Summary of existing modules/patterns found during pre-research"
141
+ },
142
+ "openQuestions": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "object",
146
+ "properties": {
147
+ "id": { "type": "string" },
148
+ "question": { "type": "string" },
149
+ "answer": { "type": ["string", "null"] },
150
+ "status": { "type": "string", "enum": ["pending", "answered", "deferred"] }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ },
156
+
157
+ "analysis": {
158
+ "type": "object",
159
+ "description": "Enriched by step-01-analyse (analysis part, merged from old BRD step)",
160
+ "properties": {
161
+ "objectives": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "object",
165
+ "required": ["id", "objective"],
166
+ "properties": {
167
+ "id": { "type": "string", "pattern": "^OBJ-\\d{3}$" },
168
+ "objective": { "type": "string" },
169
+ "metric": { "type": "string" },
170
+ "target": { "type": "string" }
171
+ }
172
+ }
173
+ },
174
+ "businessRules": {
175
+ "type": "array",
176
+ "items": {
177
+ "type": "object",
178
+ "required": ["id", "name", "category", "statement"],
179
+ "properties": {
180
+ "id": { "type": "string", "pattern": "^BR-(VAL|CALC|WF|SEC|DATA)-\\d{3}$" },
181
+ "name": { "type": "string" },
182
+ "category": { "type": "string", "enum": ["validation", "calculation", "workflow", "security", "data"] },
183
+ "statement": { "type": "string", "description": "IF ... THEN ... ELSE ..." },
184
+ "priority": { "type": "string", "enum": ["must", "should", "could"] },
185
+ "conditions": { "type": "array", "items": { "type": "string" } },
186
+ "examples": {
187
+ "type": "array",
188
+ "items": {
189
+ "type": "object",
190
+ "properties": {
191
+ "input": { "type": "string" },
192
+ "expected": { "type": "string" }
193
+ }
194
+ }
195
+ },
196
+ "testability": { "type": "string" }
197
+ }
198
+ }
199
+ },
200
+ "entities": {
201
+ "type": "array",
202
+ "description": "Business-view entities only. NO technical fields (Id, TenantId, CreatedBy, etc.)",
203
+ "items": {
204
+ "type": "object",
205
+ "required": ["name"],
206
+ "properties": {
207
+ "name": { "type": "string", "description": "PascalCase entity name" },
208
+ "description": { "type": "string" },
209
+ "attributes": {
210
+ "type": "array",
211
+ "items": {
212
+ "type": "object",
213
+ "required": ["name"],
214
+ "properties": {
215
+ "name": { "type": "string" },
216
+ "description": { "type": "string" },
217
+ "required": { "type": "boolean", "default": false },
218
+ "unique": { "type": "boolean", "default": false },
219
+ "validation": { "type": "string" }
220
+ }
221
+ }
222
+ },
223
+ "relationships": {
224
+ "type": "array",
225
+ "items": {
226
+ "type": "object",
227
+ "required": ["target", "type"],
228
+ "properties": {
229
+ "target": { "type": "string" },
230
+ "type": { "type": "string", "enum": ["1:1", "1:N", "N:1", "N:M"] },
231
+ "description": { "type": "string" }
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ },
238
+ "processFlow": {
239
+ "type": "object",
240
+ "properties": {
241
+ "entryPoints": { "type": "array", "items": { "type": "string" } },
242
+ "mainFlow": {
243
+ "type": "array",
244
+ "items": {
245
+ "type": "object",
246
+ "properties": {
247
+ "step": { "type": "integer" },
248
+ "actor": { "type": "string" },
249
+ "action": { "type": "string" },
250
+ "system": { "type": "string" }
251
+ }
252
+ }
253
+ },
254
+ "decisionPoints": {
255
+ "type": "array",
256
+ "items": {
257
+ "type": "object",
258
+ "properties": {
259
+ "condition": { "type": "string" },
260
+ "ifTrue": { "type": "string" },
261
+ "ifFalse": { "type": "string" },
262
+ "rule": { "type": "string", "description": "Reference to BR-XXX" }
263
+ }
264
+ }
265
+ },
266
+ "alternativeFlows": { "type": "array", "items": { "type": "object" } }
267
+ }
268
+ },
269
+ "integrations": {
270
+ "type": "array",
271
+ "items": {
272
+ "type": "object",
273
+ "properties": {
274
+ "system": { "type": "string" },
275
+ "direction": { "type": "string", "enum": ["in", "out", "bidirectional"] },
276
+ "data": { "type": "string" },
277
+ "frequency": { "type": "string" },
278
+ "errorStrategy": { "type": "string" }
279
+ }
280
+ }
281
+ },
282
+ "dataLifecycle": {
283
+ "type": "object",
284
+ "properties": {
285
+ "retentionPeriod": { "type": "string" },
286
+ "archiveStrategy": { "type": "string" },
287
+ "gdprCompliance": { "type": "string" },
288
+ "states": {
289
+ "type": "array",
290
+ "items": {
291
+ "type": "object",
292
+ "properties": {
293
+ "name": { "type": "string" },
294
+ "transitions": { "type": "array", "items": { "type": "string" } }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ },
300
+ "crossModuleImpact": {
301
+ "type": "object",
302
+ "properties": {
303
+ "existingModules": { "type": "array", "items": { "type": "string" } },
304
+ "sharedData": { "type": "array", "items": { "type": "string" } },
305
+ "events": { "type": "array", "items": { "type": "string" } },
306
+ "modifications": { "type": "array", "items": { "type": "string" } }
307
+ }
308
+ }
309
+ }
310
+ },
311
+
312
+ "specification": {
313
+ "type": "object",
314
+ "description": "Enriched by step-02-specify",
315
+ "properties": {
316
+ "actors": {
317
+ "type": "array",
318
+ "items": {
319
+ "type": "object",
320
+ "required": ["role", "permissions"],
321
+ "properties": {
322
+ "role": { "type": "string" },
323
+ "description": { "type": "string" },
324
+ "permissions": { "type": "array", "items": { "type": "string" } }
325
+ }
326
+ }
327
+ },
328
+ "useCases": {
329
+ "type": "array",
330
+ "items": {
331
+ "type": "object",
332
+ "required": ["id", "name", "primaryActor", "permission"],
333
+ "properties": {
334
+ "id": { "type": "string", "pattern": "^UC-\\d{3}$" },
335
+ "name": { "type": "string" },
336
+ "primaryActor": { "type": "string" },
337
+ "permission": { "type": "string", "description": "business.{app}.{module}.{action}" },
338
+ "preconditions": { "type": "array", "items": { "type": "string" } },
339
+ "postconditions": { "type": "array", "items": { "type": "string" } },
340
+ "mainScenario": { "type": "array", "items": { "type": "string" } },
341
+ "alternativeScenarios": {
342
+ "type": "array",
343
+ "items": {
344
+ "type": "object",
345
+ "properties": {
346
+ "name": { "type": "string" },
347
+ "steps": { "type": "array", "items": { "type": "string" } }
348
+ }
349
+ }
350
+ },
351
+ "errorScenarios": {
352
+ "type": "array",
353
+ "items": {
354
+ "type": "object",
355
+ "properties": {
356
+ "name": { "type": "string" },
357
+ "steps": { "type": "array", "items": { "type": "string" } }
358
+ }
359
+ }
360
+ },
361
+ "linkedRules": {
362
+ "type": "array",
363
+ "items": { "type": "string" },
364
+ "description": "Cross-references to BR-XXX in analysis.businessRules"
365
+ }
366
+ }
367
+ }
368
+ },
369
+ "functionalRequirements": {
370
+ "type": "array",
371
+ "items": {
372
+ "type": "object",
373
+ "required": ["id", "statement", "priority"],
374
+ "properties": {
375
+ "id": { "type": "string", "pattern": "^FR-\\d{3}$" },
376
+ "statement": { "type": "string", "description": "System MUST/SHOULD/COULD ..." },
377
+ "priority": { "type": "string", "enum": ["must", "should", "could"] },
378
+ "linkedRules": {
379
+ "type": "array",
380
+ "items": { "type": "string" },
381
+ "description": "Cross-references to BR-XXX"
382
+ },
383
+ "linkedUseCases": {
384
+ "type": "array",
385
+ "items": { "type": "string" },
386
+ "description": "Cross-references to UC-XXX"
387
+ },
388
+ "acceptanceCriteria": { "type": "array", "items": { "type": "string" } }
389
+ }
390
+ }
391
+ },
392
+ "permissionMatrix": {
393
+ "type": "object",
394
+ "properties": {
395
+ "permissions": {
396
+ "type": "array",
397
+ "description": "All permissions for this module",
398
+ "items": {
399
+ "type": "object",
400
+ "required": ["path", "action"],
401
+ "properties": {
402
+ "path": { "type": "string", "description": "business.{app}.{module}.{action}" },
403
+ "action": { "type": "string", "enum": ["read", "create", "update", "delete", "export", "import", "admin", "*"] },
404
+ "description": { "type": "string" }
405
+ }
406
+ }
407
+ },
408
+ "roleAssignments": {
409
+ "type": "array",
410
+ "description": "Role-to-permission mapping (SeedData source)",
411
+ "items": {
412
+ "type": "object",
413
+ "required": ["role", "permissions"],
414
+ "properties": {
415
+ "role": { "type": "string" },
416
+ "permissions": {
417
+ "type": "array",
418
+ "items": { "type": "string" },
419
+ "description": "Permission paths assigned to this role"
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+ },
426
+ "navigation": {
427
+ "type": "object",
428
+ "description": "Navigation hierarchy for SeedData generation",
429
+ "properties": {
430
+ "entries": {
431
+ "type": "array",
432
+ "items": {
433
+ "type": "object",
434
+ "required": ["level", "code", "route"],
435
+ "properties": {
436
+ "level": { "type": "string", "enum": ["context", "application", "module", "section", "resource"] },
437
+ "code": { "type": "string" },
438
+ "labels": {
439
+ "type": "object",
440
+ "properties": {
441
+ "fr": { "type": "string" },
442
+ "en": { "type": "string" },
443
+ "it": { "type": "string" },
444
+ "de": { "type": "string" }
445
+ }
446
+ },
447
+ "route": { "type": "string" },
448
+ "icon": { "type": "string" },
449
+ "isNew": { "type": "boolean" }
450
+ }
451
+ }
452
+ }
453
+ }
454
+ },
455
+ "gherkinScenarios": {
456
+ "type": "array",
457
+ "items": {
458
+ "type": "object",
459
+ "properties": {
460
+ "feature": { "type": "string" },
461
+ "scenarios": {
462
+ "type": "array",
463
+ "items": {
464
+ "type": "object",
465
+ "properties": {
466
+ "name": { "type": "string" },
467
+ "tags": { "type": "array", "items": { "type": "string" } },
468
+ "given": { "type": "array", "items": { "type": "string" } },
469
+ "when": { "type": "array", "items": { "type": "string" } },
470
+ "then": { "type": "array", "items": { "type": "string" } }
471
+ }
472
+ }
473
+ }
474
+ }
475
+ }
476
+ },
477
+ "validations": {
478
+ "type": "array",
479
+ "description": "Field-level validations for entities",
480
+ "items": {
481
+ "type": "object",
482
+ "properties": {
483
+ "entity": { "type": "string" },
484
+ "field": { "type": "string" },
485
+ "rules": { "type": "array", "items": { "type": "string" } },
486
+ "errorMessageKey": { "type": "string" }
487
+ }
488
+ }
489
+ },
490
+ "apiEndpoints": {
491
+ "type": "array",
492
+ "items": {
493
+ "type": "object",
494
+ "properties": {
495
+ "method": { "type": "string", "enum": ["GET", "POST", "PUT", "PATCH", "DELETE"] },
496
+ "path": { "type": "string" },
497
+ "permission": { "type": "string" },
498
+ "requestDto": { "type": "string" },
499
+ "responseDto": { "type": "string" },
500
+ "description": { "type": "string" }
501
+ }
502
+ }
503
+ },
504
+ "i18nKeys": {
505
+ "type": "object",
506
+ "description": "Translation keys organized by section",
507
+ "additionalProperties": {
508
+ "type": "object",
509
+ "additionalProperties": { "type": "string" }
510
+ }
511
+ },
512
+ "uiWireframes": {
513
+ "type": "array",
514
+ "items": {
515
+ "type": "object",
516
+ "properties": {
517
+ "screen": { "type": "string" },
518
+ "description": { "type": "string" },
519
+ "elements": { "type": "array", "items": { "type": "string" } },
520
+ "actions": { "type": "array", "items": { "type": "string" } },
521
+ "permissionsRequired": { "type": "array", "items": { "type": "string" } }
522
+ }
523
+ }
524
+ },
525
+ "messages": {
526
+ "type": "array",
527
+ "description": "Business messages (success, error, warning, info) with i18n keys. MANDATORY: ≥4 messages.",
528
+ "items": {
529
+ "type": "object",
530
+ "required": ["code", "type", "i18nKey"],
531
+ "properties": {
532
+ "code": { "type": "string", "description": "SCREAMING_SNAKE_CASE identifier (e.g., VEHICLE_CREATED_SUCCESS)" },
533
+ "type": { "type": "string", "enum": ["success", "error", "warning", "info"] },
534
+ "title": { "type": "string" },
535
+ "message": { "type": "string", "description": "User-facing message with {placeholders}" },
536
+ "i18nKey": { "type": "string", "description": "Dot-separated i18n key (e.g., freebike.messages.vehicleCreated)" }
537
+ }
538
+ }
539
+ },
540
+ "lifeCycles": {
541
+ "type": "array",
542
+ "description": "Per-entity state machines for entities with Status fields. MANDATORY: ≥1 entity.",
543
+ "items": {
544
+ "type": "object",
545
+ "required": ["entity", "states"],
546
+ "properties": {
547
+ "entity": { "type": "string", "description": "PascalCase entity name" },
548
+ "states": {
549
+ "type": "array",
550
+ "items": {
551
+ "type": "object",
552
+ "required": ["id", "allowedTransitions"],
553
+ "properties": {
554
+ "id": { "type": "string", "description": "State code (e.g., Draft, Active, Completed)" },
555
+ "displayName": { "type": "string" },
556
+ "description": { "type": "string" },
557
+ "allowedTransitions": { "type": "array", "items": { "type": "string" } },
558
+ "isTerminal": { "type": "boolean", "default": false }
559
+ }
560
+ }
561
+ }
562
+ }
563
+ }
564
+ },
565
+ "seedDataCore": {
566
+ "type": "object",
567
+ "description": "5 mandatory SmartStack core SeedData definitions derived from navigation + permissionMatrix. CRITICAL: without these, module is invisible (403).",
568
+ "properties": {
569
+ "navigationModules": {
570
+ "type": "array",
571
+ "description": "Entries for nav_Modules table (HasData). Derived from navigation.entries.",
572
+ "items": {
573
+ "type": "object",
574
+ "required": ["code", "label", "icon", "route"],
575
+ "properties": {
576
+ "code": { "type": "string" },
577
+ "label": { "type": "string" },
578
+ "icon": { "type": "string" },
579
+ "route": { "type": "string" },
580
+ "parentCode": { "type": ["string", "null"] },
581
+ "sort": { "type": "integer" }
582
+ }
583
+ }
584
+ },
585
+ "navigationTranslations": {
586
+ "type": "array",
587
+ "description": "Translations for nav_Translations table (HasData). One entry per module per language.",
588
+ "items": {
589
+ "type": "object",
590
+ "required": ["moduleCode", "language", "label"],
591
+ "properties": {
592
+ "moduleCode": { "type": "string" },
593
+ "language": { "type": "string", "enum": ["fr", "en", "it", "de"] },
594
+ "label": { "type": "string" }
595
+ }
596
+ }
597
+ },
598
+ "permissions": {
599
+ "type": "array",
600
+ "description": "Entries for nav_Permissions table (HasData). Full paths from permissionMatrix.permissions.",
601
+ "items": {
602
+ "type": "object",
603
+ "required": ["path", "action"],
604
+ "properties": {
605
+ "path": { "type": "string", "description": "Full permission path (business.{app}.{module}.{resource}.{action})" },
606
+ "action": { "type": "string" },
607
+ "description": { "type": "string" }
608
+ }
609
+ }
610
+ },
611
+ "rolePermissions": {
612
+ "type": "array",
613
+ "description": "Entries for auth_RolePermissions table (HasData). Derived from permissionMatrix.roleAssignments.",
614
+ "items": {
615
+ "type": "object",
616
+ "required": ["role", "permissionPath"],
617
+ "properties": {
618
+ "role": { "type": "string" },
619
+ "permissionPath": { "type": "string", "description": "Full permission path (must match permissions[].path)" }
620
+ }
621
+ }
622
+ },
623
+ "permissionConstants": {
624
+ "type": "array",
625
+ "description": "Compile-time constants for Permissions.cs (Application layer). Used in [RequirePermission] attributes.",
626
+ "items": {
627
+ "type": "object",
628
+ "required": ["constantName", "path"],
629
+ "properties": {
630
+ "constantName": { "type": "string", "description": "PascalCase constant (e.g., VehiclesRead)" },
631
+ "path": { "type": "string", "description": "Matching permission path" }
632
+ }
633
+ }
634
+ }
635
+ }
636
+ }
637
+ }
638
+ },
639
+
640
+ "validation": {
641
+ "type": "object",
642
+ "description": "Enriched by step-03-validate",
643
+ "properties": {
644
+ "validatedAt": { "type": ["string", "null"], "format": "date-time" },
645
+ "completenessChecks": {
646
+ "type": "array",
647
+ "description": "Per-section completeness verification",
648
+ "items": {
649
+ "type": "object",
650
+ "properties": {
651
+ "section": { "type": "string" },
652
+ "count": { "type": "integer" },
653
+ "minimum": { "type": "integer" },
654
+ "status": { "type": "string", "enum": ["PASS", "FAIL", "WARNING"] }
655
+ }
656
+ }
657
+ },
658
+ "consistencyChecks": {
659
+ "type": "array",
660
+ "description": "Cross-reference consistency checks (UC↔FR, FR↔BR, Actor↔Matrix, etc.)",
661
+ "items": {
662
+ "type": "object",
663
+ "properties": {
664
+ "check": { "type": "string" },
665
+ "passed": { "type": "integer" },
666
+ "warnings": { "type": "integer" },
667
+ "errors": { "type": "integer" },
668
+ "status": { "type": "string", "enum": ["PASS", "FAIL", "WARNING"] }
669
+ }
670
+ }
671
+ },
672
+ "conventionChecks": {
673
+ "type": "array",
674
+ "description": "SmartStack convention validation (naming, permissions, routes, etc.)",
675
+ "items": {
676
+ "type": "object",
677
+ "properties": {
678
+ "check": { "type": "string" },
679
+ "status": { "type": "string", "enum": ["PASS", "FAIL", "WARNING"] },
680
+ "details": { "type": "string" }
681
+ }
682
+ }
683
+ },
684
+ "riskAssessments": {
685
+ "type": "array",
686
+ "description": "Scope and complexity risk evaluation",
687
+ "items": {
688
+ "type": "object",
689
+ "properties": {
690
+ "risk": { "type": "string" },
691
+ "value": { "type": "integer" },
692
+ "threshold": { "type": "integer" },
693
+ "status": { "type": "string", "enum": ["ACCEPTABLE", "WARNING", "CRITICAL", "MONITORED"] }
694
+ }
695
+ }
696
+ },
697
+ "warnings": {
698
+ "type": "array",
699
+ "description": "Non-blocking warnings and observations",
700
+ "items": { "type": "string" }
701
+ },
702
+ "decision": {
703
+ "type": "object",
704
+ "description": "Final approval decision",
705
+ "properties": {
706
+ "approved": { "type": "boolean" },
707
+ "reason": { "type": "string" },
708
+ "approvalMode": { "type": "string", "enum": ["standard", "micro", "delta", "force"] },
709
+ "approvedBy": { "type": "string" },
710
+ "approvedAt": { "type": "string", "format": "date-time" }
711
+ }
712
+ }
713
+ }
714
+ },
715
+
716
+ "handoff": {
717
+ "type": "object",
718
+ "description": "Enriched by step-04-handoff",
719
+ "properties": {
720
+ "complexity": { "type": "string", "enum": ["simple", "medium", "complex"] },
721
+ "filesToCreate": {
722
+ "type": "object",
723
+ "properties": {
724
+ "domain": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } },
725
+ "application": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } },
726
+ "infrastructure": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } },
727
+ "api": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } },
728
+ "frontend": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } },
729
+ "seedData": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } },
730
+ "tests": { "type": "array", "items": { "$ref": "#/$defs/fileSpec" } }
731
+ }
732
+ },
733
+ "brToCodeMapping": {
734
+ "type": "array",
735
+ "description": "Maps each business rule to its implementation points across layers. Derived from analysis.businessRules[].",
736
+ "items": {
737
+ "type": "object",
738
+ "required": ["ruleId", "implementationPoints"],
739
+ "properties": {
740
+ "ruleId": { "type": "string", "description": "BR-XXX identifier from analysis.businessRules" },
741
+ "title": { "type": "string", "description": "Business rule title" },
742
+ "implementationPoints": {
743
+ "type": "array",
744
+ "items": {
745
+ "type": "object",
746
+ "required": ["layer", "component"],
747
+ "properties": {
748
+ "layer": { "type": "string", "description": "Architecture layer (Domain, Application, Infrastructure, API, Frontend)" },
749
+ "component": { "type": "string", "description": "File name (e.g., Order.cs, OrdersController.cs)" },
750
+ "method": { "type": "string", "description": "Method or attribute (e.g., Validate(), [Authorize])" },
751
+ "implementation": { "type": "string", "description": "How the rule is enforced" }
752
+ }
753
+ }
754
+ }
755
+ }
756
+ }
757
+ },
758
+ "apiEndpointSummary": {
759
+ "type": "array",
760
+ "description": "Subset of specification.apiEndpoints enriched with linkedUC. MUST use EXACT same routes as specification.",
761
+ "items": {
762
+ "type": "object",
763
+ "properties": {
764
+ "operation": { "type": "string" },
765
+ "method": { "type": "string", "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"] },
766
+ "route": { "type": "string", "description": "MUST match specification.apiEndpoints[].path exactly" },
767
+ "linkedUC": { "type": "string" },
768
+ "permissions": { "type": "string" }
769
+ }
770
+ }
771
+ },
772
+ "ralphPrd": {
773
+ "type": "object",
774
+ "description": "Embedded Ralph Loop task breakdown (also exported to .ralph/prd.json)",
775
+ "properties": {
776
+ "tasks": {
777
+ "type": "array",
778
+ "items": {
779
+ "type": "object",
780
+ "properties": {
781
+ "id": { "type": "integer" },
782
+ "description": { "type": "string" },
783
+ "category": { "type": "string", "enum": ["domain", "seedData", "seedDataCore", "application", "infrastructure", "api", "frontend", "i18n", "test", "validation"] },
784
+ "dependencies": { "type": "array", "items": { "type": "integer" } },
785
+ "acceptanceCriteria": { "type": "string" }
786
+ }
787
+ }
788
+ }
789
+ }
790
+ }
791
+ }
792
+ },
793
+
794
+ "suggestions": {
795
+ "type": "array",
796
+ "description": "Proactive AI suggestions for complementary modules/sections",
797
+ "items": {
798
+ "type": "object",
799
+ "required": ["type", "code", "reason"],
800
+ "properties": {
801
+ "type": {
802
+ "type": "string",
803
+ "enum": ["module", "section", "integration", "enhancement"]
804
+ },
805
+ "code": { "type": "string", "description": "Suggested module/section code (PascalCase)" },
806
+ "title": { "type": "string" },
807
+ "reason": { "type": "string", "description": "Why this is suggested based on the current analysis" },
808
+ "accepted": {
809
+ "type": ["boolean", "null"],
810
+ "description": "null = not yet answered, true = accepted, false = rejected"
811
+ }
812
+ }
813
+ }
814
+ },
815
+
816
+ "changelog": {
817
+ "type": "array",
818
+ "description": "Version history and change tracking. Each step adds an entry.",
819
+ "items": {
820
+ "type": "object",
821
+ "required": ["timestamp", "changes"],
822
+ "properties": {
823
+ "step": { "type": "string", "description": "Step identifier (e.g., step-01-analyse, step-02-specify, step-03-validate, step-04-handoff)" },
824
+ "version": { "type": "string", "description": "Feature version at this point" },
825
+ "timestamp": { "type": "string", "format": "date-time" },
826
+ "author": { "type": "string" },
827
+ "changes": { "type": "array", "items": { "type": "string" } },
828
+ "warnings": { "type": "array", "items": { "type": "string" }, "description": "Non-blocking warnings from this step" },
829
+ "decision": { "type": "string", "description": "Step decision outcome (e.g., approved, rejected)" }
830
+ }
831
+ }
832
+ }
833
+ },
834
+
835
+ "$defs": {
836
+ "stepStatus": {
837
+ "type": "object",
838
+ "properties": {
839
+ "status": { "type": "string", "enum": ["pending", "in-progress", "completed", "skipped"] },
840
+ "startedAt": { "type": ["string", "null"], "format": "date-time" },
841
+ "completedAt": { "type": ["string", "null"], "format": "date-time" }
842
+ }
843
+ },
844
+ "fileSpec": {
845
+ "type": "object",
846
+ "required": ["path", "type"],
847
+ "properties": {
848
+ "path": { "type": "string", "description": "Relative file path" },
849
+ "type": { "type": "string", "description": "File type (Entity, Service, DTO, Repository, Migration, HasData, Constants, ApiController, Page, Component, ApiClient, ReduxSlice, UnitTests, IntegrationTests, Enum)" },
850
+ "linkedFRs": { "type": "array", "items": { "type": "string" }, "description": "Linked functional requirement IDs (FR-XXX)" },
851
+ "linkedUCs": { "type": "array", "items": { "type": "string" }, "description": "Linked use case IDs (UC-XXX)" },
852
+ "category": { "type": "string", "enum": ["core", "business"], "description": "SeedData category: core (navigation/permissions) or business (lookup tables)" },
853
+ "source": { "type": "string", "description": "Source path in feature.json for derivation (e.g., specification.seedDataCore.permissions)" },
854
+ "description": { "type": "string" },
855
+ "pattern": { "type": "string", "description": "Reference pattern from existing codebase" },
856
+ "instructions": { "type": "string" }
857
+ }
858
+ }
859
+ }
860
+ }