@atlashub/smartstack-cli 1.5.0 → 1.5.2

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 (159) hide show
  1. package/.documentation/agents.html +920 -916
  2. package/.documentation/apex.html +1022 -1018
  3. package/.documentation/business-analyse.html +1505 -1501
  4. package/.documentation/commands.html +684 -680
  5. package/.documentation/css/styles.css +2168 -2168
  6. package/.documentation/efcore.html +2509 -2505
  7. package/.documentation/gitflow.html +2622 -2618
  8. package/.documentation/hooks.html +417 -413
  9. package/.documentation/index.html +327 -323
  10. package/.documentation/init.html +565 -0
  11. package/.documentation/installation.html +548 -462
  12. package/.documentation/js/app.js +794 -794
  13. package/.documentation/ralph-loop.html +534 -530
  14. package/.documentation/test-web.html +517 -513
  15. package/config/default-config.json +86 -86
  16. package/config/settings.json +53 -53
  17. package/config/settings.local.example.json +16 -16
  18. package/dist/index.js +18 -8
  19. package/dist/index.js.map +1 -1
  20. package/package.json +88 -88
  21. package/templates/agents/action.md +36 -36
  22. package/templates/agents/efcore/conflicts.md +84 -84
  23. package/templates/agents/efcore/db-deploy.md +51 -51
  24. package/templates/agents/efcore/db-reset.md +59 -59
  25. package/templates/agents/efcore/db-seed.md +56 -56
  26. package/templates/agents/efcore/db-status.md +64 -64
  27. package/templates/agents/efcore/migration.md +85 -85
  28. package/templates/agents/efcore/rebase-snapshot.md +62 -62
  29. package/templates/agents/efcore/scan.md +90 -90
  30. package/templates/agents/efcore/squash.md +67 -67
  31. package/templates/agents/explore-codebase.md +65 -65
  32. package/templates/agents/explore-docs.md +97 -97
  33. package/templates/agents/fix-grammar.md +49 -49
  34. package/templates/agents/gitflow/abort.md +45 -45
  35. package/templates/agents/gitflow/cleanup.md +85 -85
  36. package/templates/agents/gitflow/commit.md +40 -40
  37. package/templates/agents/gitflow/exec.md +48 -48
  38. package/templates/agents/gitflow/finish.md +92 -92
  39. package/templates/agents/gitflow/init.md +139 -139
  40. package/templates/agents/gitflow/merge.md +62 -62
  41. package/templates/agents/gitflow/plan.md +42 -42
  42. package/templates/agents/gitflow/pr.md +78 -78
  43. package/templates/agents/gitflow/review.md +49 -49
  44. package/templates/agents/gitflow/start.md +61 -61
  45. package/templates/agents/gitflow/status.md +32 -32
  46. package/templates/agents/snipper.md +36 -36
  47. package/templates/agents/websearch.md +46 -46
  48. package/templates/commands/_resources/formatting-guide.md +124 -124
  49. package/templates/commands/ai-prompt.md +315 -315
  50. package/templates/commands/apex/1-analyze.md +100 -100
  51. package/templates/commands/apex/2-plan.md +145 -145
  52. package/templates/commands/apex/3-execute.md +171 -171
  53. package/templates/commands/apex/4-examine.md +116 -116
  54. package/templates/commands/apex/5-tasks.md +209 -209
  55. package/templates/commands/apex.md +76 -76
  56. package/templates/commands/application/create.md +362 -362
  57. package/templates/commands/application/templates-backend.md +463 -463
  58. package/templates/commands/application/templates-frontend.md +517 -517
  59. package/templates/commands/application/templates-i18n.md +478 -478
  60. package/templates/commands/application/templates-seed.md +362 -362
  61. package/templates/commands/application.md +303 -303
  62. package/templates/commands/business-analyse/0-orchestrate.md +640 -640
  63. package/templates/commands/business-analyse/1-init.md +269 -269
  64. package/templates/commands/business-analyse/2-discover.md +520 -520
  65. package/templates/commands/business-analyse/3-analyse.md +408 -408
  66. package/templates/commands/business-analyse/4-specify.md +598 -598
  67. package/templates/commands/business-analyse/5-validate.md +326 -326
  68. package/templates/commands/business-analyse/6-handoff.md +746 -746
  69. package/templates/commands/business-analyse/7-doc-html.md +602 -602
  70. package/templates/commands/business-analyse/bug.md +325 -325
  71. package/templates/commands/business-analyse/change-request.md +368 -368
  72. package/templates/commands/business-analyse/hotfix.md +200 -200
  73. package/templates/commands/business-analyse.md +640 -640
  74. package/templates/commands/controller/create.md +216 -216
  75. package/templates/commands/controller/postman-templates.md +528 -528
  76. package/templates/commands/controller/templates.md +600 -600
  77. package/templates/commands/controller.md +337 -337
  78. package/templates/commands/create/agent.md +138 -138
  79. package/templates/commands/create/command.md +166 -166
  80. package/templates/commands/create/hook.md +234 -234
  81. package/templates/commands/create/plugin.md +329 -329
  82. package/templates/commands/create/project.md +507 -507
  83. package/templates/commands/create/skill.md +199 -199
  84. package/templates/commands/create.md +220 -220
  85. package/templates/commands/debug.md +95 -95
  86. package/templates/commands/documentation/module.md +202 -202
  87. package/templates/commands/documentation/templates.md +432 -432
  88. package/templates/commands/documentation.md +190 -190
  89. package/templates/commands/efcore/_env-check.md +153 -153
  90. package/templates/commands/efcore/conflicts.md +186 -186
  91. package/templates/commands/efcore/db-deploy.md +193 -193
  92. package/templates/commands/efcore/db-reset.md +426 -426
  93. package/templates/commands/efcore/db-seed.md +326 -326
  94. package/templates/commands/efcore/db-status.md +226 -226
  95. package/templates/commands/efcore/migration.md +400 -400
  96. package/templates/commands/efcore/rebase-snapshot.md +264 -264
  97. package/templates/commands/efcore/scan.md +198 -198
  98. package/templates/commands/efcore/squash.md +298 -298
  99. package/templates/commands/efcore.md +224 -224
  100. package/templates/commands/epct.md +69 -69
  101. package/templates/commands/explain.md +186 -186
  102. package/templates/commands/explore.md +45 -45
  103. package/templates/commands/feature-full.md +267 -267
  104. package/templates/commands/gitflow/1-init.md +1038 -1038
  105. package/templates/commands/gitflow/10-start.md +768 -768
  106. package/templates/commands/gitflow/11-finish.md +457 -457
  107. package/templates/commands/gitflow/12-cleanup.md +276 -276
  108. package/templates/commands/gitflow/13-sync.md +216 -216
  109. package/templates/commands/gitflow/14-rebase.md +251 -251
  110. package/templates/commands/gitflow/2-status.md +277 -277
  111. package/templates/commands/gitflow/3-commit.md +344 -344
  112. package/templates/commands/gitflow/4-plan.md +145 -145
  113. package/templates/commands/gitflow/5-exec.md +147 -147
  114. package/templates/commands/gitflow/6-abort.md +344 -344
  115. package/templates/commands/gitflow/7-pull-request.md +453 -355
  116. package/templates/commands/gitflow/8-review.md +240 -176
  117. package/templates/commands/gitflow/9-merge.md +451 -365
  118. package/templates/commands/gitflow.md +128 -128
  119. package/templates/commands/implement.md +663 -663
  120. package/templates/commands/init.md +567 -562
  121. package/templates/commands/mcp-integration.md +330 -330
  122. package/templates/commands/notification.md +129 -129
  123. package/templates/commands/oneshot.md +57 -57
  124. package/templates/commands/quick-search.md +72 -72
  125. package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
  126. package/templates/commands/ralph-loop/help.md +126 -126
  127. package/templates/commands/ralph-loop/ralph-loop.md +18 -18
  128. package/templates/commands/review.md +106 -106
  129. package/templates/commands/utils/test-web-config.md +160 -160
  130. package/templates/commands/utils/test-web.md +151 -151
  131. package/templates/commands/validate.md +233 -233
  132. package/templates/commands/workflow.md +193 -193
  133. package/templates/gitflow/config.json +138 -138
  134. package/templates/hooks/ef-migration-check.md +139 -139
  135. package/templates/hooks/hooks.json +25 -25
  136. package/templates/hooks/stop-hook.sh +177 -177
  137. package/templates/skills/ai-prompt/SKILL.md +778 -778
  138. package/templates/skills/application/SKILL.md +563 -563
  139. package/templates/skills/application/templates-backend.md +450 -450
  140. package/templates/skills/application/templates-frontend.md +531 -531
  141. package/templates/skills/application/templates-i18n.md +520 -520
  142. package/templates/skills/application/templates-seed.md +647 -647
  143. package/templates/skills/business-analyse/SKILL.md +191 -191
  144. package/templates/skills/business-analyse/questionnaire.md +283 -283
  145. package/templates/skills/business-analyse/templates-frd.md +477 -477
  146. package/templates/skills/business-analyse/templates-react.md +580 -580
  147. package/templates/skills/controller/SKILL.md +240 -240
  148. package/templates/skills/controller/postman-templates.md +614 -614
  149. package/templates/skills/controller/templates.md +1468 -1468
  150. package/templates/skills/documentation/SKILL.md +133 -133
  151. package/templates/skills/documentation/templates.md +476 -476
  152. package/templates/skills/feature-full/SKILL.md +838 -838
  153. package/templates/skills/notification/SKILL.md +555 -555
  154. package/templates/skills/ui-components/SKILL.md +870 -870
  155. package/templates/skills/workflow/SKILL.md +582 -582
  156. package/templates/test-web/api-health.json +38 -38
  157. package/templates/test-web/minimal.json +19 -19
  158. package/templates/test-web/npm-package.json +46 -46
  159. package/templates/test-web/seo-check.json +54 -54
@@ -1,663 +1,663 @@
1
- ---
2
- description: Implement a feature from its BA handoff (skip explore phase)
3
- argument-hint: <FEAT-XXX>
4
- model: opus
5
- ---
6
-
7
- # Implement Feature from Handoff
8
-
9
- > **Modele:** OPUS (implementation one-shot, zero ambiguite)
10
- > **Cout estime:** ~$2.00 (one-shot) / ~$5.00-15.00 (avec ralph-loop)
11
- > **Prerequis:** Handoff valide (4-development-handoff.md)
12
-
13
- ---
14
-
15
- ## RALPH-LOOP INTEGRATION (OBLIGATOIRE)
16
-
17
- ```
18
- ╔══════════════════════════════════════════════════════════════════════════════╗
19
- ║ UTILISATION AVEC RALPH-LOOP ║
20
- ╠══════════════════════════════════════════════════════════════════════════════╣
21
- ║ ║
22
- ║ /ralph-loop "/implement FEAT-XXX" --completion-promise "COMPLETE" ║
23
- ║ --max-iterations 25 ║
24
- ║ ║
25
- ║ FICHIERS RALPH (créés automatiquement): ║
26
- ║ ├── prd.json → Liste des tâches avec statut ║
27
- ║ └── progress.txt → Mémoire persistante entre itérations ║
28
- ║ ║
29
- ║ PROCESSUS PAR ITERATION: ║
30
- ║ 1. Lire prd.json → Trouver prochaine tâche "passes": false ║
31
- ║ 2. Lire progress.txt → Comprendre le contexte ║
32
- ║ 3. Implémenter UNE SEULE tâche ║
33
- ║ 4. git commit ║
34
- ║ 5. Mettre à jour prd.json → "passes": true ║
35
- ║ 6. Ajouter apprentissages à progress.txt ║
36
- ║ 7. Si TOUTES tâches "passes": true → <promise>COMPLETE</promise> ║
37
- ║ ║
38
- ║ SIGNAL DE FIN: <promise>COMPLETE</promise> ║
39
- ║ ║
40
- ╚══════════════════════════════════════════════════════════════════════════════╝
41
- ```
42
-
43
- ---
44
-
45
- ## WORKFLOW RALPH
46
-
47
- ```
48
- ┌─────────────────────────────────────────────────────────────────────────────┐
49
- │ BOUCLE RALPH │
50
- ├─────────────────────────────────────────────────────────────────────────────┤
51
- │ │
52
- │ ITERATION N │
53
- │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
54
- │ │ 1. LIRE │───►│ 2. WORK │───►│ 3. SAVE │───►│ 4. CHECK │ │
55
- │ │ prd.json │ │ 1 tâche │ │ commit │ │ all done?│ │
56
- │ │ progress │ │ │ │ prd.json │ │ │ │
57
- │ └──────────┘ └──────────┘ │ progress │ └────┬─────┘ │
58
- │ └──────────┘ │ │
59
- │ ▼ │
60
- │ ┌─────────────────────┐ │
61
- │ │ NON: Terminer │ │
62
- │ │ (Ralph relance) │ │
63
- │ ├─────────────────────┤ │
64
- │ │ OUI: <promise> │ │
65
- │ │ COMPLETE</promise> │ │
66
- │ └─────────────────────┘ │
67
- │ │
68
- └─────────────────────────────────────────────────────────────────────────────┘
69
- ```
70
-
71
- ---
72
-
73
- ## STEP 0: Initialisation Ralph (première itération seulement)
74
-
75
- ### 0.1 Vérifier si prd.json existe
76
-
77
- ```bash
78
- FEATURE_ID=$1 # Paramètre: FEAT-XXX
79
-
80
- # Si prd.json n'existe PAS → Première itération, initialiser
81
- if [ ! -f "prd.json" ]; then
82
- echo "Première itération - Initialisation Ralph..."
83
- # Continuer vers 0.2
84
- else
85
- echo "Itération suivante - Lecture état..."
86
- # Sauter vers STEP 1
87
- fi
88
- ```
89
-
90
- ### 0.2 Charger le handoff et créer prd.json
91
-
92
- ```bash
93
- # Trouver le dossier feature
94
- FEATURE_DIR=$(find .business-analyse -type d -name "${FEATURE_ID}*" | head -1)
95
- HANDOFF_FILE="$FEATURE_DIR/4-development-handoff.md"
96
-
97
- if [ ! -f "$HANDOFF_FILE" ]; then
98
- echo "ERREUR: Handoff non trouvé"
99
- echo " Lancez d'abord: /business-analyse:6-handoff $FEATURE_ID"
100
- exit 1
101
- fi
102
- ```
103
-
104
- **Créer prd.json avec les user stories extraites du handoff:**
105
-
106
- ```json
107
- {
108
- "feature_id": "FEAT-XXX",
109
- "handoff_file": ".business-analyse/FEAT-XXX/4-development-handoff.md",
110
- "created_at": "2026-01-16T12:00:00Z",
111
- "userStories": [
112
- { "id": "1", "title": "Créer Entity Domain", "phase": "backend", "passes": false },
113
- { "id": "2", "title": "Créer Configuration EF Core", "phase": "backend", "passes": false },
114
- { "id": "3", "title": "Créer Migration EF Core", "phase": "backend", "passes": false },
115
- { "id": "4", "title": "Créer Commands/Queries Application", "phase": "backend", "passes": false },
116
- { "id": "5", "title": "Créer Validators FluentValidation", "phase": "backend", "passes": false },
117
- { "id": "6", "title": "Créer Controller API", "phase": "backend", "passes": false },
118
- { "id": "7", "title": "Vérifier Backend Build", "phase": "backend", "passes": false },
119
- { "id": "8", "title": "Créer Service API Frontend", "phase": "frontend", "passes": false },
120
- { "id": "9", "title": "Créer Pages Frontend", "phase": "frontend", "passes": false },
121
- { "id": "10", "title": "Ajouter i18n (4 langues)", "phase": "frontend", "passes": false },
122
- { "id": "11", "title": "Ajouter Routes", "phase": "frontend", "passes": false },
123
- { "id": "12", "title": "Vérifier Frontend Build", "phase": "frontend", "passes": false },
124
- { "id": "13", "title": "Ajouter Notifications (si requis)", "phase": "integrations", "passes": false },
125
- { "id": "14", "title": "Ajouter Workflows (si requis)", "phase": "integrations", "passes": false },
126
- { "id": "15", "title": "Ajouter Prompts IA (si requis)", "phase": "integrations", "passes": false },
127
- { "id": "16", "title": "Tests unitaires", "phase": "tests", "passes": false },
128
- { "id": "17", "title": "Tests intégration", "phase": "tests", "passes": false },
129
- { "id": "18", "title": "Lint et TypeCheck final", "phase": "quality", "passes": false }
130
- ]
131
- }
132
- ```
133
-
134
- ### 0.3 Créer progress.txt
135
-
136
- ```markdown
137
- # Progress - FEAT-XXX
138
-
139
- ## Initialisation
140
- - Feature: {titre du handoff}
141
- - Date: {timestamp}
142
- - Handoff: {chemin}
143
-
144
- ## Contexte du projet
145
- - Backend: .NET 8, Clean Architecture
146
- - Frontend: React + TypeScript + Vite
147
- - Base: SmartStack.app
148
-
149
- ---
150
-
151
- ```
152
-
153
- ### 0.4 Premier commit Ralph
154
-
155
- ```bash
156
- git add prd.json progress.txt
157
- git commit -m "chore(ralph): initialize implementation tracking for FEAT-XXX"
158
- ```
159
-
160
- ---
161
-
162
- ## STEP 1: Lire l'état Ralph (chaque itération)
163
-
164
- ### 1.1 Lire prd.json
165
-
166
- ```bash
167
- # Lire prd.json pour trouver la prochaine tâche
168
- PRD=$(cat prd.json)
169
-
170
- # Identifier la PROCHAINE tâche avec "passes": false
171
- # → C'est LA tâche à implémenter cette itération
172
- ```
173
-
174
- **Analyser prd.json:**
175
- - Compter les tâches `"passes": true` → Progression
176
- - Trouver la PREMIÈRE tâche `"passes": false` → Tâche courante
177
- - Si AUCUNE tâche `"passes": false` → TOUTES TERMINÉES
178
-
179
- ### 1.2 Lire progress.txt
180
-
181
- ```bash
182
- # Lire progress.txt pour comprendre le contexte
183
- PROGRESS=$(cat progress.txt)
184
-
185
- # Extraire les apprentissages des itérations précédentes
186
- # Comprendre les décisions prises et problèmes résolus
187
- ```
188
-
189
- ### 1.3 Vérifier git log
190
-
191
- ```bash
192
- # Voir les commits récents pour contexte
193
- git log --oneline -10
194
- ```
195
-
196
- ### 1.4 Afficher le résumé
197
-
198
- ```
199
- ================================================================================
200
- RALPH ITERATION - FEAT-XXX
201
- ================================================================================
202
-
203
- PROGRESSION: {N}/{TOTAL} tâches terminées
204
-
205
- TÂCHE COURANTE: #{id} - {title}
206
- PHASE: {phase}
207
-
208
- CONTEXTE (progress.txt):
209
- {derniers apprentissages}
210
-
211
- ================================================================================
212
- ```
213
-
214
- ---
215
-
216
- ## STEP 2: Implémenter UNE SEULE tâche
217
-
218
- > **RÈGLE CRITIQUE:** Ne travailler que sur la tâche identifiée en STEP 1.
219
- > Ne PAS avancer sur d'autres tâches même si c'est tentant.
220
-
221
- ### Référence des tâches par phase
222
-
223
- **Phase: backend**
224
- | ID | Tâche | Instructions |
225
- |----|-------|--------------|
226
- | 1 | Créer Entity Domain | Voir STEP 3.1 |
227
- | 2 | Créer Configuration EF Core | Voir STEP 3.2 |
228
- | 3 | Créer Migration EF Core | `/efcore:migration` |
229
- | 4 | Créer Commands/Queries Application | Voir STEP 3.3 |
230
- | 5 | Créer Validators FluentValidation | Voir STEP 3.3 |
231
- | 6 | Créer Controller API | Voir STEP 3.4 |
232
- | 7 | Vérifier Backend Build | `dotnet build` |
233
-
234
- **Phase: frontend**
235
- | ID | Tâche | Instructions |
236
- |----|-------|--------------|
237
- | 8 | Créer Service API Frontend | Voir STEP 4.1 |
238
- | 9 | Créer Pages Frontend | Voir STEP 4.2 |
239
- | 10 | Ajouter i18n (4 langues) | Voir STEP 4.3 |
240
- | 11 | Ajouter Routes | Voir STEP 4.4 |
241
- | 12 | Vérifier Frontend Build | `npm run build` |
242
-
243
- **Phase: integrations**
244
- | ID | Tâche | Instructions |
245
- |----|-------|--------------|
246
- | 13 | Ajouter Notifications | Voir STEP 5.2 (si requis dans handoff) |
247
- | 14 | Ajouter Workflows | Voir STEP 5.3 (si requis dans handoff) |
248
- | 15 | Ajouter Prompts IA | Voir STEP 5.4 (si requis dans handoff) |
249
-
250
- **Phase: tests**
251
- | ID | Tâche | Instructions |
252
- |----|-------|--------------|
253
- | 16 | Tests unitaires | `dotnet test --filter "Category=Unit"` |
254
- | 17 | Tests intégration | `dotnet test --filter "Category=Integration"` |
255
-
256
- **Phase: quality**
257
- | ID | Tâche | Instructions |
258
- |----|-------|--------------|
259
- | 18 | Lint et TypeCheck final | `npm run lint && npm run typecheck` |
260
-
261
- ---
262
-
263
- ## STEP 3: Instructions Backend (tâches 1-7)
264
-
265
- ### 3.1 Domain Layer
266
-
267
- ```
268
- EXPLORER PATTERNS EXISTANTS:
269
- -> src/SmartStack.Domain/Entities/
270
- -> src/SmartStack.Domain/Constants/Permissions.cs
271
- ```
272
-
273
- Actions:
274
- 1. Creer l'entite dans Domain/Entities/Business/
275
- 2. Ajouter les constantes de permission
276
- 3. Valider: `dotnet build src/SmartStack.Domain`
277
-
278
- ### 3.2 Infrastructure Layer
279
-
280
- ```
281
- EXPLORER PATTERNS EXISTANTS:
282
- -> src/SmartStack.Infrastructure/Persistence/Configurations/
283
- ```
284
-
285
- Actions:
286
- 1. Creer EntityTypeConfiguration
287
- 2. Ajouter HasData pour seed si necessaire
288
- 3. Creer migration: `/efcore:migration`
289
- 4. Valider: `dotnet build src/SmartStack.Infrastructure`
290
-
291
- ### 3.3 Application Layer
292
-
293
- ```
294
- EXPLORER PATTERNS EXISTANTS:
295
- -> src/SmartStack.Application/Features/
296
- ```
297
-
298
- Actions:
299
- 1. Creer Commands (Create, Update, Delete)
300
- 2. Creer Queries (GetById, GetList)
301
- 3. Creer DTOs
302
- 4. Creer Validators (FluentValidation)
303
- 5. Valider: `dotnet build src/SmartStack.Application`
304
-
305
- ### 3.4 API Layer
306
-
307
- ```
308
- EXPLORER PATTERNS EXISTANTS:
309
- -> src/SmartStack.Api/Areas/Business/Controllers/
310
- ```
311
-
312
- Actions:
313
- 1. Creer Controller dans Areas/Business
314
- 2. Ajouter [RequirePermission] sur chaque action
315
- 3. Documenter avec [ProducesResponseType]
316
- 4. Valider: `dotnet build src/SmartStack.Api`
317
-
318
- ### 3.5 Check Backend
319
-
320
- ```bash
321
- # Build complet
322
- dotnet build
323
-
324
- # Si erreur: corriger et recommencer
325
- ```
326
-
327
- ---
328
-
329
- ## STEP 4: Implementation Frontend
330
-
331
- ### 4.1 Service API
332
-
333
- ```
334
- EXPLORER PATTERNS EXISTANTS:
335
- -> web/smartstack-web/src/services/api/
336
- ```
337
-
338
- Actions:
339
- 1. Creer service avec endpoints
340
- 2. Definir types TypeScript
341
- 3. Valider: `npm run typecheck`
342
-
343
- ### 4.2 Pages
344
-
345
- ```
346
- EXPLORER PATTERNS EXISTANTS:
347
- -> web/smartstack-web/src/pages/business/
348
- -> web/smartstack-web/src/pages/admin/ (pour patterns CRUD)
349
- ```
350
-
351
- Actions:
352
- 1. Creer ListPage avec DataTable
353
- 2. Creer DetailPage (si applicable)
354
- 3. Ajouter modals Create/Edit
355
- 4. Implementer filtres et pagination
356
- 5. Ajouter permission checks (usePermission)
357
-
358
- ### 4.3 i18n
359
-
360
- ```
361
- FICHIERS A MODIFIER:
362
- -> web/smartstack-web/src/i18n/locales/fr/{module}.json
363
- -> web/smartstack-web/src/i18n/locales/en/{module}.json
364
- -> web/smartstack-web/src/i18n/locales/it/{module}.json
365
- -> web/smartstack-web/src/i18n/locales/de/{module}.json
366
- ```
367
-
368
- Actions:
369
- 1. Ajouter toutes les cles dans les 4 langues
370
- 2. Utiliser useTranslation dans les composants
371
-
372
- ### 4.4 Routes
373
-
374
- ```
375
- FICHIER:
376
- -> web/smartstack-web/src/App.tsx ou routes.tsx
377
- ```
378
-
379
- Actions:
380
- 1. Ajouter routes pour les nouvelles pages
381
- 2. Proteger avec RequireAuth si necessaire
382
-
383
- ### 4.5 Check Frontend
384
-
385
- ```bash
386
- cd web/smartstack-web
387
- npm run lint
388
- npm run typecheck
389
- npm run build
390
- ```
391
-
392
- ---
393
-
394
- ## STEP 5: Integrations SmartStack
395
-
396
- > **CRITIQUE:** Lire la Section 9 du handoff pour determiner les integrations requises.
397
-
398
- ### 5.1 Verifier les integrations requises
399
-
400
- ```bash
401
- # Dans le handoff, section 9.4:
402
- # | Integration | Requis | Skill |
403
- # |-------------|--------|-------|
404
- # | Notifications | oui/non | /notification add |
405
- # | Workflows | oui/non | /workflow create |
406
- # | IA | oui/non | /ai-prompt create |
407
- ```
408
-
409
- ### 5.2 Notifications (si requis=oui)
410
-
411
- **Skill a executer:** `/notification add`
412
-
413
- Actions:
414
- 1. Ajouter le NotificationType dans l'enum
415
- 2. Injecter `INotificationService` dans le service
416
- 3. Ajouter l'appel `SendNotificationAsync` apres les operations CRUD
417
- 4. Creer le hook frontend `use{Module}Notifications.ts`
418
-
419
- ```csharp
420
- // Template dans le service
421
- await _notificationService.SendNotificationAsync(
422
- userId: destinataire.Id,
423
- type: NotificationType.{Entity}Created,
424
- title: _localizer["{module}.notifications.created.title"],
425
- message: _localizer["{module}.notifications.created.message", entity.Name],
426
- relatedEntityType: nameof({Entity}),
427
- relatedEntityId: entity.Id,
428
- actionUrl: $"/{module}/{entity.Id}",
429
- cancellationToken: ct);
430
- ```
431
-
432
- ### 5.3 Workflows (si requis=oui)
433
-
434
- **Skill a executer:** `/workflow create`
435
-
436
- Actions:
437
- 1. Creer le trigger dans WorkflowTriggerConfiguration.cs
438
- 2. Creer le workflow dans WorkflowConfiguration.cs
439
- 3. Ajouter les steps dans WorkflowStepConfiguration.cs
440
- 4. Creer les email templates si necessaire
441
- 5. Ajouter l'appel `TriggerAsync` dans le service
442
-
443
- ```csharp
444
- // Template dans le service
445
- await _workflowService.TriggerAsync(
446
- "{entity}.created",
447
- new Dictionary<string, object>
448
- {
449
- ["entityId"] = entity.Id,
450
- ["entityName"] = entity.Name,
451
- ["userEmail"] = _currentUser.Email
452
- },
453
- language: _currentUser.Language ?? "fr",
454
- cancellationToken: ct);
455
- ```
456
-
457
- ### 5.4 Assistance IA (si requis=oui)
458
-
459
- **Skill a executer:** `/ai-prompt create`
460
-
461
- Actions:
462
- 1. Creer le Prompt dans PromptConfiguration.cs
463
- 2. Creer les Blocks dans PromptBlockConfiguration.cs
464
- 3. Creer le OutputSchema si sortie structuree
465
- 4. Ajouter l'appel `CompleteAsync` dans le service
466
-
467
- ```csharp
468
- // Template dans le service
469
- var result = await _aiCompletionService.CompleteAsync<{OutputType}>(
470
- "{prompt-code}",
471
- new Dictionary<string, object>
472
- {
473
- ["context"] = context,
474
- ["entity"] = entity
475
- },
476
- cancellationToken: ct);
477
- ```
478
-
479
- ### 5.5 Migration EF Core (si nouvelles entites)
480
-
481
- ```bash
482
- # Si des entites ont ete ajoutees (triggers, workflows, templates)
483
- /efcore:migration
484
- ```
485
-
486
- ---
487
-
488
- ## STEP 6: Tests
489
-
490
- ### 6.1 Tests Unitaires
491
-
492
- ```bash
493
- # Backend
494
- dotnet test --filter "Category=Unit"
495
-
496
- # Frontend
497
- npm run test:unit
498
- ```
499
-
500
- ### 6.2 Tests Integration
501
-
502
- ```bash
503
- # API tests
504
- dotnet test --filter "Category=Integration"
505
- ```
506
-
507
- ### 6.3 Collection Postman (optionnel)
508
-
509
- ```bash
510
- /controller:postman-templates {module}
511
- ```
512
-
513
- ---
514
-
515
- ## STEP 7: Persister l'état Ralph (FIN DE CHAQUE ITERATION)
516
-
517
- > **OBLIGATOIRE:** Ces actions DOIVENT être faites à CHAQUE itération.
518
-
519
- ### 7.1 Git commit
520
-
521
- ```bash
522
- # Commit du travail de cette itération
523
- git add -A
524
- git commit -m "feat({module}): {description courte de la tâche}"
525
- ```
526
-
527
- ### 7.2 Mettre à jour prd.json
528
-
529
- Modifier la tâche courante: `"passes": false` → `"passes": true`
530
-
531
- ```json
532
- // AVANT
533
- { "id": "3", "title": "Créer Migration EF Core", "phase": "backend", "passes": false }
534
-
535
- // APRÈS
536
- { "id": "3", "title": "Créer Migration EF Core", "phase": "backend", "passes": true }
537
- ```
538
-
539
- ### 7.3 Ajouter à progress.txt
540
-
541
- Ajouter une entrée à la fin du fichier:
542
-
543
- ```markdown
544
- ## Itération {DATE} {HEURE}
545
- - Tâche: #{id} - {title}
546
- - Fait: {description de ce qui a été implémenté}
547
- - Fichiers modifiés: {liste des fichiers créés/modifiés}
548
- - Apprentissages: {ce qui sera utile pour les prochaines itérations}
549
- - Problèmes: {difficultés rencontrées, le cas échéant}
550
- ```
551
-
552
- ### 7.4 Commit des fichiers Ralph
553
-
554
- ```bash
555
- git add prd.json progress.txt
556
- git commit -m "chore(ralph): mark task #{id} complete"
557
- ```
558
-
559
- ---
560
-
561
- ## STEP 8: Vérifier completion et signaler
562
-
563
- ### 8.1 Compter les tâches restantes
564
-
565
- ```bash
566
- # Lire prd.json et compter les "passes": false
567
- REMAINING=$(grep -c '"passes": false' prd.json)
568
- ```
569
-
570
- ### 8.2 Si des tâches restent (REMAINING > 0)
571
-
572
- ```
573
- ================================================================================
574
- ITERATION TERMINEE - FEAT-XXX
575
- ================================================================================
576
-
577
- TÂCHE COMPLETEE: #{id} - {title}
578
- PROGRESSION: {N}/{TOTAL} tâches
579
-
580
- PROCHAINE TÂCHE: #{next_id} - {next_title}
581
-
582
- ================================================================================
583
- ```
584
-
585
- **NE PAS afficher `<promise>COMPLETE</promise>`**
586
- → Ralph relancera automatiquement une nouvelle itération.
587
-
588
- ### 8.3 Si TOUTES les tâches sont terminées (REMAINING = 0)
589
-
590
- ```
591
- ================================================================================
592
- FEATURE IMPLEMENTEE - {FEATURE_ID}
593
- ================================================================================
594
-
595
- TOUTES LES TÂCHES TERMINÉES (18/18)
596
-
597
- BACKEND:
598
- Entity: src/SmartStack.Domain/Entities/Business/{Entity}.cs
599
- Config: src/SmartStack.Infrastructure/.../Configuration.cs
600
- Commands: src/SmartStack.Application/Features/{Module}/Commands/
601
- Queries: src/SmartStack.Application/Features/{Module}/Queries/
602
- Controller: src/SmartStack.Api/Areas/Business/Controllers/{Module}Controller.cs
603
- Migration: {migration_name}
604
-
605
- FRONTEND:
606
- Service: web/smartstack-web/src/services/api/{module}Service.ts
607
- Pages: web/smartstack-web/src/pages/business/{app}/{module}/
608
- i18n: 4 langues (fr, en, it, de)
609
-
610
- INTEGRATIONS SMARTSTACK:
611
- Notifications: {oui/non} - {N} types ajoutes
612
- Workflows: {oui/non} - {N} workflows crees
613
- IA Prompts: {oui/non} - {N} prompts crees
614
-
615
- ================================================================================
616
- PROCHAINES ETAPES (manuelles)
617
- ================================================================================
618
-
619
- 1. Tester manuellement dans le navigateur
620
- 2. Tester les notifications en temps réel (si applicable)
621
- 3. Vérifier les workflows dans l'admin (si applicable)
622
- 4. Générer la documentation:
623
- /business-analyse:7-doc-html {FEATURE_ID}
624
-
625
- ================================================================================
626
-
627
- <promise>COMPLETE</promise>
628
-
629
- ================================================================================
630
- ```
631
-
632
- ---
633
-
634
- ## Règles Ralph critiques
635
-
636
- 1. **UNE tâche par itération** - Ne JAMAIS faire plusieurs tâches à la fois
637
- 2. **Toujours commit** - Chaque itération DOIT produire un commit
638
- 3. **Toujours update prd.json** - Marquer la tâche comme terminée
639
- 4. **Toujours enrichir progress.txt** - C'est la mémoire pour les prochaines itérations
640
- 5. **Ne marquer "passes": true que si ça fonctionne** - Si erreur, ne pas marquer comme fait
641
-
642
- ---
643
-
644
- ## Options (mode sans Ralph)
645
-
646
- | Option | Description |
647
- |--------|-------------|
648
- | `--no-ralph` | Mode classique sans tracking Ralph |
649
- | `--phase=1` | Backend seulement |
650
- | `--phase=2` | Frontend seulement |
651
- | `--phase=3` | Integrations SmartStack seulement |
652
- | `--phase=4` | Tests seulement |
653
-
654
- ---
655
-
656
- ## Fichiers Ralph créés
657
-
658
- | Fichier | Description | Gitignore |
659
- |---------|-------------|-----------|
660
- | `prd.json` | Liste des tâches avec statut | Non (tracker dans git) |
661
- | `progress.txt` | Mémoire persistante | Non (tracker dans git) |
662
-
663
- Ces fichiers sont commités pour permettre la reprise après interruption.
1
+ ---
2
+ description: Implement a feature from its BA handoff (skip explore phase)
3
+ argument-hint: <FEAT-XXX>
4
+ model: opus
5
+ ---
6
+
7
+ # Implement Feature from Handoff
8
+
9
+ > **Modele:** OPUS (implementation one-shot, zero ambiguite)
10
+ > **Cout estime:** ~$2.00 (one-shot) / ~$5.00-15.00 (avec ralph-loop)
11
+ > **Prerequis:** Handoff valide (4-development-handoff.md)
12
+
13
+ ---
14
+
15
+ ## RALPH-LOOP INTEGRATION (OBLIGATOIRE)
16
+
17
+ ```
18
+ ╔══════════════════════════════════════════════════════════════════════════════╗
19
+ ║ UTILISATION AVEC RALPH-LOOP ║
20
+ ╠══════════════════════════════════════════════════════════════════════════════╣
21
+ ║ ║
22
+ ║ /ralph-loop "/implement FEAT-XXX" --completion-promise "COMPLETE" ║
23
+ ║ --max-iterations 25 ║
24
+ ║ ║
25
+ ║ FICHIERS RALPH (créés automatiquement): ║
26
+ ║ ├── prd.json → Liste des tâches avec statut ║
27
+ ║ └── progress.txt → Mémoire persistante entre itérations ║
28
+ ║ ║
29
+ ║ PROCESSUS PAR ITERATION: ║
30
+ ║ 1. Lire prd.json → Trouver prochaine tâche "passes": false ║
31
+ ║ 2. Lire progress.txt → Comprendre le contexte ║
32
+ ║ 3. Implémenter UNE SEULE tâche ║
33
+ ║ 4. git commit ║
34
+ ║ 5. Mettre à jour prd.json → "passes": true ║
35
+ ║ 6. Ajouter apprentissages à progress.txt ║
36
+ ║ 7. Si TOUTES tâches "passes": true → <promise>COMPLETE</promise> ║
37
+ ║ ║
38
+ ║ SIGNAL DE FIN: <promise>COMPLETE</promise> ║
39
+ ║ ║
40
+ ╚══════════════════════════════════════════════════════════════════════════════╝
41
+ ```
42
+
43
+ ---
44
+
45
+ ## WORKFLOW RALPH
46
+
47
+ ```
48
+ ┌─────────────────────────────────────────────────────────────────────────────┐
49
+ │ BOUCLE RALPH │
50
+ ├─────────────────────────────────────────────────────────────────────────────┤
51
+ │ │
52
+ │ ITERATION N │
53
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
54
+ │ │ 1. LIRE │───►│ 2. WORK │───►│ 3. SAVE │───►│ 4. CHECK │ │
55
+ │ │ prd.json │ │ 1 tâche │ │ commit │ │ all done?│ │
56
+ │ │ progress │ │ │ │ prd.json │ │ │ │
57
+ │ └──────────┘ └──────────┘ │ progress │ └────┬─────┘ │
58
+ │ └──────────┘ │ │
59
+ │ ▼ │
60
+ │ ┌─────────────────────┐ │
61
+ │ │ NON: Terminer │ │
62
+ │ │ (Ralph relance) │ │
63
+ │ ├─────────────────────┤ │
64
+ │ │ OUI: <promise> │ │
65
+ │ │ COMPLETE</promise> │ │
66
+ │ └─────────────────────┘ │
67
+ │ │
68
+ └─────────────────────────────────────────────────────────────────────────────┘
69
+ ```
70
+
71
+ ---
72
+
73
+ ## STEP 0: Initialisation Ralph (première itération seulement)
74
+
75
+ ### 0.1 Vérifier si prd.json existe
76
+
77
+ ```bash
78
+ FEATURE_ID=$1 # Paramètre: FEAT-XXX
79
+
80
+ # Si prd.json n'existe PAS → Première itération, initialiser
81
+ if [ ! -f "prd.json" ]; then
82
+ echo "Première itération - Initialisation Ralph..."
83
+ # Continuer vers 0.2
84
+ else
85
+ echo "Itération suivante - Lecture état..."
86
+ # Sauter vers STEP 1
87
+ fi
88
+ ```
89
+
90
+ ### 0.2 Charger le handoff et créer prd.json
91
+
92
+ ```bash
93
+ # Trouver le dossier feature
94
+ FEATURE_DIR=$(find .business-analyse -type d -name "${FEATURE_ID}*" | head -1)
95
+ HANDOFF_FILE="$FEATURE_DIR/4-development-handoff.md"
96
+
97
+ if [ ! -f "$HANDOFF_FILE" ]; then
98
+ echo "ERREUR: Handoff non trouvé"
99
+ echo " Lancez d'abord: /business-analyse:6-handoff $FEATURE_ID"
100
+ exit 1
101
+ fi
102
+ ```
103
+
104
+ **Créer prd.json avec les user stories extraites du handoff:**
105
+
106
+ ```json
107
+ {
108
+ "feature_id": "FEAT-XXX",
109
+ "handoff_file": ".business-analyse/FEAT-XXX/4-development-handoff.md",
110
+ "created_at": "2026-01-16T12:00:00Z",
111
+ "userStories": [
112
+ { "id": "1", "title": "Créer Entity Domain", "phase": "backend", "passes": false },
113
+ { "id": "2", "title": "Créer Configuration EF Core", "phase": "backend", "passes": false },
114
+ { "id": "3", "title": "Créer Migration EF Core", "phase": "backend", "passes": false },
115
+ { "id": "4", "title": "Créer Commands/Queries Application", "phase": "backend", "passes": false },
116
+ { "id": "5", "title": "Créer Validators FluentValidation", "phase": "backend", "passes": false },
117
+ { "id": "6", "title": "Créer Controller API", "phase": "backend", "passes": false },
118
+ { "id": "7", "title": "Vérifier Backend Build", "phase": "backend", "passes": false },
119
+ { "id": "8", "title": "Créer Service API Frontend", "phase": "frontend", "passes": false },
120
+ { "id": "9", "title": "Créer Pages Frontend", "phase": "frontend", "passes": false },
121
+ { "id": "10", "title": "Ajouter i18n (4 langues)", "phase": "frontend", "passes": false },
122
+ { "id": "11", "title": "Ajouter Routes", "phase": "frontend", "passes": false },
123
+ { "id": "12", "title": "Vérifier Frontend Build", "phase": "frontend", "passes": false },
124
+ { "id": "13", "title": "Ajouter Notifications (si requis)", "phase": "integrations", "passes": false },
125
+ { "id": "14", "title": "Ajouter Workflows (si requis)", "phase": "integrations", "passes": false },
126
+ { "id": "15", "title": "Ajouter Prompts IA (si requis)", "phase": "integrations", "passes": false },
127
+ { "id": "16", "title": "Tests unitaires", "phase": "tests", "passes": false },
128
+ { "id": "17", "title": "Tests intégration", "phase": "tests", "passes": false },
129
+ { "id": "18", "title": "Lint et TypeCheck final", "phase": "quality", "passes": false }
130
+ ]
131
+ }
132
+ ```
133
+
134
+ ### 0.3 Créer progress.txt
135
+
136
+ ```markdown
137
+ # Progress - FEAT-XXX
138
+
139
+ ## Initialisation
140
+ - Feature: {titre du handoff}
141
+ - Date: {timestamp}
142
+ - Handoff: {chemin}
143
+
144
+ ## Contexte du projet
145
+ - Backend: .NET 8, Clean Architecture
146
+ - Frontend: React + TypeScript + Vite
147
+ - Base: SmartStack.app
148
+
149
+ ---
150
+
151
+ ```
152
+
153
+ ### 0.4 Premier commit Ralph
154
+
155
+ ```bash
156
+ git add prd.json progress.txt
157
+ git commit -m "chore(ralph): initialize implementation tracking for FEAT-XXX"
158
+ ```
159
+
160
+ ---
161
+
162
+ ## STEP 1: Lire l'état Ralph (chaque itération)
163
+
164
+ ### 1.1 Lire prd.json
165
+
166
+ ```bash
167
+ # Lire prd.json pour trouver la prochaine tâche
168
+ PRD=$(cat prd.json)
169
+
170
+ # Identifier la PROCHAINE tâche avec "passes": false
171
+ # → C'est LA tâche à implémenter cette itération
172
+ ```
173
+
174
+ **Analyser prd.json:**
175
+ - Compter les tâches `"passes": true` → Progression
176
+ - Trouver la PREMIÈRE tâche `"passes": false` → Tâche courante
177
+ - Si AUCUNE tâche `"passes": false` → TOUTES TERMINÉES
178
+
179
+ ### 1.2 Lire progress.txt
180
+
181
+ ```bash
182
+ # Lire progress.txt pour comprendre le contexte
183
+ PROGRESS=$(cat progress.txt)
184
+
185
+ # Extraire les apprentissages des itérations précédentes
186
+ # Comprendre les décisions prises et problèmes résolus
187
+ ```
188
+
189
+ ### 1.3 Vérifier git log
190
+
191
+ ```bash
192
+ # Voir les commits récents pour contexte
193
+ git log --oneline -10
194
+ ```
195
+
196
+ ### 1.4 Afficher le résumé
197
+
198
+ ```
199
+ ================================================================================
200
+ RALPH ITERATION - FEAT-XXX
201
+ ================================================================================
202
+
203
+ PROGRESSION: {N}/{TOTAL} tâches terminées
204
+
205
+ TÂCHE COURANTE: #{id} - {title}
206
+ PHASE: {phase}
207
+
208
+ CONTEXTE (progress.txt):
209
+ {derniers apprentissages}
210
+
211
+ ================================================================================
212
+ ```
213
+
214
+ ---
215
+
216
+ ## STEP 2: Implémenter UNE SEULE tâche
217
+
218
+ > **RÈGLE CRITIQUE:** Ne travailler que sur la tâche identifiée en STEP 1.
219
+ > Ne PAS avancer sur d'autres tâches même si c'est tentant.
220
+
221
+ ### Référence des tâches par phase
222
+
223
+ **Phase: backend**
224
+ | ID | Tâche | Instructions |
225
+ |----|-------|--------------|
226
+ | 1 | Créer Entity Domain | Voir STEP 3.1 |
227
+ | 2 | Créer Configuration EF Core | Voir STEP 3.2 |
228
+ | 3 | Créer Migration EF Core | `/efcore:migration` |
229
+ | 4 | Créer Commands/Queries Application | Voir STEP 3.3 |
230
+ | 5 | Créer Validators FluentValidation | Voir STEP 3.3 |
231
+ | 6 | Créer Controller API | Voir STEP 3.4 |
232
+ | 7 | Vérifier Backend Build | `dotnet build` |
233
+
234
+ **Phase: frontend**
235
+ | ID | Tâche | Instructions |
236
+ |----|-------|--------------|
237
+ | 8 | Créer Service API Frontend | Voir STEP 4.1 |
238
+ | 9 | Créer Pages Frontend | Voir STEP 4.2 |
239
+ | 10 | Ajouter i18n (4 langues) | Voir STEP 4.3 |
240
+ | 11 | Ajouter Routes | Voir STEP 4.4 |
241
+ | 12 | Vérifier Frontend Build | `npm run build` |
242
+
243
+ **Phase: integrations**
244
+ | ID | Tâche | Instructions |
245
+ |----|-------|--------------|
246
+ | 13 | Ajouter Notifications | Voir STEP 5.2 (si requis dans handoff) |
247
+ | 14 | Ajouter Workflows | Voir STEP 5.3 (si requis dans handoff) |
248
+ | 15 | Ajouter Prompts IA | Voir STEP 5.4 (si requis dans handoff) |
249
+
250
+ **Phase: tests**
251
+ | ID | Tâche | Instructions |
252
+ |----|-------|--------------|
253
+ | 16 | Tests unitaires | `dotnet test --filter "Category=Unit"` |
254
+ | 17 | Tests intégration | `dotnet test --filter "Category=Integration"` |
255
+
256
+ **Phase: quality**
257
+ | ID | Tâche | Instructions |
258
+ |----|-------|--------------|
259
+ | 18 | Lint et TypeCheck final | `npm run lint && npm run typecheck` |
260
+
261
+ ---
262
+
263
+ ## STEP 3: Instructions Backend (tâches 1-7)
264
+
265
+ ### 3.1 Domain Layer
266
+
267
+ ```
268
+ EXPLORER PATTERNS EXISTANTS:
269
+ -> src/SmartStack.Domain/Entities/
270
+ -> src/SmartStack.Domain/Constants/Permissions.cs
271
+ ```
272
+
273
+ Actions:
274
+ 1. Creer l'entite dans Domain/Entities/Business/
275
+ 2. Ajouter les constantes de permission
276
+ 3. Valider: `dotnet build src/SmartStack.Domain`
277
+
278
+ ### 3.2 Infrastructure Layer
279
+
280
+ ```
281
+ EXPLORER PATTERNS EXISTANTS:
282
+ -> src/SmartStack.Infrastructure/Persistence/Configurations/
283
+ ```
284
+
285
+ Actions:
286
+ 1. Creer EntityTypeConfiguration
287
+ 2. Ajouter HasData pour seed si necessaire
288
+ 3. Creer migration: `/efcore:migration`
289
+ 4. Valider: `dotnet build src/SmartStack.Infrastructure`
290
+
291
+ ### 3.3 Application Layer
292
+
293
+ ```
294
+ EXPLORER PATTERNS EXISTANTS:
295
+ -> src/SmartStack.Application/Features/
296
+ ```
297
+
298
+ Actions:
299
+ 1. Creer Commands (Create, Update, Delete)
300
+ 2. Creer Queries (GetById, GetList)
301
+ 3. Creer DTOs
302
+ 4. Creer Validators (FluentValidation)
303
+ 5. Valider: `dotnet build src/SmartStack.Application`
304
+
305
+ ### 3.4 API Layer
306
+
307
+ ```
308
+ EXPLORER PATTERNS EXISTANTS:
309
+ -> src/SmartStack.Api/Areas/Business/Controllers/
310
+ ```
311
+
312
+ Actions:
313
+ 1. Creer Controller dans Areas/Business
314
+ 2. Ajouter [RequirePermission] sur chaque action
315
+ 3. Documenter avec [ProducesResponseType]
316
+ 4. Valider: `dotnet build src/SmartStack.Api`
317
+
318
+ ### 3.5 Check Backend
319
+
320
+ ```bash
321
+ # Build complet
322
+ dotnet build
323
+
324
+ # Si erreur: corriger et recommencer
325
+ ```
326
+
327
+ ---
328
+
329
+ ## STEP 4: Implementation Frontend
330
+
331
+ ### 4.1 Service API
332
+
333
+ ```
334
+ EXPLORER PATTERNS EXISTANTS:
335
+ -> web/smartstack-web/src/services/api/
336
+ ```
337
+
338
+ Actions:
339
+ 1. Creer service avec endpoints
340
+ 2. Definir types TypeScript
341
+ 3. Valider: `npm run typecheck`
342
+
343
+ ### 4.2 Pages
344
+
345
+ ```
346
+ EXPLORER PATTERNS EXISTANTS:
347
+ -> web/smartstack-web/src/pages/business/
348
+ -> web/smartstack-web/src/pages/admin/ (pour patterns CRUD)
349
+ ```
350
+
351
+ Actions:
352
+ 1. Creer ListPage avec DataTable
353
+ 2. Creer DetailPage (si applicable)
354
+ 3. Ajouter modals Create/Edit
355
+ 4. Implementer filtres et pagination
356
+ 5. Ajouter permission checks (usePermission)
357
+
358
+ ### 4.3 i18n
359
+
360
+ ```
361
+ FICHIERS A MODIFIER:
362
+ -> web/smartstack-web/src/i18n/locales/fr/{module}.json
363
+ -> web/smartstack-web/src/i18n/locales/en/{module}.json
364
+ -> web/smartstack-web/src/i18n/locales/it/{module}.json
365
+ -> web/smartstack-web/src/i18n/locales/de/{module}.json
366
+ ```
367
+
368
+ Actions:
369
+ 1. Ajouter toutes les cles dans les 4 langues
370
+ 2. Utiliser useTranslation dans les composants
371
+
372
+ ### 4.4 Routes
373
+
374
+ ```
375
+ FICHIER:
376
+ -> web/smartstack-web/src/App.tsx ou routes.tsx
377
+ ```
378
+
379
+ Actions:
380
+ 1. Ajouter routes pour les nouvelles pages
381
+ 2. Proteger avec RequireAuth si necessaire
382
+
383
+ ### 4.5 Check Frontend
384
+
385
+ ```bash
386
+ cd web/smartstack-web
387
+ npm run lint
388
+ npm run typecheck
389
+ npm run build
390
+ ```
391
+
392
+ ---
393
+
394
+ ## STEP 5: Integrations SmartStack
395
+
396
+ > **CRITIQUE:** Lire la Section 9 du handoff pour determiner les integrations requises.
397
+
398
+ ### 5.1 Verifier les integrations requises
399
+
400
+ ```bash
401
+ # Dans le handoff, section 9.4:
402
+ # | Integration | Requis | Skill |
403
+ # |-------------|--------|-------|
404
+ # | Notifications | oui/non | /notification add |
405
+ # | Workflows | oui/non | /workflow create |
406
+ # | IA | oui/non | /ai-prompt create |
407
+ ```
408
+
409
+ ### 5.2 Notifications (si requis=oui)
410
+
411
+ **Skill a executer:** `/notification add`
412
+
413
+ Actions:
414
+ 1. Ajouter le NotificationType dans l'enum
415
+ 2. Injecter `INotificationService` dans le service
416
+ 3. Ajouter l'appel `SendNotificationAsync` apres les operations CRUD
417
+ 4. Creer le hook frontend `use{Module}Notifications.ts`
418
+
419
+ ```csharp
420
+ // Template dans le service
421
+ await _notificationService.SendNotificationAsync(
422
+ userId: destinataire.Id,
423
+ type: NotificationType.{Entity}Created,
424
+ title: _localizer["{module}.notifications.created.title"],
425
+ message: _localizer["{module}.notifications.created.message", entity.Name],
426
+ relatedEntityType: nameof({Entity}),
427
+ relatedEntityId: entity.Id,
428
+ actionUrl: $"/{module}/{entity.Id}",
429
+ cancellationToken: ct);
430
+ ```
431
+
432
+ ### 5.3 Workflows (si requis=oui)
433
+
434
+ **Skill a executer:** `/workflow create`
435
+
436
+ Actions:
437
+ 1. Creer le trigger dans WorkflowTriggerConfiguration.cs
438
+ 2. Creer le workflow dans WorkflowConfiguration.cs
439
+ 3. Ajouter les steps dans WorkflowStepConfiguration.cs
440
+ 4. Creer les email templates si necessaire
441
+ 5. Ajouter l'appel `TriggerAsync` dans le service
442
+
443
+ ```csharp
444
+ // Template dans le service
445
+ await _workflowService.TriggerAsync(
446
+ "{entity}.created",
447
+ new Dictionary<string, object>
448
+ {
449
+ ["entityId"] = entity.Id,
450
+ ["entityName"] = entity.Name,
451
+ ["userEmail"] = _currentUser.Email
452
+ },
453
+ language: _currentUser.Language ?? "fr",
454
+ cancellationToken: ct);
455
+ ```
456
+
457
+ ### 5.4 Assistance IA (si requis=oui)
458
+
459
+ **Skill a executer:** `/ai-prompt create`
460
+
461
+ Actions:
462
+ 1. Creer le Prompt dans PromptConfiguration.cs
463
+ 2. Creer les Blocks dans PromptBlockConfiguration.cs
464
+ 3. Creer le OutputSchema si sortie structuree
465
+ 4. Ajouter l'appel `CompleteAsync` dans le service
466
+
467
+ ```csharp
468
+ // Template dans le service
469
+ var result = await _aiCompletionService.CompleteAsync<{OutputType}>(
470
+ "{prompt-code}",
471
+ new Dictionary<string, object>
472
+ {
473
+ ["context"] = context,
474
+ ["entity"] = entity
475
+ },
476
+ cancellationToken: ct);
477
+ ```
478
+
479
+ ### 5.5 Migration EF Core (si nouvelles entites)
480
+
481
+ ```bash
482
+ # Si des entites ont ete ajoutees (triggers, workflows, templates)
483
+ /efcore:migration
484
+ ```
485
+
486
+ ---
487
+
488
+ ## STEP 6: Tests
489
+
490
+ ### 6.1 Tests Unitaires
491
+
492
+ ```bash
493
+ # Backend
494
+ dotnet test --filter "Category=Unit"
495
+
496
+ # Frontend
497
+ npm run test:unit
498
+ ```
499
+
500
+ ### 6.2 Tests Integration
501
+
502
+ ```bash
503
+ # API tests
504
+ dotnet test --filter "Category=Integration"
505
+ ```
506
+
507
+ ### 6.3 Collection Postman (optionnel)
508
+
509
+ ```bash
510
+ /controller:postman-templates {module}
511
+ ```
512
+
513
+ ---
514
+
515
+ ## STEP 7: Persister l'état Ralph (FIN DE CHAQUE ITERATION)
516
+
517
+ > **OBLIGATOIRE:** Ces actions DOIVENT être faites à CHAQUE itération.
518
+
519
+ ### 7.1 Git commit
520
+
521
+ ```bash
522
+ # Commit du travail de cette itération
523
+ git add -A
524
+ git commit -m "feat({module}): {description courte de la tâche}"
525
+ ```
526
+
527
+ ### 7.2 Mettre à jour prd.json
528
+
529
+ Modifier la tâche courante: `"passes": false` → `"passes": true`
530
+
531
+ ```json
532
+ // AVANT
533
+ { "id": "3", "title": "Créer Migration EF Core", "phase": "backend", "passes": false }
534
+
535
+ // APRÈS
536
+ { "id": "3", "title": "Créer Migration EF Core", "phase": "backend", "passes": true }
537
+ ```
538
+
539
+ ### 7.3 Ajouter à progress.txt
540
+
541
+ Ajouter une entrée à la fin du fichier:
542
+
543
+ ```markdown
544
+ ## Itération {DATE} {HEURE}
545
+ - Tâche: #{id} - {title}
546
+ - Fait: {description de ce qui a été implémenté}
547
+ - Fichiers modifiés: {liste des fichiers créés/modifiés}
548
+ - Apprentissages: {ce qui sera utile pour les prochaines itérations}
549
+ - Problèmes: {difficultés rencontrées, le cas échéant}
550
+ ```
551
+
552
+ ### 7.4 Commit des fichiers Ralph
553
+
554
+ ```bash
555
+ git add prd.json progress.txt
556
+ git commit -m "chore(ralph): mark task #{id} complete"
557
+ ```
558
+
559
+ ---
560
+
561
+ ## STEP 8: Vérifier completion et signaler
562
+
563
+ ### 8.1 Compter les tâches restantes
564
+
565
+ ```bash
566
+ # Lire prd.json et compter les "passes": false
567
+ REMAINING=$(grep -c '"passes": false' prd.json)
568
+ ```
569
+
570
+ ### 8.2 Si des tâches restent (REMAINING > 0)
571
+
572
+ ```
573
+ ================================================================================
574
+ ITERATION TERMINEE - FEAT-XXX
575
+ ================================================================================
576
+
577
+ TÂCHE COMPLETEE: #{id} - {title}
578
+ PROGRESSION: {N}/{TOTAL} tâches
579
+
580
+ PROCHAINE TÂCHE: #{next_id} - {next_title}
581
+
582
+ ================================================================================
583
+ ```
584
+
585
+ **NE PAS afficher `<promise>COMPLETE</promise>`**
586
+ → Ralph relancera automatiquement une nouvelle itération.
587
+
588
+ ### 8.3 Si TOUTES les tâches sont terminées (REMAINING = 0)
589
+
590
+ ```
591
+ ================================================================================
592
+ FEATURE IMPLEMENTEE - {FEATURE_ID}
593
+ ================================================================================
594
+
595
+ TOUTES LES TÂCHES TERMINÉES (18/18)
596
+
597
+ BACKEND:
598
+ Entity: src/SmartStack.Domain/Entities/Business/{Entity}.cs
599
+ Config: src/SmartStack.Infrastructure/.../Configuration.cs
600
+ Commands: src/SmartStack.Application/Features/{Module}/Commands/
601
+ Queries: src/SmartStack.Application/Features/{Module}/Queries/
602
+ Controller: src/SmartStack.Api/Areas/Business/Controllers/{Module}Controller.cs
603
+ Migration: {migration_name}
604
+
605
+ FRONTEND:
606
+ Service: web/smartstack-web/src/services/api/{module}Service.ts
607
+ Pages: web/smartstack-web/src/pages/business/{app}/{module}/
608
+ i18n: 4 langues (fr, en, it, de)
609
+
610
+ INTEGRATIONS SMARTSTACK:
611
+ Notifications: {oui/non} - {N} types ajoutes
612
+ Workflows: {oui/non} - {N} workflows crees
613
+ IA Prompts: {oui/non} - {N} prompts crees
614
+
615
+ ================================================================================
616
+ PROCHAINES ETAPES (manuelles)
617
+ ================================================================================
618
+
619
+ 1. Tester manuellement dans le navigateur
620
+ 2. Tester les notifications en temps réel (si applicable)
621
+ 3. Vérifier les workflows dans l'admin (si applicable)
622
+ 4. Générer la documentation:
623
+ /business-analyse:7-doc-html {FEATURE_ID}
624
+
625
+ ================================================================================
626
+
627
+ <promise>COMPLETE</promise>
628
+
629
+ ================================================================================
630
+ ```
631
+
632
+ ---
633
+
634
+ ## Règles Ralph critiques
635
+
636
+ 1. **UNE tâche par itération** - Ne JAMAIS faire plusieurs tâches à la fois
637
+ 2. **Toujours commit** - Chaque itération DOIT produire un commit
638
+ 3. **Toujours update prd.json** - Marquer la tâche comme terminée
639
+ 4. **Toujours enrichir progress.txt** - C'est la mémoire pour les prochaines itérations
640
+ 5. **Ne marquer "passes": true que si ça fonctionne** - Si erreur, ne pas marquer comme fait
641
+
642
+ ---
643
+
644
+ ## Options (mode sans Ralph)
645
+
646
+ | Option | Description |
647
+ |--------|-------------|
648
+ | `--no-ralph` | Mode classique sans tracking Ralph |
649
+ | `--phase=1` | Backend seulement |
650
+ | `--phase=2` | Frontend seulement |
651
+ | `--phase=3` | Integrations SmartStack seulement |
652
+ | `--phase=4` | Tests seulement |
653
+
654
+ ---
655
+
656
+ ## Fichiers Ralph créés
657
+
658
+ | Fichier | Description | Gitignore |
659
+ |---------|-------------|-----------|
660
+ | `prd.json` | Liste des tâches avec statut | Non (tracker dans git) |
661
+ | `progress.txt` | Mémoire persistante | Non (tracker dans git) |
662
+
663
+ Ces fichiers sont commités pour permettre la reprise après interruption.