@atlashub/smartstack-cli 1.13.2 → 1.14.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 (210) hide show
  1. package/.documentation/agents.html +1 -1
  2. package/.documentation/apex.html +1 -1
  3. package/.documentation/business-analyse.html +1 -1
  4. package/.documentation/cli-commands.html +3 -3
  5. package/.documentation/commands.html +1 -1
  6. package/.documentation/efcore.html +1 -1
  7. package/.documentation/gitflow.html +1 -1
  8. package/.documentation/hooks.html +1 -1
  9. package/.documentation/index.html +1 -1
  10. package/.documentation/init.html +3 -3
  11. package/.documentation/installation.html +1001 -352
  12. package/.documentation/ralph-loop.html +1 -1
  13. package/.documentation/test-web.html +1 -1
  14. package/README.md +88 -20
  15. package/dist/index.js +276 -85
  16. package/dist/index.js.map +1 -1
  17. package/package.json +1 -1
  18. package/templates/agents/code-reviewer.md +163 -0
  19. package/templates/agents/efcore/db-deploy.md +25 -7
  20. package/templates/agents/efcore/db-reset.md +31 -10
  21. package/templates/agents/efcore/db-status.md +22 -5
  22. package/templates/agents/efcore/migration.md +69 -19
  23. package/templates/agents/gitflow/cleanup.md +8 -1
  24. package/templates/agents/gitflow/commit.md +7 -5
  25. package/templates/agents/gitflow/finish.md +6 -4
  26. package/templates/agents/gitflow/pr.md +8 -1
  27. package/templates/agents/gitflow/start.md +1 -1
  28. package/templates/commands/check-version.md +267 -0
  29. package/templates/commands/efcore/_shared.md +30 -1
  30. package/templates/commands/efcore/db-reset.md +18 -6
  31. package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -0
  32. package/templates/commands/refactor.md +164 -0
  33. package/templates/project/DependencyInjection.Application.cs.template +25 -0
  34. package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
  35. package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
  36. package/templates/project/ExampleEntity.cs.template +116 -0
  37. package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
  38. package/templates/project/ExampleService.cs.template +146 -0
  39. package/templates/project/ExtensionsDbContext.cs.template +41 -0
  40. package/templates/project/IExtensionsDbContext.cs.template +22 -0
  41. package/templates/project/Program.cs.template +47 -0
  42. package/templates/project/README.md +79 -0
  43. package/templates/ralph/README.md +10 -8
  44. package/templates/ralph/ralph.config.yaml +2 -2
  45. package/templates/skills/_shared.md +44 -44
  46. package/templates/skills/ai-prompt/SKILL.md +55 -55
  47. package/templates/skills/apex/SKILL.md +235 -0
  48. package/templates/skills/apex/steps/step-00-init.md +203 -0
  49. package/templates/skills/apex/steps/step-01-analyze.md +210 -0
  50. package/templates/skills/apex/steps/step-02-plan.md +217 -0
  51. package/templates/skills/apex/steps/step-03-execute.md +178 -0
  52. package/templates/skills/apex/steps/step-04-validate.md +217 -0
  53. package/templates/skills/apex/steps/step-05-examine.md +207 -0
  54. package/templates/skills/apex/steps/step-06-resolve.md +181 -0
  55. package/templates/skills/apex/steps/step-07-tests.md +206 -0
  56. package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
  57. package/templates/skills/apex/templates/00-context.md +46 -0
  58. package/templates/skills/apex/templates/01-analyze.md +63 -0
  59. package/templates/skills/apex/templates/02-plan.md +63 -0
  60. package/templates/skills/apex/templates/03-execute.md +34 -0
  61. package/templates/skills/apex/templates/04-validate.md +61 -0
  62. package/templates/skills/apex/templates/05-examine.md +58 -0
  63. package/templates/skills/apex/templates/06-resolve.md +39 -0
  64. package/templates/skills/apex/templates/07-tests.md +56 -0
  65. package/templates/skills/apex/templates/08-run-tests.md +41 -0
  66. package/templates/skills/apex/templates/README.md +69 -0
  67. package/templates/skills/application/SKILL.md +50 -50
  68. package/templates/skills/application/templates-backend.md +25 -25
  69. package/templates/skills/application/templates-frontend.md +43 -43
  70. package/templates/skills/application/templates-i18n.md +29 -29
  71. package/templates/skills/application/templates-seed.md +77 -77
  72. package/templates/skills/business-analyse/SKILL.md +223 -0
  73. package/templates/skills/business-analyse/_shared.md +258 -0
  74. package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
  75. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
  76. package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
  77. package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
  78. package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
  79. package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
  80. package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
  81. package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
  82. package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
  83. package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
  84. package/templates/skills/business-analyse/questionnaire.md +177 -177
  85. package/templates/skills/business-analyse/react/components.md +340 -0
  86. package/templates/skills/business-analyse/react/i18n-template.md +245 -0
  87. package/templates/skills/business-analyse/react/schema.md +151 -0
  88. package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
  89. package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
  90. package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
  91. package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
  92. package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
  93. package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
  94. package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
  95. package/templates/skills/business-analyse/templates/00-context.md +105 -0
  96. package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
  97. package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
  98. package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
  99. package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
  100. package/templates/skills/business-analyse/templates-frd.md +217 -217
  101. package/templates/skills/business-analyse/templates-react.md +26 -26
  102. package/templates/skills/controller/SKILL.md +141 -92
  103. package/templates/skills/controller/postman-templates.md +15 -15
  104. package/templates/skills/controller/steps/step-00-init.md +191 -0
  105. package/templates/skills/controller/steps/step-01-analyze.md +146 -0
  106. package/templates/skills/controller/steps/step-02-plan.md +176 -0
  107. package/templates/skills/controller/steps/step-03-generate.md +219 -0
  108. package/templates/skills/controller/steps/step-04-perms.md +219 -0
  109. package/templates/skills/controller/steps/step-05-validate.md +107 -0
  110. package/templates/skills/controller/templates.md +77 -77
  111. package/templates/skills/documentation/SKILL.md +79 -79
  112. package/templates/skills/feature-full/SKILL.md +38 -38
  113. package/templates/skills/gitflow/SKILL.md +277 -0
  114. package/templates/{commands → skills}/gitflow/_shared.md +20 -20
  115. package/templates/skills/gitflow/phases/abort.md +173 -0
  116. package/templates/skills/gitflow/phases/cleanup.md +226 -0
  117. package/templates/skills/gitflow/phases/status.md +178 -0
  118. package/templates/skills/gitflow/steps/step-commit.md +255 -0
  119. package/templates/skills/gitflow/steps/step-finish.md +255 -0
  120. package/templates/skills/gitflow/steps/step-init.md +209 -0
  121. package/templates/skills/gitflow/steps/step-merge.md +225 -0
  122. package/templates/skills/gitflow/steps/step-plan.md +208 -0
  123. package/templates/skills/gitflow/steps/step-pr.md +235 -0
  124. package/templates/skills/gitflow/steps/step-start.md +234 -0
  125. package/templates/skills/gitflow/steps/step-sync.md +200 -0
  126. package/templates/skills/gitflow/templates/config.json +53 -0
  127. package/templates/skills/notification/SKILL.md +51 -51
  128. package/templates/skills/ralph-loop/SKILL.md +228 -0
  129. package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
  130. package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
  131. package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
  132. package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
  133. package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
  134. package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
  135. package/templates/skills/review-code/SKILL.md +219 -0
  136. package/templates/skills/review-code/references/clean-code-principles.md +140 -0
  137. package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
  138. package/templates/skills/review-code/references/feedback-patterns.md +149 -0
  139. package/templates/skills/review-code/references/security-checklist.md +127 -0
  140. package/templates/skills/ui-components/SKILL.md +54 -54
  141. package/templates/skills/workflow/SKILL.md +46 -46
  142. package/templates/commands/ai-prompt.md +0 -315
  143. package/templates/commands/apex/1-analyze.md +0 -100
  144. package/templates/commands/apex/2-plan.md +0 -145
  145. package/templates/commands/apex/3-execute.md +0 -171
  146. package/templates/commands/apex/4-examine.md +0 -116
  147. package/templates/commands/apex/5-tasks.md +0 -209
  148. package/templates/commands/apex.md +0 -76
  149. package/templates/commands/application/create.md +0 -362
  150. package/templates/commands/application/templates-backend.md +0 -463
  151. package/templates/commands/application/templates-frontend.md +0 -517
  152. package/templates/commands/application/templates-i18n.md +0 -478
  153. package/templates/commands/application/templates-seed.md +0 -362
  154. package/templates/commands/application.md +0 -303
  155. package/templates/commands/business-analyse/0-orchestrate.md +0 -156
  156. package/templates/commands/business-analyse/1-init.md +0 -99
  157. package/templates/commands/business-analyse/2-discover.md +0 -143
  158. package/templates/commands/business-analyse/3-analyse.md +0 -106
  159. package/templates/commands/business-analyse/4-specify.md +0 -133
  160. package/templates/commands/business-analyse/5-validate.md +0 -132
  161. package/templates/commands/business-analyse/6-handoff.md +0 -157
  162. package/templates/commands/business-analyse/7-doc-html.md +0 -103
  163. package/templates/commands/business-analyse/_shared.md +0 -176
  164. package/templates/commands/business-analyse/bug.md +0 -118
  165. package/templates/commands/business-analyse/change-request.md +0 -144
  166. package/templates/commands/business-analyse/hotfix.md +0 -116
  167. package/templates/commands/business-analyse.md +0 -121
  168. package/templates/commands/controller/create.md +0 -216
  169. package/templates/commands/controller/postman-templates.md +0 -528
  170. package/templates/commands/controller/templates.md +0 -600
  171. package/templates/commands/controller.md +0 -337
  172. package/templates/commands/create/agent.md +0 -138
  173. package/templates/commands/create/command.md +0 -166
  174. package/templates/commands/create/hook.md +0 -234
  175. package/templates/commands/create/plugin.md +0 -329
  176. package/templates/commands/create/project.md +0 -508
  177. package/templates/commands/create/skill.md +0 -199
  178. package/templates/commands/create.md +0 -220
  179. package/templates/commands/documentation/module.md +0 -202
  180. package/templates/commands/documentation/templates.md +0 -432
  181. package/templates/commands/documentation.md +0 -190
  182. package/templates/commands/epct.md +0 -69
  183. package/templates/commands/explain.md +0 -186
  184. package/templates/commands/feature-full.md +0 -267
  185. package/templates/commands/gitflow/1-init.md +0 -188
  186. package/templates/commands/gitflow/10-start.md +0 -190
  187. package/templates/commands/gitflow/11-finish.md +0 -382
  188. package/templates/commands/gitflow/12-cleanup.md +0 -103
  189. package/templates/commands/gitflow/13-sync.md +0 -216
  190. package/templates/commands/gitflow/14-rebase.md +0 -251
  191. package/templates/commands/gitflow/2-status.md +0 -122
  192. package/templates/commands/gitflow/3-commit.md +0 -209
  193. package/templates/commands/gitflow/4-plan.md +0 -174
  194. package/templates/commands/gitflow/5-exec.md +0 -202
  195. package/templates/commands/gitflow/6-abort.md +0 -121
  196. package/templates/commands/gitflow/7-pull-request.md +0 -176
  197. package/templates/commands/gitflow/8-review.md +0 -113
  198. package/templates/commands/gitflow/9-merge.md +0 -157
  199. package/templates/commands/gitflow.md +0 -128
  200. package/templates/commands/implement.md +0 -663
  201. package/templates/commands/init.md +0 -567
  202. package/templates/commands/mcp-integration.md +0 -330
  203. package/templates/commands/notification.md +0 -129
  204. package/templates/commands/oneshot.md +0 -57
  205. package/templates/commands/quickstart.md +0 -154
  206. package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
  207. package/templates/commands/ralph-loop/help.md +0 -126
  208. package/templates/commands/ralph-loop/ralph-loop.md +0 -120
  209. package/templates/commands/review.md +0 -106
  210. package/templates/commands/workflow.md +0 -193
@@ -0,0 +1,239 @@
1
+ ---
2
+ name: step-04-validate
3
+ description: Validation gate - APPROVED or REJECTED decision
4
+ model: haiku
5
+ prev_step: steps/step-03-specify.md
6
+ next_step: steps/step-05-handoff.md
7
+ ---
8
+
9
+ <objective>
10
+ Validate that all specifications are complete and consistent.
11
+ Gate decision: APPROVED or REJECTED with reasons.
12
+ </objective>
13
+
14
+ ## EXECUTION SEQUENCE
15
+
16
+ ### 1. Read Current State
17
+
18
+ Read `{output_dir}/00-context.md` for state variables.
19
+ Read all previous outputs:
20
+ - `1-discovery.md`
21
+ - `2-business-requirements.md`
22
+ - `3-functional-specification.md`
23
+
24
+ Update progress: `04-validate` -> "In Progress"
25
+
26
+ ---
27
+
28
+ ### 2. Completeness Checklist
29
+
30
+ **Discovery validation:**
31
+ - [ ] Business problem clearly defined
32
+ - [ ] All stakeholders identified
33
+ - [ ] Scope (In/Out) explicit
34
+ - [ ] Acceptance criteria defined
35
+ - [ ] No critical open questions
36
+
37
+ **BRD validation:**
38
+ - [ ] All business objectives measurable
39
+ - [ ] All business rules have BR-ID
40
+ - [ ] Rules are testable (conditions + examples)
41
+ - [ ] Process flow documented
42
+ - [ ] Data entities complete
43
+
44
+ **FRD validation:**
45
+ - [ ] All UC have permission mapping
46
+ - [ ] All FR trace to BR
47
+ - [ ] Permission matrix complete
48
+ - [ ] UI wireframes provided
49
+ - [ ] Gherkin scenarios cover happy path + errors
50
+ - [ ] i18n keys defined for messages
51
+
52
+ ---
53
+
54
+ ### 3. Consistency Checks
55
+
56
+ **Cross-reference validation:**
57
+
58
+ | Check | Source | Target | Status |
59
+ |-------|--------|--------|--------|
60
+ | BR -> FR | 2-brd.md | 3-frd.md | {OK/FAIL} |
61
+ | AC -> UC | 1-discovery.md | 3-frd.md | {OK/FAIL} |
62
+ | Stakeholder -> Actor | 1-discovery.md | 3-frd.md | {OK/FAIL} |
63
+ | Entity -> Endpoint | 2-brd.md | 3-frd.md | {OK/FAIL} |
64
+
65
+ **Identify gaps:**
66
+ - BR without FR coverage
67
+ - AC without UC coverage
68
+ - Endpoints without permissions
69
+
70
+ ---
71
+
72
+ ### 4. SmartStack Convention Validation
73
+
74
+ **Permission path format:**
75
+ ```
76
+ VALID: business.{app}.{module}.{action}
77
+ INVALID: business.{app}.{action}
78
+ INVALID: {app}.{module}.{action}
79
+ ```
80
+
81
+ **NavRoute compliance:**
82
+ - Controller route must match: `business.{app}.{module}`
83
+ - Permissions must use same base path
84
+
85
+ **Entity naming:**
86
+ - PascalCase for entity names
87
+ - Matches module naming convention
88
+
89
+ ---
90
+
91
+ ### 5. Risk Assessment
92
+
93
+ | Risk | Severity | Mitigation |
94
+ |------|----------|------------|
95
+ | {identified risk} | High/Medium/Low | {mitigation strategy} |
96
+
97
+ **Common risks to check:**
98
+ - [ ] Missing error handling for integrations
99
+ - [ ] Performance concerns for large datasets
100
+ - [ ] Security gaps in permission model
101
+ - [ ] Complex workflow without clear rollback
102
+
103
+ ---
104
+
105
+ ### 6. Make Decision
106
+
107
+ **APPROVED if:**
108
+ - All completeness checks pass (100%)
109
+ - All consistency checks pass
110
+ - No HIGH severity risks unmitigated
111
+ - SmartStack conventions respected
112
+
113
+ **REJECTED if:**
114
+ - Any critical completeness check fails
115
+ - Consistency gap found
116
+ - HIGH severity risk without mitigation
117
+ - Convention violations
118
+
119
+ ---
120
+
121
+ ### 7. Generate Validation Report
122
+
123
+ ```json
124
+ {
125
+ "featureId": "{feature_id}",
126
+ "validatedAt": "{timestamp}",
127
+ "validatedBy": "Business Analyst (Claude)",
128
+ "decision": "APPROVED" | "REJECTED",
129
+ "completeness": {
130
+ "discovery": {
131
+ "score": "5/5",
132
+ "issues": []
133
+ },
134
+ "brd": {
135
+ "score": "5/5",
136
+ "issues": []
137
+ },
138
+ "frd": {
139
+ "score": "6/6",
140
+ "issues": []
141
+ }
142
+ },
143
+ "consistency": {
144
+ "brToFr": "OK",
145
+ "acToUc": "OK",
146
+ "stakeholderToActor": "OK",
147
+ "entityToEndpoint": "OK"
148
+ },
149
+ "conventions": {
150
+ "permissions": "OK",
151
+ "navRoute": "OK",
152
+ "naming": "OK"
153
+ },
154
+ "risks": [
155
+ {
156
+ "risk": "{description}",
157
+ "severity": "Medium",
158
+ "mitigation": "{strategy}",
159
+ "status": "Mitigated"
160
+ }
161
+ ],
162
+ "summary": "{Overall assessment}",
163
+ "nextStep": "step-05-handoff" | "Revision required"
164
+ }
165
+ ```
166
+
167
+ ---
168
+
169
+ ### 8. Save Output
170
+
171
+ Write to: `{output_dir}/validation.json`
172
+
173
+ Update `00-context.md`:
174
+ - Progress: `04-validate` -> "Complete"
175
+ - Add validation status
176
+
177
+ ---
178
+
179
+ ### 9. Handle Decision
180
+
181
+ **If APPROVED:**
182
+
183
+ Display:
184
+ ```
185
+ VALIDATION - {feature_id}
186
+ ├── Status: APPROVED
187
+ ├── Completeness: 100%
188
+ ├── Consistency: All checks passed
189
+ ├── Conventions: SmartStack compliant
190
+ ├── Risks: {count} mitigated
191
+ ├── Output: {output_dir}/validation.json
192
+ └── Next: step-05-handoff (Development prompt)
193
+ ```
194
+
195
+ Load next step: `steps/step-05-handoff.md`
196
+
197
+ **If REJECTED:**
198
+
199
+ Display:
200
+ ```
201
+ VALIDATION - {feature_id}
202
+ ├── Status: REJECTED
203
+ ├── Issues found:
204
+ │ ├── {issue 1}
205
+ │ ├── {issue 2}
206
+ │ └── {issue 3}
207
+ ├── Required actions:
208
+ │ ├── {action 1}
209
+ │ └── {action 2}
210
+ └── Next: Revise specifications
211
+ ```
212
+
213
+ **Ask user:**
214
+ ```json
215
+ {
216
+ "questions": [
217
+ {
218
+ "question": "How would you like to proceed?",
219
+ "header": "Action",
220
+ "options": [
221
+ {"label": "Auto-revise", "description": "Claude fixes the identified issues"},
222
+ {"label": "Manual revision", "description": "You fix and relaunch validation"},
223
+ {"label": "Force approval", "description": "Continue despite issues (not recommended)"}
224
+ ],
225
+ "multiSelect": false
226
+ }
227
+ ]
228
+ }
229
+ ```
230
+
231
+ ---
232
+
233
+ ## OUTPUT
234
+
235
+ This step produces:
236
+ - `{output_dir}/validation.json` (created)
237
+ - `{output_dir}/00-context.md` (updated)
238
+
239
+ Gate decision enables or blocks next step.
@@ -0,0 +1,336 @@
1
+ ---
2
+ name: step-05-handoff
3
+ description: Handoff phase - Generate autonomous development prompt
4
+ model: opus
5
+ prev_step: steps/step-04-validate.md
6
+ next_step: steps/step-06-doc-html.md
7
+ ---
8
+
9
+ <objective>
10
+ Generate a complete, autonomous development prompt for `/implement`.
11
+ The handoff must be zero-ambiguity: a developer (or Claude) can implement without questions.
12
+ </objective>
13
+
14
+ <ultrathink>
15
+ ULTRATHINK MODE - Handoff Generation:
16
+ - Every implementation detail must be explicit
17
+ - File paths must be exact
18
+ - Patterns must reference existing code
19
+ - No assumptions about "obvious" behavior
20
+ </ultrathink>
21
+
22
+ ## EXECUTION SEQUENCE
23
+
24
+ ### 1. Read Current State
25
+
26
+ Read `{output_dir}/00-context.md` for state variables.
27
+ Read validation: `{output_dir}/validation.json`
28
+ Read specs: `{output_dir}/3-functional-specification.md`
29
+
30
+ Update progress: `05-handoff` -> "In Progress"
31
+
32
+ ---
33
+
34
+ ### 2. Verify Validation Passed
35
+
36
+ ```
37
+ IF validation.decision != "APPROVED" THEN
38
+ DISPLAY ERROR: "Validation must pass before handoff"
39
+ EXIT to step-04-validate
40
+ END IF
41
+ ```
42
+
43
+ ---
44
+
45
+ ### 3. Load Handoff Template
46
+
47
+ ```
48
+ Read: templates/frd-handoff.md # ~100 lines
49
+ ```
50
+
51
+ ---
52
+
53
+ ### 4. Explore Existing Patterns
54
+
55
+ **CRITICAL: Handoff must reference ACTUAL code patterns!**
56
+
57
+ If `{economy_mode}` = false, launch parallel agents:
58
+
59
+ ```
60
+ Agent 1: Backend patterns
61
+ "Explore src/SmartStack.Domain/Entities/ and
62
+ src/SmartStack.Application/Features/ to document:
63
+ - Entity naming pattern
64
+ - CQRS handler pattern
65
+ - Validation pattern
66
+ - Repository pattern"
67
+
68
+ Agent 2: Frontend patterns
69
+ "Explore web/smartstack-web/src/pages/business/ to document:
70
+ - Page component structure
71
+ - API service pattern
72
+ - i18n usage pattern
73
+ - Form handling pattern"
74
+
75
+ Agent 3: Infrastructure patterns
76
+ "Explore src/SmartStack.Infrastructure/ to document:
77
+ - EF Core configuration pattern
78
+ - DbContext registration
79
+ - Migration naming convention"
80
+ ```
81
+
82
+ If `{economy_mode}` = true:
83
+ - Use Glob/Grep to find similar modules
84
+ - Read 2-3 reference files directly
85
+
86
+ ---
87
+
88
+ ### 5. Map Specifications to Files
89
+
90
+ **Backend files to create:**
91
+
92
+ | Layer | File | Template/Pattern |
93
+ |-------|------|------------------|
94
+ | Domain | `src/SmartStack.Domain/Entities/Business/{Entity}.cs` | Standard entity |
95
+ | Application | `src/SmartStack.Application/Features/{Module}/Commands/` | CQRS pattern |
96
+ | Application | `src/SmartStack.Application/Features/{Module}/Queries/` | CQRS pattern |
97
+ | Application | `src/SmartStack.Application/Features/{Module}/DTOs/` | Request/Response DTOs |
98
+ | Application | `src/SmartStack.Application/Features/{Module}/Validators/` | FluentValidation |
99
+ | Infrastructure | `src/SmartStack.Infrastructure/Persistence/Configurations/` | EF Core config |
100
+ | API | `src/SmartStack.Api/Controllers/Business/{Module}Controller.cs` | NavRoute controller |
101
+
102
+ **Frontend files to create:**
103
+
104
+ | Layer | File | Pattern |
105
+ |-------|------|---------|
106
+ | Pages | `web/smartstack-web/src/pages/business/{app}/{module}/` | Page components |
107
+ | Services | `web/smartstack-web/src/services/api/{module}Api.ts` | Axios service |
108
+ | i18n | `web/smartstack-web/src/i18n/locales/{lang}/{module}.json` | 4 languages |
109
+
110
+ ---
111
+
112
+ ### 6. Generate Implementation Instructions
113
+
114
+ For each file, provide explicit instructions:
115
+
116
+ ```markdown
117
+ ### Backend: {Entity}.cs
118
+
119
+ **Path:** `src/SmartStack.Domain/Entities/Business/{Entity}.cs`
120
+
121
+ **Reference:** Copy pattern from `src/SmartStack.Domain/Entities/Business/[ExistingEntity].cs`
122
+
123
+ **Properties to add:**
124
+ | Property | Type | Attributes | From BR |
125
+ |----------|------|------------|---------|
126
+ | Id | Guid | [Key] | - |
127
+ | {attr1} | string | [Required, MaxLength(100)] | BR-001 |
128
+ | {attr2} | decimal | [Precision(18,2)] | BR-002 |
129
+ | TenantId | Guid | [Required] | Multi-tenant |
130
+ | CreatedAt | DateTime | Audit | - |
131
+ | UpdatedAt | DateTime | Audit | - |
132
+
133
+ **Business rules to implement:**
134
+ - BR-001: {rule} -> Implement in Validator
135
+ - BR-002: {rule} -> Implement in Entity method
136
+ ```
137
+
138
+ ---
139
+
140
+ ### 7. Map Business Rules to Code
141
+
142
+ | BR-ID | Rule | Implementation Location | Code Pattern |
143
+ |-------|------|------------------------|--------------|
144
+ | BR-001 | {rule} | `{Entity}Validator.cs` | `.RuleFor(x => x.Field).NotEmpty()` |
145
+ | BR-002 | {rule} | `{Entity}.cs` method | `public bool CanXXX() { ... }` |
146
+ | BR-003 | {rule} | `{Handler}.cs` | `if (!entity.CanXXX()) throw` |
147
+
148
+ ---
149
+
150
+ ### 8. Define API Endpoints
151
+
152
+ | Endpoint | Method | Handler | Permission | Request DTO | Response DTO |
153
+ |----------|--------|---------|------------|-------------|--------------|
154
+ | `/api/business/{module}` | GET | `GetAll{Entity}Query` | `.read` | - | `{Entity}ListResponse` |
155
+ | `/api/business/{module}` | POST | `Create{Entity}Command` | `.create` | `Create{Entity}Request` | `{Entity}Response` |
156
+ | `/api/business/{module}/{id}` | GET | `Get{Entity}ByIdQuery` | `.read` | - | `{Entity}Response` |
157
+ | `/api/business/{module}/{id}` | PUT | `Update{Entity}Command` | `.update` | `Update{Entity}Request` | `{Entity}Response` |
158
+ | `/api/business/{module}/{id}` | DELETE | `Delete{Entity}Command` | `.delete` | - | `204` |
159
+
160
+ ---
161
+
162
+ ### 9. Generate Test Requirements
163
+
164
+ **Unit tests:**
165
+ - [ ] `{Entity}ValidatorTests.cs` - Validation rules
166
+ - [ ] `{Entity}Tests.cs` - Entity methods
167
+
168
+ **Integration tests:**
169
+ - [ ] `{Module}ControllerTests.cs` - All endpoints
170
+ - [ ] Permission tests - 403 for unauthorized
171
+ - [ ] Validation tests - 400 for invalid data
172
+
173
+ **Gherkin reference:** Copy scenarios from FRD section 7
174
+
175
+ ---
176
+
177
+ ### 10. Generate i18n Keys
178
+
179
+ **Keys to create:**
180
+
181
+ ```json
182
+ {
183
+ "{module}": {
184
+ "title": "{Module display name}",
185
+ "fields": {
186
+ "{field1}": "{Label}",
187
+ "{field2}": "{Label}"
188
+ },
189
+ "messages": {
190
+ "created": "{Entity} created successfully",
191
+ "updated": "{Entity} updated successfully",
192
+ "deleted": "{Entity} deleted successfully"
193
+ },
194
+ "errors": {
195
+ "{field1}Required": "{Field1} is required",
196
+ "notFound": "{Entity} not found",
197
+ "permissionDenied": "You don't have permission to perform this action"
198
+ },
199
+ "buttons": {
200
+ "create": "Create {Entity}",
201
+ "edit": "Edit",
202
+ "delete": "Delete",
203
+ "save": "Save",
204
+ "cancel": "Cancel"
205
+ }
206
+ }
207
+ }
208
+ ```
209
+
210
+ ---
211
+
212
+ ### 11. Compile Handoff Document
213
+
214
+ ```markdown
215
+ # Development Handoff - {feature_id} {feature_description}
216
+
217
+ > **Module:** business/{application_name}/{module_name}
218
+ > **Version:** 1.0
219
+ > **Validated Specs:** FRD v1.0 (validation.json: APPROVED)
220
+ > **Implementation:** `/implement {feature_id}`
221
+
222
+ ## DEVELOPER INSTRUCTIONS
223
+
224
+ This document is a standalone prompt for Claude Code. Execute:
225
+ ```
226
+ /implement {feature_id}
227
+ ```
228
+
229
+ ---
230
+
231
+ ## 1. QUICK CONTEXT
232
+
233
+ | Attribute | Value |
234
+ |-----------|-------|
235
+ | Feature ID | {feature_id} |
236
+ | Module | business/{application_name}/{module_name} |
237
+ | Permission base | `business.{app}.{module}` |
238
+ | Complexity | {Simple/Medium/Complex} |
239
+ | Entities | {entity count} |
240
+ | Endpoints | {endpoint count} |
241
+
242
+ ## 2. [EXPLORE] EXISTING PATTERNS
243
+
244
+ {Patterns discovered in step 4}
245
+
246
+ ## 3. FILES TO CREATE
247
+
248
+ {File mapping table}
249
+
250
+ ## 4. DETAILED SPECIFICATIONS
251
+
252
+ {Per-file instructions}
253
+
254
+ ## 5. BUSINESS RULES → CODE
255
+
256
+ {BR to code mapping}
257
+
258
+ ## 6. REQUIRED TESTS
259
+
260
+ {Test checklist}
261
+
262
+ ## 7. POST-IMPLEMENTATION CHECKLIST
263
+
264
+ - [ ] Build backend OK (`dotnet build`)
265
+ - [ ] Build frontend OK (`pnpm build`)
266
+ - [ ] Tests pass (`dotnet test`)
267
+ - [ ] EF Core migration created
268
+ - [ ] Permissions in PermissionConfiguration.cs
269
+ - [ ] i18n complete (FR, EN, IT, DE)
270
+ - [ ] Documentation: `/business-analyse:6-doc-html {feature_id}`
271
+
272
+ ---
273
+
274
+ ## EXECUTION
275
+
276
+ ```bash
277
+ /implement {feature_id}
278
+ ```
279
+ ```
280
+
281
+ ---
282
+
283
+ ### 12. Save Output
284
+
285
+ Write to: `{output_dir}/4-development-handoff.md`
286
+
287
+ Update `00-context.md`:
288
+ - Progress: `05-handoff` -> "Complete"
289
+
290
+ ---
291
+
292
+ ### 13. Display Summary and Offer Next Step
293
+
294
+ **Display:**
295
+ ```
296
+ HANDOFF - {feature_id}
297
+ ├── Status: Complete
298
+ ├── Files to create: {file count}
299
+ ├── Tests to write: {test count}
300
+ ├── Output: {output_dir}/4-development-handoff.md
301
+ ├── Execute: /implement {feature_id}
302
+ └── Optional: step-06-doc-html (React documentation)
303
+ ```
304
+
305
+ **Ask user:**
306
+ ```json
307
+ {
308
+ "questions": [
309
+ {
310
+ "question": "What would you like to do now?",
311
+ "header": "Next",
312
+ "options": [
313
+ {"label": "Generate HTML documentation", "description": "Create the React documentation page"},
314
+ {"label": "Launch implementation", "description": "Execute /implement {feature_id}"},
315
+ {"label": "End BA", "description": "Stop here, implement later"}
316
+ ],
317
+ "multiSelect": false
318
+ }
319
+ ]
320
+ }
321
+ ```
322
+
323
+ If "Generate HTML documentation":
324
+ ```
325
+ Read and execute: steps/step-06-doc-html.md
326
+ ```
327
+
328
+ ---
329
+
330
+ ## OUTPUT
331
+
332
+ This step produces:
333
+ - `{output_dir}/4-development-handoff.md` (created)
334
+ - `{output_dir}/00-context.md` (updated)
335
+
336
+ Handoff is ready for `/implement {feature_id}`.