/dotnet-agent-kit:migratefrom dotnet Agent Kit
Safe migration workflow for EF Core schema changes, .NET version upgrades, and NuGet package updates with rollback plans. Handles add/update migration, .NET upgrade, and package audit for CVEs/license traps.
Ships in dotnet Agent Kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The single migration workflow for three change types, with EF Core schema migrations as the primary flow:
/migrate packages) — outdated, vulnerable, and
commercial-licence audit, then incremental one-package-at-a-time updates so
breakage is always attributable.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 or audit → Flow C (/migrate packages). Then follow that flow end to end.
Step 1: Assess current state
dotnet ef migrations list --project <InfraProject> --startup-project <ApiProject>
Check for pending migrations and uncaptured model changes.
Step 2: Review model changes
Use MCP tools instead of reading whole files:
find_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
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.
# GOOD
dotnet ef migrations add AddOrderShippingAddress --project <Infra> --startup-project <Api>
# BAD — names the entity, not the change
dotnet ef migrations add Order
Step 4: Review generated SQL
database update has no dry-run flag — preview by generating an idempotent
script and reading it:
dotnet ef migrations script --idempotent --project <Infra> --startup-project <Api>
Flag and report:
If data must survive a rename/retype, use a multi-step migration with raw SQL:
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");
}
Step 5: Apply and verify
dotnet ef database update --project <Infra> --startup-project <Api>
dotnet build && dotnet test # integration tests catch schema mismatches
Step 6: Document rollback
dotnet ef database update <PreviousMigrationName> --project <Infra> --startup-project <Api>
dotnet ef migrations remove --project <Infra> --startup-project <Api> # if unapplying from code
Never modify a migration that is already applied — create a new one.
.NET 8 and .NET 9 reached end of support on 2026-11-10, so upgrade them to
.NET 10 (LTS, supported to 2028-11-14). Default target is net10.0; move to
net11.0 (STS, GA 2026-11-10) only for C# 15 unions or runtime async. For
10 to 11, read knowledge/breaking-changes.md and the official .NET 11
breaking-changes list first.
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.*
(only after the TFM is changed), then build and fix.knowledge/dotnet-whats-new.md: TimeProvider,
HybridCache, primary constructors, collection expressions.dotnet build, dotnet test, dotnet format --verify-no-changes./migrate packages)Read references/packages.md and follow it: inventory with get_nuget_packages,
check outdated and vulnerable, screen for commercial-licence traps, then report in
priority order (VULNERABLE, LICENSE, TFM-BLOCKED, MAJOR, MINOR/PATCH).
Two rules apply every time:
net10.0 project, Microsoft.*, System.*, and
EF Core packages stay on 10.x. dotnet add package with no version can now pull
11.0.0, which needs net11.0.Update one package at a time with dotnet build && dotnet test between each;
rollback is a git revert of the bump.
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 upgradesget_nuget_packages — package inventory for /migrate packagesUser: /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
ef-core — entity configuration, query patterns, migration internals/verify — full verification pipeline after migration work/wrap-up checkpoint — commit a safe state before risky migrationsknowledge/package-recommendations.md — vetted packages and licensing detailWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ef-core, dotnet-migration, nuget-audit, schema-migration, rollback
npx claudepluginhub codewithmukesh/dotnet-agent-kit --plugin dotnet-agent-kit37 skills in this plugin
/api-hardeningProduction hardening for ASP.NET Core 10 APIs: HSTS, forwarded headers behind a proxy (KnownIPNetworks), strict CORS, body and upload limits, security headers, no detailed errors. Use for "HSTS", "forwarded headers", "behind nginx", "CORS", "request size limit", "security headers", "harden for production". Do NOT use for auth (use authentication) or throttling (use rate-limiting).
/architecture-advisorArchitecture selection for new or restructured .NET solutions: asks about domain, team and compliance, then recommends modular slices (default), vertical slice, Clean Architecture or DDD. Use for "which architecture", "new solution", "restructure", "DDD", "project structure", "tech stack". Do NOT use for adding features to a modular-slices codebase (modular-slices), scaffolding (scaffold), or CLAUDE.md (dotnet-init).
/aspireAspire (17.x, requires .NET 10) orchestration: AppHost, service defaults, resource configuration, service discovery, dashboard. Use for "Aspire", "AppHost", "service defaults", "service discovery", "AddDotnetProject", "AddProject", "WithReference", "aspire run". Do NOT use for Dockerfiles or container images (use docker), CI/CD pipelines (use ci-cd), or OpenTelemetry SDK setup (use opentelemetry).
/authenticationAuthentication and authorization for ASP.NET Core: JWT bearer, OpenID Connect, ASP.NET Identity, policies, role and claim-based authorization, API keys, cookie auth. Use for "JWT", "OIDC", "Identity", "claims", "roles", "RequireAuthorization", "API key". Do NOT use for endpoint design (use minimal-api), security schemes in API docs (use openapi), secrets and options binding (use configuration), or which rows a user may see (use resource-authorization).
/build-fixAutonomous loop that drives a broken .NET build or failing tests to green, with bounded iterations and retry guards (build, parse, fix, rebuild; test-fix variant). Use for "fix the build", "make it compile", "fix failing tests", "keep going until it works", "auto-fix". Do NOT use for cleanup of code that already builds (use de-sloppify), writing new tests (use testing or tdd), or a pre-PR check (use verify).
/cachingCaching for .NET 10: HybridCache (the default), output caching, response caching, distributed cache. Use for "cache", "HybridCache", "Redis", "output cache", "IMemoryCache", "cache invalidation", "stampede protection". Do NOT use for EF Core query tuning or N+1 (use ef-core), retry and timeout policies (use resilience), or Redis as a message broker (use messaging).
Other plugins' skills for the same job