@atlashub/smartstack-cli 3.7.0 → 3.9.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 (133) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +4 -2
  4. package/templates/agents/action.md +1 -0
  5. package/templates/agents/ba-writer.md +33 -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/backend-controller-hierarchy.md +58 -0
  28. package/templates/skills/application/references/backend-entity-seeding.md +72 -0
  29. package/templates/skills/application/references/backend-verification.md +88 -0
  30. package/templates/skills/application/references/frontend-verification.md +111 -0
  31. package/templates/skills/application/references/nav-fallback-procedure.md +200 -0
  32. package/templates/skills/application/references/provider-template.md +134 -0
  33. package/templates/skills/application/references/test-frontend.md +73 -0
  34. package/templates/skills/application/references/test-prerequisites.md +72 -0
  35. package/templates/skills/application/steps/step-01-navigation.md +7 -198
  36. package/templates/skills/application/steps/step-03b-provider.md +4 -128
  37. package/templates/skills/application/steps/step-04-backend.md +20 -350
  38. package/templates/skills/application/steps/step-05-frontend.md +12 -101
  39. package/templates/skills/application/steps/step-07-tests.md +12 -132
  40. package/templates/skills/business-analyse/SKILL.md +11 -2
  41. package/templates/skills/business-analyse/html/ba-interactive.html +3214 -2246
  42. package/templates/skills/business-analyse/html/build-html.js +77 -0
  43. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +130 -0
  44. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +22 -0
  45. package/templates/skills/business-analyse/html/src/scripts/03-render-cadrage.js +208 -0
  46. package/templates/skills/business-analyse/html/src/scripts/04-render-modules.js +211 -0
  47. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +554 -0
  48. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +110 -0
  49. package/templates/skills/business-analyse/html/src/scripts/07-render-handoff.js +90 -0
  50. package/templates/skills/business-analyse/html/src/scripts/08-editing.js +45 -0
  51. package/templates/skills/business-analyse/html/src/scripts/09-export.js +168 -0
  52. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +171 -0
  53. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +161 -0
  54. package/templates/skills/business-analyse/html/src/styles/01-variables.css +38 -0
  55. package/templates/skills/business-analyse/html/src/styles/02-layout.css +101 -0
  56. package/templates/skills/business-analyse/html/src/styles/03-navigation.css +62 -0
  57. package/templates/skills/business-analyse/html/src/styles/04-cards.css +196 -0
  58. package/templates/skills/business-analyse/html/src/styles/05-modules.css +325 -0
  59. package/templates/skills/business-analyse/html/src/styles/06-wireframes.css +230 -0
  60. package/templates/skills/business-analyse/html/src/styles/07-comments.css +184 -0
  61. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +241 -0
  62. package/templates/skills/business-analyse/html/src/template.html +623 -0
  63. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  64. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  65. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  66. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  67. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  68. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  69. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  70. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  71. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  72. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  73. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  74. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  75. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  76. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  77. package/templates/skills/business-analyse/steps/step-00-init.md +35 -68
  78. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  79. package/templates/skills/business-analyse/steps/step-03a-data.md +6 -49
  80. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  81. package/templates/skills/business-analyse/steps/step-03d-validate.md +3 -48
  82. package/templates/skills/business-analyse/steps/step-04-consolidation.md +9 -104
  83. package/templates/skills/business-analyse/steps/step-05a-handoff.md +25 -441
  84. package/templates/skills/business-analyse/steps/step-05b-deploy.md +19 -187
  85. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  86. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  87. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  88. package/templates/skills/check-version/SKILL.md +7 -0
  89. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  90. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  91. package/templates/skills/controller/steps/step-03-generate.md +6 -158
  92. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  93. package/templates/skills/debug/SKILL.md +7 -0
  94. package/templates/skills/explore/SKILL.md +6 -0
  95. package/templates/skills/feature-full/SKILL.md +39 -142
  96. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  97. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  98. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  99. package/templates/skills/gitflow/references/plan-template.md +69 -0
  100. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  101. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  102. package/templates/skills/gitflow/steps/step-init.md +18 -289
  103. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  104. package/templates/skills/gitflow/steps/step-start.md +16 -126
  105. package/templates/skills/mcp/SKILL.md +9 -213
  106. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  107. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  108. package/templates/skills/notification/SKILL.md +7 -0
  109. package/templates/skills/quick-search/SKILL.md +5 -0
  110. package/templates/skills/ralph-loop/SKILL.md +99 -381
  111. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  112. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  113. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  114. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  115. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  116. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  117. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  118. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  119. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  120. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  121. package/templates/skills/refactor/SKILL.md +12 -176
  122. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  123. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  124. package/templates/skills/review-code/SKILL.md +19 -257
  125. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  126. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  127. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  128. package/templates/skills/ui-components/SKILL.md +7 -0
  129. package/templates/skills/utils/SKILL.md +6 -0
  130. package/templates/skills/validate/SKILL.md +6 -0
  131. package/templates/skills/validate-feature/SKILL.md +8 -0
  132. package/templates/skills/workflow/SKILL.md +40 -118
  133. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -228,56 +228,11 @@ ba-writer.updateModuleStatus({feature_id}, {currentModule.code}, "specified")
228
228
  ### 11-bis. Deploy Incremental Interactive HTML (MANDATORY)
229
229
 
230
230
  > **After each module is specified, deploy/update the interactive HTML document with all available data.**
231
- > This allows the client to review completed modules while the next module is being specified.
232
- > The HTML is incrementally enriched: after module 1, only module 1 specs appear; after module 2, both appear; etc.
231
+ > The client can review completed modules while the next module is being specified.
233
232
 
234
- **Source:** `html/ba-interactive.html` (relative to skill root = `~/.claude/skills/business-analyse/html/`)
233
+ See [references/validate-incremental-html.md](../references/validate-incremental-html.md) for the complete deployment process (read sources, build FEATURE_DATA, replace placeholders, write HTML).
235
234
 
236
- **Destination:** `docs/business/{app}/business-analyse/v{version}/ba-interactive.html`
237
-
238
- **Steps:**
239
-
240
- 1. **Read sources:**
241
- - Read the HTML template from skill directory
242
- - Read the master feature.json (application level — now updated with current module status)
243
- - Read EACH completed module's feature.json (including the one just specified)
244
-
245
- 2. **Build FEATURE_DATA object:**
246
-
247
- > **Use the EXACT SAME mapping defined in step-05b-deploy.md and references/html-data-mapping.md.**
248
- > The mapping is identical — the only difference is that `moduleSpecs` only includes completed modules.
249
- > Modules not yet specified will NOT appear in `moduleSpecs` (their entry in `modules[]` will show `status: "pending"`).
250
-
251
- Follow step-05 section 9d "Step 2: Build FEATURE_DATA object" for the complete mapping pseudocode:
252
- - `metadata`, `cadrage`, `modules[]`, `dependencies[]` → from master feature.json
253
- - `moduleSpecs[moduleCode]` → only for modules with status "specified" (completed so far)
254
- - `consolidation` → empty `{ interactions: [], e2eFlows: [] }` (not yet consolidated)
255
- - `handoff` → empty `{}` (not yet handed off)
256
-
257
- 3. **Replace placeholders in template:**
258
- - Serialize the FEATURE_DATA object as JSON (2-space indentation)
259
- - Replace `{{FEATURE_DATA}}` with the serialized JSON
260
- - Replace `{{APPLICATION_NAME}}` → `{application_name}`
261
- - Replace `{{APPLICATION_ID}}` → `{feature_id}`
262
- - Replace `{{VERSION}}` → `{version}`
263
- - Replace `{{CREATED_AT}}` → `{ISO timestamp}`
264
-
265
- 4. **Write and confirm:**
266
-
267
- ```
268
- ✓ Interactive HTML updated (incremental):
269
- Path: docs/business/{app}/business-analyse/v{version}/ba-interactive.html
270
- Modules included: {completedModules.length}/{totalModules} specified
271
- - {completedModule1}: {uc_count} UCs, {br_count} BRs, {entity_count} entities
272
- - {completedModule2}: ...
273
- Remaining: {pendingModules.join(', ')} (will be added after specification)
274
- → Client can open in browser to review completed modules now.
275
- ```
276
-
277
- > **WHY incremental?** The client doesn't have to wait until handoff to start reviewing.
278
- > While module 2 is being specified, the client can already give feedback on module 1.
279
- > Each incremental deployment OVERWRITES the previous HTML (latest state always).
280
- > The FINAL deployment at step-05 (handoff) will include consolidation and handoff data.
235
+ Uses the **same mapping** as step-05b-deploy.md — only difference is `moduleSpecs` only includes completed modules.
281
236
 
282
237
  ---
283
238
 
@@ -212,112 +212,17 @@ Store results in consolidation.semanticChecks[]:
212
212
 
213
213
  ### 4-bis. Structural Schema Conformity Check (MANDATORY)
214
214
 
215
- > **Post-generation validation.** After semantic checks, verify that ALL module feature.json files conform to the JSON schema structure. This catches field name mismatches, missing sections, and wrong nesting.
216
-
217
- For EACH module feature.json, run these structural checks:
218
-
219
- **A. Required Sections Presence**
220
-
221
- | Section | Required | Check |
222
- |---------|----------|-------|
223
- | `metadata` | YES | Must have: app, module, language, featureDescription, featureType |
224
- | `discovery` | YES | Must exist (even if minimal) |
225
- | `analysis.entities[]` | YES | Must have ≥1 entity |
226
- | `analysis.businessRules[]` | YES | Must have ≥1 BR |
227
- | `analysis.objectives[]` | YES | Must have ≥1 objective |
228
- | `analysis.processFlow` | YES | Must have entryPoints, mainFlow, decisionPoints |
229
- | `analysis.dataLifecycle` | YES | Must have retention, archival, deletion, gdprRelevant |
230
- | `specification.useCases[]` | YES | Must have ≥1 UC |
231
- | `specification.functionalRequirements[]` | YES | Must have ≥1 FR |
232
- | `specification.permissionMatrix` | YES | Must be `{permissions[], roleAssignments[]}` (NOT flat array) |
233
- | `specification.sections[]` | YES | Must have ≥1 section with resources |
234
- | `specification.uiWireframes[]` | YES | Must have ≥1 wireframe with `layout` object |
235
- | `specification.lifeCycles[]` | IF entities have status | States must be objects (NOT strings) |
236
- | `specification.seedDataCore` | YES | Must have 5 arrays: navigationModules, navigationTranslations, permissions, rolePermissions, permissionConstants |
237
- | `specification.gherkinScenarios` | YES | Must be `{feature, scenarios[]}` (NOT flat array) |
238
- | `specification.navigation` | YES | Must have entries[] |
239
- | `specification.i18nKeys[]` | YES | Must have ≥1 key with fr, en, nl, de |
240
- | `validation` | YES | Must have completenessChecks, consistencyChecks, semanticChecks, decision |
241
- | `handoff` | Written by step-05 | Checked post-handoff |
242
-
243
- **B. Field Name Conformity**
244
-
245
- For each section, verify NO FORBIDDEN field names are used:
246
-
247
- | Section | FORBIDDEN fields | Correct fields |
248
- |---------|-----------------|----------------|
249
- | `entities[].attributes[]` | `type`, `values`, `rules` | `description`, `unique`, `validation` |
250
- | `businessRules[]` | `rule`, `condition` (singular), `action` | `name`, `statement`, `conditions[]` |
251
- | `useCases[]` | `actor`, `linkedBRs`, `linkedFRs` | `primaryActor`, `linkedRules` |
252
- | `functionalRequirements[]` | `name`, `description`, `linkedUCs`, `linkedBRs` | `statement`, `linkedUseCases`, `linkedRules` |
253
- | `permissionMatrix` | flat array with `resource`/`roles` | `{permissions[], roleAssignments[]}` |
254
- | `lifeCycles[].states[]` | string values like `"Active"` | objects with `{id, displayName, color, isTerminal}` |
255
- | `seedDataCore` | flat object, string values | 5 typed arrays |
256
- | `gherkinScenarios` | flat scenario array | `{feature, scenarios[]}` nested |
257
-
258
- **C. ID Pattern Conformity**
259
-
260
- | ID Type | Pattern | Example |
261
- |---------|---------|---------|
262
- | BR | `BR-(VAL\|CALC\|WF\|SEC\|DATA)-{PREFIX}-\d{3}` | BR-VAL-RM-001 |
263
- | UC | `UC-{PREFIX}-\d{3}` | UC-RM-001 |
264
- | FR | `FR-{PREFIX}-\d{3}` | FR-RM-001 |
265
- | Permissions | `business.{app}.{module}.{resource}.{action}` | business.freebike.repairs.create |
266
-
267
- Verify all IDs use the correct module prefix (2-4 uppercase letters).
268
-
269
- **D. Cross-Module ID Uniqueness**
270
-
271
- Verify no ID collision across modules:
272
- ```
273
- SET all_ids = {}
274
- FOR each module:
275
- FOR each BR, UC, FR id:
276
- IF id IN all_ids → ERROR: "Duplicate {id} in {module1} and {module2}"
277
- ADD id to all_ids
278
- ```
215
+ > **Post-generation validation.** After semantic checks, verify ALL module feature.json files conform to JSON schema.
279
216
 
280
- **E. Wireframe Layout Completeness**
217
+ See [references/consolidation-structural-checks.md](../references/consolidation-structural-checks.md) for the full 6-category structural check:
218
+ - **A.** Required Sections Presence (18 sections)
219
+ - **B.** Field Name Conformity (forbidden vs correct fields)
220
+ - **C.** ID Pattern Conformity (BR, UC, FR, Permissions)
221
+ - **D.** Cross-Module ID Uniqueness
222
+ - **E.** Wireframe Layout Completeness
223
+ - **F.** SeedDataCore Translation Coverage
281
224
 
282
- For each `uiWireframes[]`:
283
- ```
284
- IF missing componentMapping[] → ERROR
285
- IF missing layout object → ERROR
286
- IF missing layout.regions[] → ERROR
287
- FOR each region in layout.regions[]:
288
- IF missing position → ERROR
289
- IF missing components[] → ERROR
290
- ```
291
-
292
- **F. SeedDataCore Translation Coverage**
293
-
294
- ```
295
- FOR each navigationModules[].code:
296
- FOR each language in [fr, en, nl, de]:
297
- IF NOT EXISTS navigationTranslations[] with moduleCode AND language → ERROR
298
- ```
299
-
300
- **Result aggregation:**
301
- ```json
302
- {
303
- "structuralChecks": [
304
- { "check": "required-sections", "module": "...", "status": "PASS|ERROR", "details": "Missing: analysis.objectives" },
305
- { "check": "field-names", "module": "...", "status": "PASS|ERROR", "details": "businessRules[0] uses 'rule' instead of 'name'+'statement'" },
306
- { "check": "id-patterns", "module": "...", "status": "PASS|ERROR", "details": "BR-001 missing category segment" },
307
- { "check": "id-uniqueness", "module": "...", "status": "PASS|ERROR", "details": "UC-RM-003 duplicated in Vehicles and Repairs" },
308
- { "check": "wireframe-layout", "module": "...", "status": "PASS|ERROR", "details": "Wireframe repairs-list missing layout object" },
309
- { "check": "seeddata-translations", "module": "...", "status": "PASS|ERROR", "details": "Missing nl translation for NavigationModuleRepairs" }
310
- ]
311
- }
312
- ```
313
-
314
- **Blocking rule:**
315
- - 0 ERROR → PASS (merge structuralChecks into consolidation.semanticChecks[])
316
- - ≥1 ERROR → BLOCK. For each ERROR:
317
- 1. Attempt AUTO-FIX (rename fields, restructure)
318
- 2. Re-write the module feature.json with fixes
319
- 3. Re-check
320
- 4. If still ERROR → ask user
225
+ **Blocking rule:** 0 ERROR → PASS. ≥1 ERROR → BLOCK (attempt auto-fix, re-write, re-check).
321
226
 
322
227
  ### 5. End-to-End Flows
323
228
 
@@ -142,410 +142,35 @@ For **EACH module** in topological order:
142
142
  > - API: `src/API/Controllers/Business/HumanResources/ProjectsController.cs`
143
143
  > - Tests: `src/Tests/Unit/Domain/Business/HumanResources/Projects/ProjectTests.cs`
144
144
 
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
245
-
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
- ```
407
-
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/`.
410
-
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
145
+ #### 4.1-4.7 File Category Templates
146
+
147
+ See [references/handoff-file-templates.md](../references/handoff-file-templates.md) for the complete JSON templates for all 7 categories:
148
+
149
+ | Category | Source | Key rules |
150
+ |----------|--------|-----------|
151
+ | **4.1 Domain** | `analysis.entities[]` | Entities, ValueObjects, Enums, Exceptions |
152
+ | **4.2 Application** | `analysis.useCases[]` | Services, DTOs, Validators |
153
+ | **4.3 Infrastructure** | `analysis.entities[]` | EF Configurations, DbSet, DI |
154
+ | **4.4 API** | `specification.apiEndpoints[]` | Controllers with `{ContextShort}` mapping |
155
+ | **4.5 Frontend** | `specification.uiWireframes[]` | Pages, Components, Hooks + wireframe traceability |
156
+ | **4.6 SeedData** | `specification.seedDataCore` | 5 CORE + business + IClientSeedDataProvider |
157
+ | **4.7 Tests** | All layers | Unit, Integration, Security tests |
158
+
159
+ **Critical rules:**
160
+ - All backend paths include `{ContextPascal}/{ApplicationName}/` hierarchy
161
+ - Frontend pages MUST have `linkedWireframes[]` + `wireframeAcceptanceCriteria`
162
+ - SeedData: 5 CORE entries ALWAYS + IClientSeedDataProvider for client projects
163
+ - Path convention: `Persistence/Seeding/Data/` (NEVER `Data/SeedData/`)
467
164
 
468
165
  ---
469
166
 
470
167
  ### 5. Map Business Rules to Code
471
168
 
472
- Derive from `analysis.businessRules[]` of **EACH module**.
169
+ See [references/handoff-mappings.md](../references/handoff-mappings.md) Section "Business Rules to Code Mapping".
473
170
 
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}
547
-
548
- Layers: Domain, Application, Infrastructure, API, Frontend
171
+ For each BR in `analysis.businessRules[]` of EACH module, generate:
172
+ - **ruleId**, **title**, **module**, **severity** (critical/high/medium/low)
173
+ - **implementationPoints**: Array of `{layer, component, method, implementation}` across Domain, Application, Infrastructure, API, Frontend
549
174
 
550
175
  ---
551
176
 
@@ -553,50 +178,9 @@ Layers: Domain, Application, Infrastructure, API, Frontend
553
178
 
554
179
  > **ABSOLUTE RULE:** Copy **EXACTLY** from `specification.apiEndpoints[]`. **NEVER** reinvent routes.
555
180
 
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
- ```
181
+ See [references/handoff-mappings.md](../references/handoff-mappings.md) Section "API Endpoint Summary".
588
182
 
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
183
+ For each endpoint: operation, method, route, linkedUC, linkedFR, permissions, requestSchema, responseSchema, errorCodes, module.
600
184
 
601
185
  Total endpoints = count of specification.apiEndpoints[] across all modules.
602
186