@atlashub/smartstack-cli 4.75.0 → 4.79.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 (81) hide show
  1. package/dist/index.js +87 -41
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/project/claude-md/root.CLAUDE.md.template +1 -1
  5. package/templates/skills/ai-prompt/SKILL.md +64 -0
  6. package/templates/skills/ai-prompt/references/ai-agent-modes.md +89 -0
  7. package/templates/skills/ai-prompt/references/eval-framework.md +129 -0
  8. package/templates/skills/apex/SKILL.md +2 -2
  9. package/templates/skills/apex/references/checks/frontend-checks.sh +123 -11
  10. package/templates/skills/apex/references/checks/seed-checks.sh +81 -7
  11. package/templates/skills/apex/references/core-seed-data.md +27 -22
  12. package/templates/skills/apex/references/domain-events-pattern.md +45 -0
  13. package/templates/skills/apex/references/entity-hooks-pattern.md +68 -0
  14. package/templates/skills/apex/references/licensing-enforcement.md +52 -0
  15. package/templates/skills/apex/references/post-checks.md +18 -1
  16. package/templates/skills/apex/references/smartstack-api.md +116 -5
  17. package/templates/skills/apex/references/smartstack-frontend.md +1 -1
  18. package/templates/skills/apex/references/smartstack-layers.md +6 -6
  19. package/templates/skills/apex/steps/step-00-init.md +1 -1
  20. package/templates/skills/apex/steps/step-03b-layer1-seed.md +26 -0
  21. package/templates/skills/apex/steps/step-03d-layer3-frontend.md +124 -2
  22. package/templates/skills/apex/steps/step-04-examine.md +163 -0
  23. package/templates/skills/apex-verify/SKILL.md +110 -0
  24. package/templates/skills/apex-verify/references/audit-rules.md +50 -0
  25. package/templates/skills/apex-verify/steps/step-00-init.md +119 -0
  26. package/templates/skills/apex-verify/steps/step-01-nav-audit.md +96 -0
  27. package/templates/skills/apex-verify/steps/step-02-crud-audit.md +127 -0
  28. package/templates/skills/apex-verify/steps/step-03-perm-audit.md +119 -0
  29. package/templates/skills/apex-verify/steps/step-04-route-audit.md +98 -0
  30. package/templates/skills/apex-verify/steps/step-05-report.md +110 -0
  31. package/templates/skills/application/references/contexts-cheatsheet.md +86 -0
  32. package/templates/skills/application/references/extensions-system.md +158 -0
  33. package/templates/skills/application/references/frontend-route-naming.md +7 -5
  34. package/templates/skills/application/references/frontend-verification.md +7 -5
  35. package/templates/skills/application/references/provider-template.md +4 -2
  36. package/templates/skills/application/references/smartstack-provider.md +118 -0
  37. package/templates/skills/application/references/themes-db-driven.md +484 -0
  38. package/templates/skills/application/templates-frontend.md +2 -2
  39. package/templates/skills/application/templates-seed.md +4 -2
  40. package/templates/skills/audit-route/references/routing-pattern.md +3 -1
  41. package/templates/skills/business-analyse/SKILL.md +3 -3
  42. package/templates/skills/business-analyse/_shared.md +37 -0
  43. package/templates/skills/business-analyse/react/components.md +30 -28
  44. package/templates/skills/business-analyse/references/03-json-schemas.md +11 -3
  45. package/templates/skills/business-analyse/references/03-post-check-validation.md +64 -0
  46. package/templates/skills/business-analyse/references/canonical-json-formats.md +7 -3
  47. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  48. package/templates/skills/business-analyse/references/validation-checklist.md +5 -5
  49. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +15 -4
  50. package/templates/skills/business-analyse/steps/step-03-specify.md +162 -4
  51. package/templates/skills/business-analyse/steps/step-04-consolidate.md +211 -1
  52. package/templates/skills/business-analyse/templates-react.md +15 -15
  53. package/templates/skills/business-analyse-handoff/references/agent-handoff-transform-prompt.md +3 -0
  54. package/templates/skills/business-analyse-html/html/ba-interactive.html +198 -16
  55. package/templates/skills/business-analyse-html/html/src/scripts/01-data-init.js +64 -0
  56. package/templates/skills/business-analyse-html/html/src/scripts/05-render-specs.js +80 -11
  57. package/templates/skills/business-analyse-html/html/src/scripts/06-render-consolidation.js +2 -2
  58. package/templates/skills/business-analyse-html/html/src/scripts/06-render-mockups.js +6 -3
  59. package/templates/skills/business-analyse-html/html/src/scripts/12-render-diagrams.js +46 -0
  60. package/templates/skills/business-analyse-html/references/02-feature-data-building.md +4 -2
  61. package/templates/skills/business-analyse-html/references/data-build.md +2 -0
  62. package/templates/skills/business-analyse-html/references/data-mapping.md +88 -21
  63. package/templates/skills/business-analyse-html/steps/step-02-build-data.md +6 -0
  64. package/templates/skills/business-analyse-html/steps/step-04-verify.md +92 -3
  65. package/templates/skills/business-analyse-quick/SKILL.md +807 -0
  66. package/templates/skills/{sketch → business-analyse-quick}/references/domain-heuristics.md +59 -3
  67. package/templates/skills/business-analyse-quick/references/prd-schema.md +268 -0
  68. package/templates/skills/business-analyse-review/references/review-data-mapping.md +6 -0
  69. package/templates/skills/cli-app-sync/SKILL.md +105 -4
  70. package/templates/skills/cli-app-sync/references/comparison-map.md +13 -0
  71. package/templates/skills/cli-app-sync/references/diff-entities.md +162 -0
  72. package/templates/skills/dev-start/SKILL.md +7 -7
  73. package/templates/skills/documentation/templates.md +16 -16
  74. package/templates/skills/migrate/SKILL.md +312 -0
  75. package/templates/skills/migrate/references/v3.34-to-v3.46.md +289 -0
  76. package/templates/skills/sketch/SKILL.md +15 -153
  77. package/templates/skills/smoke-generation/SKILL.md +313 -0
  78. package/templates/skills/ui-components/SKILL.md +11 -1
  79. package/templates/skills/ui-components/patterns/data-table.md +1 -1
  80. package/templates/skills/ui-components/references/component-catalog.md +82 -0
  81. package/templates/skills/workflow/SKILL.md +70 -1
@@ -1,8 +1,8 @@
1
- # Domain Heuristics — /sketch
1
+ # Domain Heuristics — /business-analyse-quick
2
2
 
3
- > **Purpose:** Accelerate entity/property inference for common business domains.
3
+ > **Purpose:** Accelerate entity/property/section/rule inference for common business domains.
4
4
  > This table is an **accelerator**, not a limiter. If the user's domain is not listed,
5
- > the LLM infers entities and properties from general knowledge.
5
+ > the LLM infers entities, properties, sections, and rules from general knowledge.
6
6
 
7
7
  ---
8
8
 
@@ -12,6 +12,10 @@
12
12
  labels: { fr: "Employé", en: "Employee", it: "Dipendente", de: "Mitarbeiter" }
13
13
  - **Department** (Name:string, Code:string, ParentDepartmentId:Guid?→Department)
14
14
  labels: { fr: "Département", en: "Department", it: "Dipartimento", de: "Abteilung" }
15
+ - typicalSections: list, detail, orgchart (functional)
16
+ - typicalRules: "Employee must have unique email", "Department cannot be its own parent"
17
+ - personExtension: Employee
18
+ - typicalRoles: [{ role: "HR Admin", level: "admin" }, { role: "HR Manager", level: "manager" }, { role: "Employee", level: "viewer" }]
15
19
 
16
20
  ## Absences / Congés
17
21
 
@@ -19,6 +23,10 @@
19
23
  labels: { fr: "Absence", en: "Absence", it: "Assenza", de: "Abwesenheit" }
20
24
  - **AbsenceType** (Name:string, Code:string, MaxDays:int, IsPaid:bool)
21
25
  labels: { fr: "Type d'absence", en: "Absence Type", it: "Tipo di assenza", de: "Abwesenheitstyp" }
26
+ - typicalSections: list, detail, calendar (functional), approve (functional)
27
+ - typicalRules: "StartDate must be before EndDate", "Cannot exceed MaxDays per type per year", "Approval required for > 3 days"
28
+ - workflow: Draft → Submitted → Approved/Rejected
29
+ - typicalRoles: [{ role: "HR Admin", level: "admin" }, { role: "Manager", level: "manager" }, { role: "Employee", level: "contributor" }]
22
30
 
23
31
  ## CRM / Clients
24
32
 
@@ -26,6 +34,10 @@
26
34
  labels: { fr: "Client", en: "Customer", it: "Cliente", de: "Kunde" }
27
35
  - **Contact** (FirstName:string, LastName:string, Email:string, Phone:string, CustomerId:Guid→Customer)
28
36
  labels: { fr: "Contact", en: "Contact", it: "Contatto", de: "Kontakt" }
37
+ - typicalSections: list, detail, dashboard (embedded)
38
+ - typicalRules: "Customer must have unique email or phone", "Contact requires valid Customer"
39
+ - personExtension: Customer, Contact
40
+ - typicalRoles: [{ role: "CRM Admin", level: "admin" }, { role: "Sales Manager", level: "manager" }, { role: "Sales Rep", level: "contributor" }]
29
41
 
30
42
  ## Commandes / Orders
31
43
 
@@ -33,6 +45,10 @@
33
45
  labels: { fr: "Commande", en: "Order", it: "Ordine", de: "Bestellung" }
34
46
  - **OrderLine** (Quantity:int, UnitPrice:decimal, TotalPrice:decimal, ProductId:Guid→Product, OrderId:Guid→Order)
35
47
  labels: { fr: "Ligne de commande", en: "Order Line", it: "Riga d'ordine", de: "Bestellposition" }
48
+ - typicalSections: list, detail, dashboard (embedded)
49
+ - typicalRules: "TotalPrice = Quantity * UnitPrice", "Order TotalAmount = sum of lines", "Cannot delete confirmed order"
50
+ - workflow: Draft → Confirmed → Shipped → Delivered/Cancelled
51
+ - typicalRoles: [{ role: "Sales Admin", level: "admin" }, { role: "Sales Manager", level: "manager" }, { role: "Sales Rep", level: "contributor" }]
36
52
 
37
53
  ## Facturation / Invoicing
38
54
 
@@ -40,6 +56,10 @@
40
56
  labels: { fr: "Facture", en: "Invoice", it: "Fattura", de: "Rechnung" }
41
57
  - **InvoiceLine** (Description:string, Quantity:int, UnitPrice:decimal, TotalPrice:decimal, InvoiceId:Guid→Invoice)
42
58
  labels: { fr: "Ligne de facture", en: "Invoice Line", it: "Riga di fattura", de: "Rechnungsposition" }
59
+ - typicalSections: list, detail, dashboard (embedded)
60
+ - typicalRules: "DueDate must be after InvoiceDate", "TotalPrice = Quantity * UnitPrice", "Cannot modify paid invoice"
61
+ - workflow: Draft → Sent → Paid/Overdue/Cancelled
62
+ - typicalRoles: [{ role: "Finance Admin", level: "admin" }, { role: "Accountant", level: "contributor" }, { role: "Viewer", level: "viewer" }]
43
63
 
44
64
  ## Projets / Projects
45
65
 
@@ -49,6 +69,10 @@
49
69
  labels: { fr: "Tâche", en: "Task", it: "Attività", de: "Aufgabe" }
50
70
  - **Milestone** (Name:string, DueDate:DateTime, Status:string, ProjectId:Guid→Project)
51
71
  labels: { fr: "Jalon", en: "Milestone", it: "Traguardo", de: "Meilenstein" }
72
+ - typicalSections: list, detail, board (functional), timeline (functional)
73
+ - typicalRules: "EndDate must be after StartDate", "Task DueDate cannot exceed project EndDate", "Milestone blocks project completion"
74
+ - workflow: Planning → InProgress → Completed/OnHold/Cancelled
75
+ - typicalRoles: [{ role: "Project Admin", level: "admin" }, { role: "Project Manager", level: "manager" }, { role: "Team Member", level: "contributor" }, { role: "Stakeholder", level: "viewer" }]
52
76
 
53
77
  ## Stock / Inventaire
54
78
 
@@ -58,6 +82,9 @@
58
82
  labels: { fr: "Catégorie", en: "Category", it: "Categoria", de: "Kategorie" }
59
83
  - **StockMovement** (Quantity:int, Type:string, Date:DateTime, ProductId:Guid→Product, WarehouseId:Guid?→Warehouse)
60
84
  labels: { fr: "Mouvement de stock", en: "Stock Movement", it: "Movimento di stock", de: "Lagerbewegung" }
85
+ - typicalSections: list, detail, movements (functional), inventory (functional)
86
+ - typicalRules: "Product code must be unique", "Stock cannot go negative", "Category cannot be its own parent"
87
+ - typicalRoles: [{ role: "Inventory Admin", level: "admin" }, { role: "Warehouse Manager", level: "manager" }, { role: "Stock Clerk", level: "contributor" }]
61
88
 
62
89
  ## Contrats / Contracts
63
90
 
@@ -65,6 +92,10 @@
65
92
  labels: { fr: "Contrat", en: "Contract", it: "Contratto", de: "Vertrag" }
66
93
  - **ContractAmendment** (Description:string, Date:DateTime, Amount:decimal?, ContractId:Guid→Contract)
67
94
  labels: { fr: "Avenant", en: "Amendment", it: "Emendamento", de: "Nachtrag" }
95
+ - typicalSections: list, detail, renewals (functional)
96
+ - typicalRules: "EndDate must be after StartDate", "Amendment Date must be within contract period", "Cannot amend terminated contract"
97
+ - workflow: Draft → Active → Expired/Terminated/Renewed
98
+ - typicalRoles: [{ role: "Contract Admin", level: "admin" }, { role: "Contract Manager", level: "manager" }, { role: "Viewer", level: "viewer" }]
68
99
 
69
100
  ## Tickets / Support
70
101
 
@@ -72,6 +103,10 @@
72
103
  labels: { fr: "Ticket", en: "Ticket", it: "Ticket", de: "Ticket" }
73
104
  - **TicketComment** (Content:string, IsInternal:bool, TicketId:Guid→Ticket)
74
105
  labels: { fr: "Commentaire", en: "Comment", it: "Commento", de: "Kommentar" }
106
+ - typicalSections: list, detail, dashboard (embedded), board (functional)
107
+ - typicalRules: "Priority must be set before assignment", "Internal comments not visible to customer", "SLA timer based on priority"
108
+ - workflow: Open → InProgress → Resolved → Closed/Reopened
109
+ - typicalRoles: [{ role: "Support Admin", level: "admin" }, { role: "Support Agent", level: "contributor" }, { role: "Customer", level: "viewer" }]
75
110
 
76
111
  ## Fournisseurs / Suppliers
77
112
 
@@ -79,6 +114,10 @@
79
114
  labels: { fr: "Fournisseur", en: "Supplier", it: "Fornitore", de: "Lieferant" }
80
115
  - **PurchaseOrder** (OrderDate:DateTime, Status:string, TotalAmount:decimal, SupplierId:Guid→Supplier)
81
116
  labels: { fr: "Bon de commande", en: "Purchase Order", it: "Ordine d'acquisto", de: "Bestellung" }
117
+ - typicalSections: list, detail
118
+ - typicalRules: "Supplier must have unique VatNumber", "PO requires valid supplier", "Cannot modify approved PO"
119
+ - workflow: Draft → Submitted → Approved → Received/Cancelled
120
+ - typicalRoles: [{ role: "Procurement Admin", level: "admin" }, { role: "Procurement Manager", level: "manager" }, { role: "Buyer", level: "contributor" }]
82
121
 
83
122
  ## Documents / GED
84
123
 
@@ -86,6 +125,9 @@
86
125
  labels: { fr: "Document", en: "Document", it: "Documento", de: "Dokument" }
87
126
  - **Folder** (Name:string, ParentFolderId:Guid?→Folder)
88
127
  labels: { fr: "Dossier", en: "Folder", it: "Cartella", de: "Ordner" }
128
+ - typicalSections: list, detail, explorer (functional)
129
+ - typicalRules: "Folder cannot be its own parent", "File size limit per tenant", "Unique filename within folder"
130
+ - typicalRoles: [{ role: "Document Admin", level: "admin" }, { role: "Editor", level: "contributor" }, { role: "Reader", level: "viewer" }]
89
131
 
90
132
  ## Réservations / Bookings
91
133
 
@@ -93,6 +135,10 @@
93
135
  labels: { fr: "Réservation", en: "Booking", it: "Prenotazione", de: "Buchung" }
94
136
  - **Resource** (Name:string, Type:string, Capacity:int?, Location:string?)
95
137
  labels: { fr: "Ressource", en: "Resource", it: "Risorsa", de: "Ressource" }
138
+ - typicalSections: list, detail, calendar (functional)
139
+ - typicalRules: "EndDate must be after StartDate", "No overlapping bookings for same resource", "Cannot book past dates"
140
+ - workflow: Pending → Confirmed → Completed/Cancelled
141
+ - typicalRoles: [{ role: "Booking Admin", level: "admin" }, { role: "Booking Manager", level: "manager" }, { role: "Customer", level: "contributor" }]
96
142
 
97
143
  ## Événements / Events
98
144
 
@@ -100,6 +146,9 @@
100
146
  labels: { fr: "Événement", en: "Event", it: "Evento", de: "Veranstaltung" }
101
147
  - **Registration** (Status:string, RegisteredAt:DateTime, EventId:Guid→Event, ContactId:Guid?→Contact)
102
148
  labels: { fr: "Inscription", en: "Registration", it: "Iscrizione", de: "Anmeldung" }
149
+ - typicalSections: list, detail, registrations (functional)
150
+ - typicalRules: "Cannot exceed MaxAttendees", "Registration closes at event StartDate", "EndDate must be after StartDate"
151
+ - typicalRoles: [{ role: "Event Admin", level: "admin" }, { role: "Event Organizer", level: "manager" }, { role: "Attendee", level: "viewer" }]
103
152
 
104
153
  ## Formation / Training
105
154
 
@@ -107,6 +156,9 @@
107
156
  labels: { fr: "Formation", en: "Training", it: "Formazione", de: "Schulung" }
108
157
  - **Enrollment** (Status:string, EnrolledAt:DateTime, TrainingId:Guid→Training, EmployeeId:Guid→Employee)
109
158
  labels: { fr: "Inscription", en: "Enrollment", it: "Iscrizione", de: "Anmeldung" }
159
+ - typicalSections: list, detail, enrollments (functional)
160
+ - typicalRules: "Cannot exceed MaxParticipants", "Employee cannot enroll twice in same training", "Trainer cannot be enrolled"
161
+ - typicalRoles: [{ role: "Training Admin", level: "admin" }, { role: "Trainer", level: "manager" }, { role: "Employee", level: "contributor" }]
110
162
 
111
163
  ## Maintenance / Equipment
112
164
 
@@ -114,3 +166,7 @@
114
166
  labels: { fr: "Équipement", en: "Equipment", it: "Attrezzatura", de: "Ausrüstung" }
115
167
  - **MaintenanceRequest** (Title:string, Description:string, Priority:string, Status:string, EquipmentId:Guid→Equipment, RequestedById:Guid?→Employee)
116
168
  labels: { fr: "Demande de maintenance", en: "Maintenance Request", it: "Richiesta di manutenzione", de: "Wartungsanfrage" }
169
+ - typicalSections: list, detail, schedule (functional)
170
+ - typicalRules: "Equipment must have unique SerialNumber", "Cannot request maintenance on decommissioned equipment"
171
+ - workflow: Submitted → Assigned → InProgress → Completed/Rejected
172
+ - typicalRoles: [{ role: "Maintenance Admin", level: "admin" }, { role: "Technician", level: "contributor" }, { role: "Requester", level: "viewer" }]
@@ -0,0 +1,268 @@
1
+ # PRD Schema Reference — /business-analyse-quick
2
+
3
+ > Schemas for PRD v4.0 and companion specification files.
4
+ > Field names are **identical** to BA schemas for APEX delegate mode compatibility.
5
+
6
+ ---
7
+
8
+ ## PRD v4.0 Structure
9
+
10
+ ```json
11
+ {
12
+ "$version": "4.0.0",
13
+ "project": {
14
+ "application": "{AppPascalCase}",
15
+ "module": "{module-kebab-case}"
16
+ },
17
+ "expectedFiles": {
18
+ "domain": [
19
+ { "path": "src/Domain/Entities/{App}/{Module}/{Entity}.cs", "type": "Entity", "module": "{Module}" }
20
+ ],
21
+ "infrastructure": [
22
+ { "path": "src/Infrastructure/Persistence/Configurations/{App}/{Module}/{Entity}Configuration.cs", "type": "EFConfig", "module": "{Module}" }
23
+ ],
24
+ "seedData": [
25
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{Module}/NavigationModuleSeedData.cs", "type": "NavModule", "module": "{Module}" },
26
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{Module}/NavigationSectionSeedData.cs", "type": "NavSection", "module": "{Module}" },
27
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{Module}/PermissionsSeedData.cs", "type": "Permissions", "module": "{Module}" },
28
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{Module}/RolesSeedData.cs", "type": "Roles", "module": "{Module}" }
29
+ ],
30
+ "application": [
31
+ { "path": "src/Application/Services/{App}/{Module}/{Entity}Service.cs", "type": "Service", "module": "{Module}" },
32
+ { "path": "src/Application/DTOs/{App}/{Module}/Create{Entity}Dto.cs", "type": "DTO", "module": "{Module}" },
33
+ { "path": "src/Application/DTOs/{App}/{Module}/Update{Entity}Dto.cs", "type": "DTO", "module": "{Module}" },
34
+ { "path": "src/Application/DTOs/{App}/{Module}/{Entity}Dto.cs", "type": "DTO", "module": "{Module}" },
35
+ { "path": "src/Application/Validators/{App}/{Module}/{Entity}Validator.cs", "type": "Validator", "module": "{Module}" }
36
+ ],
37
+ "api": [
38
+ { "path": "src/API/Controllers/{App}/{Entity}Controller.cs", "type": "Controller", "module": "{Module}" }
39
+ ],
40
+ "frontend": [
41
+ { "path": "src/pages/{app-kebab}/{module-kebab}/{Entity}ListPage.tsx", "type": "Page", "module": "{Module}" },
42
+ { "path": "src/pages/{app-kebab}/{module-kebab}/{Entity}DetailPage.tsx", "type": "Page", "module": "{Module}" },
43
+ { "path": "src/pages/{app-kebab}/{module-kebab}/Create{Entity}Page.tsx", "type": "Page", "module": "{Module}" },
44
+ { "path": "src/pages/{app-kebab}/{module-kebab}/Edit{Entity}Page.tsx", "type": "Page", "module": "{Module}" },
45
+ { "path": "src/i18n/locales/fr/{module-lower}.json", "type": "i18n", "module": "{Module}" },
46
+ { "path": "src/i18n/locales/en/{module-lower}.json", "type": "i18n", "module": "{Module}" },
47
+ { "path": "src/i18n/locales/it/{module-lower}.json", "type": "i18n", "module": "{Module}" },
48
+ { "path": "src/i18n/locales/de/{module-lower}.json", "type": "i18n", "module": "{Module}" }
49
+ ],
50
+ "tests": [
51
+ { "path": "src/Tests/Unit/Domain/{App}/{Module}/{Entity}Tests.cs", "type": "UnitTest", "module": "{Module}" },
52
+ { "path": "src/Tests/Integration/{App}/{Module}/{Entity}ControllerTests.cs", "type": "IntegrationTest", "module": "{Module}" }
53
+ ],
54
+ "documentation": []
55
+ },
56
+ "specificationFiles": {
57
+ "entities": "prd-{module}.entities.json",
58
+ "permissions": "prd-{module}.permissions.json",
59
+ "rules": "prd-{module}.rules.json",
60
+ "usecases": "prd-{module}.usecases.json",
61
+ "screens": "prd-{module}.screens.json"
62
+ },
63
+ "tasks": []
64
+ }
65
+ ```
66
+
67
+ > **Paths in `specificationFiles`** are relative to the PRD directory (`.ralph/`).
68
+ > APEX resolves them via `path.join(path.dirname(prd_path), specFiles.xxx)`.
69
+
70
+ ---
71
+
72
+ ## entities.json
73
+
74
+ ```json
75
+ {
76
+ "entities": [
77
+ {
78
+ "name": "Employee",
79
+ "description": "Represents a company employee",
80
+ "personRoleConfig": { "variant": "mandatory", "userFields": ["firstName", "lastName", "email"] },
81
+ "attributes": [
82
+ { "name": "code", "type": "string", "required": true, "unique": true, "searchable": true },
83
+ { "name": "firstName", "type": "string", "required": true },
84
+ { "name": "hireDate", "type": "DateTime", "required": true },
85
+ { "name": "status", "type": "enum", "required": true, "values": ["Active", "Inactive"] }
86
+ ],
87
+ "relationships": [
88
+ { "target": "Department", "type": "ManyToOne", "description": "Employee belongs to a department" }
89
+ ],
90
+ "codePattern": { "strategy": "sequential", "prefix": "emp", "digits": 5, "separator": "-", "includeTenantSlug": true },
91
+ "estimatedVolume": { "monthly": 20, "total2y": 500 }
92
+ }
93
+ ]
94
+ }
95
+ ```
96
+
97
+ **Rules:**
98
+ - `personRoleConfig` only if entity has personal attributes (→ FK to auth_Users with type `string`, NOT Guid)
99
+ - Omit boolean flags when `false` (unique, searchable, computed)
100
+ - NO technical fields (Id, TenantId, CreatedBy, ModifiedBy, etc.)
101
+ - `type`: string | int | decimal | long | bool | DateTime | Guid | enum
102
+
103
+ ---
104
+
105
+ ## rules.json
106
+
107
+ ```json
108
+ {
109
+ "rules": [
110
+ {
111
+ "id": "BR-VAL-EMP-001",
112
+ "name": "Hire date validation",
113
+ "category": "validation",
114
+ "statement": "Hire date cannot be in the future",
115
+ "severity": "blocking",
116
+ "priority": "must",
117
+ "entities": ["Employee"],
118
+ "examples": [
119
+ { "input": "hireDate = 2027-01-01", "expected": "Error: date in the future" }
120
+ ]
121
+ }
122
+ ]
123
+ }
124
+ ```
125
+
126
+ **ID format:** `BR-{CAT}-{MODULE}-{NNN}` where CAT = VAL|CALC|WFL|SEC|DAT|NOT
127
+ **Categories:** validation | calculation | workflow | security | data | notification
128
+ - `formula` field required for `calculation` category
129
+ - `conditions` + `consequences` fields required for `workflow` category
130
+
131
+ ---
132
+
133
+ ## usecases.json
134
+
135
+ ```json
136
+ {
137
+ "useCases": [
138
+ {
139
+ "id": "UC-EMP-001",
140
+ "name": "Create employee",
141
+ "sectionCode": "list",
142
+ "primaryActor": "HR Manager",
143
+ "permission": "HumanResources.Employees.Create",
144
+ "preconditions": ["User has HumanResources.Employees.Create permission"],
145
+ "mainScenario": [
146
+ "User opens the creation page",
147
+ "User fills mandatory fields",
148
+ "User submits the form",
149
+ "System validates business rules",
150
+ "System creates the employee with Active status"
151
+ ],
152
+ "alternativeScenarios": [
153
+ { "name": "Invalid data", "steps": ["System displays validation errors", "User corrects and resubmits"] }
154
+ ],
155
+ "postconditions": ["Employee created with status Active"],
156
+ "businessRules": ["BR-VAL-EMP-001"],
157
+ "result": "Employee is created with Active status"
158
+ }
159
+ ]
160
+ }
161
+ ```
162
+
163
+ **Field naming:** `useCases` (NOT usecases), `primaryActor` (NOT actor), `mainScenario` as string[]
164
+
165
+ ---
166
+
167
+ ## permissions.json
168
+
169
+ ```json
170
+ {
171
+ "roles": [
172
+ { "role": "HR Admin", "level": "admin", "description": "Full access to HR module" },
173
+ { "role": "Manager", "level": "manager", "description": "Read, create, update and approve access" },
174
+ { "role": "Viewer", "level": "viewer", "description": "Read-only access" }
175
+ ],
176
+ "permissionPaths": [
177
+ "HumanResources.Employees.Read",
178
+ "HumanResources.Employees.Create",
179
+ "HumanResources.Employees.Update",
180
+ "HumanResources.Employees.Delete",
181
+ "HumanResources.Employees.Export",
182
+ "HumanResources.Employees.Approve"
183
+ ],
184
+ "matrix": {
185
+ "roleAssignments": [
186
+ { "role": "HR Admin", "permissions": ["HumanResources.Employees.*"] },
187
+ { "role": "Manager", "permissions": ["HumanResources.Employees.Read", "HumanResources.Employees.Create", "HumanResources.Employees.Update", "HumanResources.Employees.Approve"] },
188
+ { "role": "Viewer", "permissions": ["HumanResources.Employees.Read"] }
189
+ ]
190
+ }
191
+ }
192
+ ```
193
+
194
+ **Role rules:**
195
+ - `role`: display name, PascalCase words with spaces (e.g., "HR Admin", NOT "hr-admin")
196
+ - `level`: one of `admin` | `manager` | `contributor` | `viewer` — determines hierarchy position
197
+ - `description`: one sentence in `{conversation_language}`
198
+ - MINIMUM 2 roles: one admin-level + one operational role
199
+
200
+ **Permission path format:**
201
+ - 3-segment (standard): `{ApplicationPascalCase}.{ModulePascalCase}.{Action}`
202
+ - 4-segment (custom section): `{ApplicationPascalCase}.{ModulePascalCase}.{SectionPascalCase}.{Action}`
203
+ - All segments are PascalCase — NO hyphens, NO spaces, NO kebab-case
204
+ - Module name conversion: `absence-management` → `AbsenceManagement`
205
+
206
+ **Standard actions:** Read, Create, Update, Delete, Export, Import, Approve, Admin
207
+
208
+ **Matrix rules:**
209
+ - Admin role ALWAYS gets wildcard: `["{base}.*"]`
210
+ - Other roles get EXPLICIT path lists (no wildcards)
211
+ - Every role in `roleAssignments` MUST exist in `roles[]`
212
+ - Every permission path in `roleAssignments` MUST exist in `permissionPaths` (except wildcards ending with `.*`)
213
+
214
+ **Cross-validation requirements:**
215
+ - Every `permission` field in usecases.json MUST exist in `permissionPaths`
216
+ - Every section `permission` in screens.json (where `permissionMode` is not `"inherit"`) MUST exist in `permissionPaths`
217
+ - `permissionPaths.length >= 4` (Read + Create + Update + Delete minimum per module)
218
+
219
+ ---
220
+
221
+ ## screens.json
222
+
223
+ ```json
224
+ {
225
+ "sections": [
226
+ {
227
+ "code": "list",
228
+ "sectionType": "primary",
229
+ "permissionMode": "crud",
230
+ "parentSectionCode": null,
231
+ "labels": { "fr": "Employés", "en": "Employees", "it": "Dipendenti", "de": "Mitarbeiter" },
232
+ "route": "/{app-kebab}/{module-kebab}/list",
233
+ "icon": "users",
234
+ "permission": "HumanResources.Employees.Read",
235
+ "useCases": ["UC-EMP-001", "UC-EMP-002"],
236
+ "resources": [
237
+ {
238
+ "code": "employees-grid",
239
+ "type": "SmartTable",
240
+ "entity": "Employee",
241
+ "columns": [
242
+ { "field": "code", "label": { "fr": "Code", "en": "Code" }, "format": "text", "sortable": true },
243
+ { "field": "firstName", "label": { "fr": "Prénom", "en": "First Name" }, "format": "text" },
244
+ { "field": "status", "label": { "fr": "Statut", "en": "Status" }, "format": "badge" }
245
+ ],
246
+ "actions": ["create", "edit", "delete"],
247
+ "defaultSort": { "field": "code", "direction": "asc" },
248
+ "defaultPageSize": 20
249
+ }
250
+ ]
251
+ }
252
+ ]
253
+ }
254
+ ```
255
+
256
+ **Section types:** primary (menu-visible, includes implicit detail/create/edit pages) | functional (independent workflow) | embedded (widget/tab)
257
+ **Resource types:** SmartTable | SmartForm | DetailCard | KpiPanel | KpiCard | Timeline | Chart | FilterBar | Tabs
258
+
259
+ > **IMPORTANT — Implicit pages (NOT sections):**
260
+ > APEX automatically generates detail (/:id), create (/create), and edit (/:id/edit) pages
261
+ > as routes under each primary section. Do NOT include "detail", "create", "edit", or "*-detail"
262
+ > as sections in screens.json — they are implicit APEX pages, not navigation entries.
263
+ >
264
+ > **API route convention:**
265
+ > - `route` field is the frontend React Router path (e.g., `/human-resources/employees/list`)
266
+ > - The backend API endpoint is `/api/{app-kebab}/{module-kebab}` (API routes never include section codes)
267
+ > - GetById: `GET /api/{app-kebab}/{module-kebab}/{id}`
268
+ > - GetAll: `GET /api/{app-kebab}/{module-kebab}` with pagination query params
@@ -153,11 +153,17 @@ reverseBusinessRule(htmlBR, existingBR) {
153
153
  name: htmlBR.name,
154
154
  category: htmlBR.category,
155
155
  statement: htmlBR.statement,
156
+ severity: htmlBR.severity || existingBR?.severity || "blocking",
157
+ sectionCode: htmlBR.sectionCode || existingBR?.sectionCode || "",
158
+ entities: htmlBR.entities || existingBR?.entities || [],
156
159
  priority: existingBR?.priority || "must",
157
160
  conditions: existingBR?.conditions || [],
158
161
  examples: htmlBR.example
159
162
  ? [{ input: htmlBR.example, expected: "" }]
160
163
  : (existingBR?.examples || []),
164
+ consequences: existingBR?.consequences || [],
165
+ formula: htmlBR.formula || existingBR?.formula || null,
166
+ domainSpecific: existingBR?.domainSpecific ?? false,
161
167
  testability: existingBR?.testability || ""
162
168
  };
163
169
  }
@@ -22,10 +22,11 @@ See [references/comparison-map.md](references/comparison-map.md) for the full fi
22
22
 
23
23
  <quick_start>
24
24
  ```bash
25
- /cli-app-sync # Full drift report (read-only)
26
- /cli-app-sync report # Same as above
27
- /cli-app-sync fix # Detect drift + apply fixes interactively
28
- /cli-app-sync check Program # Check a single file mapping
25
+ /cli-app-sync # Full drift report (read-only)
26
+ /cli-app-sync report # Same as above
27
+ /cli-app-sync fix # Detect drift + apply fixes interactively
28
+ /cli-app-sync check Program # Check a single file mapping
29
+ /cli-app-sync diff-entities # List Domain entities NOT referenced by any skill
29
30
  ```
30
31
  </quick_start>
31
32
 
@@ -37,6 +38,7 @@ See [references/comparison-map.md](references/comparison-map.md) for the full fi
37
38
  | `/cli-app-sync report` | Same as above (explicit) |
38
39
  | `/cli-app-sync fix` | Detect drift and propose fixes interactively |
39
40
  | `/cli-app-sync check <name>` | Check a single comparison point by name |
41
+ | `/cli-app-sync diff-entities` | List Domain entities present in app but NOT covered by any CLI skill (uncovered drift detector) |
40
42
 
41
43
  </subcommands>
42
44
 
@@ -262,6 +264,103 @@ Status: DRIFT (2 issues)
262
264
 
263
265
  </output_format>
264
266
 
267
+ <diff_entities_workflow>
268
+
269
+ ## `/cli-app-sync diff-entities` — uncovered Domain entities
270
+
271
+ **Why this exists.** `cli-app-sync` (default mode) compares known files in `templates/project/` and `init.ts` against their counterparts in `SmartStack.app`. It detects **explicit drift** but is blind to **trous** : a brand-new entity in the platform (e.g. `AiTool`, `WorkflowVersion`, `AiEvalDataset` added in v3.46) that no CLI skill mentions yet. Without `diff-entities`, those gaps are only caught by manual audit.
272
+
273
+ See [references/diff-entities.md](references/diff-entities.md) for the full algorithm (rules, exclusions, output format).
274
+
275
+ ### Quick algorithm
276
+
277
+ 1. **Enumerate Domain entities** :
278
+ ```bash
279
+ APP_DOMAIN="${APP_PATH:-D:/01 - projets/SmartStack.app/features/IA-Workflow}/src/SmartStack.Domain"
280
+ # Classes/records that look like aggregate roots (inherit BaseEntity or are records under Domain/)
281
+ grep -rPnh "^\s*public\s+(?:partial\s+)?(?:class|record)\s+([A-Z][A-Za-z0-9]+)\s*:?\s*(?:BaseEntity|I[A-Z][A-Za-z]+Entity|IDomainEvent)" "$APP_DOMAIN" \
282
+ --include='*.cs' \
283
+ | sed -E "s/.*\b(class|record)\s+([A-Z][A-Za-z0-9]+).*/\2/" \
284
+ | sort -u > /tmp/app-entities.txt
285
+ ```
286
+
287
+ 2. **Enumerate entities referenced in CLI skills** :
288
+ ```bash
289
+ CLI_SKILLS="D:/01 - projets/SmartStack.cli/02-Develop/templates/skills"
290
+ # Any PascalCase token in code blocks that matches an entity name
291
+ while IFS= read -r ENT; do
292
+ COUNT=$(grep -r --include='*.md' --include='*.sh' -lE "\b${ENT}\b" "$CLI_SKILLS" | wc -l)
293
+ echo "${ENT}|${COUNT}"
294
+ done < /tmp/app-entities.txt > /tmp/entity-coverage.tsv
295
+ ```
296
+
297
+ 3. **Classify** each entity :
298
+ - `count = 0` → `[NEW UNCOVERED]` — propose a skill to cover it
299
+ - `count = 1-2` → `[THIN]` — covered but might benefit from a dedicated reference
300
+ - `count ≥ 3` → `[COVERED]` — well documented (skip in report unless `--verbose`)
301
+
302
+ 4. **Suggest a skill destination** based on the entity's namespace :
303
+
304
+ | Namespace prefix | Suggested skill |
305
+ |---|---|
306
+ | `Domain.AI.Agents.*` / `Domain.AI.Skills.*` | `ai-prompt` |
307
+ | `Domain.AI.Evaluations.*` | `ai-prompt` (`references/eval-framework.md`) |
308
+ | `Domain.AI.Tools.*` | `ai-prompt` |
309
+ | `Domain.Communications.Workflow*` | `workflow` |
310
+ | `Domain.Communications.EmailTemplate*` | `notification` (or `workflow`) |
311
+ | `Domain.Navigation.*` | `application` |
312
+ | `Domain.Platform.Administration.UiConfiguration.*` | `application/references/themes-db-driven.md` |
313
+ | `Domain.Licensing.*` | `apex/references/smartstack-api.md` (Licensing section) |
314
+ | `Domain.Common.*` (interfaces, enums) | `apex/references/smartstack-api.md` |
315
+ | `Domain.Support.*` | `notification` (or new skill) |
316
+ | other | propose a new skill name based on the namespace |
317
+
318
+ ### Output (typical)
319
+
320
+ ```
321
+ ================================================================================
322
+ UNCOVERED DOMAIN ENTITIES — {date}
323
+ ================================================================================
324
+ APP : IA-Workflow @ {commit}
325
+ Total Domain entities scanned: 87
326
+
327
+ [NEW UNCOVERED] (0 references in templates/skills/)
328
+ AiTool → Domain/AI/Tools/ → ai-prompt skill
329
+ AiSkillTool → Domain/AI/Tools/ → ai-prompt skill
330
+ AiEvalDataset → Domain/AI/Evaluations/ → ai-prompt/references/eval-framework.md
331
+ AiEvalDatasetItem → Domain/AI/Evaluations/ → idem
332
+ AiEvaluation → Domain/AI/Evaluations/ → idem
333
+ AiEvalResult → Domain/AI/Evaluations/ → idem
334
+ AiAgentExecution → Domain/AI/Agents/ → ai-prompt skill
335
+ AiAgentStepExecution → Domain/AI/Agents/ → ai-prompt skill
336
+ WorkflowVersion → Domain/Communications/ → workflow skill
337
+ IBeforeCreate → Application/Hooks/ → smartstack-api.md (Hooks section)
338
+ IDomainEvent → Domain/Support/Events/ → smartstack-api.md (Domain Events)
339
+
340
+ [THIN] (1-2 references — consider dedicated docs)
341
+ License (2 refs) → smartstack-api.md (Licensing section)
342
+ BrandingAsset (1 ref) → themes-db-driven.md
343
+ UiThemeTenantPublication (1 ref) → themes-db-driven.md
344
+
345
+ [COVERED] (≥3 references — well documented, hidden unless --verbose)
346
+ 87 entities — 76 covered, 11 thin/uncovered
347
+
348
+ --------------------------------------------------------------------------------
349
+ SUMMARY : 11 entities need attention (8 NEW UNCOVERED, 3 THIN)
350
+ ================================================================================
351
+ ```
352
+
353
+ ### Integration with the rest of `cli-app-sync`
354
+
355
+ `diff-entities` is independent from the comparison map (no overlap with `report` / `fix`). It only adds new findings ; it never modifies templates. To act on findings, the user runs the suggested skill author flow manually (or invokes `/apex` if a brand-new domain warrants a full skill).
356
+
357
+ Recommended cadence :
358
+ - Run after every bump of the `APP_PATH` branch (e.g. moving from `02-Develop` to `features/IA-Workflow`)
359
+ - Run before each release of the CLI (catch entities the platform shipped that the CLI hasn't documented yet)
360
+ - Run weekly as a background `/loop /cli-app-sync diff-entities --report-only`
361
+
362
+ </diff_entities_workflow>
363
+
265
364
  <success_criteria>
266
365
  - All comparison points from the map are checked
267
366
  - Intentional differences are correctly identified as SKIP
@@ -269,4 +368,6 @@ Status: DRIFT (2 issues)
269
368
  - Fix mode correctly updates template files and init.ts inline templates
270
369
  - Build passes after fixes are applied
271
370
  - Report is clear, actionable, and easy to scan
371
+ - `diff-entities` lists every Domain entity NOT covered by any CLI skill, with a suggested destination skill
372
+ - `diff-entities` matches the manual audit pattern that surfaced AiTool / AiEvalDataset / WorkflowVersion / Hooks gaps in the v3.46 alignment work
272
373
  </success_criteria>
@@ -219,6 +219,19 @@ These comparisons should **always** return `[SKIP]` — differences are by desig
219
219
 
220
220
  ---
221
221
 
222
+ ## v3.46+ Comparison Points
223
+
224
+ Added with the v3.46 alignment of CLI templates. These verify client projects honor the new architecture.
225
+
226
+ | ID | Comparison | Reference path | Patterns to check | Criticality |
227
+ |---|---|---|---|---|
228
+ | `nav-application-flags` | Seeds use `IsPersonal`/`IsOpen`, NOT `Zone = ApplicationZone.X` | `*/Seeding/Data/*NavigationApplicationSeedData.cs` and `*/Seeding/Data/*NavigationSeedData.cs` | Must match `IsPersonal\s*=` AND `IsOpen\s*=`. Must NOT match `ApplicationZone\.\w+`. | BLOCKING (with C66 grace period — currently WARNING) |
229
+ | `frontend-layouts-count` | Exactly 4 layouts present | `web/.../src/layouts/*.tsx` | Must contain `AppLayout.tsx`, `AuthLayout.tsx`, `DocsLayout.tsx`, `PublicLayout.tsx`. Must NOT contain `AdminLayout`, `BusinessLayout`, `UserLayout`, `HRLayout`, `SalesLayout`. | BLOCKING (C67 grace period — WARNING) |
230
+ | `provider-pattern` | Client root uses `<SmartStackProvider>` | `web/.../src/main.tsx` or `web/.../src/App.tsx` | Must contain `<SmartStackProvider config={` AND `<DynamicRouter />`. Must NOT contain manual `<AuthProvider>`/`<ThemeProvider>` re-wrap. | WARNING |
231
+ | `ai-agent-modes` | If AI activated, enums `AiAgentMode` / `AiAgentStepRole` are present | `src/.../Domain/AI/Agents/*.cs` | If `AiAgent.cs` exists, must reference `AiAgentMode` enum (Sequential/ReAct/PlanAndExecute/SelfCorrection). | WARNING |
232
+
233
+ ---
234
+
222
235
  ## Maintenance
223
236
 
224
237
  When adding a new comparison point: