@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
@@ -4,177 +4,74 @@ agent: efcore-rebase-snapshot
4
4
  model: sonnet
5
5
  ---
6
6
 
7
- # EF Core Rebase-Snapshot - Resync with Develop
7
+ # EF Core Rebase-Snapshot
8
8
 
9
- Rebases the ModelSnapshot on develop and regenerates a consolidated migration. Used when conflict is detected.
10
-
11
- **USAGE:** After `/efcore:conflicts` signals a HIGH conflict.
12
-
13
- **WARNING:** This operation modifies migration files. A backup is created automatically.
9
+ > **Ref:** [_shared.md](_shared.md)
10
+ > **Usage:** Après `/efcore:conflicts` HIGH
11
+ > **WARNING:** Modifie fichiers migration. Backup automatique.
14
12
 
15
13
  ---
16
14
 
17
- ## STEP 1: Check prerequisites
15
+ ## STEP 1: Vérifier Prérequis
18
16
 
19
17
  ```bash
20
18
  CURRENT_BRANCH=$(git branch --show-current)
21
- echo "Current branch: $CURRENT_BRANCH"
22
-
23
- # Check that it's a feature/release/hotfix branch
24
- if [[ ! $CURRENT_BRANCH =~ ^(feature|release|hotfix)/ ]]; then
25
- echo "ERROR: This command can only be executed from a GitFlow branch"
26
- exit 1
27
- fi
28
-
29
- # Check that working directory is clean
30
- if [ -n "$(git status --porcelain)" ]; then
31
- echo "ERROR: Working directory not clean"
32
- echo "Commit or stash your changes first"
33
- exit 1
34
- fi
35
-
36
- # Find EF Core project
37
- CSPROJ=$(find . -name "*.csproj" -exec grep -l "Microsoft.EntityFrameworkCore" {} \; 2>/dev/null | head -1)
38
- if [ -z "$CSPROJ" ]; then
39
- echo "ERROR: No EF Core project found"
40
- exit 1
41
- fi
42
-
43
- PROJECT_DIR=$(dirname "$CSPROJ")
44
- MIGRATIONS_DIR="$PROJECT_DIR/Migrations"
45
- echo "Project: $PROJECT_DIR"
46
- echo "Migrations: $MIGRATIONS_DIR"
19
+ [[ ! $CURRENT_BRANCH =~ ^(feature|release|hotfix)/ ]] && exit 1
20
+ [ -n "$(git status --porcelain)" ] && { echo "Working directory non clean"; exit 1; }
21
+ detect_efcore_project
47
22
  ```
48
23
 
49
24
  ---
50
25
 
51
- ## STEP 2: Backup current migrations
26
+ ## STEP 2: Backup
52
27
 
53
28
  ```bash
54
29
  BACKUP_DIR=".claude/gitflow/backup/migrations/rebase_$(date +%Y%m%d_%H%M%S)"
55
30
  mkdir -p "$BACKUP_DIR"
56
-
57
- echo ""
58
- echo "BACKUP"
59
- echo "======"
60
- cp "$MIGRATIONS_DIR"/*.cs "$BACKUP_DIR/" 2>/dev/null
61
- BACKUP_COUNT=$(ls -1 "$BACKUP_DIR" | wc -l)
62
- echo " $BACKUP_COUNT files backed up to $BACKUP_DIR"
31
+ cp "$MIGRATIONS_DIR"/*.cs "$BACKUP_DIR/"
63
32
  ```
64
33
 
65
34
  ---
66
35
 
67
- ## STEP 3: Identify this branch's migrations
36
+ ## STEP 3: Identifier Migrations de la Branche
68
37
 
69
38
  ```bash
70
- # Find migrations added on this branch (not on develop)
71
- echo ""
72
- echo "THIS BRANCH'S MIGRATIONS"
73
- echo "==========================="
74
-
75
- # Get migration list on develop
76
- DEVELOP_MIGRATIONS=$(git show develop:$MIGRATIONS_DIR 2>/dev/null | grep "\.cs$" | grep -v "Designer" | grep -v "Snapshot")
77
-
78
- # Local migrations
79
- LOCAL_MIGRATIONS=$(ls -1 "$MIGRATIONS_DIR"/*.cs 2>/dev/null | xargs -n1 basename | grep -v "Designer" | grep -v "Snapshot")
39
+ # Migrations sur develop
40
+ DEVELOP_MIGRATIONS=$(git show develop:$MIGRATIONS_DIR | grep "\.cs$")
80
41
 
81
- # New migrations (on this branch but not on develop)
82
- BRANCH_MIGRATIONS=""
42
+ # Nouvelles migrations (cette branche seulement)
83
43
  for migration in $LOCAL_MIGRATIONS; do
84
- if ! echo "$DEVELOP_MIGRATIONS" | grep -q "$migration"; then
85
- BRANCH_MIGRATIONS="$BRANCH_MIGRATIONS $migration"
86
- echo " + $migration"
87
- fi
44
+ echo "$DEVELOP_MIGRATIONS" | grep -q "$migration" || BRANCH_MIGRATIONS+=" $migration"
88
45
  done
89
-
90
- if [ -z "$BRANCH_MIGRATIONS" ]; then
91
- echo " No migration specific to this branch"
92
- echo " Nothing to rebase"
93
- exit 0
94
- fi
95
46
  ```
96
47
 
97
48
  ---
98
49
 
99
- ## STEP 4: Reset ModelSnapshot on develop
50
+ ## STEP 4: Reset ModelSnapshot sur Develop
100
51
 
101
52
  ```bash
102
- echo ""
103
- echo "RESET MODELSNAPSHOT"
104
- echo "==================="
105
-
106
- # Get develop's ModelSnapshot
107
53
  git fetch origin develop
108
- SNAPSHOT_FILE=$(find "$MIGRATIONS_DIR" -name "*ModelSnapshot.cs" | head -1)
109
- SNAPSHOT_NAME=$(basename "$SNAPSHOT_FILE")
110
-
111
- git checkout origin/develop -- "$MIGRATIONS_DIR/$SNAPSHOT_NAME"
112
- echo " ModelSnapshot reset on develop"
54
+ git checkout origin/develop -- "$MIGRATIONS_DIR/*ModelSnapshot.cs"
113
55
  ```
114
56
 
115
57
  ---
116
58
 
117
- ## STEP 5: Delete this branch's migrations
59
+ ## STEP 5: Supprimer Migrations de la Branche
118
60
 
119
61
  ```bash
120
- echo ""
121
- echo "DELETE BRANCH MIGRATIONS"
122
- echo "=============================="
123
-
124
62
  for migration in $BRANCH_MIGRATIONS; do
125
- BASE_NAME="${migration%.cs}"
126
- rm -f "$MIGRATIONS_DIR/$BASE_NAME.cs"
127
- rm -f "$MIGRATIONS_DIR/$BASE_NAME.Designer.cs"
128
- echo " - $BASE_NAME"
63
+ rm -f "$MIGRATIONS_DIR/${migration%.cs}.cs"
64
+ rm -f "$MIGRATIONS_DIR/${migration%.cs}.Designer.cs"
129
65
  done
130
66
  ```
131
67
 
132
68
  ---
133
69
 
134
- ## STEP 6: Regenerate consolidated migration
70
+ ## STEP 6: Régénérer Migration Consolidée
135
71
 
136
72
  ```bash
137
- echo ""
138
- echo "REGENERATE MIGRATION"
139
- echo "======================"
140
-
141
- # Extract branch info for name
142
- BRANCH_TYPE=$(echo "$CURRENT_BRANCH" | cut -d'/' -f1)
143
- BRANCH_NAME=$(echo "$CURRENT_BRANCH" | cut -d'/' -f2 | sed 's/-/_/g' | sed 's/.*/\u&/')
144
-
145
- # Version
146
- VERSION=$(grep -oP '(?<=<Version>).*(?=</Version>)' "$CSPROJ" 2>/dev/null | head -1 || echo "1.0.0")
147
- VERSION_CLEAN=$(echo "$VERSION" | sed 's/\./_/g')
148
-
149
- # Migration name
150
- case $BRANCH_TYPE in
151
- "feature")
152
- MIGRATION_NAME="Feature_${VERSION_CLEAN}_${BRANCH_NAME}_Consolidated"
153
- ;;
154
- "hotfix")
155
- MIGRATION_NAME="Hotfix_${VERSION_CLEAN}_${BRANCH_NAME}_Fix"
156
- ;;
157
- "release")
158
- MIGRATION_NAME="Release_${VERSION_CLEAN}_Consolidated"
159
- ;;
160
- *)
161
- MIGRATION_NAME="Branch_${VERSION_CLEAN}_${BRANCH_NAME}"
162
- ;;
163
- esac
164
-
165
- echo "Name: $MIGRATION_NAME"
166
-
167
- cd "$PROJECT_DIR"
73
+ MIGRATION_NAME="${BRANCH_TYPE}_${VERSION}_${BRANCH_NAME}_Consolidated"
168
74
  dotnet ef migrations add "$MIGRATION_NAME" --verbose
169
-
170
- if [ $? -eq 0 ]; then
171
- echo " Migration created successfully"
172
- else
173
- echo " ERROR: Failed to create migration"
174
- echo " Restoring backup..."
175
- cp "$BACKUP_DIR"/*.cs "$MIGRATIONS_DIR/"
176
- exit 1
177
- fi
178
75
  ```
179
76
 
180
77
  ---
@@ -182,123 +79,24 @@ fi
182
79
  ## STEP 7: Validation
183
80
 
184
81
  ```bash
185
- echo ""
186
- echo "VALIDATION"
187
- echo "=========="
188
-
189
- # Build
190
82
  dotnet build --no-restore
191
- if [ $? -ne 0 ]; then
192
- echo " ERROR: Build failed"
193
- echo " Restoring backup..."
194
- cp "$BACKUP_DIR"/*.cs "$MIGRATIONS_DIR/"
195
- exit 1
196
- fi
197
- echo " Build: OK"
198
-
199
- # Check that migration can generate script
200
- dotnet ef migrations script --no-build > /dev/null 2>&1
201
- if [ $? -ne 0 ]; then
202
- echo " ERROR: Script generation failed"
203
- exit 1
204
- fi
205
- echo " Script: OK"
83
+ dotnet ef migrations script --no-build > /dev/null
206
84
  ```
207
85
 
208
86
  ---
209
87
 
210
- ## STEP 8: Resume
211
-
212
- **Afficher un resume apres le rebase:**
88
+ ## Résumé
213
89
 
214
90
  ```
215
- ===============================================================================
216
- REBASE-SNAPSHOT TERMINÉ
217
- ===============================================================================
218
-
219
- DÉTAILS
220
- -------------------------------------------------------------------------------
221
- • Branche: {current_branch}
222
- • Backup: {backup_dir}
223
-
224
- AVANT LE REBASE
225
- -------------------------------------------------------------------------------
226
- • Migrations: {old_migrations}
227
- • Snapshot: {old_hash}
228
-
229
- APRÈS LE REBASE
230
- -------------------------------------------------------------------------------
231
- • Migration: {new_migration_name}
232
- • Snapshot: {new_hash} (= develop)
233
-
234
- VALIDATIONS
235
- -------------------------------------------------------------------------------
236
- ✓ ModelSnapshot synchronisé avec develop
237
- ✓ Migration consolidée créée
238
- ✓ Build vérifié
239
- ✓ Script de migration valide
240
-
241
- ===============================================================================
242
- PROCHAINES ÉTAPES
243
- ===============================================================================
244
-
245
- 1. Vérifier le contenu de la migration:
246
- Ouvrir Migrations/{new_migration_name}.cs
247
-
248
- 2. Tester sur la base locale:
249
- /efcore:db-reset
250
- /efcore:db-deploy
251
-
252
- 3. Committer les changements:
253
- /gitflow:3-commit
254
-
255
- ===============================================================================
256
- RESTAURATION (si nécessaire)
257
- ===============================================================================
258
-
259
- Si le rebase a causé des problèmes, restaurez le backup:
260
-
261
- cp {backup_dir}/*.cs {migrations_dir}/
262
-
263
- ===============================================================================
264
- ```
265
-
266
- **Si le rebase échoue:**
267
-
91
+ REBASE-SNAPSHOT - {branch}
92
+ ├── Backup: {backup_dir}
93
+ ├── Avant: {old_migrations}
94
+ ├── Après: {new_migration_name} (Snapshot = develop)
95
+ ├── Validations: ✓ Build, ✓ Script
96
+ └── Prochains: /efcore:db-reset, /efcore:db-deploy, /gitflow:3-commit
268
97
  ```
269
- ===============================================================================
270
- ÉCHEC DU REBASE-SNAPSHOT
271
- ===============================================================================
272
98
 
273
- ERREUR
274
- -------------------------------------------------------------------------------
275
- ✗ {error_message}
276
-
277
- DÉTAILS
278
- -------------------------------------------------------------------------------
279
- • Branche: {current_branch}
280
- • Backup: {backup_dir}
281
-
282
- RESTAURATION AUTOMATIQUE
283
- -------------------------------------------------------------------------------
284
- ✓ Backup restauré automatiquement
285
- ✓ Fichiers originaux récupérés
286
-
287
- ===============================================================================
288
- ACTIONS SUGGÉRÉES
289
- ===============================================================================
290
-
291
- 1. Vérifier les erreurs de build:
292
- dotnet build
293
-
294
- 2. Vérifier les conflits de modèle:
295
- /efcore:conflicts
296
-
297
- 3. Si problème persistant, contacter le support:
298
- support@atlshub.ch
299
-
300
- ===============================================================================
301
- ```
99
+ **Si échec:** Backup restauré automatiquement.
302
100
 
303
101
  ---
304
102
 
@@ -306,17 +104,16 @@ RESTAURATION AUTOMATIQUE
306
104
 
307
105
  | Option | Description |
308
106
  |--------|-------------|
309
- | `--no-backup` | Don't create backup (dangerous) |
310
- | `--name <name>` | Force a specific migration name |
311
- | `--dry-run` | Show what would be done without executing |
107
+ | `--no-backup` | Sans backup (dangereux) |
108
+ | `--name <name>` | Forcer nom migration |
109
+ | `--dry-run` | Afficher sans exécuter |
312
110
 
313
111
  ---
314
112
 
315
- ## When to use
113
+ ## Quand utiliser
316
114
 
317
115
  | Situation | Action |
318
116
  |-----------|--------|
319
- | `/efcore:conflicts` returns HIGH | Use rebase-snapshot |
320
- | Merge conflict on ModelSnapshot | Use rebase-snapshot |
321
- | Multiple migrations to consolidate | Use rebase-snapshot |
322
- | Broken migration | Use rebase-snapshot |
117
+ | `/efcore:conflicts` HIGH | Utiliser rebase-snapshot |
118
+ | Conflit merge sur ModelSnapshot | Utiliser rebase-snapshot |
119
+ | Plusieurs migrations à consolider | Utiliser rebase-snapshot |
@@ -4,49 +4,23 @@ agent: efcore-scan
4
4
  model: sonnet
5
5
  ---
6
6
 
7
- # EF Core Scan - Cross-Branch Migration Scanner
7
+ # EF Core Scan
8
8
 
9
- Scans all active branches to detect migrations and analyze conflict risks using **SmartStack MCP**.
10
-
11
- **USAGE:** Before creating a migration or before a merge to check the status of other branches.
12
-
13
- **SECURITY:** Read-only - no modifications.
14
-
15
- **INTEGRATION:** Uses `mcp__smartstack__check_migrations` for each branch comparison.
9
+ > **Ref:** [_shared.md](_shared.md)
10
+ > **MCP:** `mcp__smartstack__check_migrations` pour chaque branche
11
+ > **Type:** Read-only, aucune modification
16
12
 
17
13
  ---
18
14
 
19
- ## STEP 1: Detect Active Worktrees
15
+ ## STEP 1: Détecter Worktrees Actifs
20
16
 
21
17
  ```bash
22
- # List all git worktrees
23
18
  WORKTREES=$(git worktree list --porcelain | grep "^worktree" | cut -d' ' -f2)
24
-
25
- echo "DETECTED WORKTREES"
26
- echo "=================="
27
- git worktree list
28
- echo ""
29
19
  ```
30
20
 
31
21
  ---
32
22
 
33
- ## STEP 2: Invoke MCP for Each Branch
34
-
35
- > **MCP INTEGRATION:** For each active branch, call the MCP to get structured analysis.
36
-
37
- For each worktree/branch, call:
38
-
39
- ```json
40
- {
41
- "tool": "mcp__smartstack__check_migrations",
42
- "parameters": {
43
- "branch": "<branch_name>",
44
- "compareBranch": "develop"
45
- }
46
- }
47
- ```
48
-
49
- **Claude instruction:** Loop through detected branches and invoke MCP:
23
+ ## STEP 2: Invoquer MCP pour Chaque Branche
50
24
 
51
25
  ```
52
26
  FOR each branch in [feature/*, hotfix/*, release/*]:
@@ -58,154 +32,42 @@ FOR each branch in [feature/*, hotfix/*, release/*]:
58
32
 
59
33
  ---
60
34
 
61
- ## STEP 3: Aggregate Results
62
-
63
- Parse MCP responses to build summary:
64
-
65
- ```typescript
66
- interface ScanSummary {
67
- branches: BranchScan[];
68
- totalMigrations: number;
69
- conflictCount: number;
70
- recommendedMergeOrder: string[];
71
- }
72
-
73
- interface BranchScan {
74
- name: string;
75
- migrationCount: number;
76
- riskLevel: 'NONE' | 'LOW' | 'MEDIUM' | 'HIGH';
77
- conflicts: MigrationConflict[];
78
- }
79
- ```
80
-
81
- **Risk Level Calculation:**
35
+ ## STEP 3: Calculer Niveau Risque
82
36
 
83
- | Condition | Risk Level |
84
- |-----------|------------|
85
- | Snapshot identical to develop | NONE |
86
- | Different tables modified | LOW |
87
- | FK to same tables | MEDIUM |
88
- | Same tables/columns modified | HIGH |
37
+ | Condition | Risque |
38
+ |-----------|--------|
39
+ | Snapshot = develop | NONE |
40
+ | Tables différentes | LOW |
41
+ | FK vers même table | MEDIUM |
42
+ | Même tables/colonnes | HIGH |
89
43
 
90
44
  ---
91
45
 
92
- ## STEP 4: Calculate Merge Order
93
-
94
- Based on conflict analysis, recommend merge order:
46
+ ## STEP 4: Recommander Ordre Merge
95
47
 
96
48
  ```
97
- 1. Branches with RISK=NONE (can merge immediately)
98
- 2. Branches with RISK=LOW (minor modifications, safe to merge)
99
- 3. Branches with RISK=MEDIUM (order matters, merge carefully)
100
- 4. Branches with RISK=HIGH (rebase required before merge)
49
+ 1. Branches RISK=NONE (merge immédiat)
50
+ 2. Branches RISK=LOW (modifications mineures)
51
+ 3. Branches RISK=MEDIUM (ordre important)
52
+ 4. Branches RISK=HIGH (rebase requis)
101
53
  ```
102
54
 
103
55
  ---
104
56
 
105
- ## STEP 5: Resume
106
-
107
- **Afficher le rapport de scan:**
57
+ ## Résumé
108
58
 
109
59
  ```
110
- ===============================================================================
111
- SCAN CROSS-BRANCH EF CORE
112
- ===============================================================================
113
-
114
- WORKTREES DÉTECTÉS ({count})
115
- -------------------------------------------------------------------------------
116
- main/ [main]
117
- develop/ [develop] ← RÉFÉRENCE
118
- features/user-auth/ [feature/user-auth]
119
- features/add-products/ [feature/add-products]
120
- hotfixes/login-fix/ [hotfix/login-fix]
121
-
122
- MIGRATIONS PAR BRANCHE
123
- -------------------------------------------------------------------------------
124
- Branche | Migrations | Snapshot | vs Develop
125
- -------------------------------------------------------------------------------
126
- develop | 12 | a1b2c3d4 | RÉFÉRENCE
127
- feature/user-auth | 13 | e5f6g7h8 | +1 migration
128
- feature/add-products | 13 | i9j0k1l2 | +1 migration
129
- hotfix/login-fix | 12 | a1b2c3d4 | identique
130
- -------------------------------------------------------------------------------
131
-
132
- ANALYSE DES RISQUES
133
- -------------------------------------------------------------------------------
134
- Branche | Risque | Raison
135
- -------------------------------------------------------------------------------
136
- hotfix/login-fix | AUCUN | Snapshot = develop
137
- feature/user-auth | FAIBLE | Tables différentes
138
- feature/add-products | MOYEN | FK vers même table
139
- -------------------------------------------------------------------------------
140
-
141
- ===============================================================================
142
- ORDRE DE MERGE RECOMMANDÉ
143
- ===============================================================================
144
-
145
- # | Branche | Risque | Action
146
- -------------------------------------------------------------------------------
147
- 1. | hotfix/login-fix | AUCUN | ✓ Merge direct OK
148
- 2. | feature/user-auth | FAIBLE | ✓ Merge OK
149
- 3. | feature/add-products | MOYEN | ⚠ Après user-auth, puis rebase
150
- -------------------------------------------------------------------------------
151
-
152
- ===============================================================================
153
- PROCHAINES ÉTAPES
154
- ===============================================================================
155
-
156
- 1. Pour merger une branche sans risque:
157
- /gitflow:9-merge {branch_name}
158
-
159
- 2. Pour rebaser avant un merge à risque:
160
- /efcore:rebase-snapshot
161
-
162
- 3. Pour analyser une branche spécifique:
163
- /efcore:conflicts --branch {branch_name}
164
-
165
- ===============================================================================
166
- ```
167
-
168
- **Si des conflits critiques sont détectés:**
169
-
170
- ```
171
- ===============================================================================
172
- SCAN CROSS-BRANCH - CONFLITS DÉTECTÉS
173
- ===============================================================================
174
-
175
- WORKTREES DÉTECTÉS ({count})
176
- -------------------------------------------------------------------------------
177
- {liste des worktrees}
178
-
179
- CONFLITS CRITIQUES
180
- -------------------------------------------------------------------------------
181
- ⛔ {count} branche(s) avec des conflits HIGH ou CRITICAL
182
-
183
- DÉTAILS
184
- -------------------------------------------------------------------------------
185
- {for each branch with HIGH risk}
186
- [{branch_name}]
187
- Risque: ÉLEVÉ
188
- Raison: {conflict_reason}
189
- Action: Rebase OBLIGATOIRE avant merge
190
- {end for}
191
-
192
- ===============================================================================
193
- ACTIONS REQUISES
194
- ===============================================================================
195
-
196
- ⛔ Des conflits critiques empêchent le merge de certaines branches.
197
-
198
- 1. Pour chaque branche à risque ÉLEVÉ:
199
- git checkout {branch}
200
- /efcore:rebase-snapshot
201
-
202
- 2. Recréer les migrations après rebase:
203
- /efcore:migration
204
-
205
- 3. Re-scanner pour vérifier:
206
- /efcore:scan
207
-
208
- ===============================================================================
60
+ SCAN CROSS-BRANCH
61
+ ├── Worktrees: {count}
62
+ ├── Branches avec migrations: {N}
63
+ ├── Conflits: {none/low/medium/high}
64
+
65
+ ├── ORDRE MERGE RECOMMANDÉ
66
+ │ 1. {branch} - AUCUN risque - ✓ Merge OK
67
+ │ 2. {branch} - FAIBLE risque - ✓ Merge OK
68
+ │ 3. {branch} - MOYEN risque - ⚠ Après #{2}, puis rebase
69
+
70
+ └── Prochains: /gitflow:9-merge, /efcore:rebase-snapshot, /efcore:conflicts
209
71
  ```
210
72
 
211
73
  ---
@@ -214,50 +76,19 @@ DÉTAILS
214
76
 
215
77
  | Option | Description |
216
78
  |--------|-------------|
217
- | `--json` | Output raw JSON for CI/CD |
218
- | `--branch <name>` | Scan specific branch only |
219
- | `--verbose` | Show detailed MCP responses |
220
- | `--no-recommend` | Skip merge order recommendations |
79
+ | `--json` | Output JSON pour CI/CD |
80
+ | `--branch <name>` | Scanner branche spécifique |
81
+ | `--verbose` | Détails MCP |
82
+ | `--no-recommend` | Sans recommandations |
221
83
 
222
84
  ---
223
85
 
224
86
  ## CI/CD Usage
225
87
 
226
88
  ```yaml
227
- # GitHub Actions
228
89
  - name: Scan EF Core migrations
229
90
  run: |
230
- # Claude Code will use MCP internally
231
91
  OUTPUT=$(claude-code "/efcore:scan --json")
232
92
  HIGH_RISK=$(echo $OUTPUT | jq '[.branches[] | select(.riskLevel == "HIGH")] | length')
233
- if [ "$HIGH_RISK" -gt 0 ]; then
234
- echo "::warning::$HIGH_RISK branches have HIGH risk migration conflicts"
235
- fi
93
+ [ "$HIGH_RISK" -gt 0 ] && echo "::warning::$HIGH_RISK branches HIGH risk"
236
94
  ```
237
-
238
- ---
239
-
240
- ## MCP Tool Reference
241
-
242
- **Tool:** `mcp__smartstack__check_migrations`
243
-
244
- **Description:** Analyze EF Core migrations for conflicts, ordering issues, and ModelSnapshot discrepancies between branches
245
-
246
- **Parameters:**
247
-
248
- | Parameter | Type | Description |
249
- |-----------|------|-------------|
250
- | `projectPath` | string | EF Core project path (default: auto-detect) |
251
- | `branch` | string | Git branch to check (default: current) |
252
- | `compareBranch` | string | Branch to compare against |
253
-
254
- **Response:** `MigrationCheckResult` with `hasConflicts`, `migrations[]`, `conflicts[]`, `suggestions[]`
255
-
256
- ---
257
-
258
- ## Why MCP Integration?
259
-
260
- 1. **Consistency:** Identical analysis logic for single branch (`/efcore:conflicts`) and multi-branch (`/efcore:scan`)
261
- 2. **Accuracy:** Structured parsing instead of regex on ModelSnapshot files
262
- 3. **Extensibility:** New conflict types added in MCP benefit all commands
263
- 4. **Caching:** MCP can cache results for faster subsequent scans