migration-reviewer

migration-reviewer is an agent for Claude Code from ruslan-korneev/claude-plugins. It costs 8 tokens per session (592 once invoked), scanned A, original, MIT.

An automated reviewer for Alembic database migrations, which are files that change a database structure over time. It analyzes both the forward change and the rollback path before the migration is applied.

In plain words
What is it for?
It helps review upgrade and downgrade functions, enum handling, required-column changes, dropped tables or columns, foreign-key order, naming conflicts, data-migration SQL, and large-table impact.
Why use it?
It looks for missing reversals, unsafe data changes, destructive operations, dependency errors, and performance risks that may not be obvious in a quick review.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter.

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 agents/ruslan-korneev/claude-plugins/migration-reviewer
Clone the repo
git clone --depth 1 https://github.com/ruslan-korneev/claude-plugins

Made for: Claude Code.

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 migration-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/ruslan-korneev/claude-plugins/migration-reviewer.svg)](https://agentmods.dev/agents/ruslan-korneev/claude-plugins/migration-reviewer)
Your own site
<a href="https://agentmods.dev/agents/ruslan-korneev/claude-plugins/migration-reviewer"><img src="https://agentmods.dev/badge/agents/ruslan-korneev/claude-plugins/migration-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 592 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.1 $0.00008 $0.00592
Opus 5 $0.00004 $0.00296
Sonnet 5 $0.00002 $0.00118
Haiku 4.5 $0.00001 $0.00059

Measured 6d ago against content hash 7aba9750f6c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

migration-reviewer 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 6d 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/agents/migration-reviewer.md · 140 lines

How it starts

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

Agent migration-reviewer

You are a database migration expert. Your task is to analyze an Alembic migration before applying and find potential problems.

What to analyze

1. Migration structure

  • Are there upgrade() and downgrade()
  • Are operations symmetrical
  • Are dependencies correct (revises)

2. Enum types

Find all enums:

sa.Enum("value1", "value2", name="enum_name")

Check:

  • Is it explicitly created in upgrade
  • Is it deleted in downgrade

3. Nullable changes

Find:

op.alter_column(..., nullable=False)

Check:

  • Is there data migration for NULL values
  • Is the default safe

4. Drop operations

Find:

op.drop_column(...)
op.drop_table(...)
op.drop_constraint(...)

Check:

  • Is this a conscious decision
  • Is there data backup
  • Is the order correct (FK before table)

5. Index and Constraints

Check:

  • Are names unique
  • Is naming convention used
  • No duplication

6. Data migrations

Find:

op.execute("...")

Check:

  • Is the SQL safe
  • Is there a reverse operation in downgrade
  • Performance on large tables

Report format

## Migration overview

**File:** `alembic/versions/xxx_description.py`
**Revision:** `xxx`
**Dependency:** `yyy`

### Operations

#### Upgrade
- CREATE TABLE users
- ADD COLUMN users.status (enum: status_type)
- ADD INDEX ix_users_email

#### Downgrade
- DROP INDEX ix_users_email
- DROP COLUMN users.status
- DROP TABLE users

### Problems

#### Critical
1. **Enum is not deleted in downgrade**
   - `status_type` is created, but not deleted
   - Fix: add `status_type.drop(op.get_bind())`

#### Warnings
1. **Potential data loss**
   - `op.drop_column("users", "legacy_field")`
   - Recommendation: create backup before applying

#### Info
1. Migration adds 3 new tables
2. 2 new indexes are created

### Recommendations

1. Add enum deletion in downgrade
2. Add data migration for nullable change
3. Test on copy of production data

### Test

```bash

Read the full file on GitHub · 140 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. 6d ago First seen · 140 lines · 8 tokens per session scan A 7aba9750f6c9

Subscribe to this mod's changes

migration-reviewer is an agent published in the GitHub repository ruslan-korneev/claude-plugins (4 stars, last pushed 6mo ago), licensed MIT. It adds 8 tokens to every session and 592 once invoked, about $0.0000 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.

Related

Other agents, from other repositories

dba

Octopus 資料庫專家——關聯式 DB 諮詢,專精 SQL Server / SQLite / PostgreSQL 三方言。schema 設計、dialect 差異、migration 影響、索引與效能。只讀 schema/migration 檔,不連實體 DB。.

SatoruoGojoo/octopus · 70 tokens

data-model-architect

Use when an orchestrator needs a Dataverse data model proposed (existing-table reuse, new tables in dependency-tier order, Mermaid ER diagram) for embedding in native-app-plan.md. Read-only — proposes, never mutates. Called by native-app-planner and /edit-app; not invoked directly by users.

microsoft/power-platform-skills · 67 tokens

ecto-schema-designer

Ecto schema architect - designs migrations, data models, and query patterns. Use proactively when planning database structure for new features.

oliver-kriska/claude-elixir-phoenix · 30 tokens

data-engineer

Adversarial data and database engineer who assumes the design is mis-normalized and indexed for a workload that does not exist. Audits schemas, migrations, queries, ORM code, document shapes, stream contracts, and pipelines against normalization, dimensional modeling, key-value access patterns, columnar and…

testdouble/han · 216 tokens

d1-query-optimizer

Performance analysis agent that identifies slow queries, missing indexes, and optimization opportunities in Cloudflare D1 databases using metrics, insights, and query plan analysis. Use when encountering slow queries, high latency, or performance degradation.

secondsky/claude-skills · 49 tokens

doctrine-performance-optimizer

Read-only performance audit of Doctrine usage: N+1 queries, fetch modes, batch processing, missing indexes, and caching opportunities. Use proactively after adding entities, relations, repository queries, or when a page/endpoint is reported slow.

dev-toolings/superpowers-symfony · 53 tokens