npx skills add ...
npx skills add codewithmukesh/dotnet-claude-kit --skill migrate
Guided, safe migration workflow covering EF Core schema migrations, .NET version upgrades, and NuGet dependency updates — each with rollback strategies and verification steps. Invoke when: "add migration", "update database", "create migration", "schema change", "new table", "rename column", "upgrade nuget", "update packages", "dependency update", "version upgrade", ".NET upgrade".
npx skills add codewithmukesh/dotnet-claude-kit --skill migrate
The single migration workflow for three change types, with EF Core schema migrations as the primary flow:
Shared principles: verify before applying, rollback plan always, test after every step, one logical change per migration.
First, classify the request: schema change → Flow A; framework upgrade → Flow B; package update → Flow C. Then follow that flow end to end.
Step 1: Assess current state
Check for pending migrations and uncaptured model changes.
Step 2: Review model changes
Use MCP tools instead of reading whole files:
Confirm the change is one logical unit. If not, split into multiple migrations — mixed migrations make rollback all-or-nothing.
Step 3: Generate migration
Name describes the change, not the entity: Add|Remove|Rename|Modify + WhatChanged.
Step 4: Review generated SQL
database update has no dry-run flag — preview by generating an idempotent
script and reading it:
Flag and report:
If data must survive a rename/retype, use a multi-step migration with raw SQL:
Step 5: Apply and verify
Step 6: Document rollback
Never modify a migration that is already applied — create a new one.
get_project_graph to list all TFMs; flag mixed versions.global.json — SDK version with "rollForward": "latestMinor".<TargetFramework>net10.0</TargetFramework> and
<LangVersion>14</LangVersion> in .csproj or Directory.Build.props.dotnet outdated --upgrade Major --include Microsoft.*,
then build and fix.knowledge/dotnet-whats-new.md: TimeProvider,
HybridCache, primary constructors, collection expressions.dotnet build, dotnet test, dotnet format --verify-no-changes.dotnet list package --outdated and dotnet list package --vulnerable.
Vulnerable packages are urgent: update, test, deploy.dotnet build && dotnet test
before the next. Batched updates make failures unattributable.knowledge/package-recommendations.md before adding
new packages; prefer built-in .NET alternatives. Moving off MediatR
(commercial license from v13)? Follow the step-by-step guide in
knowledge/mediatr-to-mediator-migration.md.find_symbol / find_references — locate entities, assess schema-change impactget_type_hierarchy — entity inheritance for TPH/TPT/TPCget_project_graph — TFM audit before version upgradesget_diagnostics — catch warnings after migration generation or upgradesef-core — entity configuration, query patterns, migration internals/verify — full verification pipeline after migration work/checkpoint — commit a safe state before risky migrationsfind_symbol(name: entity or DbSet) -- locate the changed entity
get_type_hierarchy(typeName: entity) -- check TPH/TPT/TPC inheritance changes
find_references(symbolName: property) -- assess downstream query impact# GOOD
dotnet ef migrations add AddOrderShippingAddress --project <Infra> --startup-project <Api>
# BAD — names the entity, not the change
dotnet ef migrations add Orderdotnet ef migrations script --idempotent --project <Infra> --startup-project <Api>protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>("ContactEmail", "Customers", nullable: true);
migrationBuilder.Sql("UPDATE \"Customers\" SET \"ContactEmail\" = \"Email\"");
migrationBuilder.AlterColumn<string>("ContactEmail", "Customers", nullable: false);
migrationBuilder.DropColumn("Email", "Customers");
}dotnet ef database update --project <Infra> --startup-project <Api>
dotnet build && dotnet test # integration tests catch schema mismatchesdotnet ef database update <PreviousMigrationName> --project <Infra> --startup-project <Api>
dotnet ef migrations remove --project <Infra> --startup-project <Api> # if unapplying from codeUser: /migrate
Claude: Checking migration state...
Last applied: 20250710_AddOrderTable
Model changes detected: new ShippingAddress property on Order entity.
Creating migration: AddOrderShippingAddress
Reviewing SQL (dotnet ef migrations script --idempotent)...
- ALTER TABLE "Orders" ADD "ShippingStreet" text NULL
- ALTER TABLE "Orders" ADD "ShippingCity" text NULL
No data loss. No locking risk. Safe to apply.
Applying migration... Done. Build: green. Tests: 34/34 passed.
Rollback (if needed):
dotnet ef database update AddOrderTable --project src/Infrastructure --startup-project src/Api