@atlashub/smartstack-cli 1.11.0 → 1.13.1

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 (74) hide show
  1. package/.documentation/agents.html +7 -2
  2. package/.documentation/apex.html +7 -2
  3. package/.documentation/business-analyse.html +7 -2
  4. package/.documentation/cli-commands.html +871 -0
  5. package/.documentation/commands.html +7 -2
  6. package/.documentation/efcore.html +7 -2
  7. package/.documentation/gitflow.html +7 -2
  8. package/.documentation/hooks.html +7 -2
  9. package/.documentation/index.html +7 -2
  10. package/.documentation/init.html +7 -2
  11. package/.documentation/installation.html +7 -2
  12. package/.documentation/ralph-loop.html +7 -2
  13. package/.documentation/test-web.html +7 -2
  14. package/dist/index.js +1932 -336
  15. package/dist/index.js.map +1 -1
  16. package/package.json +8 -2
  17. package/templates/agents/efcore/squash.md +67 -31
  18. package/templates/agents/gitflow/finish.md +68 -56
  19. package/templates/commands/business-analyse/0-orchestrate.md +72 -556
  20. package/templates/commands/business-analyse/1-init.md +23 -193
  21. package/templates/commands/business-analyse/2-discover.md +85 -462
  22. package/templates/commands/business-analyse/3-analyse.md +40 -342
  23. package/templates/commands/business-analyse/4-specify.md +72 -537
  24. package/templates/commands/business-analyse/5-validate.md +43 -237
  25. package/templates/commands/business-analyse/6-handoff.md +93 -682
  26. package/templates/commands/business-analyse/7-doc-html.md +45 -544
  27. package/templates/commands/business-analyse/_shared.md +176 -0
  28. package/templates/commands/business-analyse/bug.md +50 -257
  29. package/templates/commands/business-analyse/change-request.md +59 -283
  30. package/templates/commands/business-analyse/hotfix.md +36 -120
  31. package/templates/commands/business-analyse.md +55 -574
  32. package/templates/commands/efcore/_shared.md +206 -0
  33. package/templates/commands/efcore/conflicts.md +39 -201
  34. package/templates/commands/efcore/db-deploy.md +28 -237
  35. package/templates/commands/efcore/db-reset.md +41 -390
  36. package/templates/commands/efcore/db-seed.md +44 -323
  37. package/templates/commands/efcore/db-status.md +31 -210
  38. package/templates/commands/efcore/migration.md +45 -368
  39. package/templates/commands/efcore/rebase-snapshot.md +38 -241
  40. package/templates/commands/efcore/scan.md +35 -204
  41. package/templates/commands/efcore/squash.md +158 -251
  42. package/templates/commands/efcore.md +49 -177
  43. package/templates/commands/gitflow/1-init.md +94 -1318
  44. package/templates/commands/gitflow/10-start.md +86 -990
  45. package/templates/commands/gitflow/11-finish.md +264 -454
  46. package/templates/commands/gitflow/12-cleanup.md +40 -213
  47. package/templates/commands/gitflow/2-status.md +51 -386
  48. package/templates/commands/gitflow/3-commit.md +108 -801
  49. package/templates/commands/gitflow/4-plan.md +42 -13
  50. package/templates/commands/gitflow/5-exec.md +60 -5
  51. package/templates/commands/gitflow/6-abort.md +54 -277
  52. package/templates/commands/gitflow/7-pull-request.md +74 -717
  53. package/templates/commands/gitflow/8-review.md +51 -178
  54. package/templates/commands/gitflow/9-merge.md +74 -404
  55. package/templates/commands/gitflow/_shared.md +196 -0
  56. package/templates/commands/quickstart.md +154 -0
  57. package/templates/commands/ralph-loop/ralph-loop.md +104 -2
  58. package/templates/hooks/hooks.json +13 -0
  59. package/templates/hooks/ralph-mcp-logger.sh +46 -0
  60. package/templates/hooks/ralph-session-end.sh +69 -0
  61. package/templates/ralph/README.md +91 -0
  62. package/templates/ralph/ralph.config.yaml +113 -0
  63. package/templates/scripts/setup-ralph-loop.sh +173 -0
  64. package/templates/skills/_shared.md +117 -0
  65. package/templates/skills/ai-prompt/SKILL.md +87 -654
  66. package/templates/skills/application/SKILL.md +76 -499
  67. package/templates/skills/controller/SKILL.md +38 -165
  68. package/templates/skills/documentation/SKILL.md +2 -1
  69. package/templates/skills/feature-full/SKILL.md +107 -732
  70. package/templates/skills/notification/SKILL.md +85 -474
  71. package/templates/skills/ui-components/SKILL.md +62 -762
  72. package/templates/skills/workflow/SKILL.md +85 -489
  73. package/templates/commands/gitflow/rescue.md +0 -867
  74. package/templates/skills/business-analyse/SKILL.md +0 -191
@@ -6,593 +6,128 @@ model: sonnet
6
6
 
7
7
  # Phase 4: Spécifications Fonctionnelles - FRD
8
8
 
9
- > **Modèle:** Sonnet (spécifications détaillées)
10
- > **Coût estimé:** ~$0.18
11
- > **Input:** 2-business-requirements.md
12
- > **Output:** 3-functional-specification.md (FRD)
9
+ > **Ref:** Fonctions communes dans [_shared.md](_shared.md)
10
+ > **Templates:** [templates-frd.md](../skills/business-analyse/templates-frd.md)
13
11
 
14
12
  ---
15
13
 
16
- ## OBJECTIF
17
-
18
- ```
19
- ╔══════════════════════════════════════════════════════════════════════════════╗
20
- ║ TRANSFORMER LE BRD EN SPÉCIFICATIONS IMPLÉMENTABLES ║
21
- ╠══════════════════════════════════════════════════════════════════════════════╣
22
- ║ ║
23
- ║ Le FRD définit COMMENT le système doit se comporter: ║
24
- ║ ║
25
- ║ • Cas d'utilisation détaillés (UC-XXX) ║
26
- ║ • Exigences fonctionnelles (FR-XXX) ║
27
- ║ • Wireframes d'interface ║
28
- ║ • Permissions granulaires ║
29
- ║ • Scénarios Gherkin pour tests ║
30
- ║ ║
31
- ║ RÈGLE: Assez détaillé pour qu'un développeur puisse implémenter ║
32
- ║ sans poser de questions. ║
33
- ║ ║
34
- ╚══════════════════════════════════════════════════════════════════════════════╝
35
- ```
36
-
37
- ---
38
-
39
- ## STEP 1: Charger le BRD
14
+ ## Prérequis
40
15
 
41
16
  ```bash
42
- FEATURE_ID=$1
43
- FEATURE_DIR=$(find .business-analyse -type d -name "${FEATURE_ID}*" | head -1)
44
- BRD_FILE="$FEATURE_DIR/2-business-requirements.md"
45
-
46
- if [ ! -f "$BRD_FILE" ]; then
47
- echo "❌ ERREUR: 2-business-requirements.md non trouvé"
48
- echo " Lancez d'abord: /business-analyse:3-analyse $FEATURE_ID"
49
- exit 1
50
- fi
51
-
52
- # Extraire application et module
53
- APPLICATION=$(echo $FEATURE_DIR | grep -oP 'business/\K[^/]+')
54
- MODULE=$(echo $FEATURE_DIR | grep -oP 'modules/\K[^/]+')
17
+ find_feature_dir "$1" || exit 1
18
+ [ -f "$FEATURE_DIR/2-business-requirements.md" ] || { echo " BRD requis"; exit 1; }
55
19
  PERMISSION_BASE="business.$APPLICATION.$MODULE"
56
20
  ```
57
21
 
58
22
  ---
59
23
 
60
- ## STEP 2: Scanner les patterns UI existants
24
+ ## Objectif
61
25
 
62
- ```bash
63
- # Scanner les pages existantes pour cohérence UI
64
- EXISTING_PAGES=$(find web/smartstack-web/src/pages -name "*.tsx" | head -20)
26
+ Définir COMMENT le système doit se comporter:
27
+ - Cas d'utilisation détaillés (UC-XXX)
28
+ - Exigences fonctionnelles (FR-XXX)
29
+ - Wireframes interface
30
+ - Permissions granulaires
31
+ - Scénarios Gherkin
65
32
 
66
- # Extraire les patterns de composants utilisés
67
- COMPONENT_PATTERNS=$(grep -h "import.*from.*components" $EXISTING_PAGES 2>/dev/null | sort -u)
68
-
69
- echo "Patterns UI existants identifiés"
70
- ```
33
+ **Règle:** Assez détaillé pour implémenter SANS questions.
71
34
 
72
35
  ---
73
36
 
74
- ## STEP 3: Génération du FRD
75
-
76
- ```bash
77
- FRD_FILE="$FEATURE_DIR/3-functional-specification.md"
78
- ```
79
-
80
- ### Template 3-functional-specification.md
37
+ ## Template 3-functional-specification.md
81
38
 
82
39
  ```markdown
83
- # FRD - {FEATURE_ID} {Feature Name}
40
+ # FRD - {FEATURE_ID}
84
41
 
85
- > **Module:** business/{application}/{module}
86
- > **Version:** 1.0
87
- > **Basé sur:** 2-business-requirements.md v1.0
88
- > **Permission base:** business.{application}.{module}.*
89
- > **Standard:** IEEE 830
42
+ > **Module:** business/{app}/{module}
43
+ > **Permission base:** business.{app}.{module}.*
90
44
 
91
- ---
92
-
93
- ## 1. Vue d'ensemble
94
-
95
- ### 1.1 Objectif fonctionnel
96
-
97
- {Description de ce que le système doit faire, du point de vue utilisateur}
98
-
99
- ### 1.2 Acteurs
100
-
101
- | Acteur | Description | Permissions requises |
102
- |--------|-------------|---------------------|
103
- | Admin | Administrateur avec tous les droits | `{module}.*` |
104
- | Manager | Gestionnaire du module | `{module}.read`, `{module}.create`, `{module}.update` |
105
- | User | Utilisateur standard | `{module}.read` |
106
- | ReadOnly | Consultation seule | `{module}.read` |
107
-
108
- ### 1.3 Préconditions globales
109
-
110
- - Utilisateur authentifié
111
- - Permission `business.{application}.{module}.read` au minimum
112
- - Module activé dans la configuration tenant
113
-
114
- ---
45
+ ## 1. Acteurs
46
+ | Acteur | Permissions requises |
115
47
 
116
48
  ## 2. Cas d'utilisation
117
-
118
- ### UC-001: {Nom du cas d'utilisation principal}
119
-
49
+ ### UC-001: {Nom}
120
50
  | Attribut | Valeur |
121
- |----------|--------|
122
- | **ID** | UC-001 |
123
- | **Nom** | {Nom descriptif} |
124
- | **Acteur principal** | {Rôle} |
125
- | **Préconditions** | {conditions requises avant exécution} |
126
- | **Postconditions** | {état du système après exécution} |
127
- | **Permission** | `business.{app}.{module}.{action}` |
128
- | **Fréquence** | {Daily/Weekly/Monthly} |
129
- | **Criticité** | {High/Medium/Low} |
51
+ | ID | UC-001 |
52
+ | Acteur | {Rôle} |
53
+ | Permission | `.{action}` |
130
54
 
131
55
  **Scénario principal:**
132
-
133
56
  | # | Acteur | Système |
134
- |---|--------|---------|
135
- | 1 | {L'utilisateur fait...} | |
136
- | 2 | | {Le système répond...} |
137
- | 3 | {L'utilisateur fait...} | |
138
- | 4 | | {Le système répond...} |
139
- | 5 | | {Le système confirme avec message} |
140
-
141
- **Scénarios alternatifs:**
142
-
143
- | # | Condition | Étapes alternatives |
144
- |---|-----------|---------------------|
145
- | 3a | {Si condition X} | 3a.1 {action}, 3a.2 {action} |
146
- | 4a | {Si condition Y} | 4a.1 {action} |
147
-
148
- **Scénarios d'erreur:**
149
57
 
150
- | # | Erreur | Message | Action système |
151
- |---|--------|---------|----------------|
152
- | E1 | {description erreur} | `{module}.errors.{code}` | {comportement} |
153
- | E2 | Validation échouée | `{module}.errors.validation` | Afficher erreurs |
154
- | E3 | Permission refusée | `common.errors.forbidden` | Rediriger login |
155
-
156
- ---
58
+ **Erreurs:**
59
+ | # | Erreur | Message i18n |
157
60
 
158
61
  ## 3. Exigences fonctionnelles
159
-
160
62
  | ID | Exigence | UC lié | BR lié | Priorité |
161
- |----|----------|--------|--------|----------|
162
- | FR-001 | Le système DOIT {action} | UC-001 | BR-001 | Must |
163
- | FR-002 | Le système DOIT {action} | UC-001 | BR-002 | Must |
164
- | FR-003 | Le système DEVRAIT {action} | UC-002 | - | Should |
165
-
166
- ### 3.1 Détail FR-001: {Nom}
167
-
168
- **Énoncé:**
169
- Le système DOIT {description précise de l'exigence fonctionnelle}
170
-
171
- **Critères d'acceptation:**
172
- - [ ] {Critère mesurable et vérifiable 1}
173
- - [ ] {Critère mesurable et vérifiable 2}
174
- - [ ] {Critère mesurable et vérifiable 3}
175
-
176
- **Règles associées:** BR-001, BR-002
177
-
178
- **Scénario de test:**
179
- ```gherkin
180
- Scenario: FR-001 - {description}
181
- Given {contexte initial}
182
- When {action utilisateur}
183
- Then {résultat attendu}
184
- And {vérification supplémentaire}
185
- ```
186
63
 
187
- ---
64
+ ### FR-001: {Nom}
65
+ Critères d'acceptation:
66
+ - [ ] {critère}
188
67
 
189
68
  ## 4. Interface utilisateur
190
-
191
- ### 4.1 Navigation
192
-
193
- **Chemin d'accès:** Business > {Application} > {Module}
194
-
195
- **URL:** `/business/{application}/{module}`
196
-
197
- ### 4.2 Wireframe - Liste principale
198
-
199
- ```
200
- ┌─────────────────────────────────────────────────────────────────────────────┐
201
- │ [Logo] Business / {App} / {Module} [User ▼] [☰] │
202
- ├─────────────────────────────────────────────────────────────────────────────┤
203
- │ │
204
- │ ┌─────────────────────────────────────────────────────────────────────┐ │
205
- │ │ {Module Name} [+ Nouveau] │ │
206
- │ │ {Description courte du module} │ │
207
- │ └─────────────────────────────────────────────────────────────────────┘ │
208
- │ │
209
- │ ┌─────────────────────────────────────────────────────────────────────┐ │
210
- │ │ FILTRES │ │
211
- │ │ [Statut ▼] [Date du ▼] [Date au ▼] [Recherche... ] [Filtrer] │ │
212
- │ └─────────────────────────────────────────────────────────────────────┘ │
213
- │ │
214
- │ ┌─────────────────────────────────────────────────────────────────────┐ │
215
- │ │ TABLEAU │ │
216
- │ │ ┌────────┬────────────┬────────────┬──────────┬─────────────────┐ │ │
217
- │ │ │ □ │ {Col 1} │ {Col 2} │ {Col 3} │ Actions │ │ │
218
- │ │ ├────────┼────────────┼────────────┼──────────┼─────────────────┤ │ │
219
- │ │ │ □ │ {data} │ {data} │ {badge} │ [👁] [✏] [🗑] │ │ │
220
- │ │ │ □ │ {data} │ {data} │ {badge} │ [👁] [✏] [🗑] │ │ │
221
- │ │ │ □ │ {data} │ {data} │ {badge} │ [👁] [✏] [🗑] │ │ │
222
- │ │ └────────┴────────────┴────────────┴──────────┴─────────────────┘ │ │
223
- │ │ │ │
224
- │ │ Affichage 1-10 sur 125 [< Précédent] [Suivant >]│ │
225
- │ └─────────────────────────────────────────────────────────────────────┘ │
226
- │ │
227
- └─────────────────────────────────────────────────────────────────────────────┘
228
- ```
229
-
230
- ### 4.3 Description des éléments UI
231
-
232
- | Élément | Type | Comportement | Permission | Clé i18n |
233
- |---------|------|--------------|------------|----------|
234
- | [+ Nouveau] | Button primary | Ouvre modal création | `.create` | `{module}.actions.create` |
235
- | [👁] | Icon button | Ouvre page détail | `.read` | `common.actions.view` |
236
- | [✏] | Icon button | Ouvre modal édition | `.update` | `common.actions.edit` |
237
- | [🗑] | Icon button | Confirmation + suppression | `.delete` | `common.actions.delete` |
238
- | Checkbox | Checkbox | Sélection multiple | `.read` | - |
239
- | Filtres | Select/Input | Filtre la liste | `.read` | `{module}.filters.*` |
240
-
241
- ### 4.4 Wireframe - Modal création/édition
242
-
69
+ ### Wireframe Liste
243
70
  ```
244
- ┌─────────────────────────────────────────────────────────────┐
245
- │ {Créer | Modifier} {EntityName} [X]
246
- ├─────────────────────────────────────────────────────────────┤
247
- │ │
248
- │ {Champ 1} * │
249
- │ ┌─────────────────────────────────────────────────────┐ │
250
- │ │ │ │
251
- │ └─────────────────────────────────────────────────────┘ │
252
- │ {Message d'aide} │
253
- │ │
254
- │ {Champ 2} * │
255
- │ ┌─────────────────────────────────────────────────────┐ │
256
- │ │ [▼] │ │
257
- │ └─────────────────────────────────────────────────────┘ │
258
- │ │
259
- │ {Champ 3} │
260
- │ ┌─────────────────────────────────────────────────────┐ │
261
- │ │ │ │
262
- │ │ │ │
263
- │ │ │ │
264
- │ └─────────────────────────────────────────────────────┘ │
265
- │ │
266
- ├─────────────────────────────────────────────────────────────┤
267
- │ [Annuler] [Enregistrer] │
268
- └─────────────────────────────────────────────────────────────┘
71
+ [Header] [+ Nouveau]
72
+ [Filtres: Status, Recherche]
73
+ [Table: Col1 | Col2 | Actions]
74
+ [Pagination]
269
75
  ```
270
76
 
271
- ### 4.5 Champs du formulaire
272
-
273
- | Champ | Type | Obligatoire | Validation | Clé i18n |
274
- |-------|------|-------------|------------|----------|
275
- | {champ1} | Text input | Oui | Max 100 chars | `{module}.fields.{champ1}` |
276
- | {champ2} | Select | Oui | Liste prédéfinie | `{module}.fields.{champ2}` |
277
- | {champ3} | Textarea | Non | Max 500 chars | `{module}.fields.{champ3}` |
278
-
279
- ---
280
-
281
- ## 5. Validation et messages
282
-
283
- ### 5.1 Règles de validation
77
+ ### Champs formulaire
78
+ | Champ | Type | Requis | Validation | i18n |
284
79
 
285
- | Champ | Règle | Message erreur (clé i18n) |
286
- |-------|-------|---------------------------|
287
- | {champ} | Requis | `{module}.validation.{champ}Required` |
288
- | {champ} | Format email | `{module}.validation.{champ}InvalidEmail` |
289
- | {champ} | Min 3 caractères | `{module}.validation.{champ}MinLength` |
290
-
291
- ### 5.2 Messages système
292
-
293
- | Code | Type | Clé i18n | Quand affiché |
294
- |------|------|----------|---------------|
295
- | MSG-001 | Success | `{module}.messages.created` | Après création |
296
- | MSG-002 | Success | `{module}.messages.updated` | Après modification |
297
- | MSG-003 | Success | `{module}.messages.deleted` | Après suppression |
298
- | MSG-004 | Error | `{module}.errors.notFound` | Entité non trouvée |
299
- | MSG-005 | Error | `{module}.errors.duplicate` | Doublon détecté |
300
-
301
- ---
302
-
303
- ## 6. Permissions détaillées
304
-
305
- ### 6.1 Permission paths
80
+ ## 5. Validations et messages
81
+ | Champ | Règle | Message i18n |
82
+ | Code | Type | Clé i18n |
306
83
 
84
+ ## 6. Permissions
85
+ ### Paths
307
86
  | Permission | Description |
308
- |------------|-------------|
309
- | `business.{app}.{module}.read` | Voir la liste et les détails |
310
- | `business.{app}.{module}.create` | Créer une nouvelle entrée |
311
- | `business.{app}.{module}.update` | Modifier une entrée existante |
312
- | `business.{app}.{module}.delete` | Supprimer une entrée |
313
-
314
- ### 6.2 Matrice Rôle-Permission
315
-
316
- | Permission | SuperAdmin | Admin | Manager | User | ReadOnly |
317
- |------------|------------|-------|---------|------|----------|
318
- | `.read` | ✅ | ✅ | ✅ | ✅ | ✅ |
319
- | `.create` | ✅ | ✅ | ✅ | ❌ | ❌ |
320
- | `.update` | ✅ | ✅ | ✅ | ❌ | ❌ |
321
- | `.delete` | ✅ | ✅ | ❌ | ❌ | ❌ |
322
-
323
- ### 6.3 Mapping Endpoint-Permission
324
-
325
- | Endpoint | Méthode | Permission requise | Response si refusé |
326
- |----------|---------|-------------------|-------------------|
327
- | `/api/business/{module}` | GET | `.read` | 403 Forbidden |
328
- | `/api/business/{module}` | POST | `.create` | 403 Forbidden |
329
- | `/api/business/{module}/{id}` | GET | `.read` | 403 Forbidden |
330
- | `/api/business/{module}/{id}` | PUT | `.update` | 403 Forbidden |
331
- | `/api/business/{module}/{id}` | DELETE | `.delete` | 403 Forbidden |
332
-
333
- ### 6.4 Visibilité UI par permission
334
-
335
- | Élément | Permission requise | Si absent |
336
- |---------|-------------------|-----------|
337
- | Bouton [+ Nouveau] | `.create` | Caché |
338
- | Bouton [✏] | `.update` | Caché |
339
- | Bouton [🗑] | `.delete` | Caché |
340
- | Lien vers détail | `.read` | Désactivé |
87
+ | `.read` | Voir données |
88
+ | `.create` | Créer |
89
+ | `.update` | Modifier |
90
+ | `.delete` | Supprimer |
341
91
 
342
- ---
92
+ ### Matrice
93
+ | Permission | Admin | Manager | User | ReadOnly |
343
94
 
344
- ## 7. Scénarios Gherkin
95
+ ### Endpoint-Permission
96
+ | Endpoint | Method | Permission | Si refusé |
345
97
 
346
- ```gherkin
347
- Feature: {FEATURE_ID} - {Feature Name}
348
-
349
- Background:
350
- Given the system is running
351
- And the module "{module}" is enabled
352
-
353
- # ===== PERMISSIONS =====
354
-
355
- @permission @403
356
- Scenario: User without permission cannot access module
357
- Given I am logged in as "noperm@test.com" with role "NoPerm"
358
- When I send GET to "/api/business/{module}"
359
- Then the response status should be 403
360
- And the response should contain "Permission denied"
361
-
362
- @permission @403
363
- Scenario: ReadOnly user cannot create
364
- Given I am logged in as "readonly@test.com" with role "ReadOnly"
365
- And I have permission "business.{app}.{module}.read"
366
- When I send POST to "/api/business/{module}" with:
367
- | field1 | value1 |
368
- Then the response status should be 403
369
-
370
- # ===== CRUD OPERATIONS =====
371
-
372
- @happy-path @create
373
- Scenario: Admin creates new {entity}
374
- Given I am logged in as "admin@test.com" with role "Admin"
375
- And I have permission "business.{app}.{module}.create"
376
- When I send POST to "/api/business/{module}" with:
377
- | field1 | Test Value |
378
- | field2 | Option A |
379
- Then the response status should be 201
380
- And the response should contain "id"
381
- And the response header "Location" should match "/api/business/{module}/[a-f0-9-]+"
382
-
383
- @happy-path @read
384
- Scenario: User views {entity} list
385
- Given I am logged in as "user@test.com" with role "User"
386
- And I have permission "business.{app}.{module}.read"
387
- And there are 5 {entities} in the database
388
- When I send GET to "/api/business/{module}"
389
- Then the response status should be 200
390
- And the response should contain "items"
391
- And the response should contain "totalCount"
392
-
393
- @happy-path @update
394
- Scenario: Manager updates {entity}
395
- Given I am logged in as "manager@test.com" with role "Manager"
396
- And I have permission "business.{app}.{module}.update"
397
- And there is a {entity} with id "test-id"
398
- When I send PUT to "/api/business/{module}/test-id" with:
399
- | field1 | Updated Value |
400
- Then the response status should be 200
401
- And the response field "field1" should be "Updated Value"
402
-
403
- @happy-path @delete
404
- Scenario: Admin deletes {entity}
405
- Given I am logged in as "admin@test.com" with role "Admin"
406
- And I have permission "business.{app}.{module}.delete"
407
- And there is a {entity} with id "test-id"
408
- When I send DELETE to "/api/business/{module}/test-id"
409
- Then the response status should be 204
410
- And the {entity} "test-id" should not exist
411
-
412
- # ===== VALIDATION =====
413
-
414
- @validation @400
415
- Scenario: Create fails with missing required field
416
- Given I am logged in as "admin@test.com" with role "Admin"
417
- And I have permission "business.{app}.{module}.create"
418
- When I send POST to "/api/business/{module}" with:
419
- | field2 | Option A |
420
- Then the response status should be 400
421
- And the response should contain "field1"
422
- And the response should contain "required"
423
-
424
- # ===== BUSINESS RULES =====
425
-
426
- @business-rule @BR-001
427
- Scenario: BR-001 - {Business rule description}
428
- Given I am logged in as "admin@test.com" with role "Admin"
429
- And {precondition for business rule}
430
- When {action that triggers business rule}
431
- Then {expected outcome per BR-001}
432
- ```
98
+ ### Visibilité UI
99
+ | Élément | Permission | Si absent |
433
100
 
434
- ---
101
+ ## 7. Scénarios Gherkin
102
+ @permission @403
103
+ Scenario: User sans permission
104
+ @happy-path @create
105
+ Scenario: Admin crée
435
106
 
436
107
  ## 8. API Specification
108
+ ### GET /api/business/{module}
109
+ Query params, Response 200
437
110
 
438
- ### 8.1 GET /api/business/{module}
439
-
440
- **Description:** Récupère la liste paginée des {entities}
441
-
442
- **Query Parameters:**
443
-
444
- | Param | Type | Requis | Default | Description |
445
- |-------|------|--------|---------|-------------|
446
- | page | int | Non | 1 | Numéro de page |
447
- | pageSize | int | Non | 10 | Éléments par page (max 100) |
448
- | sortBy | string | Non | createdAt | Champ de tri |
449
- | sortOrder | string | Non | desc | asc ou desc |
450
- | search | string | Non | - | Recherche textuelle |
451
- | status | string | Non | - | Filtre par statut |
452
-
453
- **Response 200:**
454
- ```json
455
- {
456
- "items": [
457
- {
458
- "id": "guid",
459
- "field1": "value",
460
- "field2": "value",
461
- "status": "active",
462
- "createdAt": "2024-01-01T00:00:00Z",
463
- "updatedAt": "2024-01-01T00:00:00Z"
464
- }
465
- ],
466
- "totalCount": 125,
467
- "page": 1,
468
- "pageSize": 10,
469
- "totalPages": 13
470
- }
471
- ```
472
-
473
- ### 8.2 POST /api/business/{module}
111
+ ### POST /api/business/{module}
112
+ Request body, Response 201
474
113
 
475
- **Description:** Crée une nouvelle {entity}
476
-
477
- **Request Body:**
478
- ```json
479
- {
480
- "field1": "string (required, max 100)",
481
- "field2": "string (required, enum: [A, B, C])",
482
- "field3": "string (optional, max 500)"
483
- }
484
- ```
485
-
486
- **Response 201:**
487
- ```json
488
- {
489
- "id": "guid",
490
- "field1": "value",
491
- "field2": "value",
492
- "field3": "value",
493
- "status": "active",
494
- "createdAt": "2024-01-01T00:00:00Z"
495
- }
114
+ ## 9. Intégrations SmartStack
115
+ ### Notifications | Workflows | IA
116
+ | Requis | Oui/Non |
117
+ | Événements | {liste} |
118
+ | Skill | /notification, /workflow, /ai-prompt |
496
119
  ```
497
120
 
498
- **Response Headers:**
499
- - `Location: /api/business/{module}/{id}`
500
-
501
121
  ---
502
122
 
503
- ## 9. Intégrations SmartStack ⭐
504
-
505
- > **Importé depuis 1-discovery.md Section 7**
506
-
507
- ### 9.1 Notifications
508
-
509
- | Requis | Événements | Destinataires | Type notification |
510
- |--------|------------|---------------|-------------------|
511
- | {oui/non} | {entity.created, entity.updated, ...} | {créateur, assigné, rôle} | {info, warning, success} |
512
-
513
- **Spécification:**
514
- - NotificationType à créer: `{Entity}Created`, `{Entity}Updated`, etc.
515
- - Service à modifier: `{Entity}Service.cs`
516
- - Hook frontend: `use{Module}Notifications.ts`
517
-
518
- ### 9.2 Workflows & Emails
519
-
520
- | Requis | Trigger | Steps | Templates email |
521
- |--------|---------|-------|-----------------|
522
- | {oui/non} | `{entity}.{event}` | {SendEmail, Wait, Condition} | {template-codes} |
523
-
524
- **Spécification:**
525
- - Trigger à créer: `{entity}.{event}`
526
- - Workflow: `{workflow-code}`
527
- - Variables: `entityId`, `entityName`, `userEmail`, etc.
528
-
529
- ### 9.3 Assistance IA
530
-
531
- | Requis | Fonction | Entrée | Sortie | Schema |
532
- |--------|----------|--------|--------|--------|
533
- | {oui/non} | {génération/classification/suggestion} | {données contexte} | {format attendu} | {JSON schema si applicable} |
534
-
535
- **Spécification:**
536
- - Prompt à créer: `{prompt-code}`
537
- - Blocks: {system, context, query}
538
- - OutputSchema: {schema JSON si structuré}
539
-
540
- ### 9.4 Skills à utiliser
541
-
542
- | Intégration | Skill | Quand |
543
- |-------------|-------|-------|
544
- | Notifications | `/notification add` | Après création des services backend |
545
- | Workflows | `/workflow create` | Après définition des triggers |
546
- | IA | `/ai-prompt create` | Lors de l'implémentation du service |
547
-
548
- ---
549
-
550
- ## 10. Prochaines étapes
551
-
552
- - [ ] Valider ce FRD avec le sponsor
553
- - [ ] Lancer validation: `/business-analyse:5-validate {FEATURE_ID}`
554
-
555
- ---
556
-
557
- ## Historique des versions
558
-
559
- | Version | Date | Auteur | Modifications |
560
- |---------|------|--------|---------------|
561
- | 1.0 | {date} | BA (Sonnet) | Création initiale |
562
- ```
563
-
564
- ---
565
-
566
- ## STEP 4: Résumé
123
+ ## Résumé
567
124
 
568
125
  ```
569
- ================================================================================
570
- SPÉCIFICATIONS COMPLÈTES - {FEATURE_ID}
571
- ================================================================================
572
-
573
- DOCUMENT GÉNÉRÉ: {FEATURE_DIR}/3-functional-specification.md
574
- MODÈLE UTILISÉ: Sonnet
575
- BASÉ SUR: 2-business-requirements.md v1.0
576
-
577
- CONTENU:
578
- Cas d'utilisation: {N} (UC-001 à UC-XXX)
579
- Exigences fonct.: {N} (FR-001 à FR-XXX)
580
- Wireframes: {N} écrans
581
- Permissions: {N} définies
582
- Scénarios Gherkin: {N} scénarios
583
- Intégrations: {N} (Notifications/Workflows/IA)
584
-
585
- ================================================================================
586
- PROCHAINE ÉTAPE
587
- ================================================================================
588
-
589
- Lancez la validation utilisateur:
590
-
591
- /business-analyse:5-validate {FEATURE_ID}
592
-
593
- ⚠️ La validation est OBLIGATOIRE avant de générer le handoff!
594
-
595
- ================================================================================
596
-
597
- Contact support: support@atlshub.ch
126
+ SPECIFY - {FEATURE_ID}
127
+ ├── Use Cases: {N}
128
+ ├── Exigences: {N}
129
+ ├── Wireframes: {N}
130
+ ├── Permissions: {N}
131
+ ├── Scénarios Gherkin: {N}
132
+ └── Prochain: /business-analyse:5-validate {FEATURE_ID}
598
133
  ```