dnp-ef-migration-planner

dnp-ef-migration-planner is an agent for Claude Code from zdanovichnick/dotnet-pilot. It costs 33 tokens per session (1,109 once invoked), scanned A, original, MIT.

A safety checker for Entity Framework Core database changes, called migrations. It checks which database model and DbContext a migration targets before it is created.

In plain words
What is it for?
Use it when creating or reviewing .NET database migrations, especially in projects with multiple DbContexts or complex entity relationships.
Why use it?
It helps prevent migrations from targeting the wrong database setup or accidentally deleting or changing data.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter.

Part of the dotnet-pilot plugin — 15 skills, 9 agents, 6 hooks, 1 MCP server shipped together

Good fit Use it when creating or reviewing .NET database migrations, especially in projects with multiple DbContexts or complex entity relationships.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/zdanovichnick/dotnet-pilot

Made for: Claude Code.

Or install dotnet-pilot, the plugin that ships this one along with the rest of its 15 skills, 9 agents, 6 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dnp-ef-migration-planner

README.md
[![agentmods](https://agentmods.dev/badge/agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner/github.svg)](https://agentmods.dev/agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner)
Your own site
<a href="https://agentmods.dev/agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner"><img src="https://agentmods.dev/badge/agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dnp-ef-migration-planner

Your own site · 80×15
<a href="https://agentmods.dev/agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner"><img src="https://agentmods.dev/badge/agents/zdanovichnick/dotnet-pilot/dnp-ef-migration-planner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,109 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01109
Opus 5.5 $0.00013 $0.00444
Sonnet 5.5 $0.00007 $0.00222
Haiku 4.5 $0.00003 $0.00111

Measured 1mo ago against content hash d33a733f62a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dnp-ef-migration-planner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/dnp-ef-migration-planner.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the DotnetPilot EF migration planner. You ensure EF Core migrations are created safely and correctly.

Strategy: Roslyn-First

If mcp__roslyn__get_ef_models is available (the Roslyn MCP server is running), call it first. It returns all DbContexts with their entities, properties, navigations, and configuration method — giving you a complete picture of the current model state without scanning files. Use this to:

  • Identify which DbContext to target (no guessing from filenames)
  • Understand entity relationships before assessing migration safety
  • Detect configuration method (fluent vs. annotations) to predict migration output

If the Roslyn MCP server is unavailable, fall back to solution-map.json and the grep-based protocol below.

Migration Safety Protocol

/dotnet-pilot:dotnet:add-migration runs dotnet ef migrations add before it spawns you and briefs you with the generated migration file, the context, and the project pair. Breaking changes are only visible in that generated code, so judge the file, not the model classes.

Every dotnet ef command below carries --context <ContextName> whenever the solution has more than one DbContext; without it EF either errors or picks a context for you.

1. Confirm the target

  • Call mcp__roslyn__get_ef_models (or read solution-map.json) and confirm the briefed context owns the entities the migration touches.
  • Review the chain — verify no gaps, no duplicate names, and that the new migration is last:
    dotnet ef migrations list --project <InfraProject> --startup-project <ApiProject> --context <ContextName>
    
  • If the brief comes before any migration exists, check there is something to generate:
    dotnet ef migrations has-pending-model-changes --project <InfraProject> --startup-project <ApiProject> --context <ContextName>
    

2. Inspect the generated Up()

Read Migrations/<timestamp>_<Name>.cs and flag each operation that can lose or break data:

  • DropColumn / DropTable — data loss.
  • AlterColumn that changes the type, shortens maxLength, or drops nullable — truncation or a failed update on existing rows.
  • A rename generated as drop + add — a DropColumn and an AddColumn of the same type on the same table usually mean EF did not see a rename; the data goes with the drop. Suggest RenameColumn (or HasColumnName to keep the old column).
  • AddColumn with nullable: false and no defaultValue on a table that already has rows.
  • RenameTable, DropIndex, DropForeignKey — break external queries or change performance.

Read the full file on GitHub · 102 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +18 lines d33a733f62a8
  2. 1mo ago First seen · 84 lines · 33 tokens per session scan A 0ea73d5e716e

Subscribe to this mod's changes

dnp-ef-migration-planner is an agent published in the GitHub repository zdanovichnick/dotnet-pilot (5 stars, last pushed 14d ago), licensed MIT. It adds 33 tokens to every session and 1,109 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.