@atlashub/smartstack-cli 1.11.0 → 1.12.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 (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,377 +6,98 @@ model: haiku
6
6
 
7
7
  # EF Core Database Seed
8
8
 
9
- Inserts test or initial data into the database using EF Core HasData() or Seeder classes.
10
-
11
- > **CLAUDE INSTRUCTION:** The `AskUserQuestion({...})` blocks are instructions to use the `AskUserQuestion` tool in an **interactive** manner. You MUST execute the tool with these parameters to get the user's response BEFORE continuing.
9
+ > **Ref:** [_shared.md](_shared.md)
12
10
 
13
11
  ---
14
12
 
15
- ## RÈGLES DE CONFORMITÉ (OBLIGATOIRE)
13
+ ## Conformité
16
14
 
17
- > **INTERDIT - Violations CLAUDE.md:**
18
- > - ❌ Scripts SQL (.sql files) dans le repository
19
- > - Utilisation de `sqlcmd` avec SQL brut
20
- > - ❌ `migrationBuilder.Sql()` avec INSERT statements
21
- >
22
- > **OBLIGATOIRE - Méthodes autorisées:**
23
- > - ✅ `HasData()` dans les configurations EF Core
24
- > - ✅ Classes `IDataSeeder` exécutées au démarrage
25
- > - ✅ Migrations EF Core avec données typées
26
- >
27
- > **Contact support:** support@atlshub.ch
15
+ | INTERDIT | OBLIGATOIRE |
16
+ |-------------|----------------|
17
+ | Scripts .sql dans repo | `HasData()` dans configurations |
18
+ | `sqlcmd` avec INSERT | Classes `IDataSeeder` |
19
+ | `migrationBuilder.Sql()` INSERT | Migrations EF Core typées |
28
20
 
29
21
  ---
30
22
 
31
- ## STEP 0: Verification environnement et connexion
32
-
33
- > **Include:** `_env-check.md` (etapes 0.1 a 0.5)
34
-
35
- ### 0.1 Detecter et afficher l'environnement
23
+ ## STEP 0: Vérification Environnement
36
24
 
37
25
  ```bash
38
- # Scanner les fichiers appsettings
39
- API_DIR=$(find . -type d -name "*.Api" | head -1)
40
- [ -z "$API_DIR" ] && API_DIR="src/SmartStack.Api"
41
-
42
- # Selectionner l'environnement
43
- ENV_FLAG="${1#--env=}"
44
- if [ -n "$ENV_FLAG" ] && [ "$ENV_FLAG" != "$1" ]; then
45
- SELECTED_ENV="appsettings.${ENV_FLAG}.json"
46
- elif [ -f "$API_DIR/appsettings.Local.json" ]; then
47
- SELECTED_ENV="appsettings.Local.json"
48
- else
49
- echo "ERROR: Aucun fichier appsettings trouve"
50
- exit 1
51
- fi
52
-
53
- # Extraire connection string
54
- CONNECTION_STRING=$(powershell -Command "
55
- \$json = Get-Content '$API_DIR/$SELECTED_ENV' | ConvertFrom-Json
56
- \$json.ConnectionStrings.DefaultConnection
57
- ")
58
-
59
- DATABASE_NAME=$(echo "$CONNECTION_STRING" | grep -oP 'Database=\K[^;]+')
60
- SERVER_NAME=$(echo "$CONNECTION_STRING" | grep -oP 'Server=\K[^;]+')
61
-
62
- # Protection Production
63
- if [[ "$SELECTED_ENV" == *"Production"* ]]; then
64
- echo "BLOQUE: Seed interdit en environnement Production"
65
- exit 1
66
- fi
67
- ```
68
-
69
- ### 0.2 Afficher le resume
70
-
71
- ```
72
- ================================================================================
73
- EF CORE - DATABASE SEED
74
- ================================================================================
75
-
76
- ENVIRONNEMENT: {SELECTED_ENV}
77
-
78
- BASE DE DONNEES CIBLE:
79
- Server: {SERVER_NAME}
80
- Database: {DATABASE_NAME}
81
-
82
- ================================================================================
26
+ detect_environment
27
+ block_production
83
28
  ```
84
29
 
85
30
  ---
86
31
 
87
- ## STEP 1: Detect available seeding methods
32
+ ## STEP 1: Détecter Méthodes Disponibles
88
33
 
89
34
  ```bash
90
- # Search for COMPLIANT seed methods only
91
- SEED_METHODS=""
35
+ # HasData() dans configurations (RECOMMANDÉ)
36
+ grep -rq "\.HasData(" . --include="*.cs" && SEED_METHODS+=" hasdata"
92
37
 
93
- # 1. DbSeeder or DataSeeder class
94
- if grep -rq "class.*Seeder\|class.*Seed\|IDataSeeder" . --include="*.cs" 2>/dev/null; then
95
- SEED_METHODS="$SEED_METHODS seeder-class"
96
- fi
38
+ # Classes IDataSeeder
39
+ grep -rq "IDataSeeder\|class.*Seeder" . --include="*.cs" && SEED_METHODS+=" seeder-class"
97
40
 
98
- # 2. HasData() in configurations (RECOMMENDED)
99
- if grep -rq "\.HasData(" . --include="*.cs" 2>/dev/null; then
100
- SEED_METHODS="$SEED_METHODS hasdata"
101
- fi
41
+ # Argument --seed dans Program.cs
42
+ grep -q "\-\-seed" ./Program.cs && SEED_METHODS+=" cli-argument"
102
43
 
103
- # 3. --seed argument in Program.cs
104
- if grep -q "\-\-seed" ./Program.cs 2>/dev/null; then
105
- SEED_METHODS="$SEED_METHODS cli-argument"
106
- fi
107
-
108
- # WARNING: Detect forbidden SQL scripts
109
- if [ -f "./scripts/seed.sql" ] || [ -f "./Data/seed.sql" ]; then
110
- echo "⚠️ WARNING: SQL seed scripts detected - FORBIDDEN by CLAUDE.md"
111
- echo " Please migrate to HasData() in EF Core configurations"
112
- echo " Contact: support@atlshub.ch"
113
- fi
44
+ # WARNING si scripts SQL détectés
45
+ [ -f "./scripts/seed.sql" ] && echo "⚠️ Scripts SQL détectés - INTERDIT"
114
46
  ```
115
47
 
116
48
  ---
117
49
 
118
- ## STEP 2: Display options
119
-
120
- ```
121
- ================================================================================
122
- EF CORE - DATABASE SEED
123
- ================================================================================
124
-
125
- DETECTED METHODS:
126
- ```
127
-
128
- **If methods found:**
50
+ ## STEP 2: Sélection Méthode
129
51
 
130
52
  ```javascript
131
- // Build options dynamically - ONLY COMPLIANT METHODS
132
- options = []
133
-
134
- if (SEED_METHODS.includes("hasdata")) {
135
- options.push({
136
- label: "HasData (Recommended)",
137
- description: "Data seeded via EF Core migrations - compliant"
138
- })
139
- }
140
-
141
- if (SEED_METHODS.includes("seeder-class")) {
142
- options.push({
143
- label: "Seeder Class",
144
- description: "Execute DbSeeder/DataSeeder class at startup"
145
- })
146
- }
147
-
148
- if (SEED_METHODS.includes("cli-argument")) {
149
- options.push({
150
- label: "CLI --seed",
151
- description: "Launch app with --seed argument"
152
- })
153
- }
154
-
155
53
  AskUserQuestion({
156
54
  questions: [{
157
- question: "Which seeding method to use?",
55
+ question: "Méthode de seeding?",
158
56
  header: "Seed",
159
- options: options,
57
+ options: [
58
+ { label: "HasData (Recommandé)", description: "Via migrations EF Core" },
59
+ { label: "Seeder Class", description: "Exécuter DbSeeder/DataSeeder" },
60
+ { label: "CLI --seed", description: "Lancer app avec --seed" }
61
+ ],
160
62
  multiSelect: false
161
63
  }]
162
64
  })
163
65
  ```
164
66
 
165
- **If no method found:**
166
-
167
- ```
168
- ⚠️ No seeding method detected
169
-
170
- SOLUTION RECOMMANDÉE - HasData():
171
- ────────────────────────────────────────────────────────────────────────────────
172
- Ajoutez HasData() dans vos fichiers *Configuration.cs :
173
-
174
- public class UserConfiguration : IEntityTypeConfiguration<User>
175
- {
176
- public void Configure(EntityTypeBuilder<User> builder)
177
- {
178
- builder.HasData(new User
179
- {
180
- Id = Guid.Parse("7f3c9a2e-8d1b-4e5f-a6c8-9b4d2f7e1a3c"), // Random GUID
181
- Name = "Admin",
182
- Email = "admin@example.com",
183
- CreatedAt = new DateTime(2024, 1, 1, 0, 0, 0, DateTimeKind.Utc)
184
- });
185
- }
186
- }
187
- ────────────────────────────────────────────────────────────────────────────────
188
-
189
- Puis créez une migration:
190
- dotnet ef migrations add SeedInitialData
191
-
192
- ALTERNATIVE - Seeder Class:
193
- ────────────────────────────────────────────────────────────────────────────────
194
- public interface IDataSeeder
195
- {
196
- Task SeedAsync(CancellationToken ct = default);
197
- }
198
-
199
- public class DatabaseSeeder : IDataSeeder
200
- {
201
- private readonly ApplicationDbContext _context;
202
-
203
- public async Task SeedAsync(CancellationToken ct = default)
204
- {
205
- if (!await _context.Users.AnyAsync(ct))
206
- {
207
- _context.Users.Add(new User { ... });
208
- await _context.SaveChangesAsync(ct);
209
- }
210
- }
211
- }
212
- ────────────────────────────────────────────────────────────────────────────────
213
-
214
- ❌ INTERDIT: Création de scripts SQL (.sql files)
215
- Contact: support@atlshub.ch
216
- ```
217
-
218
- ---
219
-
220
- ## STEP 3: Execute seeding
221
-
222
- ### Option A: HasData (via migrations)
223
-
224
- ```bash
225
- # Les données sont déjà dans les migrations
226
- # Simplement appliquer les migrations
227
- STARTUP_PROJECT=$(find . -name "*.Api.csproj" -o -name "*Web.csproj" | head -1)
228
- INFRA_PROJECT=$(find . -name "*Infrastructure.csproj" | head -1)
229
-
230
- dotnet ef database update \
231
- --project "$INFRA_PROJECT" \
232
- --startup-project "$STARTUP_PROJECT"
233
-
234
- echo "✓ HasData() seed applied via migrations"
235
- ```
236
-
237
- ### Option B: Seeder Class
238
-
239
- ```bash
240
- # Detect startup project
241
- STARTUP_PROJECT=$(find . -name "*.csproj" -exec grep -l "Microsoft.AspNetCore" {} \; | head -1)
242
-
243
- # Execute with seed option
244
- dotnet run --project "$STARTUP_PROJECT" -- --seed
245
-
246
- echo "✓ Seeder class executed"
247
- ```
248
-
249
- ### Option C: CLI --seed
250
-
251
- ```bash
252
- STARTUP_PROJECT=$(find . -name "*.csproj" -exec grep -l "Microsoft.AspNetCore" {} \; | head -1)
253
- dotnet run --project "$STARTUP_PROJECT" -- --seed
254
- ```
67
+ **Si aucune méthode:** afficher guide HasData() et IDataSeeder.
255
68
 
256
69
  ---
257
70
 
258
- ## STEP 4: Verification
71
+ ## STEP 3: Exécution
259
72
 
260
- ```bash
261
- # Verify seeding via EF Core context
262
- STARTUP_PROJECT=$(find . -name "*.csproj" -exec grep -l "Microsoft.AspNetCore" {} \; | head -1)
73
+ **HasData:** `dotnet ef database update`
263
74
 
264
- # Run verification endpoint or check via application
265
- echo "Verification: Launch application and check data"
266
- echo " dotnet run --project $STARTUP_PROJECT"
267
- echo ""
268
- echo "Or check via EF Core:"
269
- echo " dotnet ef dbcontext info"
270
- ```
75
+ **Seeder Class:** `dotnet run --project "$STARTUP_PROJECT" -- --seed`
271
76
 
272
77
  ---
273
78
 
274
- ## STEP 5: Resume
275
-
276
- **Afficher un resume apres le seeding:**
79
+ ## Résumé
277
80
 
278
81
  ```
279
- ===============================================================================
280
- DONNÉES INSÉRÉES
281
- ===============================================================================
282
-
283
- DÉTAILS SEED
284
- -------------------------------------------------------------------------------
285
- • Environnement: {SELECTED_ENV}
286
- • Base: {DATABASE_NAME}
287
- • Méthode: {method_used}
288
-
289
- OPÉRATIONS EFFECTUÉES
290
- -------------------------------------------------------------------------------
291
- ✓ Données initiales insérées avec succès
292
- ✓ Méthode conforme: {method_used}
293
-
294
- CONFORMITÉ
295
- -------------------------------------------------------------------------------
296
- ✓ EF Core natif (HasData ou Seeder)
297
- ✓ Pas de SQL brut
298
- ✓ Conforme aux règles CLAUDE.md
299
-
300
- ===============================================================================
301
- PROCHAINES ÉTAPES
302
- ===============================================================================
303
-
304
- 1. Vérifier le statut de la base:
305
- /efcore:db-status
306
-
307
- 2. Lancer l'application:
308
- dotnet run --project {STARTUP_PROJECT}
309
-
310
- 3. Vérifier les données via l'API:
311
- GET /api/{entities}
312
-
313
- ===============================================================================
314
- ```
315
-
316
- **Si aucune méthode de seeding détectée:**
317
-
318
- ```
319
- ===============================================================================
320
- AUCUNE MÉTHODE DE SEED DÉTECTÉE
321
- ===============================================================================
322
-
323
- PROBLÈME
324
- -------------------------------------------------------------------------------
325
- ✗ Aucune méthode de seeding trouvée dans le projet
326
-
327
- MÉTHODES RECHERCHÉES
328
- -------------------------------------------------------------------------------
329
- ○ HasData() dans les configurations EF Core
330
- ○ Classes IDataSeeder / DbSeeder
331
- ○ Argument --seed dans Program.cs
332
-
333
- ===============================================================================
334
- ACTIONS SUGGÉRÉES
335
- ===============================================================================
336
-
337
- 1. RECOMMANDÉ - Ajouter HasData() dans vos configurations:
338
- Voir documentation ci-dessus
339
-
340
- 2. ALTERNATIVE - Créer une classe Seeder:
341
- Implémenter IDataSeeder
342
-
343
- 3. Besoin d'aide?
344
- support@atlshub.ch
345
-
346
- ===============================================================================
82
+ SEED - {DATABASE_NAME}
83
+ ├── Environnement: {SELECTED_ENV}
84
+ ├── Méthode: {method_used}
85
+ ├── Conformité: ✓ EF Core natif, ✓ Pas de SQL brut
86
+ └── Prochains: /efcore:db-status, dotnet run
347
87
  ```
348
88
 
349
89
  ---
350
90
 
351
- ## Migration de scripts SQL existants
91
+ ## Guide Migration SQL HasData
352
92
 
353
- Si vous avez des scripts SQL legacy, migrez-les vers HasData():
354
-
355
- ```
356
- AVANT (INTERDIT):
357
- ────────────────────────────────────────────────────────────────────────────────
358
- -- scripts/seed.sql
359
- INSERT INTO Users (Id, Name, Email) VALUES (1, 'Admin', 'admin@test.com');
360
- ────────────────────────────────────────────────────────────────────────────────
93
+ ```csharp
94
+ // ❌ AVANT (INTERDIT): scripts/seed.sql
95
+ INSERT INTO Users (Id, Name) VALUES (1, 'Admin');
361
96
 
362
- APRÈS (CORRECT):
363
- ────────────────────────────────────────────────────────────────────────────────
364
- // UserConfiguration.cs
365
- builder.HasData(new User
366
- {
97
+ // ✅ APRÈS (CORRECT): UserConfiguration.cs
98
+ builder.HasData(new User {
367
99
  Id = Guid.Parse("7f3c9a2e-8d1b-4e5f-a6c8-9b4d2f7e1a3c"),
368
- Name = "Admin",
369
- Email = "admin@test.com"
100
+ Name = "Admin"
370
101
  });
371
- ────────────────────────────────────────────────────────────────────────────────
372
-
373
- Puis: dotnet ef migrations add MigrateSeedData
102
+ // Puis: dotnet ef migrations add SeedData
374
103
  ```
375
-
376
- ---
377
-
378
- ## Support
379
-
380
- > **Questions ou problèmes avec le seeding EF Core?**
381
- >
382
- > 📧 **support@atlshub.ch**