Help us improve
Share bugs, ideas, or general feedback.
From dotnet-claude-kit
Reviews pending EF Core model changes, generates descriptive migration, reviews SQL for safety risks, and applies with rollback readiness.
npx claudepluginhub codewithmukesh/dotnet-claude-kit --plugin dotnet-claude-kitHow this command is triggered — by the user, by Claude, or both
Slash command
/dotnet-claude-kit:migrateThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /migrate ## What Guided EF Core migration workflow that takes you from model change to applied migration safely. It reviews what changed in your entity model, creates a properly named migration, reviews the generated SQL for data loss and locking risks, and applies it with a documented rollback path. This command enforces the "one logical change per migration" principle and prevents the most common migration mistakes: blind application, data loss, and un-rollbackable batched changes. ## When - After modifying entity classes, DbContext configuration, or relationships - User says: "add...
/migrateAuto-detects ORM/migration tool and generates idiomatic database migrations with backward compatibility checks, rollback validation, lock estimates. Applies, rolls back, or shows status via flags.
/create-migrationGenerates up/down database migration files for schema changes using detected tool (Prisma, Django, Rails, etc.). Adds constraints, indexes, data logic; validates, saves to migrations dir, previews SQL.
/migrationGenerates timestamped up/down migration files for PostgreSQL, MySQL, SQLite, MongoDB using SQL or ORM, with run instructions and testing guidance.
/plan-migrationPlan safe schema migration with backward compatibility and rollback strategy.
/migratePlans and executes incremental framework or library migrations: audits dependencies, analyzes breaking changes, creates ordered plan, executes module-by-module, verifies with tests and performance checks.
/migrateAnalyzes legacy ETL (stored procedures, SSIS, Informatica) and produces modern dbt models, PySpark jobs, Airflow DAGs, migration mappings, and validation queries.
Share bugs, ideas, or general feedback.
Guided EF Core migration workflow that takes you from model change to applied migration safely. It reviews what changed in your entity model, creates a properly named migration, reviews the generated SQL for data loss and locking risks, and applies it with a documented rollback path.
This command enforces the "one logical change per migration" principle and prevents the most common migration mistakes: blind application, data loss, and un-rollbackable batched changes.
dotnet ef migrations list --project <InfraProject> --startup-project <ApiProject>
Check for:
Use MCP tools to understand what changed:
find_symbol(name: entity or DbSet name) -- locate the changed entity
get_type_hierarchy(typeName: entity) -- check inheritance changes
find_references(symbolName: changed property) -- assess downstream impact
Confirm the change is a single logical unit. If not, guide the user to split into multiple migrations.
Create with a descriptive name that explains the change, not the entity:
dotnet ef migrations add <DescriptiveName> --project <InfraProject> --startup-project <ApiProject>
Naming convention: Add|Remove|Rename|Modify + WhatChanged
AddOrderShippingAddressRenameCustomerEmailToContactEmailAddIndexOnOrderCreatedAtRemoveDeprecatedProductSkudotnet ef migrations script --idempotent --project <InfraProject> --startup-project <ApiProject>
Flag and report:
If data transformation is needed, guide the user through a multi-step migration (add nullable column, copy data, set non-nullable, drop old column).
dotnet ef database update --project <InfraProject> --startup-project <ApiProject>
dotnet build
dotnet test
Document the rollback command for this migration:
dotnet ef database update <PreviousMigrationName> --project <InfraProject> --startup-project <ApiProject>
| Type | Name | Purpose |
|---|---|---|
| Skill | migration-workflow | Safe migration patterns and rollback strategy |
| Skill | ef-core | Entity configuration and query patterns |
| Agent | ef-core-specialist | Database design and migration expertise |
find_symbol -- Locate entity types, DbContext, and configurationsget_type_hierarchy -- Understand entity inheritance for TPH/TPT/TPCfind_references -- Assess impact of schema changes on queriesget_diagnostics -- Catch EF Core warnings after migration generationUser: /migrate
Claude: Checking migration state...
Last applied: 20250710_AddOrderTable
Model changes detected: new ShippingAddress property on Order entity.
Creating migration: AddOrderShippingAddress
Reviewing generated SQL...
SQL Review:
- ALTER TABLE "Orders" ADD "ShippingStreet" text NULL
- ALTER TABLE "Orders" ADD "ShippingCity" text NULL
- ALTER TABLE "Orders" ADD "ShippingZip" text NULL
No data loss. No locking risk. Safe to apply.
Applying migration... Done.
Build: green. Tests: 34/34 passed.
Rollback command (if needed):
dotnet ef database update AddOrderTable --project src/Infrastructure --startup-project src/Api
/build-fix -- Fix build errors that may arise after migration changes