# EF Core — workflow de migrations EF Core — migration workflow

Le skill `/efcore` couvre le cycle de vie complet des migrations Entity Framework Core sur un projet généré SmartStack (dual context : `CoreDbContext` + `ExtensionsDbContext`) ou sur le Studio (single context, providers Sqlite / Postgres / SqlServer). The `/efcore` skill covers the full Entity Framework Core migration lifecycle on a generated SmartStack project (dual context: `CoreDbContext` + `ExtensionsDbContext`) or on the Studio (single context, Sqlite / Postgres / SqlServer providers).

## Routing des opérations Operation routing

Intention Intent | Agent | CLI
--- | --- | ---
Lister les migrations List migrations | `agents/list.md` | `cli/list`
État (pending / applied)Status (pending / applied) | `agents/status.md` | `cli/status`
Créer une migration Create a migration | `agents/create.md` | `cli/create`
Compresser avant merge Squash before merge | `agents/squash.md` | `cli/squash`
Rebase snapshot Rebase snapshot | `agents/rebase-snapshot.md` | `cli/rebase-snapshot`
Appliquer (dotnet ef database update)Apply (dotnet ef database update) | `agents/db-update.md` | —

## Convention de nommage Naming convention

Toutes les migrations suivent le pattern `{prefix}v{version}{seq3}{Description}`, calculé par `cli/lib/migration-name.ts` : All migrations follow the pattern `{prefix}v{version}{seq3}{Description}`, computed by `cli/lib/migration-name.ts`:

    Core_v5_0_0_001_AddInitialSchema
    Ext_v5_0_0_002_AddInvoiceTable

Token Token | Source Source
--- | ---
`prefix` | `Core` / `Ext` / `Sqlite` / `Postgres` / `SqlServer`
`version` | depuis `.csproj` (PackageVersion)from `.csproj` (PackageVersion)
`seq3` | numérotation séquentielle à 3 chiffres 3-digit sequential numbering
`Description` | PascalCase PascalCase

## Détection automatique Automatic detection

Le CLI détecte automatiquement la structure : The CLI auto-detects the structure:

- App générée : 2 contextes, 2 fichiers de migrations.Generated app: 2 contexts, 2 migration files.
- Studio : 1 contexte, 3 projets de migrations (un par provider).Studio: 1 context, 3 migration projects (one per provider).

Plus aucune dépendance MCP — `cli/lib/ef-runner.ts` appelle `dotnet ef` directement. No more MCP dependency — `cli/lib/ef-runner.ts` calls `dotnet ef` directly.

## Skills disponibles

## Available Skills

### infrastructure

`/efcore` infrastructure

EF Core migration workflow — create, squash, rebase-snapshot, apply, list, status. Applies the best practices of the global /efcore agents without MCP or external dependencies. Works against a single-assembly generated app (CoreDbContext + ExtensionsDbContext) or the multi-assembly Studio (StudioDbContext with Sqlite / Postgres / SqlServer migration projects).