@atlashub/smartstack-cli 3.8.0 → 3.10.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 (130) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +2 -1
  4. package/templates/agents/action.md +1 -0
  5. package/templates/agents/ba-writer.md +211 -0
  6. package/templates/agents/explore-codebase.md +1 -0
  7. package/templates/agents/explore-docs.md +1 -0
  8. package/templates/agents/fix-grammar.md +1 -0
  9. package/templates/agents/snipper.md +1 -0
  10. package/templates/skills/admin/SKILL.md +6 -0
  11. package/templates/skills/ai-prompt/SKILL.md +32 -136
  12. package/templates/skills/ai-prompt/steps/step-01-implementation.md +122 -0
  13. package/templates/skills/apex/SKILL.md +120 -0
  14. package/templates/skills/apex/_shared.md +86 -0
  15. package/templates/skills/apex/references/agent-teams-protocol.md +164 -0
  16. package/templates/skills/apex/references/smartstack-layers.md +173 -0
  17. package/templates/skills/apex/steps/step-00-init.md +156 -0
  18. package/templates/skills/apex/steps/step-01-analyze.md +169 -0
  19. package/templates/skills/apex/steps/step-02-plan.md +160 -0
  20. package/templates/skills/apex/steps/step-03-execute.md +166 -0
  21. package/templates/skills/apex/steps/step-04-validate.md +138 -0
  22. package/templates/skills/apex/steps/step-05-examine.md +124 -0
  23. package/templates/skills/apex/steps/step-06-resolve.md +105 -0
  24. package/templates/skills/apex/steps/step-07-tests.md +130 -0
  25. package/templates/skills/apex/steps/step-08-run-tests.md +115 -0
  26. package/templates/skills/application/SKILL.md +10 -0
  27. package/templates/skills/application/references/application-roles-template.md +227 -0
  28. package/templates/skills/application/references/backend-controller-hierarchy.md +58 -0
  29. package/templates/skills/application/references/backend-entity-seeding.md +72 -0
  30. package/templates/skills/application/references/backend-verification.md +88 -0
  31. package/templates/skills/application/references/frontend-verification.md +111 -0
  32. package/templates/skills/application/references/nav-fallback-procedure.md +200 -0
  33. package/templates/skills/application/references/provider-template.md +158 -0
  34. package/templates/skills/application/references/test-frontend.md +73 -0
  35. package/templates/skills/application/references/test-prerequisites.md +72 -0
  36. package/templates/skills/application/steps/step-01-navigation.md +7 -198
  37. package/templates/skills/application/steps/step-03-roles.md +45 -7
  38. package/templates/skills/application/steps/step-03b-provider.md +15 -132
  39. package/templates/skills/application/steps/step-04-backend.md +20 -350
  40. package/templates/skills/application/steps/step-05-frontend.md +12 -101
  41. package/templates/skills/application/steps/step-07-tests.md +12 -132
  42. package/templates/skills/business-analyse/SKILL.md +67 -6
  43. package/templates/skills/business-analyse/html/ba-interactive.html +176 -14
  44. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +1 -0
  45. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +16 -4
  46. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +7 -2
  47. package/templates/skills/business-analyse/html/src/scripts/09-export.js +103 -0
  48. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +12 -6
  49. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +24 -2
  50. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +12 -0
  51. package/templates/skills/business-analyse/html/src/template.html +1 -0
  52. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +477 -0
  53. package/templates/skills/business-analyse/references/cache-warming-strategy.md +578 -0
  54. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  55. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  56. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  57. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  58. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  59. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  60. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  61. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  62. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  63. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  64. package/templates/skills/business-analyse/references/robustness-checks.md +538 -0
  65. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  66. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  67. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  68. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  69. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +33 -1
  70. package/templates/skills/business-analyse/steps/step-00-init.md +186 -53
  71. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  72. package/templates/skills/business-analyse/steps/step-03a-data.md +42 -49
  73. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  74. package/templates/skills/business-analyse/steps/step-03c-compile.md +71 -2
  75. package/templates/skills/business-analyse/steps/step-03d-validate.md +277 -48
  76. package/templates/skills/business-analyse/steps/step-04-consolidation.md +175 -104
  77. package/templates/skills/business-analyse/steps/step-05a-handoff.md +66 -438
  78. package/templates/skills/business-analyse/steps/step-05b-deploy.md +35 -184
  79. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +526 -0
  80. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  81. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  82. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  83. package/templates/skills/check-version/SKILL.md +7 -0
  84. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  85. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  86. package/templates/skills/controller/steps/step-03-generate.md +166 -158
  87. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  88. package/templates/skills/controller/templates.md +11 -2
  89. package/templates/skills/debug/SKILL.md +7 -0
  90. package/templates/skills/explore/SKILL.md +6 -0
  91. package/templates/skills/feature-full/SKILL.md +39 -142
  92. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  93. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  94. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  95. package/templates/skills/gitflow/references/plan-template.md +69 -0
  96. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  97. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  98. package/templates/skills/gitflow/steps/step-init.md +18 -289
  99. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  100. package/templates/skills/gitflow/steps/step-start.md +16 -126
  101. package/templates/skills/mcp/SKILL.md +9 -213
  102. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  103. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  104. package/templates/skills/notification/SKILL.md +7 -0
  105. package/templates/skills/quick-search/SKILL.md +5 -0
  106. package/templates/skills/ralph-loop/SKILL.md +99 -381
  107. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  108. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  109. package/templates/skills/ralph-loop/references/core-seed-data.md +173 -21
  110. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  111. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  112. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  113. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  114. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  115. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  116. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  117. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  118. package/templates/skills/refactor/SKILL.md +12 -176
  119. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  120. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  121. package/templates/skills/review-code/SKILL.md +19 -257
  122. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  123. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  124. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  125. package/templates/skills/ui-components/SKILL.md +7 -0
  126. package/templates/skills/utils/SKILL.md +6 -0
  127. package/templates/skills/validate/SKILL.md +6 -0
  128. package/templates/skills/validate-feature/SKILL.md +8 -0
  129. package/templates/skills/workflow/SKILL.md +40 -118
  130. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -57,6 +57,50 @@ Include:
57
57
 
58
58
  ---
59
59
 
60
+ ### 1b. Cache Warming for Handoff & Deploy
61
+
62
+ > **Performance Optimization:** Pre-load handoff templates and references to reduce redundant reads during handoff generation.
63
+ > This step runs ONCE at start of step-05a, files retained through step-05b.
64
+
65
+ ```
66
+ // Pre-load handoff & deploy references (Bucket 5)
67
+ const handoffRefs = [
68
+ "~/.claude/skills/business-analyse/references/handoff-file-templates.md",
69
+ "~/.claude/skills/business-analyse/references/handoff-mappings.md",
70
+ "~/.claude/skills/business-analyse/references/deploy-data-build.md",
71
+ "~/.claude/skills/business-analyse/references/deploy-modes.md",
72
+ "~/.claude/skills/business-analyse/references/html-data-mapping.md"
73
+ ];
74
+
75
+ for (const file of handoffRefs) {
76
+ read(file); // Pre-load into cache
77
+ }
78
+
79
+ // Pre-load HTML template (large file, loaded once)
80
+ read("~/.claude/skills/business-analyse/html/ba-interactive.html");
81
+
82
+ Display: "✓ Cache warmed: handoff templates (139KB, 6 files)"
83
+ Display: " Expected token savings: ~3,000 tokens (handoff refs read 2× → 1×)"
84
+ Display: " Retention: through step-05b (deploy)"
85
+ ```
86
+
87
+ **Rationale:**
88
+
89
+ - Handoff templates are read 2× during step-05a + step-05b (without caching)
90
+ - HTML template (85KB) is read once but benefits from explicit pre-load (faster deploy)
91
+ - Token savings: ~3,000 tokens for handoff process
92
+ - Cache retained until session end (needed for both handoff and deploy steps)
93
+
94
+ **Why NOT loaded at step-00:**
95
+ - Large files (139KB total), especially ba-interactive.html (85KB)
96
+ - Only used at END of workflow (steps 05a, 05b)
97
+ - Low re-use (1-2× each)
98
+ - Loading at step-05a is more efficient (just-in-time caching)
99
+
100
+ See [references/cache-warming-strategy.md](../references/cache-warming-strategy.md) § Bucket 5 for details.
101
+
102
+ ---
103
+
60
104
  ### 2. Implementation Strategy Choice (Multi-Module)
61
105
 
62
106
  **IF** more than 1 module defined in feature.json:
@@ -142,410 +186,35 @@ For **EACH module** in topological order:
142
186
  > - API: `src/API/Controllers/Business/HumanResources/ProjectsController.cs`
143
187
  > - Tests: `src/Tests/Unit/Domain/Business/HumanResources/Projects/ProjectTests.cs`
144
188
 
145
- #### 4.1 Domain Files
146
-
147
- From `analysis.entities[]` of the module:
148
-
149
- ```json
150
- "domain": [
151
- {
152
- "path": "src/Domain/Entities/{ContextPascal}/{ApplicationName}/{ModuleName}/{EntityName}.cs",
153
- "type": "Entity",
154
- "linkedFRs": ["FR-001", "FR-002"],
155
- "linkedUCs": ["UC-001"],
156
- "module": "{moduleCode}"
157
- }
158
- ]
159
- ```
160
-
161
- Include:
162
- - Value objects referenced by entities (`src/Domain/Entities/{ContextPascal}/{ApplicationName}/{ModuleName}/{ValueObject}.cs`)
163
- - Enums used in domain (`src/Domain/Enums/{ContextPascal}/{ApplicationName}/{ModuleName}/{EnumName}.cs`)
164
- - Domain exceptions specific to module (`src/Domain/Exceptions/{ContextPascal}/{ApplicationName}/{ModuleName}/{ExceptionName}.cs`)
165
-
166
- #### 4.2 Application Files
167
-
168
- From `analysis.useCases[]` of the module:
169
-
170
- ```json
171
- "application": [
172
- {
173
- "path": "src/Application/Services/{ContextPascal}/{ApplicationName}/{ModuleName}/{ServiceName}Service.cs",
174
- "type": "Service",
175
- "linkedFRs": ["FR-001"],
176
- "linkedUCs": ["UC-001", "UC-002"],
177
- "module": "{moduleCode}"
178
- },
179
- {
180
- "path": "src/Application/DTOs/{ContextPascal}/{ApplicationName}/{ModuleName}/{DtoName}Dto.cs",
181
- "type": "Dto",
182
- "linkedUCs": ["UC-001"],
183
- "module": "{moduleCode}"
184
- },
185
- {
186
- "path": "src/Application/Validators/{ContextPascal}/{ApplicationName}/{ModuleName}/{ValidatorName}Validator.cs",
187
- "type": "Validator",
188
- "linkedFRs": ["FR-001"],
189
- "module": "{moduleCode}"
190
- }
191
- ]
192
- ```
193
-
194
- Include:
195
- - Service per use case cluster (or per domain entity if applicable)
196
- - DTOs for API contracts
197
- - Validators for FluentValidation
198
- - Query handlers
199
-
200
- #### 4.3 Infrastructure Files
201
-
202
- From `analysis.entities[]` of the module:
203
-
204
- ```json
205
- "infrastructure": [
206
- {
207
- "path": "src/Infrastructure/Persistence/Configurations/{ContextPascal}/{ApplicationName}/{ModuleName}/{EntityName}Configuration.cs",
208
- "type": "EFConfiguration",
209
- "linkedFRs": ["FR-001"],
210
- "module": "{moduleCode}"
211
- }
212
- ]
213
- ```
214
-
215
- Include:
216
- - EF Core configuration per entity (`Persistence/Configurations/{ContextPascal}/{ApplicationName}/{ModuleName}/`)
217
- - DbSet registration in `IExtensionsDbContext` / `ExtensionsDbContext`
218
- - DI registration in `DependencyInjection.cs`
219
- - Specifications if complex queries
220
-
221
- #### 4.4 API Files
222
-
223
- From `specification.apiEndpoints[]` of the module:
224
-
225
- ```json
226
- "api": [
227
- {
228
- "path": "src/API/Controllers/{ContextShort}/{ApplicationName}/{EntityName}Controller.cs",
229
- "type": "ApiController",
230
- "linkedUCs": ["UC-001", "UC-002"],
231
- "linkedFRs": ["FR-001"],
232
- "module": "{moduleCode}"
233
- }
234
- ]
235
- ```
236
-
237
- > **Context-to-folder mapping (`{ContextShort}`):** `business` → `Business`, `platform` → `Admin`, `personal` → `User`
238
-
239
- Include:
240
- - One controller per domain aggregate root (or logical grouping)
241
- - Include all HTTP methods (GET, POST, PUT, DELETE, PATCH)
242
- - Error handling and validation responses
243
-
244
- #### 4.5 Frontend Files
189
+ #### 4.1-4.7 File Category Templates
245
190
 
246
- From `specification.uiWireframes[]`, `specification.dashboards[]` and `analysis.useCases[]` of the module:
247
-
248
- > **WIREFRAME TRACEABILITY RULE:** Every frontend file (Page, DashboardPage, Component) MUST include `linkedWireframes[]` referencing the wireframe `screen` identifiers from `specification.uiWireframes[]`. This ensures the BA mockups validated by the client are respected during implementation.
249
-
250
- ```json
251
- "frontend": [
252
- {
253
- "path": "src/pages/{ModuleName}/{PageName}Page.tsx",
254
- "type": "Page",
255
- "linkedUCs": ["UC-001", "UC-002"],
256
- "linkedWireframes": ["{module}-list"],
257
- "module": "{moduleCode}",
258
- "wireframeAcceptanceCriteria": "Layout MUST match wireframe '{module}-list': elements [{elements}], actions [{actions}]. See specification.uiWireframes[] for exact mockup."
259
- },
260
- {
261
- "path": "src/pages/{ModuleName}/{PageName}DetailPage.tsx",
262
- "type": "Page",
263
- "linkedUCs": ["UC-003"],
264
- "linkedWireframes": ["{module}-detail"],
265
- "module": "{moduleCode}",
266
- "wireframeAcceptanceCriteria": "Layout MUST match wireframe '{module}-detail': elements [{elements}], actions [{actions}]. See specification.uiWireframes[] for exact mockup."
267
- },
268
- {
269
- "path": "src/pages/{ModuleName}/{DashboardName}DashboardPage.tsx",
270
- "type": "DashboardPage",
271
- "linkedUCs": ["UC-060"],
272
- "linkedWireframes": ["{module}-dashboard"],
273
- "module": "{moduleCode}",
274
- "dashboardRef": "{module}-dashboard",
275
- "instructions": "Use Recharts library. See specification.dashboards[] for KPI definitions, chart types, filters, and data sources.",
276
- "wireframeAcceptanceCriteria": "Layout MUST match wireframe '{module}-dashboard': KPI card positions, chart placement, filter bar location. See specification.uiWireframes[] AND specification.dashboards[] for exact mockup and KPI specs."
277
- },
278
- {
279
- "path": "src/components/{ModuleName}/{ComponentName}.tsx",
280
- "type": "Component",
281
- "linkedUCs": ["UC-001"],
282
- "linkedWireframes": ["{module}-{section}"],
283
- "module": "{moduleCode}"
284
- },
285
- {
286
- "path": "src/hooks/use{ModuleName}{Hook}.ts",
287
- "type": "Hook",
288
- "linkedUCs": ["UC-001", "UC-002"],
289
- "module": "{moduleCode}"
290
- }
291
- ]
292
- ```
293
-
294
- **Wireframe Acceptance Criteria (ALL frontend pages):**
295
- > **MANDATORY** for every Page and DashboardPage task. These criteria ensure the BA mockups are respected.
296
- - Layout structure matches the validated ASCII/SVG wireframe from `specification.uiWireframes[]`
297
- - All `elements` listed in the wireframe are present in the generated component
298
- - All `actions` listed in the wireframe are implemented with correct permissions
299
- - Component mapping follows the wireframe-to-component table (see step-03 section 3b-bis)
300
- - If wireframe shows a DataGrid → implement with `SmartTable` or `EntityCard` grid
301
- - If wireframe shows FilterBar → implement with `SmartFilter`
302
- - If wireframe shows ActionButton → wrap in `RequirePermission`
303
-
304
- **Dashboard pages (type: DashboardPage):**
305
- - Generated from `specification.dashboards[]` entries
306
- - `dashboardRef` links to the dashboard code in specification.dashboards[]
307
- - `linkedWireframes` links to the dashboard wireframe in specification.uiWireframes[]
308
- - `instructions` MUST reference chart types, KPI definitions, and data sources
309
- - Acceptance criteria for DashboardPage tasks MUST include:
310
- - Chart library (Recharts) installed in package.json
311
- - Chart types matching specification.dashboards[].kpis[].visualization
312
- - KPI cards for kpi-card type visualizations
313
- - Filters functional (dateRange, select, etc.)
314
- - CSS variables used (no hardcoded colors) - see ui-components/patterns/dashboard-chart.md
315
- - Responsive layout (1-col mobile, 2-col tablet, 3-col desktop)
316
- - **KPI card positions match wireframe layout** (e.g., 4 cards in a row if wireframe shows 4)
317
- - **Chart placement matches wireframe** (e.g., 2-column grid if wireframe shows side-by-side)
318
-
319
- **Standard pages (type: Page):**
320
- - Pages for major use cases
321
- - Components for reusable UI elements
322
- - Custom hooks for business logic
323
- - Forms for data entry
324
- - List/Detail views
325
- - **ALL pages MUST reference their wireframe via `linkedWireframes`**
326
-
327
- #### 4.6 SeedData Files
328
-
329
- **OBLIGATORY:** 5 CORE SeedData entries per module + business seed data:
330
-
331
- ```json
332
- "seedData": [
333
- {
334
- "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/NavigationModuleSeedData.cs",
335
- "type": "SeedData",
336
- "category": "core",
337
- "source": "specification.seedDataCore.navigationModules",
338
- "module": "{moduleCode}"
339
- },
340
- {
341
- "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/PermissionsSeedData.cs",
342
- "type": "SeedData",
343
- "category": "core",
344
- "source": "specification.seedDataCore.permissions",
345
- "module": "{moduleCode}"
346
- },
347
- {
348
- "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/RolesSeedData.cs",
349
- "type": "SeedData",
350
- "category": "core",
351
- "source": "specification.seedDataCore.roles",
352
- "module": "{moduleCode}"
353
- },
354
- {
355
- "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/TenantSeedData.cs",
356
- "type": "SeedData",
357
- "category": "core",
358
- "source": "specification.seedDataCore.tenants",
359
- "module": "{moduleCode}"
360
- },
361
- {
362
- "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/UserSeedData.cs",
363
- "type": "SeedData",
364
- "category": "core",
365
- "source": "specification.seedDataCore.users",
366
- "module": "{moduleCode}"
367
- },
368
- {
369
- "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/{Entity}SeedData.cs",
370
- "type": "SeedData",
371
- "category": "business",
372
- "source": "specification.seedDataBusiness.{module}",
373
- "module": "{moduleCode}"
374
- }
375
- ]
376
- ```
377
-
378
- **For client projects (ExtensionsDbContext), add these MANDATORY infrastructure files:**
379
-
380
- ```json
381
- "seedData": [
382
- // ... 5 core + business entries above ...
383
- {
384
- "path": "src/Infrastructure/Persistence/Seeding/{AppPascalName}SeedDataProvider.cs",
385
- "type": "IClientSeedDataProvider",
386
- "category": "infrastructure",
387
- "description": "Runtime provider that injects core seed data (navigation, permissions, roles) into Core schema",
388
- "source": "specification.seedDataCore",
389
- "module": "{moduleCode}"
390
- },
391
- {
392
- "path": "src/Infrastructure/Persistence/Seeding/DevDataSeeder.cs",
393
- "type": "DevDataSeeder",
394
- "category": "infrastructure",
395
- "description": "Seeds development/demo data for domain entities at startup",
396
- "module": "{moduleCode}"
397
- },
398
- {
399
- "path": "src/Infrastructure/Persistence/Seeding/Data/SeedConstants.cs",
400
- "type": "SeedConstants",
401
- "category": "infrastructure",
402
- "description": "Shared constants for deterministic seed data",
403
- "module": "{moduleCode}"
404
- }
405
- ]
406
- ```
191
+ See [references/handoff-file-templates.md](../references/handoff-file-templates.md) for the complete JSON templates for all 7 categories:
407
192
 
408
- **Path convention:** All seed data files MUST be under `Persistence/Seeding/Data/` (matching SmartStack.app architecture).
409
- NEVER use `Data/SeedData/` or `Infrastructure/Data/SeedData/`.
193
+ | Category | Source | Key rules |
194
+ |----------|--------|-----------|
195
+ | **4.1 Domain** | `analysis.entities[]` | Entities, ValueObjects, Enums, Exceptions |
196
+ | **4.2 Application** | `analysis.useCases[]` | Services, DTOs, Validators |
197
+ | **4.3 Infrastructure** | `analysis.entities[]` | EF Configurations, DbSet, DI |
198
+ | **4.4 API** | `specification.apiEndpoints[]` | Controllers with `{ContextShort}` mapping |
199
+ | **4.5 Frontend** | `specification.uiWireframes[]` | Pages, Components, Hooks + wireframe traceability |
200
+ | **4.6 SeedData** | `specification.seedDataCore` | 5 CORE + business + IClientSeedDataProvider |
201
+ | **4.7 Tests** | All layers | Unit, Integration, Security tests |
410
202
 
411
- **IClientSeedDataProvider (MANDATORY for client projects):** This provider injects core seed data
412
- (navigation, permissions, roles) into the Core schema at runtime. Generated at
413
- `src/Infrastructure/Persistence/Seeding/{AppPascalName}SeedDataProvider.cs`.
414
- See `/application` skill step-03b-provider for the full pattern.
415
- Without this provider, the 5 core SeedData files are DEAD CODE and will have no effect.
416
-
417
- Core categories (ALWAYS 5):
418
- 1. NavigationModuleSeedData (navigation items for module)
419
- 2. PermissionsSeedData (RBAC permissions)
420
- 3. RolesSeedData (roles using permissions)
421
- 4. TenantSeedData (test tenants)
422
- 5. UserSeedData (test users)
423
-
424
- Business categories (from specification.seedDataBusiness):
425
- - Domain-specific reference data
426
- - Test data fixtures
427
- - Lookup tables (statuses, categories, etc.)
428
-
429
- #### 4.7 Test Files
430
-
431
- ```json
432
- "tests": [
433
- {
434
- "path": "src/Tests/Unit/Domain/{ContextPascal}/{ApplicationName}/{ModuleName}/{Entity}Tests.cs",
435
- "type": "UnitTests",
436
- "linkedFRs": ["FR-001"],
437
- "module": "{moduleCode}"
438
- },
439
- {
440
- "path": "src/Tests/Unit/Application/{ContextPascal}/{ApplicationName}/{ModuleName}/{ServiceName}ServiceTests.cs",
441
- "type": "UnitTests",
442
- "linkedFRs": ["FR-001"],
443
- "linkedUCs": ["UC-001"],
444
- "module": "{moduleCode}"
445
- },
446
- {
447
- "path": "src/Tests/Integration/{ContextPascal}/{ApplicationName}/{ModuleName}/{ApiControllerName}ControllerTests.cs",
448
- "type": "IntegrationTests",
449
- "linkedUCs": ["UC-001"],
450
- "module": "{moduleCode}"
451
- },
452
- {
453
- "path": "src/Tests/Security/{ContextPascal}/{ApplicationName}/{ModuleName}/{ModuleName}SecurityTests.cs",
454
- "type": "SecurityTests",
455
- "linkedFRs": ["FR-001"],
456
- "module": "{moduleCode}"
457
- }
458
- ]
459
- ```
460
-
461
- Test files:
462
- - Unit tests for domain entities and value objects
463
- - Unit tests for services and validators
464
- - Integration tests for API endpoints
465
- - Security tests for authorization and tenant isolation
466
- - E2E tests for critical user flows
203
+ **Critical rules:**
204
+ - All backend paths include `{ContextPascal}/{ApplicationName}/` hierarchy
205
+ - Frontend pages MUST have `linkedWireframes[]` + `wireframeAcceptanceCriteria`
206
+ - SeedData: 5 CORE entries ALWAYS + IClientSeedDataProvider for client projects
207
+ - Path convention: `Persistence/Seeding/Data/` (NEVER `Data/SeedData/`)
467
208
 
468
209
  ---
469
210
 
470
211
  ### 5. Map Business Rules to Code
471
212
 
472
- Derive from `analysis.businessRules[]` of **EACH module**.
473
-
474
- Generate complete mapping for each BR:
475
-
476
- ```json
477
- {
478
- "brToCodeMapping": [
479
- {
480
- "ruleId": "BR-VAL-001",
481
- "title": "Order total must equal sum of item prices",
482
- "module": "{moduleCode}",
483
- "severity": "critical",
484
- "implementationPoints": [
485
- {
486
- "layer": "Domain",
487
- "component": "Order.cs",
488
- "method": "CalculateTotal()",
489
- "implementation": "Validate sum equals sum of OrderItems.Price"
490
- },
491
- {
492
- "layer": "Application",
493
- "component": "CreateOrderService.cs",
494
- "method": "Handle()",
495
- "implementation": "Calculate total before persisting"
496
- },
497
- {
498
- "layer": "API",
499
- "component": "OrdersController.cs",
500
- "method": "CreateOrder()",
501
- "implementation": "Return validation error if total mismatch"
502
- },
503
- {
504
- "layer": "Frontend",
505
- "component": "OrderForm.tsx",
506
- "method": "calculateTotal()",
507
- "implementation": "Real-time calculation on item change"
508
- }
509
- ]
510
- },
511
- {
512
- "ruleId": "BR-SEC-002",
513
- "title": "User can only view orders from their tenant",
514
- "module": "{moduleCode}",
515
- "severity": "critical",
516
- "implementationPoints": [
517
- {
518
- "layer": "Domain",
519
- "component": "Order.cs",
520
- "method": "Validate()",
521
- "implementation": "Check TenantId matches user context"
522
- },
523
- {
524
- "layer": "Infrastructure",
525
- "component": "OrderRepository.cs",
526
- "method": "GetUserOrders()",
527
- "implementation": "Filter by TenantId in WHERE clause"
528
- },
529
- {
530
- "layer": "API",
531
- "component": "OrdersController.cs",
532
- "method": "GetOrders()",
533
- "implementation": "Enforce permission check + tenant filter"
534
- }
535
- ]
536
- }
537
- ]
538
- }
539
- ```
540
-
541
- For each BR include:
542
- - **ruleId**: Reference to analysis.businessRules[].id
543
- - **title**: The rule statement
544
- - **module**: Which module it belongs to
545
- - **severity**: "critical", "high", "medium", "low"
546
- - **implementationPoints**: Array of {layer, component, method, implementation}
213
+ See [references/handoff-mappings.md](../references/handoff-mappings.md) Section "Business Rules to Code Mapping".
547
214
 
548
- Layers: Domain, Application, Infrastructure, API, Frontend
215
+ For each BR in `analysis.businessRules[]` of EACH module, generate:
216
+ - **ruleId**, **title**, **module**, **severity** (critical/high/medium/low)
217
+ - **implementationPoints**: Array of `{layer, component, method, implementation}` across Domain, Application, Infrastructure, API, Frontend
549
218
 
550
219
  ---
551
220
 
@@ -553,50 +222,9 @@ Layers: Domain, Application, Infrastructure, API, Frontend
553
222
 
554
223
  > **ABSOLUTE RULE:** Copy **EXACTLY** from `specification.apiEndpoints[]`. **NEVER** reinvent routes.
555
224
 
556
- Generate summary with full details:
557
-
558
- ```json
559
- {
560
- "apiEndpointSummary": [
561
- {
562
- "operation": "ListOrders",
563
- "method": "GET",
564
- "route": "/api/business/orders",
565
- "linkedUC": "UC-001",
566
- "linkedFR": "FR-001",
567
- "permissions": ["business.orders.read"],
568
- "requestSchema": { "type": "query", "params": ["pageNumber", "pageSize", "status"] },
569
- "responseSchema": { "type": "PaginatedOrderDto[]" },
570
- "errorCodes": [401, 403, 400, 500],
571
- "module": "{moduleCode}"
572
- },
573
- {
574
- "operation": "CreateOrder",
575
- "method": "POST",
576
- "route": "/api/business/orders",
577
- "linkedUC": "UC-002",
578
- "linkedFR": "FR-002",
579
- "permissions": ["business.orders.create"],
580
- "requestSchema": { "type": "body", "schema": "CreateOrderDto" },
581
- "responseSchema": { "type": "OrderDto" },
582
- "errorCodes": [400, 401, 403, 422, 500],
583
- "module": "{moduleCode}"
584
- }
585
- ]
586
- }
587
- ```
225
+ See [references/handoff-mappings.md](../references/handoff-mappings.md) Section "API Endpoint Summary".
588
226
 
589
- For each endpoint:
590
- - **operation**: Use case name or operation name
591
- - **method**: HTTP method (GET, POST, PUT, DELETE, PATCH)
592
- - **route**: Full API path from specification
593
- - **linkedUC**: Use case ID(s) this endpoint implements
594
- - **linkedFR**: Feature requirement ID(s)
595
- - **permissions**: Array of exact permission paths
596
- - **requestSchema**: Input contract (query params or body)
597
- - **responseSchema**: Output contract
598
- - **errorCodes**: Expected HTTP error codes
599
- - **module**: Which module
227
+ For each endpoint: operation, method, route, linkedUC, linkedFR, permissions, requestSchema, responseSchema, errorCodes, module.
600
228
 
601
229
  Total endpoints = count of specification.apiEndpoints[] across all modules.
602
230