migrate:check

migrate:check is a command for coding agents from ruslan-korneev/claude-plugins. It costs 15 tokens per session (716 once invoked), scanned A, original, MIT.

A command for reviewing an Alembic database migration before it is applied. A migration is a controlled change to a database's tables, columns, indexes, or constraints.

In plain words
What is it for?
It helps inspect upgrade and downgrade steps, check enum reversals, plan data updates before making fields required, review dropped columns, and verify foreign keys, indexes, and constraints.
Why use it?
It catches risks such as data loss, unsafe required fields, missing cleanup for enum types, and incorrectly ordered foreign-key changes before they affect the database.

Command

Part of the fastapi plugin — 2 skills, 5 commands, 1 agent shipped together

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.

agentmods
npx agentmods add commands/ruslan-korneev/claude-plugins/migrate-check
Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Or install fastapi, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 1 agent.

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 migrate:check

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/migrate-check.svg)](https://agentmods.dev/commands/ruslan-korneev/claude-plugins/migrate-check)
Your own site
<a href="https://agentmods.dev/commands/ruslan-korneev/claude-plugins/migrate-check"><img src="https://agentmods.dev/badge/commands/ruslan-korneev/claude-plugins/migrate-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 716 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00015 $0.00716
Opus 5 $0.00008 $0.00358
Sonnet 5 $0.00003 $0.00143
Haiku 4.5 $0.00002 $0.00072

Measured 4d ago against content hash cf8173529b15, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migrate:check 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 4d 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.

plugins/fastapi/commands/migrate-check.md · 142 lines

How it starts

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

Command /migrate:check

Check migration for common problems before applying.

What we check

  1. Enum types — is there drop in downgrade
  2. Nullable changes — is there data migration
  3. Index/Constraint names — are names unique
  4. Foreign keys — correct order of operations
  5. Data loss — potential data loss

Instructions

Step 1: Find migration file

# Latest migration
alembic heads

# Specific revision
alembic show {{ revision }}

Step 2: Read migration

# Get file path
alembic show {{ revision }} | grep "Path"

Step 3: Check for problems

Enum without drop in downgrade
# Look for enum in upgrade
sa.Enum("value1", "value2", name="enum_name")

# Check downgrade
# Should be:
# sa.Enum(name="enum_name").drop(op.get_bind(), checkfirst=False)
Nullable False without data migration
# Dangerous:
op.alter_column("users", "name", nullable=False)

# Safe:
op.execute("UPDATE users SET name = 'default' WHERE name IS NULL")
op.alter_column("users", "name", nullable=False)
Drop column without backup
# Dangerous — data loss:
op.drop_column("users", "important_data")

# Recommendation: first deprecate, then delete
Foreign key order
# Correct — first FK, then table:
def downgrade():
    op.drop_constraint("fk_orders_user_id", "orders")
    op.drop_table("users")

# Incorrect — FK constraint error:
def downgrade():
    op.drop_table("users")  # FK still exists!

Step 4: Test upgrade/downgrade

# Full cycle
alembic upgrade head
alembic downgrade -1
alembic upgrade head

Checklist

  • All enum types are deleted in downgrade
  • Nullable changes have data migration
  • No hardcoded constraint names (use naming convention)
  • FK are deleted before tables in downgrade
  • Drop column — conscious decision
  • Test upgrade/downgrade passes

Response format

## Migration check: {{ revision }}

### Status: OK / Needs attention / Problems

### Found problems

#### Enum without drop in downgrade
- `status_type` is created, but not deleted
- **Fix:** add to downgrade:
  ```python
  sa.Enum(name="status_type").drop(op.get_bind(), checkfirst=False)
Nullable change without data migration
  • users.name changes to NOT NULL
  • Recommendation: add:
    op.execute("UPDATE users SET name = 'Unknown' WHERE name IS NULL")
    

Recommendations

  1. ...
  2. ...

Test

alembic upgrade head && alembic downgrade -1 && alembic upgrade head

Read the full file on GitHub · 142 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. 4d ago First seen · 142 lines · 15 tokens per session scan A cf8173529b15

Subscribe to this mod's changes

migrate:check is a command published in the GitHub repository ruslan-korneev/claude-plugins (4 stars, last pushed 6mo ago), licensed MIT. It adds 15 tokens to every session and 716 once invoked, about $0.0001 per session on Opus 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.