@atlashub/smartstack-cli 1.5.1 → 1.5.3

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 (147) hide show
  1. package/.documentation/css/styles.css +2168 -2168
  2. package/.documentation/js/app.js +794 -794
  3. package/config/default-config.json +86 -86
  4. package/config/settings.json +53 -53
  5. package/config/settings.local.example.json +16 -16
  6. package/dist/index.js +0 -0
  7. package/dist/index.js.map +1 -1
  8. package/package.json +88 -88
  9. package/templates/agents/action.md +36 -36
  10. package/templates/agents/efcore/conflicts.md +84 -84
  11. package/templates/agents/efcore/db-deploy.md +51 -51
  12. package/templates/agents/efcore/db-reset.md +59 -59
  13. package/templates/agents/efcore/db-seed.md +56 -56
  14. package/templates/agents/efcore/db-status.md +64 -64
  15. package/templates/agents/efcore/migration.md +85 -85
  16. package/templates/agents/efcore/rebase-snapshot.md +62 -62
  17. package/templates/agents/efcore/scan.md +90 -90
  18. package/templates/agents/efcore/squash.md +67 -67
  19. package/templates/agents/explore-codebase.md +65 -65
  20. package/templates/agents/explore-docs.md +97 -97
  21. package/templates/agents/fix-grammar.md +49 -49
  22. package/templates/agents/gitflow/abort.md +45 -45
  23. package/templates/agents/gitflow/cleanup.md +85 -85
  24. package/templates/agents/gitflow/commit.md +40 -40
  25. package/templates/agents/gitflow/exec.md +48 -48
  26. package/templates/agents/gitflow/finish.md +92 -92
  27. package/templates/agents/gitflow/init.md +139 -139
  28. package/templates/agents/gitflow/merge.md +62 -62
  29. package/templates/agents/gitflow/plan.md +42 -42
  30. package/templates/agents/gitflow/pr.md +78 -78
  31. package/templates/agents/gitflow/review.md +49 -49
  32. package/templates/agents/gitflow/start.md +61 -61
  33. package/templates/agents/gitflow/status.md +32 -32
  34. package/templates/agents/snipper.md +36 -36
  35. package/templates/agents/websearch.md +46 -46
  36. package/templates/commands/_resources/formatting-guide.md +124 -124
  37. package/templates/commands/ai-prompt.md +315 -315
  38. package/templates/commands/apex/1-analyze.md +100 -100
  39. package/templates/commands/apex/2-plan.md +145 -145
  40. package/templates/commands/apex/3-execute.md +171 -171
  41. package/templates/commands/apex/4-examine.md +116 -116
  42. package/templates/commands/apex/5-tasks.md +209 -209
  43. package/templates/commands/apex.md +76 -76
  44. package/templates/commands/application/create.md +362 -362
  45. package/templates/commands/application/templates-backend.md +463 -463
  46. package/templates/commands/application/templates-frontend.md +517 -517
  47. package/templates/commands/application/templates-i18n.md +478 -478
  48. package/templates/commands/application/templates-seed.md +362 -362
  49. package/templates/commands/application.md +303 -303
  50. package/templates/commands/business-analyse/0-orchestrate.md +640 -640
  51. package/templates/commands/business-analyse/1-init.md +269 -269
  52. package/templates/commands/business-analyse/2-discover.md +520 -520
  53. package/templates/commands/business-analyse/3-analyse.md +408 -408
  54. package/templates/commands/business-analyse/4-specify.md +598 -598
  55. package/templates/commands/business-analyse/5-validate.md +326 -326
  56. package/templates/commands/business-analyse/6-handoff.md +746 -746
  57. package/templates/commands/business-analyse/7-doc-html.md +602 -602
  58. package/templates/commands/business-analyse/bug.md +325 -325
  59. package/templates/commands/business-analyse/change-request.md +368 -368
  60. package/templates/commands/business-analyse/hotfix.md +200 -200
  61. package/templates/commands/business-analyse.md +640 -640
  62. package/templates/commands/controller/create.md +216 -216
  63. package/templates/commands/controller/postman-templates.md +528 -528
  64. package/templates/commands/controller/templates.md +600 -600
  65. package/templates/commands/controller.md +337 -337
  66. package/templates/commands/create/agent.md +138 -138
  67. package/templates/commands/create/command.md +166 -166
  68. package/templates/commands/create/hook.md +234 -234
  69. package/templates/commands/create/plugin.md +329 -329
  70. package/templates/commands/create/project.md +507 -507
  71. package/templates/commands/create/skill.md +199 -199
  72. package/templates/commands/create.md +220 -220
  73. package/templates/commands/debug.md +95 -95
  74. package/templates/commands/documentation/module.md +202 -202
  75. package/templates/commands/documentation/templates.md +432 -432
  76. package/templates/commands/documentation.md +190 -190
  77. package/templates/commands/efcore/_env-check.md +153 -153
  78. package/templates/commands/efcore/conflicts.md +186 -186
  79. package/templates/commands/efcore/db-deploy.md +193 -193
  80. package/templates/commands/efcore/db-reset.md +426 -426
  81. package/templates/commands/efcore/db-seed.md +326 -326
  82. package/templates/commands/efcore/db-status.md +226 -226
  83. package/templates/commands/efcore/migration.md +400 -400
  84. package/templates/commands/efcore/rebase-snapshot.md +264 -264
  85. package/templates/commands/efcore/scan.md +198 -198
  86. package/templates/commands/efcore/squash.md +298 -298
  87. package/templates/commands/efcore.md +224 -224
  88. package/templates/commands/epct.md +69 -69
  89. package/templates/commands/explain.md +186 -186
  90. package/templates/commands/explore.md +45 -45
  91. package/templates/commands/feature-full.md +267 -267
  92. package/templates/commands/gitflow/1-init.md +1038 -1038
  93. package/templates/commands/gitflow/10-start.md +768 -768
  94. package/templates/commands/gitflow/11-finish.md +457 -457
  95. package/templates/commands/gitflow/12-cleanup.md +276 -276
  96. package/templates/commands/gitflow/13-sync.md +216 -216
  97. package/templates/commands/gitflow/14-rebase.md +251 -251
  98. package/templates/commands/gitflow/2-status.md +277 -277
  99. package/templates/commands/gitflow/3-commit.md +344 -344
  100. package/templates/commands/gitflow/4-plan.md +145 -145
  101. package/templates/commands/gitflow/5-exec.md +147 -147
  102. package/templates/commands/gitflow/6-abort.md +344 -344
  103. package/templates/commands/gitflow/7-pull-request.md +453 -355
  104. package/templates/commands/gitflow/8-review.md +240 -176
  105. package/templates/commands/gitflow/9-merge.md +451 -365
  106. package/templates/commands/gitflow.md +128 -128
  107. package/templates/commands/implement.md +663 -663
  108. package/templates/commands/init.md +567 -567
  109. package/templates/commands/mcp-integration.md +330 -330
  110. package/templates/commands/notification.md +129 -129
  111. package/templates/commands/oneshot.md +57 -57
  112. package/templates/commands/quick-search.md +72 -72
  113. package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
  114. package/templates/commands/ralph-loop/help.md +126 -126
  115. package/templates/commands/ralph-loop/ralph-loop.md +18 -18
  116. package/templates/commands/review.md +106 -106
  117. package/templates/commands/utils/test-web-config.md +160 -160
  118. package/templates/commands/utils/test-web.md +151 -151
  119. package/templates/commands/validate.md +233 -233
  120. package/templates/commands/workflow.md +193 -193
  121. package/templates/gitflow/config.json +138 -138
  122. package/templates/hooks/ef-migration-check.md +139 -139
  123. package/templates/hooks/hooks.json +25 -25
  124. package/templates/hooks/stop-hook.sh +177 -177
  125. package/templates/skills/ai-prompt/SKILL.md +778 -778
  126. package/templates/skills/application/SKILL.md +563 -563
  127. package/templates/skills/application/templates-backend.md +450 -450
  128. package/templates/skills/application/templates-frontend.md +531 -531
  129. package/templates/skills/application/templates-i18n.md +520 -520
  130. package/templates/skills/application/templates-seed.md +647 -647
  131. package/templates/skills/business-analyse/SKILL.md +191 -191
  132. package/templates/skills/business-analyse/questionnaire.md +283 -283
  133. package/templates/skills/business-analyse/templates-frd.md +477 -477
  134. package/templates/skills/business-analyse/templates-react.md +580 -580
  135. package/templates/skills/controller/SKILL.md +240 -240
  136. package/templates/skills/controller/postman-templates.md +614 -614
  137. package/templates/skills/controller/templates.md +1468 -1468
  138. package/templates/skills/documentation/SKILL.md +133 -133
  139. package/templates/skills/documentation/templates.md +476 -476
  140. package/templates/skills/feature-full/SKILL.md +838 -838
  141. package/templates/skills/notification/SKILL.md +555 -555
  142. package/templates/skills/ui-components/SKILL.md +870 -870
  143. package/templates/skills/workflow/SKILL.md +582 -582
  144. package/templates/test-web/api-health.json +38 -38
  145. package/templates/test-web/minimal.json +19 -19
  146. package/templates/test-web/npm-package.json +46 -46
  147. package/templates/test-web/seo-check.json +54 -54
@@ -1,602 +1,602 @@
1
- ---
2
- description: Phase 7 - Generate HTML documentation (React components) integrated in module
3
- agent: ba-doc-html
4
- model: sonnet
5
- ---
6
-
7
- # Phase 7: Documentation HTML (React) - Intégrée au Module
8
-
9
- > **Modèle:** Sonnet (génération React + i18n avec Context7)
10
- > **Coût estimé:** ~$0.20
11
- > **Output:** Composant React dans le module business: `pages/business/{app}/{module}/DocumentationPage.tsx`
12
-
13
- ---
14
-
15
- ## OBJECTIF
16
-
17
- ```
18
- +==============================================================================+
19
- | DOCUMENTATION FRD INTÉGRÉE AU MODULE BUSINESS |
20
- +==============================================================================+
21
- | |
22
- | La documentation est un ONGLET/TAB dans chaque module business: |
23
- | |
24
- | /business/{application}/{module} |
25
- | ├── (index) → Page principale du module |
26
- | ├── /list → Liste des entités |
27
- | ├── /create → Création |
28
- | ├── /:id → Détail |
29
- | └── /documentation → 📄 Documentation FRD (CETTE PAGE) |
30
- | |
31
- | AVANTAGE: L'utilisateur accède à la doc depuis le module qu'il utilise |
32
- | |
33
- +==============================================================================+
34
- ```
35
-
36
- ---
37
-
38
- ## CONTEXT7 - UTILISATION OBLIGATOIRE
39
-
40
- ```
41
- +==============================================================================+
42
- | GÉNÉRATION REACT AVEC CONTEXT7 |
43
- +==============================================================================+
44
- | |
45
- | Pour CHAQUE composant React généré, utiliser: |
46
- | |
47
- | "use context7 with /facebook/react and /i18next/react-i18next |
48
- | to generate {component} following SmartStack documentation patterns" |
49
- | |
50
- | Libraries à référencer: |
51
- | • /facebook/react - React 19 patterns, hooks |
52
- | • /i18next/react-i18next - useTranslation, Trans |
53
- | • /remix-run/react-router - Link, useParams, useNavigate |
54
- | • /lucide-icons/lucide-react - Icons cohérents |
55
- | |
56
- +==============================================================================+
57
- ```
58
-
59
- ---
60
-
61
- ## STEP 1: Charger les documents
62
-
63
- ```bash
64
- FEATURE_ID=$1
65
- FEATURE_DIR=$(find .business-analyse -type d -name "${FEATURE_ID}*" | head -1)
66
- FRD_FILE="$FEATURE_DIR/3-functional-specification.md"
67
- HANDOFF_FILE="$FEATURE_DIR/4-development-handoff.md"
68
-
69
- # Extraire les informations
70
- APPLICATION=$(echo $FEATURE_DIR | grep -oP 'business/\K[^/]+')
71
- MODULE=$(echo $FEATURE_DIR | grep -oP 'modules/\K[^/]+')
72
- FEATURE_NAME=$(echo $FEATURE_DIR | grep -oP 'FEAT-\d+-\K.*')
73
-
74
- # Paths de sortie - DANS LE MODULE BUSINESS (pas dans /docs)
75
- WEB_DIR="web/smartstack-web/src"
76
- MODULE_DIR="$WEB_DIR/pages/business/$APPLICATION/$MODULE"
77
- I18N_DIR="$WEB_DIR/i18n/locales"
78
- ```
79
-
80
- ---
81
-
82
- ## STEP 2: Analyser le FRD pour extraction
83
-
84
- ```bash
85
- # Extraire les données structurées du FRD
86
- echo "Extraction des données du FRD..."
87
-
88
- # Cas d'utilisation
89
- USE_CASES=$(grep -oP 'UC-\d+.*' "$FRD_FILE" | head -10)
90
-
91
- # Règles métier liées
92
- BUSINESS_RULES=$(grep -oP 'BR-\d+' "$FRD_FILE" | sort -u)
93
-
94
- # Permissions
95
- PERMISSIONS=$(grep -oP 'business\.[a-z.]+' "$FRD_FILE" | sort -u)
96
-
97
- # Endpoints API
98
- ENDPOINTS=$(grep -oP '/api/business/[a-z/{}]+' "$FRD_FILE" | sort -u)
99
- ```
100
-
101
- ---
102
-
103
- ## STEP 3: Créer la structure de dossiers
104
-
105
- ```bash
106
- # Le dossier du module doit déjà exister (créé par /implement)
107
- # On ajoute juste la page Documentation
108
-
109
- if [ ! -d "$MODULE_DIR" ]; then
110
- echo "⚠️ Module $APPLICATION/$MODULE non implémenté"
111
- echo " Exécutez d'abord: /implement $FEATURE_ID"
112
- exit 1
113
- fi
114
-
115
- # Vérifier si DocumentationPage existe déjà
116
- if [ -f "$MODULE_DIR/DocumentationPage.tsx" ]; then
117
- echo "📄 DocumentationPage existe - mise à jour"
118
- else
119
- echo "📄 Création de DocumentationPage"
120
- fi
121
- ```
122
-
123
- ---
124
-
125
- ## STEP 4: Générer DocumentationPage.tsx
126
-
127
- **Utiliser Context7 pour génération:**
128
-
129
- ```
130
- use context7 with /facebook/react and /i18next/react-i18next
131
- to generate a documentation page component for the {MODULE} module
132
- following SmartStack patterns with:
133
- - Back link to module main page
134
- - Table of contents (sticky sidebar)
135
- - Overview section
136
- - Use cases section with actors
137
- - Business rules section
138
- - Permissions matrix
139
- - API endpoints table
140
- - Version and last update info
141
- ```
142
-
143
- ### Template de sortie: DocumentationPage.tsx
144
-
145
- ```tsx
146
- // web/smartstack-web/src/pages/business/{app}/{module}/DocumentationPage.tsx
147
- // GÉNÉRÉ AVEC CONTEXT7: /facebook/react, /i18next/react-i18next
148
-
149
- import { Link, useParams } from 'react-router-dom';
150
- import { useTranslation } from 'react-i18next';
151
- import {
152
- FileText,
153
- Users,
154
- Shield,
155
- CheckCircle,
156
- ArrowLeft,
157
- List,
158
- Code,
159
- BookOpen,
160
- Hash
161
- } from 'lucide-react';
162
-
163
- // Données extraites du FRD
164
- const frdData = {
165
- featureId: '{FEATURE_ID}',
166
- version: '1.0',
167
- lastUpdated: '{DATE}',
168
-
169
- overview: {
170
- description: '{FROM FRD SECTION 1}',
171
- objectives: [
172
- '{OBJECTIVE 1}',
173
- '{OBJECTIVE 2}'
174
- ]
175
- },
176
-
177
- useCases: [
178
- {
179
- id: 'UC-001',
180
- title: '{Title}',
181
- actor: '{Actor}',
182
- description: '{Description}',
183
- preconditions: ['{PRE}'],
184
- postconditions: ['{POST}'],
185
- steps: ['{STEP 1}', '{STEP 2}']
186
- }
187
- ],
188
-
189
- businessRules: [
190
- {
191
- id: 'BR-001',
192
- title: '{Title}',
193
- category: '{Category}',
194
- description: '{Description}',
195
- priority: 'Must'
196
- }
197
- ],
198
-
199
- permissions: [
200
- {
201
- key: 'business.{app}.{module}.read',
202
- description: '{Description}',
203
- roles: ['Admin', 'Manager']
204
- }
205
- ],
206
-
207
- endpoints: [
208
- {
209
- method: 'GET',
210
- path: '/api/business/{app}/{module}',
211
- description: '{Description}',
212
- permission: 'business.{app}.{module}.read'
213
- }
214
- ]
215
- };
216
-
217
- export function DocumentationPage() {
218
- const { t } = useTranslation('{app}-{module}');
219
-
220
- return (
221
- <div className="flex gap-8">
222
- {/* Sidebar - Table of Contents */}
223
- <aside className="hidden lg:block w-64 shrink-0">
224
- <nav className="sticky top-24 space-y-2">
225
- <h3 className="font-semibold text-sm text-[var(--text-secondary)] uppercase tracking-wide mb-4">
226
- {t('documentation.toc')}
227
- </h3>
228
- <a href="#overview" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
229
- {t('documentation.sections.overview')}
230
- </a>
231
- <a href="#use-cases" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
232
- {t('documentation.sections.useCases')}
233
- </a>
234
- <a href="#business-rules" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
235
- {t('documentation.sections.businessRules')}
236
- </a>
237
- <a href="#permissions" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
238
- {t('documentation.sections.permissions')}
239
- </a>
240
- <a href="#api" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
241
- {t('documentation.sections.api')}
242
- </a>
243
- </nav>
244
- </aside>
245
-
246
- {/* Main Content */}
247
- <main className="flex-1 max-w-4xl">
248
- {/* Back Link */}
249
- <Link
250
- to="/business/{app}/{module}"
251
- className="inline-flex items-center gap-2 text-sm text-[var(--text-secondary)] hover:text-[var(--color-primary-600)] mb-6"
252
- >
253
- <ArrowLeft className="w-4 h-4" />
254
- {t('documentation.backToModule')}
255
- </Link>
256
-
257
- {/* Header */}
258
- <header className="mb-8">
259
- <div className="flex items-center gap-3 mb-2">
260
- <BookOpen className="w-8 h-8 text-[var(--color-primary-600)]" />
261
- <h1 className="text-3xl font-bold">{t('documentation.title')}</h1>
262
- </div>
263
- <p className="text-[var(--text-secondary)]">
264
- {t('documentation.subtitle')}
265
- </p>
266
- <div className="flex gap-4 mt-4 text-sm text-[var(--text-tertiary)]">
267
- <span>Version {frdData.version}</span>
268
- <span>•</span>
269
- <span>{t('documentation.lastUpdated')}: {frdData.lastUpdated}</span>
270
- </div>
271
- </header>
272
-
273
- {/* Overview Section */}
274
- <section id="overview" className="mb-12">
275
- <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
276
- <Hash className="w-5 h-5 text-[var(--color-primary-600)]" />
277
- {t('documentation.sections.overview')}
278
- </h2>
279
- <div className="card p-6">
280
- <p className="mb-4">{frdData.overview.description}</p>
281
- <h4 className="font-medium mb-2">{t('documentation.objectives')}</h4>
282
- <ul className="list-disc list-inside space-y-1 text-[var(--text-secondary)]">
283
- {frdData.overview.objectives.map((obj, i) => (
284
- <li key={i}>{obj}</li>
285
- ))}
286
- </ul>
287
- </div>
288
- </section>
289
-
290
- {/* Use Cases Section */}
291
- <section id="use-cases" className="mb-12">
292
- <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
293
- <Users className="w-5 h-5 text-[var(--color-primary-600)]" />
294
- {t('documentation.sections.useCases')}
295
- </h2>
296
- <div className="space-y-4">
297
- {frdData.useCases.map((uc) => (
298
- <div key={uc.id} className="card p-6">
299
- <div className="flex items-center gap-2 mb-2">
300
- <span className="px-2 py-1 text-xs font-mono bg-[var(--color-primary-100)] text-[var(--color-primary-700)] rounded">
301
- {uc.id}
302
- </span>
303
- <h3 className="font-semibold">{uc.title}</h3>
304
- </div>
305
- <p className="text-[var(--text-secondary)] mb-4">{uc.description}</p>
306
- <div className="grid grid-cols-2 gap-4 text-sm">
307
- <div>
308
- <span className="font-medium">{t('documentation.labels.actor')}:</span>
309
- <span className="ml-2">{uc.actor}</span>
310
- </div>
311
- </div>
312
- </div>
313
- ))}
314
- </div>
315
- </section>
316
-
317
- {/* Business Rules Section */}
318
- <section id="business-rules" className="mb-12">
319
- <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
320
- <CheckCircle className="w-5 h-5 text-[var(--color-primary-600)]" />
321
- {t('documentation.sections.businessRules')}
322
- </h2>
323
- <div className="overflow-x-auto">
324
- <table className="w-full text-sm">
325
- <thead>
326
- <tr className="border-b border-[var(--border-color)]">
327
- <th className="text-left py-3 px-4">ID</th>
328
- <th className="text-left py-3 px-4">{t('documentation.labels.rule')}</th>
329
- <th className="text-left py-3 px-4">{t('documentation.labels.category')}</th>
330
- <th className="text-left py-3 px-4">{t('documentation.labels.priority')}</th>
331
- </tr>
332
- </thead>
333
- <tbody>
334
- {frdData.businessRules.map((br) => (
335
- <tr key={br.id} className="border-b border-[var(--border-color)]">
336
- <td className="py-3 px-4 font-mono text-xs">{br.id}</td>
337
- <td className="py-3 px-4">{br.title}</td>
338
- <td className="py-3 px-4">{br.category}</td>
339
- <td className="py-3 px-4">
340
- <span className={`px-2 py-1 rounded text-xs ${
341
- br.priority === 'Must' ? 'bg-red-100 text-red-700' :
342
- br.priority === 'Should' ? 'bg-yellow-100 text-yellow-700' :
343
- 'bg-gray-100 text-gray-700'
344
- }`}>
345
- {br.priority}
346
- </span>
347
- </td>
348
- </tr>
349
- ))}
350
- </tbody>
351
- </table>
352
- </div>
353
- </section>
354
-
355
- {/* Permissions Section */}
356
- <section id="permissions" className="mb-12">
357
- <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
358
- <Shield className="w-5 h-5 text-[var(--color-primary-600)]" />
359
- {t('documentation.sections.permissions')}
360
- </h2>
361
- <div className="overflow-x-auto">
362
- <table className="w-full text-sm">
363
- <thead>
364
- <tr className="border-b border-[var(--border-color)]">
365
- <th className="text-left py-3 px-4">{t('documentation.labels.permission')}</th>
366
- <th className="text-left py-3 px-4">Description</th>
367
- <th className="text-left py-3 px-4">Roles</th>
368
- </tr>
369
- </thead>
370
- <tbody>
371
- {frdData.permissions.map((perm) => (
372
- <tr key={perm.key} className="border-b border-[var(--border-color)]">
373
- <td className="py-3 px-4 font-mono text-xs">{perm.key}</td>
374
- <td className="py-3 px-4">{perm.description}</td>
375
- <td className="py-3 px-4">
376
- <div className="flex gap-1">
377
- {perm.roles.map((role) => (
378
- <span key={role} className="px-2 py-1 bg-[var(--bg-secondary)] rounded text-xs">
379
- {role}
380
- </span>
381
- ))}
382
- </div>
383
- </td>
384
- </tr>
385
- ))}
386
- </tbody>
387
- </table>
388
- </div>
389
- </section>
390
-
391
- {/* API Endpoints Section */}
392
- <section id="api" className="mb-12">
393
- <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
394
- <Code className="w-5 h-5 text-[var(--color-primary-600)]" />
395
- {t('documentation.sections.api')}
396
- </h2>
397
- <div className="space-y-3">
398
- {frdData.endpoints.map((ep, i) => (
399
- <div key={i} className="card p-4">
400
- <div className="flex items-center gap-3">
401
- <span className={`px-2 py-1 text-xs font-bold rounded ${
402
- ep.method === 'GET' ? 'bg-green-100 text-green-700' :
403
- ep.method === 'POST' ? 'bg-blue-100 text-blue-700' :
404
- ep.method === 'PUT' ? 'bg-yellow-100 text-yellow-700' :
405
- ep.method === 'DELETE' ? 'bg-red-100 text-red-700' :
406
- 'bg-gray-100 text-gray-700'
407
- }`}>
408
- {ep.method}
409
- </span>
410
- <code className="text-sm">{ep.path}</code>
411
- </div>
412
- <p className="text-sm text-[var(--text-secondary)] mt-2">{ep.description}</p>
413
- <p className="text-xs text-[var(--text-tertiary)] mt-1">
414
- {t('documentation.labels.permission')}: <code>{ep.permission}</code>
415
- </p>
416
- </div>
417
- ))}
418
- </div>
419
- </section>
420
- </main>
421
- </div>
422
- );
423
- }
424
- ```
425
-
426
- ---
427
-
428
- ## STEP 5: Générer/Mettre à jour i18n
429
-
430
- ### Ajouter les clés dans le namespace du module
431
-
432
- Fichier: `{lang}/{app}-{module}.json`
433
-
434
- ```json
435
- {
436
- "documentation": {
437
- "title": "Documentation fonctionnelle",
438
- "subtitle": "Spécifications du module {Module}",
439
- "backToModule": "Retour au module",
440
- "lastUpdated": "Dernière mise à jour",
441
- "toc": "Table des matières",
442
- "objectives": "Objectifs",
443
-
444
- "sections": {
445
- "overview": "Vue d'ensemble",
446
- "useCases": "Cas d'utilisation",
447
- "businessRules": "Règles métier",
448
- "permissions": "Permissions",
449
- "api": "API Endpoints"
450
- },
451
-
452
- "labels": {
453
- "actor": "Acteur",
454
- "rule": "Règle",
455
- "category": "Catégorie",
456
- "priority": "Priorité",
457
- "permission": "Permission"
458
- }
459
- }
460
- }
461
- ```
462
-
463
- | Langue | Fichier |
464
- |--------|---------|
465
- | FR | `fr/{app}-{module}.json` |
466
- | EN | `en/{app}-{module}.json` |
467
- | IT | `it/{app}-{module}.json` |
468
- | DE | `de/{app}-{module}.json` |
469
-
470
- ---
471
-
472
- ## STEP 6: Mettre à jour App.tsx
473
-
474
- Ajouter la route dans le groupe du module business:
475
-
476
- ```tsx
477
- {/* Business context routes */}
478
- <Route path="/business" element={<BusinessLayout />}>
479
- {/* {Application} */}
480
- <Route path="{app}/{module}" element={<{Module}IndexPage />} />
481
- <Route path="{app}/{module}/list" element={<{Module}ListPage />} />
482
- <Route path="{app}/{module}/create" element={<{Module}CreatePage />} />
483
- <Route path="{app}/{module}/:id" element={<{Module}DetailPage />} />
484
- <Route path="{app}/{module}/documentation" element={<DocumentationPage />} /> {/* ← NOUVEAU */}
485
- </Route>
486
- ```
487
-
488
- ---
489
-
490
- ## STEP 7: Ajouter le lien dans la navigation du module
491
-
492
- Dans la page principale du module, ajouter un onglet/lien vers la documentation:
493
-
494
- ```tsx
495
- // Dans {Module}IndexPage.tsx ou layout du module
496
- <nav className="flex gap-4 border-b border-[var(--border-color)] mb-6">
497
- <NavLink to="/business/{app}/{module}" end>
498
- {t('tabs.overview')}
499
- </NavLink>
500
- <NavLink to="/business/{app}/{module}/list">
501
- {t('tabs.list')}
502
- </NavLink>
503
- <NavLink to="/business/{app}/{module}/documentation">
504
- <BookOpen className="w-4 h-4 mr-1" />
505
- {t('tabs.documentation')}
506
- </NavLink>
507
- </nav>
508
- ```
509
-
510
- ---
511
-
512
- ## STEP 8: Validation
513
-
514
- ```bash
515
- # Vérifier que les fichiers sont créés
516
- echo "Vérification des fichiers générés..."
517
-
518
- FILES_TO_CHECK=(
519
- "$MODULE_DIR/DocumentationPage.tsx"
520
- "$I18N_DIR/fr/{app}-{module}.json"
521
- "$I18N_DIR/en/{app}-{module}.json"
522
- "$I18N_DIR/it/{app}-{module}.json"
523
- "$I18N_DIR/de/{app}-{module}.json"
524
- )
525
-
526
- for file in "${FILES_TO_CHECK[@]}"; do
527
- if [ -f "$file" ]; then
528
- echo " ✓ $file"
529
- else
530
- echo " ✗ $file (MANQUANT)"
531
- fi
532
- done
533
-
534
- # Vérifier le build
535
- echo ""
536
- echo "Test build frontend..."
537
- cd web/smartstack-web && npm run build --dry-run 2>/dev/null || echo "Build check skipped"
538
- ```
539
-
540
- ---
541
-
542
- ## STEP 9: Résumé
543
-
544
- ```
545
- ================================================================================
546
- DOCUMENTATION HTML GÉNÉRÉE - {FEATURE_ID}
547
- ================================================================================
548
-
549
- MODULE: /business/{app}/{module}
550
-
551
- FICHIERS CRÉÉS:
552
-
553
- PAGE REACT:
554
- ✓ pages/business/{app}/{module}/DocumentationPage.tsx
555
-
556
- I18N (4 langues):
557
- ✓ fr/{app}-{module}.json (clés documentation.*)
558
- ✓ en/{app}-{module}.json
559
- ✓ it/{app}-{module}.json
560
- ✓ de/{app}-{module}.json
561
-
562
- ROUTE AJOUTÉE (App.tsx):
563
- /business/{app}/{module}/documentation
564
-
565
- NAVIGATION:
566
- Onglet "Documentation" ajouté dans le module
567
-
568
- ================================================================================
569
- ACCÈS
570
- ================================================================================
571
-
572
- URL de la documentation:
573
- http://localhost:5173/business/{app}/{module}/documentation
574
-
575
- Accès depuis le module:
576
- Onglet "Documentation" dans la barre de navigation du module
577
-
578
- ================================================================================
579
- CONTEXT7 UTILISÉ
580
- ================================================================================
581
-
582
- Libraries référencées:
583
- • /facebook/react
584
- • /i18next/react-i18next
585
- • /remix-run/react-router
586
- • /lucide-icons/lucide-react
587
-
588
- ================================================================================
589
-
590
- Contact support: support@atlshub.ch
591
- ```
592
-
593
- ---
594
-
595
- ## Checklist génération
596
-
597
- - [ ] DocumentationPage.tsx généré avec Context7
598
- - [ ] Données FRD extraites et intégrées
599
- - [ ] i18n ajouté pour 4 langues dans namespace module
600
- - [ ] Route ajoutée dans App.tsx
601
- - [ ] Onglet Documentation ajouté dans navigation module
602
- - [ ] Build frontend vérifié
1
+ ---
2
+ description: Phase 7 - Generate HTML documentation (React components) integrated in module
3
+ agent: ba-doc-html
4
+ model: sonnet
5
+ ---
6
+
7
+ # Phase 7: Documentation HTML (React) - Intégrée au Module
8
+
9
+ > **Modèle:** Sonnet (génération React + i18n avec Context7)
10
+ > **Coût estimé:** ~$0.20
11
+ > **Output:** Composant React dans le module business: `pages/business/{app}/{module}/DocumentationPage.tsx`
12
+
13
+ ---
14
+
15
+ ## OBJECTIF
16
+
17
+ ```
18
+ +==============================================================================+
19
+ | DOCUMENTATION FRD INTÉGRÉE AU MODULE BUSINESS |
20
+ +==============================================================================+
21
+ | |
22
+ | La documentation est un ONGLET/TAB dans chaque module business: |
23
+ | |
24
+ | /business/{application}/{module} |
25
+ | ├── (index) → Page principale du module |
26
+ | ├── /list → Liste des entités |
27
+ | ├── /create → Création |
28
+ | ├── /:id → Détail |
29
+ | └── /documentation → 📄 Documentation FRD (CETTE PAGE) |
30
+ | |
31
+ | AVANTAGE: L'utilisateur accède à la doc depuis le module qu'il utilise |
32
+ | |
33
+ +==============================================================================+
34
+ ```
35
+
36
+ ---
37
+
38
+ ## CONTEXT7 - UTILISATION OBLIGATOIRE
39
+
40
+ ```
41
+ +==============================================================================+
42
+ | GÉNÉRATION REACT AVEC CONTEXT7 |
43
+ +==============================================================================+
44
+ | |
45
+ | Pour CHAQUE composant React généré, utiliser: |
46
+ | |
47
+ | "use context7 with /facebook/react and /i18next/react-i18next |
48
+ | to generate {component} following SmartStack documentation patterns" |
49
+ | |
50
+ | Libraries à référencer: |
51
+ | • /facebook/react - React 19 patterns, hooks |
52
+ | • /i18next/react-i18next - useTranslation, Trans |
53
+ | • /remix-run/react-router - Link, useParams, useNavigate |
54
+ | • /lucide-icons/lucide-react - Icons cohérents |
55
+ | |
56
+ +==============================================================================+
57
+ ```
58
+
59
+ ---
60
+
61
+ ## STEP 1: Charger les documents
62
+
63
+ ```bash
64
+ FEATURE_ID=$1
65
+ FEATURE_DIR=$(find .business-analyse -type d -name "${FEATURE_ID}*" | head -1)
66
+ FRD_FILE="$FEATURE_DIR/3-functional-specification.md"
67
+ HANDOFF_FILE="$FEATURE_DIR/4-development-handoff.md"
68
+
69
+ # Extraire les informations
70
+ APPLICATION=$(echo $FEATURE_DIR | grep -oP 'business/\K[^/]+')
71
+ MODULE=$(echo $FEATURE_DIR | grep -oP 'modules/\K[^/]+')
72
+ FEATURE_NAME=$(echo $FEATURE_DIR | grep -oP 'FEAT-\d+-\K.*')
73
+
74
+ # Paths de sortie - DANS LE MODULE BUSINESS (pas dans /docs)
75
+ WEB_DIR="web/smartstack-web/src"
76
+ MODULE_DIR="$WEB_DIR/pages/business/$APPLICATION/$MODULE"
77
+ I18N_DIR="$WEB_DIR/i18n/locales"
78
+ ```
79
+
80
+ ---
81
+
82
+ ## STEP 2: Analyser le FRD pour extraction
83
+
84
+ ```bash
85
+ # Extraire les données structurées du FRD
86
+ echo "Extraction des données du FRD..."
87
+
88
+ # Cas d'utilisation
89
+ USE_CASES=$(grep -oP 'UC-\d+.*' "$FRD_FILE" | head -10)
90
+
91
+ # Règles métier liées
92
+ BUSINESS_RULES=$(grep -oP 'BR-\d+' "$FRD_FILE" | sort -u)
93
+
94
+ # Permissions
95
+ PERMISSIONS=$(grep -oP 'business\.[a-z.]+' "$FRD_FILE" | sort -u)
96
+
97
+ # Endpoints API
98
+ ENDPOINTS=$(grep -oP '/api/business/[a-z/{}]+' "$FRD_FILE" | sort -u)
99
+ ```
100
+
101
+ ---
102
+
103
+ ## STEP 3: Créer la structure de dossiers
104
+
105
+ ```bash
106
+ # Le dossier du module doit déjà exister (créé par /implement)
107
+ # On ajoute juste la page Documentation
108
+
109
+ if [ ! -d "$MODULE_DIR" ]; then
110
+ echo "⚠️ Module $APPLICATION/$MODULE non implémenté"
111
+ echo " Exécutez d'abord: /implement $FEATURE_ID"
112
+ exit 1
113
+ fi
114
+
115
+ # Vérifier si DocumentationPage existe déjà
116
+ if [ -f "$MODULE_DIR/DocumentationPage.tsx" ]; then
117
+ echo "📄 DocumentationPage existe - mise à jour"
118
+ else
119
+ echo "📄 Création de DocumentationPage"
120
+ fi
121
+ ```
122
+
123
+ ---
124
+
125
+ ## STEP 4: Générer DocumentationPage.tsx
126
+
127
+ **Utiliser Context7 pour génération:**
128
+
129
+ ```
130
+ use context7 with /facebook/react and /i18next/react-i18next
131
+ to generate a documentation page component for the {MODULE} module
132
+ following SmartStack patterns with:
133
+ - Back link to module main page
134
+ - Table of contents (sticky sidebar)
135
+ - Overview section
136
+ - Use cases section with actors
137
+ - Business rules section
138
+ - Permissions matrix
139
+ - API endpoints table
140
+ - Version and last update info
141
+ ```
142
+
143
+ ### Template de sortie: DocumentationPage.tsx
144
+
145
+ ```tsx
146
+ // web/smartstack-web/src/pages/business/{app}/{module}/DocumentationPage.tsx
147
+ // GÉNÉRÉ AVEC CONTEXT7: /facebook/react, /i18next/react-i18next
148
+
149
+ import { Link, useParams } from 'react-router-dom';
150
+ import { useTranslation } from 'react-i18next';
151
+ import {
152
+ FileText,
153
+ Users,
154
+ Shield,
155
+ CheckCircle,
156
+ ArrowLeft,
157
+ List,
158
+ Code,
159
+ BookOpen,
160
+ Hash
161
+ } from 'lucide-react';
162
+
163
+ // Données extraites du FRD
164
+ const frdData = {
165
+ featureId: '{FEATURE_ID}',
166
+ version: '1.0',
167
+ lastUpdated: '{DATE}',
168
+
169
+ overview: {
170
+ description: '{FROM FRD SECTION 1}',
171
+ objectives: [
172
+ '{OBJECTIVE 1}',
173
+ '{OBJECTIVE 2}'
174
+ ]
175
+ },
176
+
177
+ useCases: [
178
+ {
179
+ id: 'UC-001',
180
+ title: '{Title}',
181
+ actor: '{Actor}',
182
+ description: '{Description}',
183
+ preconditions: ['{PRE}'],
184
+ postconditions: ['{POST}'],
185
+ steps: ['{STEP 1}', '{STEP 2}']
186
+ }
187
+ ],
188
+
189
+ businessRules: [
190
+ {
191
+ id: 'BR-001',
192
+ title: '{Title}',
193
+ category: '{Category}',
194
+ description: '{Description}',
195
+ priority: 'Must'
196
+ }
197
+ ],
198
+
199
+ permissions: [
200
+ {
201
+ key: 'business.{app}.{module}.read',
202
+ description: '{Description}',
203
+ roles: ['Admin', 'Manager']
204
+ }
205
+ ],
206
+
207
+ endpoints: [
208
+ {
209
+ method: 'GET',
210
+ path: '/api/business/{app}/{module}',
211
+ description: '{Description}',
212
+ permission: 'business.{app}.{module}.read'
213
+ }
214
+ ]
215
+ };
216
+
217
+ export function DocumentationPage() {
218
+ const { t } = useTranslation('{app}-{module}');
219
+
220
+ return (
221
+ <div className="flex gap-8">
222
+ {/* Sidebar - Table of Contents */}
223
+ <aside className="hidden lg:block w-64 shrink-0">
224
+ <nav className="sticky top-24 space-y-2">
225
+ <h3 className="font-semibold text-sm text-[var(--text-secondary)] uppercase tracking-wide mb-4">
226
+ {t('documentation.toc')}
227
+ </h3>
228
+ <a href="#overview" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
229
+ {t('documentation.sections.overview')}
230
+ </a>
231
+ <a href="#use-cases" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
232
+ {t('documentation.sections.useCases')}
233
+ </a>
234
+ <a href="#business-rules" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
235
+ {t('documentation.sections.businessRules')}
236
+ </a>
237
+ <a href="#permissions" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
238
+ {t('documentation.sections.permissions')}
239
+ </a>
240
+ <a href="#api" className="block py-1 text-sm hover:text-[var(--color-primary-600)]">
241
+ {t('documentation.sections.api')}
242
+ </a>
243
+ </nav>
244
+ </aside>
245
+
246
+ {/* Main Content */}
247
+ <main className="flex-1 max-w-4xl">
248
+ {/* Back Link */}
249
+ <Link
250
+ to="/business/{app}/{module}"
251
+ className="inline-flex items-center gap-2 text-sm text-[var(--text-secondary)] hover:text-[var(--color-primary-600)] mb-6"
252
+ >
253
+ <ArrowLeft className="w-4 h-4" />
254
+ {t('documentation.backToModule')}
255
+ </Link>
256
+
257
+ {/* Header */}
258
+ <header className="mb-8">
259
+ <div className="flex items-center gap-3 mb-2">
260
+ <BookOpen className="w-8 h-8 text-[var(--color-primary-600)]" />
261
+ <h1 className="text-3xl font-bold">{t('documentation.title')}</h1>
262
+ </div>
263
+ <p className="text-[var(--text-secondary)]">
264
+ {t('documentation.subtitle')}
265
+ </p>
266
+ <div className="flex gap-4 mt-4 text-sm text-[var(--text-tertiary)]">
267
+ <span>Version {frdData.version}</span>
268
+ <span>•</span>
269
+ <span>{t('documentation.lastUpdated')}: {frdData.lastUpdated}</span>
270
+ </div>
271
+ </header>
272
+
273
+ {/* Overview Section */}
274
+ <section id="overview" className="mb-12">
275
+ <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
276
+ <Hash className="w-5 h-5 text-[var(--color-primary-600)]" />
277
+ {t('documentation.sections.overview')}
278
+ </h2>
279
+ <div className="card p-6">
280
+ <p className="mb-4">{frdData.overview.description}</p>
281
+ <h4 className="font-medium mb-2">{t('documentation.objectives')}</h4>
282
+ <ul className="list-disc list-inside space-y-1 text-[var(--text-secondary)]">
283
+ {frdData.overview.objectives.map((obj, i) => (
284
+ <li key={i}>{obj}</li>
285
+ ))}
286
+ </ul>
287
+ </div>
288
+ </section>
289
+
290
+ {/* Use Cases Section */}
291
+ <section id="use-cases" className="mb-12">
292
+ <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
293
+ <Users className="w-5 h-5 text-[var(--color-primary-600)]" />
294
+ {t('documentation.sections.useCases')}
295
+ </h2>
296
+ <div className="space-y-4">
297
+ {frdData.useCases.map((uc) => (
298
+ <div key={uc.id} className="card p-6">
299
+ <div className="flex items-center gap-2 mb-2">
300
+ <span className="px-2 py-1 text-xs font-mono bg-[var(--color-primary-100)] text-[var(--color-primary-700)] rounded">
301
+ {uc.id}
302
+ </span>
303
+ <h3 className="font-semibold">{uc.title}</h3>
304
+ </div>
305
+ <p className="text-[var(--text-secondary)] mb-4">{uc.description}</p>
306
+ <div className="grid grid-cols-2 gap-4 text-sm">
307
+ <div>
308
+ <span className="font-medium">{t('documentation.labels.actor')}:</span>
309
+ <span className="ml-2">{uc.actor}</span>
310
+ </div>
311
+ </div>
312
+ </div>
313
+ ))}
314
+ </div>
315
+ </section>
316
+
317
+ {/* Business Rules Section */}
318
+ <section id="business-rules" className="mb-12">
319
+ <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
320
+ <CheckCircle className="w-5 h-5 text-[var(--color-primary-600)]" />
321
+ {t('documentation.sections.businessRules')}
322
+ </h2>
323
+ <div className="overflow-x-auto">
324
+ <table className="w-full text-sm">
325
+ <thead>
326
+ <tr className="border-b border-[var(--border-color)]">
327
+ <th className="text-left py-3 px-4">ID</th>
328
+ <th className="text-left py-3 px-4">{t('documentation.labels.rule')}</th>
329
+ <th className="text-left py-3 px-4">{t('documentation.labels.category')}</th>
330
+ <th className="text-left py-3 px-4">{t('documentation.labels.priority')}</th>
331
+ </tr>
332
+ </thead>
333
+ <tbody>
334
+ {frdData.businessRules.map((br) => (
335
+ <tr key={br.id} className="border-b border-[var(--border-color)]">
336
+ <td className="py-3 px-4 font-mono text-xs">{br.id}</td>
337
+ <td className="py-3 px-4">{br.title}</td>
338
+ <td className="py-3 px-4">{br.category}</td>
339
+ <td className="py-3 px-4">
340
+ <span className={`px-2 py-1 rounded text-xs ${
341
+ br.priority === 'Must' ? 'bg-red-100 text-red-700' :
342
+ br.priority === 'Should' ? 'bg-yellow-100 text-yellow-700' :
343
+ 'bg-gray-100 text-gray-700'
344
+ }`}>
345
+ {br.priority}
346
+ </span>
347
+ </td>
348
+ </tr>
349
+ ))}
350
+ </tbody>
351
+ </table>
352
+ </div>
353
+ </section>
354
+
355
+ {/* Permissions Section */}
356
+ <section id="permissions" className="mb-12">
357
+ <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
358
+ <Shield className="w-5 h-5 text-[var(--color-primary-600)]" />
359
+ {t('documentation.sections.permissions')}
360
+ </h2>
361
+ <div className="overflow-x-auto">
362
+ <table className="w-full text-sm">
363
+ <thead>
364
+ <tr className="border-b border-[var(--border-color)]">
365
+ <th className="text-left py-3 px-4">{t('documentation.labels.permission')}</th>
366
+ <th className="text-left py-3 px-4">Description</th>
367
+ <th className="text-left py-3 px-4">Roles</th>
368
+ </tr>
369
+ </thead>
370
+ <tbody>
371
+ {frdData.permissions.map((perm) => (
372
+ <tr key={perm.key} className="border-b border-[var(--border-color)]">
373
+ <td className="py-3 px-4 font-mono text-xs">{perm.key}</td>
374
+ <td className="py-3 px-4">{perm.description}</td>
375
+ <td className="py-3 px-4">
376
+ <div className="flex gap-1">
377
+ {perm.roles.map((role) => (
378
+ <span key={role} className="px-2 py-1 bg-[var(--bg-secondary)] rounded text-xs">
379
+ {role}
380
+ </span>
381
+ ))}
382
+ </div>
383
+ </td>
384
+ </tr>
385
+ ))}
386
+ </tbody>
387
+ </table>
388
+ </div>
389
+ </section>
390
+
391
+ {/* API Endpoints Section */}
392
+ <section id="api" className="mb-12">
393
+ <h2 className="text-xl font-semibold mb-4 flex items-center gap-2">
394
+ <Code className="w-5 h-5 text-[var(--color-primary-600)]" />
395
+ {t('documentation.sections.api')}
396
+ </h2>
397
+ <div className="space-y-3">
398
+ {frdData.endpoints.map((ep, i) => (
399
+ <div key={i} className="card p-4">
400
+ <div className="flex items-center gap-3">
401
+ <span className={`px-2 py-1 text-xs font-bold rounded ${
402
+ ep.method === 'GET' ? 'bg-green-100 text-green-700' :
403
+ ep.method === 'POST' ? 'bg-blue-100 text-blue-700' :
404
+ ep.method === 'PUT' ? 'bg-yellow-100 text-yellow-700' :
405
+ ep.method === 'DELETE' ? 'bg-red-100 text-red-700' :
406
+ 'bg-gray-100 text-gray-700'
407
+ }`}>
408
+ {ep.method}
409
+ </span>
410
+ <code className="text-sm">{ep.path}</code>
411
+ </div>
412
+ <p className="text-sm text-[var(--text-secondary)] mt-2">{ep.description}</p>
413
+ <p className="text-xs text-[var(--text-tertiary)] mt-1">
414
+ {t('documentation.labels.permission')}: <code>{ep.permission}</code>
415
+ </p>
416
+ </div>
417
+ ))}
418
+ </div>
419
+ </section>
420
+ </main>
421
+ </div>
422
+ );
423
+ }
424
+ ```
425
+
426
+ ---
427
+
428
+ ## STEP 5: Générer/Mettre à jour i18n
429
+
430
+ ### Ajouter les clés dans le namespace du module
431
+
432
+ Fichier: `{lang}/{app}-{module}.json`
433
+
434
+ ```json
435
+ {
436
+ "documentation": {
437
+ "title": "Documentation fonctionnelle",
438
+ "subtitle": "Spécifications du module {Module}",
439
+ "backToModule": "Retour au module",
440
+ "lastUpdated": "Dernière mise à jour",
441
+ "toc": "Table des matières",
442
+ "objectives": "Objectifs",
443
+
444
+ "sections": {
445
+ "overview": "Vue d'ensemble",
446
+ "useCases": "Cas d'utilisation",
447
+ "businessRules": "Règles métier",
448
+ "permissions": "Permissions",
449
+ "api": "API Endpoints"
450
+ },
451
+
452
+ "labels": {
453
+ "actor": "Acteur",
454
+ "rule": "Règle",
455
+ "category": "Catégorie",
456
+ "priority": "Priorité",
457
+ "permission": "Permission"
458
+ }
459
+ }
460
+ }
461
+ ```
462
+
463
+ | Langue | Fichier |
464
+ |--------|---------|
465
+ | FR | `fr/{app}-{module}.json` |
466
+ | EN | `en/{app}-{module}.json` |
467
+ | IT | `it/{app}-{module}.json` |
468
+ | DE | `de/{app}-{module}.json` |
469
+
470
+ ---
471
+
472
+ ## STEP 6: Mettre à jour App.tsx
473
+
474
+ Ajouter la route dans le groupe du module business:
475
+
476
+ ```tsx
477
+ {/* Business context routes */}
478
+ <Route path="/business" element={<BusinessLayout />}>
479
+ {/* {Application} */}
480
+ <Route path="{app}/{module}" element={<{Module}IndexPage />} />
481
+ <Route path="{app}/{module}/list" element={<{Module}ListPage />} />
482
+ <Route path="{app}/{module}/create" element={<{Module}CreatePage />} />
483
+ <Route path="{app}/{module}/:id" element={<{Module}DetailPage />} />
484
+ <Route path="{app}/{module}/documentation" element={<DocumentationPage />} /> {/* ← NOUVEAU */}
485
+ </Route>
486
+ ```
487
+
488
+ ---
489
+
490
+ ## STEP 7: Ajouter le lien dans la navigation du module
491
+
492
+ Dans la page principale du module, ajouter un onglet/lien vers la documentation:
493
+
494
+ ```tsx
495
+ // Dans {Module}IndexPage.tsx ou layout du module
496
+ <nav className="flex gap-4 border-b border-[var(--border-color)] mb-6">
497
+ <NavLink to="/business/{app}/{module}" end>
498
+ {t('tabs.overview')}
499
+ </NavLink>
500
+ <NavLink to="/business/{app}/{module}/list">
501
+ {t('tabs.list')}
502
+ </NavLink>
503
+ <NavLink to="/business/{app}/{module}/documentation">
504
+ <BookOpen className="w-4 h-4 mr-1" />
505
+ {t('tabs.documentation')}
506
+ </NavLink>
507
+ </nav>
508
+ ```
509
+
510
+ ---
511
+
512
+ ## STEP 8: Validation
513
+
514
+ ```bash
515
+ # Vérifier que les fichiers sont créés
516
+ echo "Vérification des fichiers générés..."
517
+
518
+ FILES_TO_CHECK=(
519
+ "$MODULE_DIR/DocumentationPage.tsx"
520
+ "$I18N_DIR/fr/{app}-{module}.json"
521
+ "$I18N_DIR/en/{app}-{module}.json"
522
+ "$I18N_DIR/it/{app}-{module}.json"
523
+ "$I18N_DIR/de/{app}-{module}.json"
524
+ )
525
+
526
+ for file in "${FILES_TO_CHECK[@]}"; do
527
+ if [ -f "$file" ]; then
528
+ echo " ✓ $file"
529
+ else
530
+ echo " ✗ $file (MANQUANT)"
531
+ fi
532
+ done
533
+
534
+ # Vérifier le build
535
+ echo ""
536
+ echo "Test build frontend..."
537
+ cd web/smartstack-web && npm run build --dry-run 2>/dev/null || echo "Build check skipped"
538
+ ```
539
+
540
+ ---
541
+
542
+ ## STEP 9: Résumé
543
+
544
+ ```
545
+ ================================================================================
546
+ DOCUMENTATION HTML GÉNÉRÉE - {FEATURE_ID}
547
+ ================================================================================
548
+
549
+ MODULE: /business/{app}/{module}
550
+
551
+ FICHIERS CRÉÉS:
552
+
553
+ PAGE REACT:
554
+ ✓ pages/business/{app}/{module}/DocumentationPage.tsx
555
+
556
+ I18N (4 langues):
557
+ ✓ fr/{app}-{module}.json (clés documentation.*)
558
+ ✓ en/{app}-{module}.json
559
+ ✓ it/{app}-{module}.json
560
+ ✓ de/{app}-{module}.json
561
+
562
+ ROUTE AJOUTÉE (App.tsx):
563
+ /business/{app}/{module}/documentation
564
+
565
+ NAVIGATION:
566
+ Onglet "Documentation" ajouté dans le module
567
+
568
+ ================================================================================
569
+ ACCÈS
570
+ ================================================================================
571
+
572
+ URL de la documentation:
573
+ http://localhost:5173/business/{app}/{module}/documentation
574
+
575
+ Accès depuis le module:
576
+ Onglet "Documentation" dans la barre de navigation du module
577
+
578
+ ================================================================================
579
+ CONTEXT7 UTILISÉ
580
+ ================================================================================
581
+
582
+ Libraries référencées:
583
+ • /facebook/react
584
+ • /i18next/react-i18next
585
+ • /remix-run/react-router
586
+ • /lucide-icons/lucide-react
587
+
588
+ ================================================================================
589
+
590
+ Contact support: support@atlshub.ch
591
+ ```
592
+
593
+ ---
594
+
595
+ ## Checklist génération
596
+
597
+ - [ ] DocumentationPage.tsx généré avec Context7
598
+ - [ ] Données FRD extraites et intégrées
599
+ - [ ] i18n ajouté pour 4 langues dans namespace module
600
+ - [ ] Route ajoutée dans App.tsx
601
+ - [ ] Onglet Documentation ajouté dans navigation module
602
+ - [ ] Build frontend vérifié