@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
@@ -1,463 +0,0 @@
1
- # Templates Backend - Application Skill
2
-
3
- > Ces templates génèrent le code C# pour les nouvelles applications/modules.
4
- > **RAPPEL:** Seules les applications dans le context `business` sont autorisées.
5
-
6
- ---
7
-
8
- ## TEMPLATE: PERMISSIONS CLASS
9
-
10
- ```csharp
11
- // Ajouter dans src/SmartStack.Application/Common/Authorization/Permissions.cs
12
-
13
- // IMPORTANT: Les permissions client sont TOUJOURS sous "business.*"
14
- public static class Business
15
- {
16
- public const string Access = "business";
17
-
18
- public static class $APP_PASCAL
19
- {
20
- public const string Access = "business.$app";
21
-
22
- public static class $MODULE_PASCAL
23
- {
24
- public const string View = "business.$app.$module.read";
25
- public const string Create = "business.$app.$module.create";
26
- public const string Update = "business.$app.$module.update";
27
- public const string Delete = "business.$app.$module.delete";
28
- public const string Assign = "business.$app.$module.assign";
29
- public const string Execute = "business.$app.$module.execute";
30
- }
31
- }
32
- }
33
- ```
34
-
35
- ### Exemple pour Business > CRM > Leads
36
-
37
- ```csharp
38
- public static class Business
39
- {
40
- public const string Access = "business";
41
-
42
- public static class Crm
43
- {
44
- public const string Access = "business.crm";
45
-
46
- public static class Leads
47
- {
48
- public const string View = "business.crm.leads.read";
49
- public const string Create = "business.crm.leads.create";
50
- public const string Update = "business.crm.leads.update";
51
- public const string Delete = "business.crm.leads.delete";
52
- }
53
- }
54
- }
55
- ```
56
-
57
- ---
58
-
59
- ## TEMPLATE: SERVICE INTERFACE
60
-
61
- ```csharp
62
- // src/SmartStack.Application/Common/Interfaces/I{Module}Service.cs
63
-
64
- using SmartStack.Application.$MODULE_PASCAL.Models;
65
-
66
- namespace SmartStack.Application.Common.Interfaces;
67
-
68
- public interface I$MODULE_PASCALService
69
- {
70
- Task<PagedResult<$ENTITY_PASCALDto>> GetAllAsync(
71
- $ENTITY_PASCALQueryParameters parameters,
72
- CancellationToken cancellationToken = default);
73
-
74
- Task<$ENTITY_PASCALDto?> GetByIdAsync(
75
- Guid id,
76
- CancellationToken cancellationToken = default);
77
-
78
- Task<$ENTITY_PASCALDto> CreateAsync(
79
- Create$ENTITY_PASCALRequest request,
80
- CancellationToken cancellationToken = default);
81
-
82
- Task<$ENTITY_PASCALDto> UpdateAsync(
83
- Guid id,
84
- Update$ENTITY_PASCALRequest request,
85
- CancellationToken cancellationToken = default);
86
-
87
- Task<bool> DeleteAsync(
88
- Guid id,
89
- CancellationToken cancellationToken = default);
90
- }
91
- ```
92
-
93
- ---
94
-
95
- ## TEMPLATE: SERVICE IMPLEMENTATION
96
-
97
- ```csharp
98
- // src/SmartStack.Infrastructure/Services/$MODULE_PASCAL/$MODULE_PASCALService.cs
99
-
100
- using Microsoft.EntityFrameworkCore;
101
- using Microsoft.Extensions.Logging;
102
- using SmartStack.Application.Common.Interfaces;
103
- using SmartStack.Application.$MODULE_PASCAL.Models;
104
- using SmartStack.Domain.$MODULE_PASCAL;
105
-
106
- namespace SmartStack.Infrastructure.Services.$MODULE_PASCAL;
107
-
108
- public class $MODULE_PASCALService : I$MODULE_PASCALService
109
- {
110
- private readonly IApplicationDbContext _context;
111
- private readonly ICurrentUserService _currentUser;
112
- private readonly ILogger<$MODULE_PASCALService> _logger;
113
-
114
- public $MODULE_PASCALService(
115
- IApplicationDbContext context,
116
- ICurrentUserService currentUser,
117
- ILogger<$MODULE_PASCALService> logger)
118
- {
119
- _context = context;
120
- _currentUser = currentUser;
121
- _logger = logger;
122
- }
123
-
124
- public async Task<PagedResult<$ENTITY_PASCALDto>> GetAllAsync(
125
- $ENTITY_PASCALQueryParameters parameters,
126
- CancellationToken cancellationToken = default)
127
- {
128
- var query = _context.$ENTITY_PLURAL
129
- .AsNoTracking();
130
-
131
- // Apply filters
132
- if (!string.IsNullOrWhiteSpace(parameters.SearchTerm))
133
- {
134
- query = query.Where(x =>
135
- x.Name.Contains(parameters.SearchTerm) ||
136
- x.Description.Contains(parameters.SearchTerm));
137
- }
138
-
139
- // Apply sorting
140
- query = parameters.SortColumn?.ToLower() switch
141
- {
142
- "name" => parameters.SortDirection == "desc"
143
- ? query.OrderByDescending(x => x.Name)
144
- : query.OrderBy(x => x.Name),
145
- "createdat" => parameters.SortDirection == "desc"
146
- ? query.OrderByDescending(x => x.CreatedAt)
147
- : query.OrderBy(x => x.CreatedAt),
148
- _ => query.OrderByDescending(x => x.CreatedAt)
149
- };
150
-
151
- var totalCount = await query.CountAsync(cancellationToken);
152
-
153
- var items = await query
154
- .Skip((parameters.Page - 1) * parameters.PageSize)
155
- .Take(parameters.PageSize)
156
- .Select(x => new $ENTITY_PASCALDto
157
- {
158
- Id = x.Id,
159
- Name = x.Name,
160
- Description = x.Description,
161
- IsActive = x.IsActive,
162
- CreatedAt = x.CreatedAt,
163
- UpdatedAt = x.UpdatedAt
164
- })
165
- .ToListAsync(cancellationToken);
166
-
167
- return new PagedResult<$ENTITY_PASCALDto>
168
- {
169
- Items = items,
170
- TotalCount = totalCount,
171
- Page = parameters.Page,
172
- PageSize = parameters.PageSize
173
- };
174
- }
175
-
176
- public async Task<$ENTITY_PASCALDto?> GetByIdAsync(
177
- Guid id,
178
- CancellationToken cancellationToken = default)
179
- {
180
- var entity = await _context.$ENTITY_PLURAL
181
- .AsNoTracking()
182
- .FirstOrDefaultAsync(x => x.Id == id, cancellationToken);
183
-
184
- if (entity == null)
185
- return null;
186
-
187
- return new $ENTITY_PASCALDto
188
- {
189
- Id = entity.Id,
190
- Name = entity.Name,
191
- Description = entity.Description,
192
- IsActive = entity.IsActive,
193
- CreatedAt = entity.CreatedAt,
194
- UpdatedAt = entity.UpdatedAt
195
- };
196
- }
197
-
198
- public async Task<$ENTITY_PASCALDto> CreateAsync(
199
- Create$ENTITY_PASCALRequest request,
200
- CancellationToken cancellationToken = default)
201
- {
202
- var entity = $ENTITY_PASCAL.Create(
203
- request.Name,
204
- request.Description);
205
-
206
- _context.$ENTITY_PLURAL.Add(entity);
207
- await _context.SaveChangesAsync(cancellationToken);
208
-
209
- _logger.LogInformation(
210
- "User {User} created $ENTITY_PASCAL {Id} ({Name})",
211
- _currentUser.Email,
212
- entity.Id,
213
- entity.Name);
214
-
215
- return new $ENTITY_PASCALDto
216
- {
217
- Id = entity.Id,
218
- Name = entity.Name,
219
- Description = entity.Description,
220
- IsActive = entity.IsActive,
221
- CreatedAt = entity.CreatedAt
222
- };
223
- }
224
-
225
- public async Task<$ENTITY_PASCALDto> UpdateAsync(
226
- Guid id,
227
- Update$ENTITY_PASCALRequest request,
228
- CancellationToken cancellationToken = default)
229
- {
230
- var entity = await _context.$ENTITY_PLURAL
231
- .FirstOrDefaultAsync(x => x.Id == id, cancellationToken)
232
- ?? throw new NotFoundException("$ENTITY_PASCAL", id);
233
-
234
- entity.Update(request.Name, request.Description);
235
-
236
- await _context.SaveChangesAsync(cancellationToken);
237
-
238
- _logger.LogInformation(
239
- "User {User} updated $ENTITY_PASCAL {Id} ({Name})",
240
- _currentUser.Email,
241
- entity.Id,
242
- entity.Name);
243
-
244
- return new $ENTITY_PASCALDto
245
- {
246
- Id = entity.Id,
247
- Name = entity.Name,
248
- Description = entity.Description,
249
- IsActive = entity.IsActive,
250
- CreatedAt = entity.CreatedAt,
251
- UpdatedAt = entity.UpdatedAt
252
- };
253
- }
254
-
255
- public async Task<bool> DeleteAsync(
256
- Guid id,
257
- CancellationToken cancellationToken = default)
258
- {
259
- var entity = await _context.$ENTITY_PLURAL
260
- .FirstOrDefaultAsync(x => x.Id == id, cancellationToken);
261
-
262
- if (entity == null)
263
- return false;
264
-
265
- _context.$ENTITY_PLURAL.Remove(entity);
266
- await _context.SaveChangesAsync(cancellationToken);
267
-
268
- _logger.LogWarning(
269
- "User {User} deleted $ENTITY_PASCAL {Id} ({Name})",
270
- _currentUser.Email,
271
- id,
272
- entity.Name);
273
-
274
- return true;
275
- }
276
- }
277
- ```
278
-
279
- ---
280
-
281
- ## TEMPLATE: DTOs
282
-
283
- ```csharp
284
- // src/SmartStack.Application/$MODULE_PASCAL/Models/$ENTITY_PASCALDto.cs
285
-
286
- namespace SmartStack.Application.$MODULE_PASCAL.Models;
287
-
288
- public record $ENTITY_PASCALDto
289
- {
290
- public Guid Id { get; init; }
291
- public string Name { get; init; } = null!;
292
- public string? Description { get; init; }
293
- public bool IsActive { get; init; }
294
- public DateTime CreatedAt { get; init; }
295
- public DateTime? UpdatedAt { get; init; }
296
- }
297
-
298
- public record Create$ENTITY_PASCALRequest
299
- {
300
- public string Name { get; init; } = null!;
301
- public string? Description { get; init; }
302
- }
303
-
304
- public record Update$ENTITY_PASCALRequest
305
- {
306
- public string Name { get; init; } = null!;
307
- public string? Description { get; init; }
308
- }
309
-
310
- public record $ENTITY_PASCALQueryParameters
311
- {
312
- public int Page { get; init; } = 1;
313
- public int PageSize { get; init; } = 10;
314
- public string? SearchTerm { get; init; }
315
- public string? SortColumn { get; init; } = "createdAt";
316
- public string? SortDirection { get; init; } = "desc";
317
- }
318
- ```
319
-
320
- ---
321
-
322
- ## TEMPLATE: DOMAIN ENTITY
323
-
324
- ```csharp
325
- // src/SmartStack.Domain/$MODULE_PASCAL/$ENTITY_PASCAL.cs
326
-
327
- using SmartStack.Domain.Common;
328
-
329
- namespace SmartStack.Domain.$MODULE_PASCAL;
330
-
331
- public class $ENTITY_PASCAL : BaseEntity
332
- {
333
- public string Name { get; private set; } = null!;
334
- public string? Description { get; private set; }
335
- public bool IsActive { get; private set; }
336
-
337
- private $ENTITY_PASCAL() { }
338
-
339
- public static $ENTITY_PASCAL Create(string name, string? description = null)
340
- {
341
- if (string.IsNullOrWhiteSpace(name))
342
- throw new Exceptions.DomainException("Name is required");
343
-
344
- return new $ENTITY_PASCAL
345
- {
346
- Id = Guid.NewGuid(),
347
- Name = name,
348
- Description = description,
349
- IsActive = true,
350
- CreatedAt = DateTime.UtcNow
351
- };
352
- }
353
-
354
- public void Update(string name, string? description)
355
- {
356
- if (string.IsNullOrWhiteSpace(name))
357
- throw new Exceptions.DomainException("Name is required");
358
-
359
- Name = name;
360
- Description = description;
361
- UpdatedAt = DateTime.UtcNow;
362
- }
363
-
364
- public void Activate() => IsActive = true;
365
- public void Deactivate() => IsActive = false;
366
- }
367
- ```
368
-
369
- ---
370
-
371
- ## TEMPLATE: EF CONFIGURATION
372
-
373
- ```csharp
374
- // src/SmartStack.Infrastructure/Persistence/Configurations/$MODULE_PASCAL/$ENTITY_PASCALConfiguration.cs
375
-
376
- using Microsoft.EntityFrameworkCore;
377
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
378
- using SmartStack.Domain.$MODULE_PASCAL;
379
-
380
- namespace SmartStack.Infrastructure.Persistence.Configurations.$MODULE_PASCAL;
381
-
382
- public class $ENTITY_PASCALConfiguration : IEntityTypeConfiguration<$ENTITY_PASCAL>
383
- {
384
- public void Configure(EntityTypeBuilder<$ENTITY_PASCAL> builder)
385
- {
386
- // Tables métier client dans le schéma "biz" (business)
387
- builder.ToTable("$ENTITY_PLURAL", "biz");
388
-
389
- builder.HasKey(x => x.Id);
390
-
391
- builder.Property(x => x.Name)
392
- .HasMaxLength(200)
393
- .IsRequired();
394
-
395
- builder.Property(x => x.Description)
396
- .HasMaxLength(1000);
397
-
398
- builder.HasIndex(x => x.Name)
399
- .IsUnique();
400
- }
401
- }
402
- ```
403
-
404
- ---
405
-
406
- ## TEMPLATE: DBCONTEXT UPDATE
407
-
408
- ```csharp
409
- // Ajouter dans IApplicationDbContext.cs
410
- DbSet<$ENTITY_PASCAL> $ENTITY_PLURAL { get; }
411
-
412
- // Ajouter dans ApplicationDbContext.cs
413
- public DbSet<$ENTITY_PASCAL> $ENTITY_PLURAL => Set<$ENTITY_PASCAL>();
414
- ```
415
-
416
- ---
417
-
418
- ## TEMPLATE: DI REGISTRATION
419
-
420
- ```csharp
421
- // Ajouter dans src/SmartStack.Infrastructure/DependencyInjection.cs
422
-
423
- services.AddScoped<I$MODULE_PASCALService, $MODULE_PASCALService>();
424
- ```
425
-
426
- ---
427
-
428
- ## CHAÎNAGE AVEC /controller:create
429
-
430
- Après génération des templates backend, le skill appelle automatiquement :
431
-
432
- ```
433
- /controller:create Business $MODULE $ENTITY
434
- ```
435
-
436
- Exemple :
437
- ```
438
- /controller:create Business Leads Lead
439
- ```
440
-
441
- Cela génère :
442
- - Controller avec CRUD complet
443
- - Endpoints REST
444
- - ProducesResponseType
445
- - Logging approprié
446
- - Tests Postman
447
-
448
- ---
449
-
450
- ## CHECKLIST BACKEND
451
-
452
- | Vérification | Status |
453
- |--------------|--------|
454
- | ☐ Permissions.cs mis à jour (sous Business.*) | |
455
- | ☐ Service interface créée | |
456
- | ☐ Service implementation créée | |
457
- | ☐ DTOs créés | |
458
- | ☐ Domain entity créée | |
459
- | ☐ EF Configuration créée (schéma "biz") | |
460
- | ☐ DbContext mis à jour | |
461
- | ☐ DI registration ajoutée | |
462
- | ☐ /controller:create exécuté | |
463
- | ☐ dotnet build réussi | |