@atlashub/smartstack-cli 4.18.0 → 4.19.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 (160) hide show
  1. package/package.json +1 -1
  2. package/templates/agents/ba-reader.md +86 -80
  3. package/templates/agents/ba-writer.md +318 -415
  4. package/templates/agents/docs-context-reader.md +3 -3
  5. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
  6. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +126 -0
  7. package/templates/skills/apex/SKILL.md +29 -16
  8. package/templates/skills/apex/_shared.md +62 -9
  9. package/templates/skills/apex/references/analysis-methods.md +8 -6
  10. package/templates/skills/apex/references/challenge-questions.md +5 -5
  11. package/templates/skills/apex/references/core-seed-data.md +68 -45
  12. package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +26 -21
  13. package/templates/skills/apex/references/parallel-execution.md +156 -0
  14. package/templates/skills/apex/references/person-extension-pattern.md +12 -12
  15. package/templates/skills/apex/references/post-checks.md +1748 -1726
  16. package/templates/skills/apex/references/smartstack-api.md +63 -57
  17. package/templates/skills/apex/references/smartstack-frontend-compliance.md +594 -0
  18. package/templates/skills/apex/references/smartstack-frontend.md +1246 -1842
  19. package/templates/skills/apex/references/smartstack-layers.md +98 -145
  20. package/templates/skills/apex/steps/step-00-init.md +30 -6
  21. package/templates/skills/apex/steps/step-01-analyze.md +27 -23
  22. package/templates/skills/apex/steps/step-02-plan.md +12 -12
  23. package/templates/skills/apex/steps/step-03-execute.md +198 -143
  24. package/templates/skills/apex/steps/step-04-examine.md +24 -93
  25. package/templates/skills/apex/steps/step-05-deep-review.md +16 -16
  26. package/templates/skills/apex/steps/step-06-resolve.md +9 -9
  27. package/templates/skills/apex/steps/step-07-tests.md +3 -1
  28. package/templates/skills/apex/steps/step-08-run-tests.md +1 -1
  29. package/templates/skills/business-analyse/SKILL.md +182 -301
  30. package/templates/skills/business-analyse/_shared.md +119 -336
  31. package/templates/skills/business-analyse/html/ba-interactive.html +703 -82
  32. package/templates/skills/business-analyse/html/build-html.js +41 -3
  33. package/templates/skills/business-analyse/html/src/partials/cadrage-context.html +34 -0
  34. package/templates/skills/business-analyse/html/src/partials/cadrage-risks.html +48 -0
  35. package/templates/skills/business-analyse/html/src/partials/cadrage-scope.html +49 -0
  36. package/templates/skills/business-analyse/html/src/partials/cadrage-stakeholders.html +55 -0
  37. package/templates/skills/business-analyse/html/src/partials/cadrage-success.html +34 -0
  38. package/templates/skills/business-analyse/html/src/partials/consol-datamodel.html +8 -0
  39. package/templates/skills/business-analyse/html/src/partials/consol-flows.html +29 -0
  40. package/templates/skills/business-analyse/html/src/partials/consol-interactions.html +8 -0
  41. package/templates/skills/business-analyse/html/src/partials/consol-permissions.html +8 -0
  42. package/templates/skills/business-analyse/html/src/partials/decomp-dependencies.html +38 -0
  43. package/templates/skills/business-analyse/html/src/partials/decomp-modules.html +51 -0
  44. package/templates/skills/business-analyse/html/src/partials/handoff-summary.html +24 -0
  45. package/templates/skills/business-analyse/html/src/partials/module-spec-container.html +4 -0
  46. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +17 -1
  47. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +31 -5
  48. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +100 -63
  49. package/templates/skills/business-analyse/html/src/scripts/06-render-mockups.js +372 -0
  50. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
  51. package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
  52. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
  53. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +142 -0
  54. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +94 -0
  55. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +150 -0
  56. package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
  57. package/templates/skills/business-analyse/questionnaire.md +23 -280
  58. package/templates/skills/business-analyse/react/application-viewer.md +2 -2
  59. package/templates/skills/business-analyse/react/components.md +4 -4
  60. package/templates/skills/business-analyse/react/i18n-template.md +1 -1
  61. package/templates/skills/business-analyse/react/schema.md +14 -14
  62. package/templates/skills/business-analyse/references/acceptance-criteria.md +21 -21
  63. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
  64. package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
  65. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +5 -5
  66. package/templates/skills/business-analyse/references/deploy-data-build.md +12 -11
  67. package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
  68. package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
  69. package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
  70. package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
  71. package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
  72. package/templates/skills/business-analyse/references/robustness-checks.md +36 -36
  73. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  74. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  75. package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
  76. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  77. package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
  78. package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
  79. package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
  80. package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
  81. package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
  82. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  83. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
  84. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
  85. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  86. package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -4
  87. package/templates/skills/business-analyse/steps/step-00-init.md +68 -77
  88. package/templates/skills/business-analyse/steps/step-01-cadrage.md +54 -180
  89. package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
  90. package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
  91. package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
  92. package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
  93. package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
  94. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  95. package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
  96. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
  97. package/templates/skills/business-analyse/templates-react.md +2 -2
  98. package/templates/skills/derive-prd/SKILL.md +92 -0
  99. package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
  100. package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
  101. package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
  102. package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
  103. package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
  104. package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -263
  105. package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
  106. package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
  107. package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
  108. package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
  109. package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
  110. package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
  111. package/templates/skills/ralph-loop/SKILL.md +2 -1
  112. package/templates/skills/ralph-loop/references/init-resume-recovery.md +1 -1
  113. package/templates/skills/ralph-loop/steps/step-01-task.md +2 -2
  114. package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
  115. package/templates/skills/business-analyse/_architecture.md +0 -124
  116. package/templates/skills/business-analyse/_elicitation.md +0 -206
  117. package/templates/skills/business-analyse/_module-loop.md +0 -115
  118. package/templates/skills/business-analyse/_rules.md +0 -142
  119. package/templates/skills/business-analyse/_suggestions.md +0 -34
  120. package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
  121. package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
  122. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
  123. package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
  124. package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
  125. package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
  126. package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
  127. package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
  128. package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
  129. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
  130. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -58
  131. package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
  132. package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
  133. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
  134. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
  135. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
  136. package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -366
  137. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
  138. package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
  139. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
  140. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
  141. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
  142. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
  143. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
  144. package/templates/skills/business-analyse/references/team-orchestration.md +0 -1093
  145. package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
  146. package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
  147. package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
  148. package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
  149. package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -486
  150. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -300
  151. package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -405
  152. package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -516
  153. package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -691
  154. package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
  155. package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
  156. package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
  157. package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
  158. package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -937
  159. package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
  160. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
@@ -0,0 +1,169 @@
1
+ # Module Acceptance Criteria (Shared Reference)
2
+
3
+ > **Loaded by:** step-03-specify (post-check), step-05-deploy (pre-handoff gate), ralph-loop step-01-task (input validation)
4
+ > **Purpose:** Define measurable, bash-verifiable acceptance criteria that a module MUST pass before being marked "specified".
5
+ > **Key principle:** These checks read the REAL JSON files on disk — NOT in-memory data the model "thinks" it wrote.
6
+
7
+ ---
8
+
9
+ ## Why Bash-Verifiable?
10
+
11
+ All previous checks were **pseudocode interpreted by the model**. The model can "decide" a check passes even when it fails (hallucination of validation). Bash checks are **objective** — they read the actual file and count real elements.
12
+
13
+ ---
14
+
15
+ ## Acceptance Criteria Table
16
+
17
+ | # | Criterion | Minimum | Field Path | Blocking | Category |
18
+ |---|-----------|---------|------------|----------|----------|
19
+ | AC-01 | Entities present | 2 | `analysis.entities[]` | YES | Data Model |
20
+ | AC-02 | Entity attributes have `type` field | ALL | `analysis.entities[].attributes[].type` | YES | Data Model |
21
+ | AC-03 | Use cases present | 2 | `specification.useCases[]` | YES | Requirements |
22
+ | AC-04 | Functional requirements present | 4 | `specification.functionalRequirements[]` | YES | Requirements |
23
+ | AC-05 | Wireframes present | 1 | `specification.uiWireframes[] \|\| specification.wireframes[]` | YES | UI |
24
+ | AC-06 | Wireframes >= sections | count match | wireframes.length >= sections.length | YES | UI |
25
+ | AC-07 | Wireframe content non-empty | ALL | `wireframe.mockup \|\| wireframe.ascii \|\| wireframe.content` | YES | UI |
26
+ | AC-08 | Sections present | 1 | `specification.sections[]` | YES | UI |
27
+ | AC-09 | SeedDataCore 9 arrays non-empty | 9/9 | `specification.seedDataCore.*` | YES | Seed Data |
28
+ | AC-10 | Gherkin scenarios is array | `Array.isArray` | `specification.gherkinScenarios` | YES | Format |
29
+ | AC-11 | API endpoints present | 1 | `specification.apiEndpoints[]` | YES | API |
30
+ | AC-12 | Messages present | 4 | `specification.messages[]` | YES | Messages |
31
+ | AC-13 | Validations present | 1 | `specification.validations[]` | YES | Validation |
32
+ | AC-14 | Wireframe field naming | canonical | `screen` not `title`, `mockup` not `ascii` | WARNING | Convention |
33
+ | AC-15 | Validation rules format | ALL array | `specification.validations[].rules` is `Array` | YES | Format |
34
+ | AC-16 | Messages have `message` field | ALL present | `specification.messages[].message` truthy | YES | Format |
35
+ | AC-17 | Gherkin content structure | ALL valid | Each element has `feature` (string) + `scenarios` (array) | YES | Format |
36
+
37
+ ---
38
+
39
+ ## Bash Verification Script (node -e)
40
+
41
+ > **Usage:** Called from step-03 post-check after writing module JSON files.
42
+ > Also callable standalone for debugging: `node -e "..." path/to/index.json`
43
+
44
+ ```bash
45
+ MODULE_JSON="{module_feature_json_path}"
46
+ node -e "
47
+ const fs = require('fs');
48
+ const data = JSON.parse(fs.readFileSync(process.argv[1], 'utf-8'));
49
+ const spec = data.specification || {};
50
+ const analysis = data.analysis || {};
51
+ const wf = spec.uiWireframes || spec.wireframes || [];
52
+ const sections = spec.sections || [];
53
+ const sdc = spec.seedDataCore || {};
54
+
55
+ const checks = [
56
+ ['AC-01: entities >= 2', (analysis.entities||[]).length, 2],
57
+ ['AC-03: useCases >= 2', (spec.useCases||[]).length, 2],
58
+ ['AC-04: FRs >= 4', (spec.functionalRequirements||[]).length, 4],
59
+ ['AC-05: wireframes >= 1', wf.length, 1],
60
+ ['AC-06: wireframes >= sections', wf.length, sections.length],
61
+ ['AC-08: sections >= 1', sections.length, 1],
62
+ ['AC-09: seedDataCore 9 arrays', Object.keys(sdc).filter(k => Array.isArray(sdc[k]) && sdc[k].length > 0).length, 9],
63
+ ['AC-10: gherkin is array', Array.isArray(spec.gherkinScenarios) ? 1 : 0, 1],
64
+ ['AC-11: apiEndpoints >= 1', (spec.apiEndpoints||[]).length, 1],
65
+ ['AC-12: messages >= 4', (spec.messages||[]).length, 4],
66
+ ['AC-13: validations >= 1', (spec.validations||[]).length, 1]
67
+ ];
68
+
69
+ const fails = [];
70
+ checks.forEach(c => {
71
+ if (c[1] < c[2]) {
72
+ fails.push(c);
73
+ console.error('FAIL: ' + c[0] + ' = ' + c[1] + ' (min: ' + c[2] + ')');
74
+ }
75
+ });
76
+
77
+ // AC-02: Entity attribute types
78
+ const badAttrs = (analysis.entities||[]).flatMap(e =>
79
+ (e.attributes||[]).filter(a => !a.type).map(a => e.name + '.' + a.name)
80
+ );
81
+ if (badAttrs.length > 0) {
82
+ fails.push(['AC-02: attr.type missing', badAttrs.length, 0]);
83
+ console.error('FAIL: AC-02: ' + badAttrs.length + ' attributes without type: ' + badAttrs.slice(0, 5).join(', ') + (badAttrs.length > 5 ? '...' : ''));
84
+ }
85
+
86
+ // AC-07: Wireframe content non-empty
87
+ const emptyWf = wf.filter(w => !w.mockup && !w.ascii && !w.content);
88
+ if (emptyWf.length > 0) {
89
+ fails.push(['AC-07: wireframe content empty', emptyWf.length, 0]);
90
+ console.error('FAIL: AC-07: ' + emptyWf.length + ' wireframes have EMPTY content');
91
+ }
92
+
93
+ // AC-14: Wireframe field naming (WARNING only)
94
+ const badFields = wf.filter(w => w.title || w.ascii || (w.name && !w.screen));
95
+ if (badFields.length > 0) {
96
+ console.warn('WARNING: AC-14: ' + badFields.length + ' wireframes use non-canonical field names (title/ascii/name)');
97
+ }
98
+
99
+ // AC-15: Validation rules format (rules must be array, not string)
100
+ const badRules = (spec.validations||[]).filter(v => v.rules && !Array.isArray(v.rules));
101
+ if (badRules.length > 0) {
102
+ fails.push(['AC-15: validations[].rules not array', badRules.length, 0]);
103
+ console.error('FAIL: AC-15: ' + badRules.length + ' validations have rules as string instead of array');
104
+ }
105
+
106
+ // AC-16: Messages must have 'message' field
107
+ const noMsg = (spec.messages||[]).filter(m => !m.message);
108
+ if (noMsg.length > 0) {
109
+ fails.push(['AC-16: messages[].message missing', noMsg.length, 0]);
110
+ console.error('FAIL: AC-16: ' + noMsg.length + ' messages missing "message" field');
111
+ }
112
+
113
+ // AC-17: Gherkin content structure (each element needs feature + scenarios[])
114
+ if (Array.isArray(spec.gherkinScenarios)) {
115
+ const badGherkin = spec.gherkinScenarios.filter(g => !g.feature || !Array.isArray(g.scenarios));
116
+ if (badGherkin.length > 0) {
117
+ fails.push(['AC-17: gherkin content invalid', badGherkin.length, 0]);
118
+ console.error('FAIL: AC-17: ' + badGherkin.length + ' gherkin entries missing feature or scenarios[]');
119
+ }
120
+ }
121
+
122
+ // Summary
123
+ if (fails.length > 0) {
124
+ console.error('\\nBLOCKING: ' + fails.length + ' acceptance criteria FAILED');
125
+ process.exit(1);
126
+ }
127
+ console.log('PASS: All acceptance criteria met (AC-01 to AC-17)');
128
+ " "$MODULE_JSON"
129
+ ```
130
+
131
+ ---
132
+
133
+ ## Integration Points
134
+
135
+ ### 1. step-03-specify.md (post-check)
136
+
137
+ After writing module JSON files, run the bash script above.
138
+ IF FAIL → re-execute section 11 write with corrected data → re-run until PASS.
139
+
140
+ ### 2. step-05-deploy.md (pre-handoff gate)
141
+
142
+ Before writing handoff for each module, run the bash script on the module index.json.
143
+ IF FAIL → STOP handoff for this module, report which criteria failed.
144
+
145
+ ### 3. ralph-loop step-01-task.md (input validation)
146
+
147
+ At PRD load time, run the bash script on each module index.json.
148
+ IF FAIL → BLOCKING: "Module {name} does not meet acceptance criteria — run /business-analyse to fix".
149
+ This prevents ralph-loop from generating code from incomplete specifications.
150
+
151
+ ---
152
+
153
+ ## Recovery Actions per Criterion
154
+
155
+ | Criterion | Recovery |
156
+ |-----------|----------|
157
+ | AC-01/02 | Re-run step-03 entity specification |
158
+ | AC-03/04 | Re-run step-03 use case / functional requirements |
159
+ | AC-05/06/07 | Re-run step-03 wireframe generation |
160
+ | AC-08 | Re-run step-03 section definition |
161
+ | AC-09 | Re-run step-03 seedDataCore transform |
162
+ | AC-10 | Auto-fix: wrap in array `[gherkinScenarios]` |
163
+ | AC-11 | Re-run step-03 API endpoints |
164
+ | AC-12 | Re-run step-03 messages |
165
+ | AC-13 | Re-run step-03 validations |
166
+ | AC-14 | Auto-fix: rename title→screen, ascii→mockup |
167
+ | AC-15 | Auto-fix: wrap string in array `[rules]` |
168
+ | AC-16 | Auto-fix: copy `description` → `message` |
169
+ | AC-17 | Re-run step-03 gherkin — ensure each entry has `feature` string + `scenarios` array |
@@ -0,0 +1,115 @@
1
+ # Entity-to-Domain File Mapping
2
+
3
+ > **Used by:** step-01-transform (section 6: Map Entity to Domain File)
4
+ > **Purpose:** Define the 1:1 mapping between BA entities and Domain layer files.
5
+
6
+ ---
7
+
8
+ ## Mapping Rules
9
+
10
+ Each entity identified during business analysis maps to exactly one file in the Domain layer. The mapping is deterministic based on entity type and module.
11
+
12
+ ### Entity -> Domain Entity File
13
+
14
+ ```
15
+ BA: analysis.entities[].name = "{EntityName}"
16
+ analysis.entities[].module = "{ModuleCode}"
17
+ metadata.application = "{AppName}"
18
+
19
+ Domain: src/SmartStack.{AppName}.Domain/{ModuleCode}/Entities/{EntityName}.cs
20
+ ```
21
+
22
+ **Example:**
23
+ ```
24
+ BA: analysis.entities[].name = "Employee"
25
+ module = "Employees"
26
+ application = "HumanResources"
27
+
28
+ Domain: src/SmartStack.HumanResources.Domain/Employees/Entities/Employee.cs
29
+ ```
30
+
31
+ ### ValueObject -> Domain ValueObject File
32
+
33
+ ```
34
+ BA: analysis.entities[].valueObjects[].name = "{VOName}"
35
+
36
+ Domain: src/SmartStack.{AppName}.Domain/{ModuleCode}/ValueObjects/{VOName}.cs
37
+ ```
38
+
39
+ **Example:**
40
+ ```
41
+ BA: valueObject.name = "Address"
42
+ module = "Employees"
43
+
44
+ Domain: src/SmartStack.HumanResources.Domain/Employees/ValueObjects/Address.cs
45
+ ```
46
+
47
+ ### Enum -> Domain Enum File
48
+
49
+ ```
50
+ BA: analysis.entities[].enums[].name = "{EnumName}"
51
+ OR attributes with type "enum" and enumValues[]
52
+
53
+ Domain: src/SmartStack.{AppName}.Domain/{ModuleCode}/Enums/{EnumName}.cs
54
+ ```
55
+
56
+ **Example:**
57
+ ```
58
+ BA: enum.name = "EmployeeStatus"
59
+ module = "Employees"
60
+
61
+ Domain: src/SmartStack.HumanResources.Domain/Employees/Enums/EmployeeStatus.cs
62
+ ```
63
+
64
+ ---
65
+
66
+ ## Path Pattern Summary
67
+
68
+ | BA Element | Domain File Path |
69
+ |------------|-----------------|
70
+ | Entity | `src/SmartStack.{App}.Domain/{Module}/Entities/{EntityName}.cs` |
71
+ | ValueObject | `src/SmartStack.{App}.Domain/{Module}/ValueObjects/{VOName}.cs` |
72
+ | Enum | `src/SmartStack.{App}.Domain/{Module}/Enums/{EnumName}.cs` |
73
+ | Domain Exception | `src/SmartStack.{App}.Domain/{Module}/Exceptions/{ExceptionName}.cs` |
74
+ | Domain Service | `src/SmartStack.{App}.Domain/{Module}/Services/{ServiceName}.cs` |
75
+
76
+ ---
77
+
78
+ ## Cross-Module Entity References
79
+
80
+ When an entity in module A references an entity in module B:
81
+ - The reference is by ID only (no direct entity dependency across modules)
82
+ - Navigation properties use the same `{App}.Domain/{Module}/Entities/` path
83
+ - Cross-module FK: `{OtherModuleEntity}Id` property + configuration in Infrastructure layer
84
+
85
+ ---
86
+
87
+ ## Integration with filesToCreate.domain
88
+
89
+ Each mapped entity becomes an entry in `handoff.filesToCreate.domain[]`:
90
+
91
+ ```json
92
+ {
93
+ "path": "src/SmartStack.HumanResources.Domain/Employees/Entities/Employee.cs",
94
+ "type": "Entity",
95
+ "module": "Employees",
96
+ "dependencies": []
97
+ }
98
+ ```
99
+
100
+ ValueObjects and Enums are also included:
101
+
102
+ ```json
103
+ {
104
+ "path": "src/SmartStack.HumanResources.Domain/Employees/ValueObjects/Address.cs",
105
+ "type": "ValueObject",
106
+ "module": "Employees",
107
+ "dependencies": []
108
+ },
109
+ {
110
+ "path": "src/SmartStack.HumanResources.Domain/Employees/Enums/EmployeeStatus.cs",
111
+ "type": "Enum",
112
+ "module": "Employees",
113
+ "dependencies": []
114
+ }
115
+ ```
@@ -1,120 +1,131 @@
1
- # Handoff File Templates (7 Categories)
2
-
3
- > **PATH HIERARCHY CONVENTION:** All backend file paths MUST include the application hierarchy.
4
- > - `{ApplicationName}` = `metadata.application` (e.g., `"HumanResources"`)
5
- > - `{ModuleName}` = `metadata.module` (e.g., `"Projects"`)
6
-
7
- ## 4.1 Domain Files
8
-
9
- From `analysis.entities[]`:
10
-
11
- ```json
12
- "domain": [
13
- { "path": "src/Domain/Entities/{ApplicationName}/{ModuleName}/{EntityName}.cs", "type": "Entity", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" }
14
- ]
15
- ```
16
-
17
- Include: Value objects, Enums (`src/Domain/Enums/...`), Domain exceptions (`src/Domain/Exceptions/...`)
18
-
19
- ## 4.2 Application Files
20
-
21
- From `analysis.useCases[]`:
22
-
23
- ```json
24
- "application": [
25
- { "path": "src/Application/Services/{ApplicationName}/{ModuleName}/{ServiceName}Service.cs", "type": "Service", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" },
26
- { "path": "src/Application/DTOs/{ApplicationName}/{ModuleName}/{DtoName}Dto.cs", "type": "Dto", "linkedUCs": [], "module": "{moduleCode}" },
27
- { "path": "src/Application/Validators/{ApplicationName}/{ModuleName}/{ValidatorName}Validator.cs", "type": "Validator", "linkedFRs": [], "module": "{moduleCode}" }
28
- ]
29
- ```
30
-
31
- Include: Service per UC cluster, DTOs for API contracts, Validators (FluentValidation), Query handlers
32
-
33
- ## 4.3 Infrastructure Files
34
-
35
- From `analysis.entities[]`:
36
-
37
- ```json
38
- "infrastructure": [
39
- { "path": "src/Infrastructure/Persistence/Configurations/{ApplicationName}/{ModuleName}/{EntityName}Configuration.cs", "type": "EFConfiguration", "linkedFRs": [], "module": "{moduleCode}" }
40
- ]
41
- ```
42
-
43
- Include: EF Core config per entity, DbSet in IExtensionsDbContext, DI registration, Specifications
44
-
45
- ## 4.4 API Files
46
-
47
- From `specification.apiEndpoints[]`:
48
-
49
- ```json
50
- "api": [
51
- { "path": "src/API/Controllers/{ApplicationName}/{EntityName}Controller.cs", "type": "ApiController", "linkedUCs": [], "linkedFRs": [], "module": "{moduleCode}" }
52
- ]
53
- ```
54
-
55
- Include: One controller per aggregate root, all HTTP methods, error handling
56
-
57
- ## 4.5 Frontend Files
58
-
59
- From `specification.uiWireframes[]`, `specification.dashboards[]` and `analysis.useCases[]`:
60
-
61
- > **WIREFRAME TRACEABILITY:** Every frontend file MUST include `linkedWireframes[]` referencing wireframe `screen` identifiers.
62
-
63
- ```json
64
- "frontend": [
65
- { "path": "src/pages/{ApplicationName}/{ModuleName}/{PageName}Page.tsx", "type": "Page", "linkedUCs": [], "linkedWireframes": ["{module}-list"], "module": "{moduleCode}", "wireframeAcceptanceCriteria": "Layout MUST match wireframe...", "skill": "/ui-components" },
66
- { "path": "src/pages/{ApplicationName}/{ModuleName}/{PageName}DetailPage.tsx", "type": "Page", "linkedUCs": [], "linkedWireframes": ["{module}-detail"], "module": "{moduleCode}", "skill": "/ui-components" },
67
- { "path": "src/pages/{ApplicationName}/{ModuleName}/{DashboardName}DashboardPage.tsx", "type": "DashboardPage", "linkedUCs": [], "linkedWireframes": ["{module}-dashboard"], "module": "{moduleCode}", "dashboardRef": "{module}-dashboard", "instructions": "Use Recharts library...", "skill": "/ui-components" },
68
- { "path": "src/components/{ModuleName}/{ComponentName}.tsx", "type": "Component", "linkedUCs": [], "linkedWireframes": [], "module": "{moduleCode}", "skill": "/ui-components" },
69
- { "path": "src/hooks/use{ModuleName}{Hook}.ts", "type": "Hook", "linkedUCs": [], "module": "{moduleCode}" },
70
- { "path": "src/i18n/locales/fr/{moduleLower}.json", "type": "I18n", "language": "fr", "module": "{moduleCode}" },
71
- { "path": "src/i18n/locales/en/{moduleLower}.json", "type": "I18n", "language": "en", "module": "{moduleCode}" },
72
- { "path": "src/i18n/locales/it/{moduleLower}.json", "type": "I18n", "language": "it", "module": "{moduleCode}" },
73
- { "path": "src/i18n/locales/de/{moduleLower}.json", "type": "I18n", "language": "de", "module": "{moduleCode}" }
74
- ]
75
- ```
76
-
77
- **Page generation:** ALL pages and components MUST be generated via `/ui-components` skill (entity lists, grids, tables, dashboards, charts). The `"skill"` field indicates which skill to invoke.
78
-
79
- **I18n generation:** 4 JSON files per module (fr, en, it, de) with identical key structures. `{moduleLower}` = lowercase module code. See `smartstack-frontend.md` for JSON template (keys: actions, labels, columns, form, errors, validation, messages, empty).
80
-
81
- **Dashboard acceptance criteria:** Chart library (Recharts), chart types matching spec, KPI cards, filters, CSS variables, responsive layout, wireframe-matching positions.
82
-
83
- ## 4.6 SeedData Files
84
-
85
- **OBLIGATORY: 2 app-level CORE + per module CORE (NavigationModule + NavigationSections + Permissions + Roles) + business per module:**
86
-
87
- ```json
88
- "seedData": [
89
- { "path": "src/Infrastructure/Persistence/Seeding/Data/NavigationApplicationSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationApplications", "module": "shared", "description": "Application-level navigation seed data. Created ONCE per application (FIRST). Provides ApplicationId for modules and roles." },
90
- { "path": "src/Infrastructure/Persistence/Seeding/Data/ApplicationRolesSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.rolePermissions", "module": "shared", "description": "Application-scoped role definitions (admin, manager, contributor, viewer). Created ONCE per application. Provides role entries for SeedRolesAsync()." },
91
- { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/NavigationModuleSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationModules", "module": "{moduleCode}" },
92
- { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/NavigationSectionSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationSections", "module": "{moduleCode}", "description": "MANDATORY when sections defined. Seeds section-level navigation entries (list, dashboard, etc.) with full absolute routes." },
93
- { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/PermissionsSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.permissions", "module": "{moduleCode}" },
94
- { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/RolesSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.rolePermissions", "module": "{moduleCode}" },
95
- { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/{Entity}SeedData.cs", "type": "SeedData", "category": "business", "source": "specification.seedDataBusiness.{module}", "module": "{moduleCode}" }
96
- ]
97
- ```
98
-
99
- **For client projects (ExtensionsDbContext), add MANDATORY infrastructure files:**
100
-
101
- ```json
102
- [
103
- { "path": "src/Infrastructure/Persistence/Seeding/{AppPascalName}SeedDataProvider.cs", "type": "IClientSeedDataProvider", "category": "infrastructure", "description": "Runtime provider that injects core seed data into Core schema" },
104
- { "path": "src/Infrastructure/Persistence/Seeding/DevDataSeeder.cs", "type": "DevDataSeeder", "category": "infrastructure" },
105
- { "path": "src/Infrastructure/Persistence/Seeding/Data/SeedConstants.cs", "type": "SeedConstants", "category": "infrastructure" }
106
- ]
107
- ```
108
-
109
- **Path convention:** All seed data under `Persistence/Seeding/Data/`. NEVER use `Data/SeedData/`.
110
-
111
- ## 4.7 Test Files
112
-
113
- ```json
114
- "tests": [
115
- { "path": "src/Tests/Unit/Domain/{ApplicationName}/{ModuleName}/{Entity}Tests.cs", "type": "UnitTests", "linkedFRs": [], "module": "{moduleCode}" },
116
- { "path": "src/Tests/Unit/Application/{ApplicationName}/{ModuleName}/{ServiceName}ServiceTests.cs", "type": "UnitTests", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" },
117
- { "path": "src/Tests/Integration/{ApplicationName}/{ModuleName}/{ApiControllerName}ControllerTests.cs", "type": "IntegrationTests", "linkedUCs": [], "module": "{moduleCode}" },
118
- { "path": "src/Tests/Security/{ApplicationName}/{ModuleName}/{ModuleName}SecurityTests.cs", "type": "SecurityTests", "linkedFRs": [], "module": "{moduleCode}" }
119
- ]
120
- ```
1
+ # Handoff File Templates (8 Categories)
2
+
3
+ > **PATH HIERARCHY CONVENTION:** All backend file paths MUST include the application hierarchy.
4
+ > - `{ApplicationName}` = `metadata.application` (e.g., `"HumanResources"`)
5
+ > - `{ModuleName}` = `metadata.module` (e.g., `"Projects"`)
6
+
7
+ ## 4.1 Domain Files
8
+
9
+ From `analysis.entities[]`:
10
+
11
+ ```json
12
+ "domain": [
13
+ { "path": "src/Domain/Entities/{ApplicationName}/{ModuleName}/{EntityName}.cs", "type": "Entity", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" }
14
+ ]
15
+ ```
16
+
17
+ Include: Value objects, Enums (`src/Domain/Enums/...`), Domain exceptions (`src/Domain/Exceptions/...`)
18
+
19
+ ## 4.2 Application Files
20
+
21
+ From `analysis.useCases[]`:
22
+
23
+ ```json
24
+ "application": [
25
+ { "path": "src/Application/Services/{ApplicationName}/{ModuleName}/{ServiceName}Service.cs", "type": "Service", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" },
26
+ { "path": "src/Application/DTOs/{ApplicationName}/{ModuleName}/{DtoName}Dto.cs", "type": "Dto", "linkedUCs": [], "module": "{moduleCode}" },
27
+ { "path": "src/Application/Validators/{ApplicationName}/{ModuleName}/{ValidatorName}Validator.cs", "type": "Validator", "linkedFRs": [], "module": "{moduleCode}" }
28
+ ]
29
+ ```
30
+
31
+ Include: Service per UC cluster, DTOs for API contracts, Validators (FluentValidation), Query handlers
32
+
33
+ ## 4.3 Infrastructure Files
34
+
35
+ From `analysis.entities[]`:
36
+
37
+ ```json
38
+ "infrastructure": [
39
+ { "path": "src/Infrastructure/Persistence/Configurations/{ApplicationName}/{ModuleName}/{EntityName}Configuration.cs", "type": "EFConfiguration", "linkedFRs": [], "module": "{moduleCode}" }
40
+ ]
41
+ ```
42
+
43
+ Include: EF Core config per entity, DbSet in IExtensionsDbContext, DI registration, Specifications
44
+
45
+ ## 4.4 API Files
46
+
47
+ From `specification.apiEndpoints[]`:
48
+
49
+ ```json
50
+ "api": [
51
+ { "path": "src/API/Controllers/{ApplicationName}/{EntityName}Controller.cs", "type": "ApiController", "linkedUCs": [], "linkedFRs": [], "module": "{moduleCode}" }
52
+ ]
53
+ ```
54
+
55
+ Include: One controller per aggregate root, all HTTP methods, error handling
56
+
57
+ ## 4.5 Frontend Files
58
+
59
+ From `specification.uiWireframes[]`, `specification.dashboards[]` and `analysis.useCases[]`:
60
+
61
+ > **WIREFRAME TRACEABILITY:** Every frontend file MUST include `linkedWireframes[]` referencing wireframe `screen` identifiers.
62
+
63
+ ```json
64
+ "frontend": [
65
+ { "path": "src/pages/{ApplicationName}/{ModuleName}/{PageName}Page.tsx", "type": "Page", "linkedUCs": [], "linkedWireframes": ["{module}-list"], "module": "{moduleCode}", "wireframeAcceptanceCriteria": "Layout MUST match wireframe...", "skill": "/ui-components" },
66
+ { "path": "src/pages/{ApplicationName}/{ModuleName}/{PageName}DetailPage.tsx", "type": "Page", "linkedUCs": [], "linkedWireframes": ["{module}-detail"], "module": "{moduleCode}", "skill": "/ui-components" },
67
+ { "path": "src/pages/{ApplicationName}/{ModuleName}/{DashboardName}DashboardPage.tsx", "type": "DashboardPage", "linkedUCs": [], "linkedWireframes": ["{module}-dashboard"], "module": "{moduleCode}", "dashboardRef": "{module}-dashboard", "instructions": "Use Recharts library...", "skill": "/ui-components" },
68
+ { "path": "src/components/{ModuleName}/{ComponentName}.tsx", "type": "Component", "linkedUCs": [], "linkedWireframes": [], "module": "{moduleCode}", "skill": "/ui-components" },
69
+ { "path": "src/hooks/use{ModuleName}{Hook}.ts", "type": "Hook", "linkedUCs": [], "module": "{moduleCode}" },
70
+ { "path": "src/i18n/locales/fr/{moduleLower}.json", "type": "I18n", "language": "fr", "module": "{moduleCode}" },
71
+ { "path": "src/i18n/locales/en/{moduleLower}.json", "type": "I18n", "language": "en", "module": "{moduleCode}" },
72
+ { "path": "src/i18n/locales/it/{moduleLower}.json", "type": "I18n", "language": "it", "module": "{moduleCode}" },
73
+ { "path": "src/i18n/locales/de/{moduleLower}.json", "type": "I18n", "language": "de", "module": "{moduleCode}" }
74
+ ]
75
+ ```
76
+
77
+ **Page generation:** ALL pages and components MUST be generated via `/ui-components` skill (entity lists, grids, tables, dashboards, charts). The `"skill"` field indicates which skill to invoke.
78
+
79
+ **I18n generation:** 4 JSON files per module (fr, en, it, de) with identical key structures. `{moduleLower}` = lowercase module code. See `smartstack-frontend.md` for JSON template (keys: actions, labels, columns, form, errors, validation, messages, empty).
80
+
81
+ **Dashboard acceptance criteria:** Chart library (Recharts), chart types matching spec, KPI cards, filters, CSS variables, responsive layout, wireframe-matching positions.
82
+
83
+ ## 4.6 SeedData Files
84
+
85
+ **OBLIGATORY: 2 app-level CORE + per module CORE (NavigationModule + NavigationSections + Permissions + Roles) + business per module:**
86
+
87
+ ```json
88
+ "seedData": [
89
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/NavigationApplicationSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationApplications", "module": "shared", "description": "Application-level navigation seed data. Created ONCE per application (FIRST). Provides ApplicationId for modules and roles." },
90
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/ApplicationRolesSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.rolePermissions", "module": "shared", "description": "Application-scoped role definitions (admin, manager, contributor, viewer). Created ONCE per application. Provides role entries for SeedRolesAsync()." },
91
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/NavigationModuleSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationModules", "module": "{moduleCode}" },
92
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/NavigationSectionSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.navigationSections", "module": "{moduleCode}", "description": "MANDATORY when sections defined. Seeds section-level navigation entries (list, dashboard, etc.) with full absolute routes." },
93
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/PermissionsSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.permissions", "module": "{moduleCode}" },
94
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/RolesSeedData.cs", "type": "SeedData", "category": "core", "source": "specification.seedDataCore.rolePermissions", "module": "{moduleCode}" },
95
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/{ModuleName}/{Entity}SeedData.cs", "type": "SeedData", "category": "business", "source": "specification.seedDataBusiness.{module}", "module": "{moduleCode}" }
96
+ ]
97
+ ```
98
+
99
+ **For client projects (ExtensionsDbContext), add MANDATORY infrastructure files:**
100
+
101
+ ```json
102
+ [
103
+ { "path": "src/Infrastructure/Persistence/Seeding/{AppPascalName}SeedDataProvider.cs", "type": "IClientSeedDataProvider", "category": "infrastructure", "description": "Runtime provider that injects core seed data into Core schema" },
104
+ { "path": "src/Infrastructure/Persistence/Seeding/DevDataSeeder.cs", "type": "DevDataSeeder", "category": "infrastructure" },
105
+ { "path": "src/Infrastructure/Persistence/Seeding/Data/SeedConstants.cs", "type": "SeedConstants", "category": "infrastructure" }
106
+ ]
107
+ ```
108
+
109
+ **Path convention:** All seed data under `Persistence/Seeding/Data/`. NEVER use `Data/SeedData/`.
110
+
111
+ ## 4.7 Test Files
112
+
113
+ ```json
114
+ "tests": [
115
+ { "path": "src/Tests/Unit/Domain/{ApplicationName}/{ModuleName}/{Entity}Tests.cs", "type": "UnitTests", "linkedFRs": [], "module": "{moduleCode}" },
116
+ { "path": "src/Tests/Unit/Application/{ApplicationName}/{ModuleName}/{ServiceName}ServiceTests.cs", "type": "UnitTests", "linkedFRs": [], "linkedUCs": [], "module": "{moduleCode}" },
117
+ { "path": "src/Tests/Integration/{ApplicationName}/{ModuleName}/{ApiControllerName}ControllerTests.cs", "type": "IntegrationTests", "linkedUCs": [], "module": "{moduleCode}" },
118
+ { "path": "src/Tests/Security/{ApplicationName}/{ModuleName}/{ModuleName}SecurityTests.cs", "type": "SecurityTests", "linkedFRs": [], "module": "{moduleCode}" }
119
+ ]
120
+ ```
121
+
122
+ ## 4.8 Documentation Files
123
+
124
+ ```json
125
+ "documentation": [
126
+ { "path": "src/docs/{ModuleName}/doc-data.ts", "type": "DocData", "module": "{moduleCode}", "description": "Documentation data export for /documentation skill" }
127
+ ]
128
+ ```
129
+
130
+ Include: Technical documentation data, API specification files, user guides.
131
+ This category can be an empty array `[]` if no documentation is planned at this stage. It will be populated by the `/documentation` skill after `/ralph-loop` completes.