@atlashub/smartstack-cli 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.documentation/agents.html +1 -371
  2. package/.documentation/cli-commands.html +1 -1
  3. package/.documentation/commands.html +1 -1
  4. package/.documentation/efcore.html +1 -1
  5. package/.documentation/gitflow.html +1 -1
  6. package/.documentation/hooks.html +27 -66
  7. package/.documentation/index.html +166 -166
  8. package/.documentation/init.html +6 -7
  9. package/.documentation/installation.html +1 -1
  10. package/.documentation/prd-json-v2.0.0.md +396 -0
  11. package/.documentation/ralph-loop.html +1 -9
  12. package/.documentation/test-web.html +15 -39
  13. package/.documentation/testing-ba-e2e.md +462 -0
  14. package/dist/index.js +23 -16
  15. package/dist/index.js.map +1 -1
  16. package/package.json +6 -2
  17. package/templates/agents/gitflow/merge.md +56 -6
  18. package/templates/agents/gitflow/pr.md +70 -9
  19. package/templates/project/appsettings.json.template +8 -2
  20. package/templates/skills/business-analyse/SKILL.md +34 -17
  21. package/templates/skills/business-analyse/html/ba-interactive.html +147 -84
  22. package/templates/skills/business-analyse/questionnaire.md +20 -15
  23. package/templates/skills/business-analyse/steps/step-00-init.md +80 -57
  24. package/templates/skills/business-analyse/steps/step-03-specify.md +57 -0
  25. package/templates/skills/business-analyse/steps/step-05-handoff.md +480 -14
  26. package/templates/skills/business-analyse/steps/step-06-extract.md +131 -3
  27. package/templates/skills/gitflow/steps/step-pr.md +17 -5
  28. package/templates/skills/ralph-loop/SKILL.md +158 -33
  29. package/templates/skills/ralph-loop/steps/step-01-task.md +160 -18
  30. package/templates/skills/ralph-loop/steps/step-02-execute.md +408 -23
  31. package/templates/skills/ralph-loop/steps/step-03-commit.md +82 -0
  32. package/templates/skills/ralph-loop/steps/step-04-check.md +305 -9
  33. package/templates/skills/ralph-loop/steps/step-05-report.md +115 -0
@@ -0,0 +1,396 @@
1
+ # PRD JSON v2.0.0 - Référence Complète
2
+
3
+ ## Vue d'ensemble
4
+
5
+ Le `prd.json` est généré **programmatiquement** par `ss derive-prd` à partir du `feature.json` (section handoff).
6
+
7
+ **Garanties** :
8
+ - ✅ Zéro hallucination LLM (extraction déterministe TypeScript)
9
+ - ✅ Traçabilité complète (`source.featureJson` path)
10
+ - ✅ Validation stricte (status + contenu obligatoire)
11
+ - ✅ Reproductibilité parfaite (même input = même output)
12
+
13
+ **Code source** :
14
+ - Types : [src/types/prd-json.d.ts](../src/types/prd-json.d.ts)
15
+ - Extraction : [src/utils/prd-extractor.ts](../src/utils/prd-extractor.ts)
16
+ - CLI : [src/commands/derive-prd.ts](../src/commands/derive-prd.ts)
17
+
18
+ ---
19
+
20
+ ## Commande CLI
21
+
22
+ ```bash
23
+ # Module unique
24
+ ss derive-prd --feature docs/business/MyApp/Orders/business-analyse/v1.0/feature.json
25
+
26
+ # Application complète (tous les modules)
27
+ ss derive-prd --application docs/business/MyApp/business-analyse/v1.0/feature.json
28
+
29
+ # Mode strict (fail on warnings)
30
+ ss derive-prd --feature <path> --strict
31
+
32
+ # Output custom
33
+ ss derive-prd --feature <path> --output .ralph/custom-prd.json
34
+ ```
35
+
36
+ **Output par défaut** : `.ralph/prd-{module}.json`
37
+
38
+ ---
39
+
40
+ ## Structure Complète
41
+
42
+ ```typescript
43
+ {
44
+ // VERSION
45
+ version: "2.0.0",
46
+
47
+ // SOURCE (traçabilité)
48
+ source: {
49
+ type: "ba-handoff-programmatic",
50
+ featureJson: "docs/business/MyApp/Orders/business-analyse/v1.0/feature.json",
51
+ extractedAt: "2024-01-15T10:30:00Z"
52
+ },
53
+
54
+ // PROJECT
55
+ project: {
56
+ application: "MyApp",
57
+ module: "Orders",
58
+ namespace: "MyCompany.MyApp" // Optionnel, depuis .smartstack/config.json
59
+ },
60
+
61
+ // REQUIREMENTS
62
+ requirements: {
63
+ useCases: [{
64
+ id: "UC-001",
65
+ name: "Create Order",
66
+ actor: "Sales Manager",
67
+ permission: "business.myapp.orders.create",
68
+ steps: ["Select products", "Validate cart", "Create order"],
69
+ linkedRules: ["BR-VAL-001"]
70
+ }],
71
+ functionalRequirements: [{
72
+ id: "FR-001",
73
+ statement: "System must allow creating orders",
74
+ priority: "high",
75
+ linkedUCs: ["UC-001"]
76
+ }]
77
+ },
78
+
79
+ // BUSINESS RULES
80
+ businessRules: [{
81
+ id: "BR-VAL-001",
82
+ name: "Order total validation",
83
+ category: "validation",
84
+ statement: "Order total must equal sum of item prices",
85
+ priority: "critical"
86
+ }],
87
+
88
+ // ARCHITECTURE
89
+ architecture: {
90
+ entities: [{
91
+ name: "Order",
92
+ type: "aggregate-root",
93
+ attributes: [{
94
+ name: "Reference",
95
+ type: "string",
96
+ required: true,
97
+ unique: true
98
+ }],
99
+ relationships: [{
100
+ target: "Customer",
101
+ type: "many-to-one"
102
+ }]
103
+ }],
104
+ apiEndpoints: [{
105
+ method: "POST",
106
+ route: "/api/business/myapp/orders",
107
+ operation: "CreateOrder",
108
+ permission: "business.myapp.orders.create",
109
+ requestSchema: "CreateOrderDto",
110
+ responseSchema: "OrderDto",
111
+ errorCodes: ["400", "401", "403", "422"],
112
+ linkedUC: "UC-001"
113
+ }],
114
+ permissionMatrix: {
115
+ permissions: [{
116
+ path: "business.myapp.orders.create",
117
+ description: "Create new orders",
118
+ scope: "tenant"
119
+ }],
120
+ roleAssignments: [{
121
+ role: "MyApp Manager",
122
+ level: "full",
123
+ permissions: ["business.myapp.orders.*"]
124
+ }]
125
+ },
126
+ sections: [{
127
+ code: "orders-list",
128
+ name: "Orders List",
129
+ route: "/business/myapp/orders",
130
+ permission: "business.myapp.orders.read",
131
+ resources: [{
132
+ code: "orders-grid",
133
+ type: "DataGrid",
134
+ entity: "Order",
135
+ columns: ["reference", "customer", "total", "status"]
136
+ }]
137
+ }],
138
+ lifeCycles: [{
139
+ entity: "Order",
140
+ field: "status",
141
+ initialState: "draft",
142
+ states: [
143
+ { id: "draft", allowedTransitions: ["submitted"] },
144
+ { id: "submitted", allowedTransitions: ["approved", "rejected"] }
145
+ ]
146
+ }]
147
+ },
148
+
149
+ // IMPLEMENTATION
150
+ implementation: {
151
+ strategy: "module-by-module",
152
+ filesToCreate: {
153
+ domain: [{
154
+ path: "src/Domain/Business/MyApp/Orders/Order.cs",
155
+ type: "Entity",
156
+ linkedFRs: ["FR-001"],
157
+ linkedUCs: ["UC-001"]
158
+ }],
159
+ application: [/* DTOs, Services, Validators */],
160
+ infrastructure: [/* Repositories, DbContext */],
161
+ api: [/* Controllers */],
162
+ frontend: [{
163
+ path: "src/pages/MyApp/OrdersPage.tsx",
164
+ type: "Page",
165
+ linkedUCs: ["UC-001"],
166
+ linkedWireframes: ["orders-list"]
167
+ }],
168
+ seedData: [{
169
+ path: "src/Infrastructure/Persistence/Seeding/Data/Orders/NavigationModuleSeedData.cs",
170
+ type: "SeedData",
171
+ category: "core"
172
+ }],
173
+ tests: [/* Unit, Integration, Security tests */]
174
+ },
175
+ brToCodeMapping: [{
176
+ ruleId: "BR-VAL-001",
177
+ targetFile: "src/Domain/Business/MyApp/Orders/Order.cs",
178
+ targetMethod: "CalculateTotal()",
179
+ implementationType: "domain-validation"
180
+ }]
181
+ },
182
+
183
+ // SEED DATA
184
+ seedData: {
185
+ core: [
186
+ { entity: "NavigationModule", count: 1 },
187
+ { entity: "Permission", count: 8 }
188
+ ],
189
+ business: [
190
+ { entity: "OrderStatus", samples: ["Draft", "Submitted"], count: 5 }
191
+ ]
192
+ }
193
+ }
194
+ ```
195
+
196
+ ---
197
+
198
+ ## Mapping feature.json → prd.json
199
+
200
+ | Champ prd.json | Source feature.json | Transformation |
201
+ |----------------|---------------------|----------------|
202
+ | `requirements.useCases[]` | `specification.useCases[]` | Direct (id, name, actor, permission, steps, linkedRules) |
203
+ | `requirements.functionalRequirements[]` | `specification.functionalRequirements[]` | Direct (id, statement, priority, linkedUCs) |
204
+ | `businessRules[]` | `analysis.businessRules[]` | Direct (id, name, category, statement, priority) |
205
+ | `architecture.entities[]` | `analysis.entities[]` | Direct (name, type, attributes, relationships) |
206
+ | `architecture.apiEndpoints[]` | `specification.apiEndpoints[]` | Direct (method, route, operation, permission) |
207
+ | `architecture.permissionMatrix` | `specification.permissionMatrix` | Direct (permissions, roleAssignments) |
208
+ | `architecture.sections[]` | `specification.sections[]` | Direct (code, name, route, resources) |
209
+ | `architecture.lifeCycles[]` | `specification.lifeCycles[]` | Direct (entity, states, transitions) |
210
+ | `implementation.strategy` | `handoff.implementationStrategy` | Direct ("module-by-module", "layer-by-layer", "hybrid") |
211
+ | `implementation.filesToCreate` | `handoff.filesToCreate` | Direct (7 categories: domain, application, infrastructure, api, frontend, seedData, tests) |
212
+ | `implementation.brToCodeMapping[]` | `handoff.brToCodeMapping[]` | Direct (ruleId, targetFile, targetMethod) |
213
+ | `seedData.core` | `specification.seedDataCore` | Direct |
214
+ | `seedData.business` | `specification.seedDataBusiness` | Direct |
215
+
216
+ **Aucune transformation complexe** : Le prd.json est une copie structurée du feature.json.
217
+
218
+ ---
219
+
220
+ ## Validation (Pre-Extraction)
221
+
222
+ ### Pré-requis MANDATORY
223
+
224
+ ```typescript
225
+ // Code: src/utils/prd-extractor.ts:validateForPrdExtraction()
226
+
227
+ function validateForPrdExtraction(feature: ModuleFeatureJson): string[] {
228
+ const errors: string[] = [];
229
+
230
+ if (!feature.id) errors.push('Missing feature ID');
231
+ if (!feature.metadata?.application) errors.push('Missing metadata.application');
232
+ if (!feature.metadata?.module) errors.push('Missing metadata.module');
233
+
234
+ if (feature.status !== 'handed-off' &&
235
+ feature.status !== 'approved' &&
236
+ feature.status !== 'consolidated') {
237
+ errors.push(`Feature status is "${feature.status}" — expected "handed-off", "approved", or "consolidated"`);
238
+ }
239
+
240
+ if (!feature.specification?.useCases?.length) {
241
+ errors.push('No use cases found in specification');
242
+ }
243
+
244
+ if (!feature.analysis?.businessRules?.length) {
245
+ errors.push('No business rules found in analysis');
246
+ }
247
+
248
+ if (!feature.handoff?.filesToCreate) {
249
+ errors.push('No filesToCreate found in handoff');
250
+ }
251
+
252
+ return errors;
253
+ }
254
+ ```
255
+
256
+ ### Mode Strict
257
+
258
+ En mode `--strict`, les warnings bloquent l'extraction :
259
+
260
+ ```bash
261
+ ss derive-prd --feature <path> --strict
262
+ # Échoue si : warnings.length > 0
263
+ ```
264
+
265
+ ---
266
+
267
+ ## Exemples Annotés
268
+
269
+ ### Simple Module (CRUD basique)
270
+
271
+ **Contexte** : Module Orders avec 1 entity, 2 UCs, 3 BRs
272
+
273
+ **Commande** :
274
+ ```bash
275
+ ss derive-prd --feature docs/business/MyApp/Orders/business-analyse/v1.0/feature.json
276
+ ```
277
+
278
+ **Output** : `.ralph/prd-Orders.json` (voir [examples/prd-simple.json](examples/prd-simple.json))
279
+
280
+ **Métriques** :
281
+ - UCs: 2
282
+ - FRs: 3
283
+ - BRs: 3
284
+ - Endpoints: 5 (CRUD + List)
285
+ - Files to create: 15
286
+ - SeedData core: 5 (MANDATORY)
287
+
288
+ ---
289
+
290
+ ### Medium Module (Avec Lifecycle)
291
+
292
+ **Contexte** : Module Invoices avec 4 entities, 6 UCs, 12 BRs, lifecycle states
293
+
294
+ **Commande** :
295
+ ```bash
296
+ ss derive-prd --feature docs/business/MyApp/Invoices/business-analyse/v1.0/feature.json
297
+ ```
298
+
299
+ **Output** : `.ralph/prd-Invoices.json` (voir [examples/prd-medium.json](examples/prd-medium.json))
300
+
301
+ **Métriques** :
302
+ - UCs: 6
303
+ - FRs: 10
304
+ - BRs: 12
305
+ - Endpoints: 12
306
+ - Files to create: 35
307
+ - LifeCycles: 1 (Invoice.status: draft → submitted → paid)
308
+
309
+ ---
310
+
311
+ ### Complex Module (Cross-Dependencies)
312
+
313
+ **Contexte** : Module Orders dépendant de Customers + Products
314
+
315
+ **Commande** :
316
+ ```bash
317
+ ss derive-prd --application docs/business/MyApp/business-analyse/v1.0/feature.json
318
+ # Génère prd-Orders.json + prd-Customers.json + prd-Products.json
319
+ ```
320
+
321
+ **Output** : 3 fichiers prd.json (voir [examples/prd-complex/](examples/prd-complex/))
322
+
323
+ **Métriques** :
324
+ - Modules: 3
325
+ - Total UCs: 15
326
+ - Total BRs: 25
327
+ - Cross-module relationships: Order → Customer, Order → Product
328
+
329
+ ---
330
+
331
+ ## Consommation par Ralph Loop
332
+
333
+ Ralph Loop lit le prd.json pour :
334
+
335
+ 1. **Générer les fichiers** (`implementation.filesToCreate`) :
336
+ - Domain entities (BaseEntity + IAuditableEntity)
337
+ - Application services (DTOs, Validators)
338
+ - Infrastructure (Repositories, DbContext)
339
+ - API controllers (RequirePermission)
340
+ - Frontend pages (SmartTable, EntityForm)
341
+ - SeedData (5 CORE + business)
342
+ - Tests (Unit, Integration, Security)
343
+
344
+ 2. **Implémenter les business rules** (`implementation.brToCodeMapping`) :
345
+ - Injection dans les layers appropriées (Domain, Application, API)
346
+
347
+ 3. **Créer les SeedData** (`seedData.core` + `seedData.business`) :
348
+ - NavigationModule, Permissions, Roles (CORE)
349
+ - Lookup tables, test fixtures (business)
350
+
351
+ 4. **Valider la couverture** :
352
+ - Tous les UCs ont des endpoints
353
+ - Tous les BRs sont mappés au code
354
+ - Toutes les permissions sont définies
355
+
356
+ ---
357
+
358
+ ## Dépannage
359
+
360
+ ### Erreur : "Feature status is X — expected handed-off"
361
+
362
+ **Cause** : Le feature.json n'a pas été finalisé par step-05-handoff.md
363
+
364
+ **Solution** :
365
+ ```bash
366
+ # Vérifier le status
367
+ jq '.status' docs/business/MyApp/Orders/business-analyse/v1.0/feature.json
368
+
369
+ # Doit retourner : "handed-off"
370
+ ```
371
+
372
+ ### Erreur : "No filesToCreate found in handoff"
373
+
374
+ **Cause** : La section handoff est vide (`handoff: {}`) ou manquante
375
+
376
+ **Solution** : Relancer step-05-handoff.md pour générer le handoff complet avec les 7 catégories de fichiers.
377
+
378
+ ### Erreur : "No use cases found"
379
+
380
+ **Cause** : `specification.useCases[]` est vide ou manquant
381
+
382
+ **Solution** : Relancer step-03-specify.md pour spécifier les use cases.
383
+
384
+ ### Avertissement : Module feature.json mais status = "approved"
385
+
386
+ **Cause** : Feature validée mais pas encore en mode handoff
387
+
388
+ **Solution** : Acceptable en mode non-strict. Pour strict, relancer step-05.
389
+
390
+ ---
391
+
392
+ ## Voir aussi
393
+
394
+ - [feature.json Schema](../templates/skills/business-analyse/schemas/feature-schema.json)
395
+ - [Step 05 Handoff](../templates/skills/business-analyse/steps/step-05-handoff.md)
396
+ - [Ralph Loop Documentation](../templates/skills/ralph-loop/SKILL.md)
@@ -12,7 +12,7 @@
12
12
  <header class="global-header">
13
13
  <div class="logo">SS</div>
14
14
  <span class="site-title">SmartStack CLI</span>
15
- <span class="version-badge">v2.0.0</span>
15
+ <span class="version-badge">v3.0.0</span>
16
16
  <div class="header-divider"></div>
17
17
  <span class="page-title">Ralph Loop</span>
18
18
  <nav class="breadcrumb">
@@ -196,14 +196,6 @@
196
196
  <span data-lang="en">Concept</span>
197
197
  </h2>
198
198
 
199
- <div class="code-block">
200
- <button class="copy-btn">Copy</button>
201
- <pre><code># Core concept
202
- while :; do
203
- cat PROMPT.md | claude-code --continue
204
- done</code></pre>
205
- </div>
206
-
207
199
  <h4 data-lang="fr">Chaque iteration</h4>
208
200
  <h4 data-lang="en">Each iteration</h4>
209
201
 
@@ -12,7 +12,7 @@
12
12
  <header class="global-header">
13
13
  <div class="logo">SS</div>
14
14
  <span class="site-title">SmartStack CLI</span>
15
- <span class="version-badge">v2.0.0</span>
15
+ <span class="version-badge">v3.0.0</span>
16
16
  <div class="header-divider"></div>
17
17
  <span class="page-title">Test Web</span>
18
18
  <nav class="breadcrumb">
@@ -225,49 +225,25 @@
225
225
  <section id="configuration">
226
226
  <h2>Configuration</h2>
227
227
 
228
- <p data-lang="fr">Creez un fichier de configuration dans <code>.claude/test-web/config.json</code> :</p>
229
- <p data-lang="en">Create a configuration file in <code>.claude/test-web/config.json</code>:</p>
228
+ <p data-lang="fr">
229
+ La configuration se fait dans <code>.claude/test-web/config.json</code>. Utilisez un template pour demarrer rapidement :
230
+ </p>
231
+ <p data-lang="en">
232
+ Configuration is done in <code>.claude/test-web/config.json</code>. Use a template to get started quickly:
233
+ </p>
230
234
 
231
235
  <div class="code-block">
232
236
  <button class="copy-btn">Copy</button>
233
- <pre><code>{
234
- "version": "1.0.0",
235
- "targets": [
236
- {
237
- "name": "npm Package Page",
238
- "url": "https://www.npmjs.com/package/@scope/package-name",
239
- "type": "fetch",
240
- "expects": {
241
- "status": 200,
242
- "contains": ["package-name", "Install"]
243
- }
244
- },
245
- {
246
- "name": "npm Search",
247
- "query": "@scope/package-name npm",
248
- "type": "search",
249
- "expects": {
250
- "hasResults": true
251
- }
252
- },
253
- {
254
- "name": "GitHub Repository",
255
- "url": "https://github.com/org/repo",
256
- "type": "fetch",
257
- "expects": {
258
- "status": 200,
259
- "contains": ["README", "package.json"]
260
- }
261
- }
262
- ],
263
- "settings": {
264
- "timeout": 30000,
265
- "retries": 2,
266
- "reportPath": ".claude/test-web/reports"
267
- }
268
- }</code></pre>
237
+ <pre><code>/test-web-config npm-package</code></pre>
269
238
  </div>
270
239
 
240
+ <p data-lang="fr">
241
+ Le fichier de configuration definit les URLs a tester, le type de test (fetch, search, chrome) et les resultats attendus (code HTTP, contenu present). Voir les templates ci-dessous pour les cas d'usage courants.
242
+ </p>
243
+ <p data-lang="en">
244
+ The configuration file defines URLs to test, the test type (fetch, search, chrome) and expected results (HTTP code, content present). See templates below for common use cases.
245
+ </p>
246
+
271
247
  <h3 data-lang="fr">Types de targets</h3>
272
248
  <h3 data-lang="en">Target Types</h3>
273
249