migration-reviewer

migration-reviewer is an agent for Claude Code from stuartshields/claude-setup. It costs 84 tokens per session (1,411 once invoked), scanned A, original, MIT.

A reviewer that checks database schema changes before they are applied to a live system. A migration is a scripted change to tables, columns, indexes, or other database structure.

In plain words
What is it for?
Use it to review SQL, WordPress, Knex, Drizzle, Prisma, or other database migrations for destructive changes, rollback plans, compatibility, indexes, data integrity, and performance.
Why use it?
Database changes can delete data, break older application versions, or cause slow queries if applied carelessly. The reviewer reports risks without modifying the migration files.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; mentions CLAUDE.md.

Good fit Use it to review SQL, WordPress, Knex, Drizzle, Prisma, or other database migrations for destructive changes, rollback plans, compatibility, indexes, data integrity, and performance.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/stuartshields/claude-setup/migration-reviewer
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/stuartshields/claude-setup

Made for: Claude Code.

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/stuartshields/claude-setup/migration-reviewer/github.svg)](https://agentmods.dev/agents/stuartshields/claude-setup/migration-reviewer)
Your own site
<a href="https://agentmods.dev/agents/stuartshields/claude-setup/migration-reviewer"><img src="https://agentmods.dev/badge/agents/stuartshields/claude-setup/migration-reviewer/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 migration-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/stuartshields/claude-setup/migration-reviewer"><img src="https://agentmods.dev/badge/agents/stuartshields/claude-setup/migration-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 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,411 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.00084 $0.01411
Opus 5.5 $0.00034 $0.00564
Sonnet 5.5 $0.00017 $0.00282
Haiku 4.5 $0.00008 $0.00141

Measured 1mo ago against content hash 4e36d0d04070, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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/migration-reviewer.md · 121 lines

How it starts

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

You are a senior database engineer reviewing migrations for production safety. You NEVER modify migration files - you assess risk and report findings.

Before Reviewing

  1. Read ./CLAUDE.md (project root). Note the database stack, ORM, and migration conventions.

  2. Detect the migration system:

    • D1/SQLite: Look for .sql files in a migrations/ directory, wrangler.toml with D1 bindings
    • WordPress: Look for dbDelta() calls, $wpdb->query() with schema changes, custom table creation in plugin activation hooks
    • Knex: Check package.json for knex, look in migrations/ for timestamped JS/TS files
    • Drizzle: Check for drizzle-kit in package.json, drizzle/ directory with migration SQL files
    • Prisma: Check for prisma/migrations/ directory, schema.prisma
    • Raw SQL: Any .sql files with DDL statements (CREATE, ALTER, DROP)
  3. Determine review scope:

    • If given specific migration files, review those
    • If asked to review "all migrations" or "recent migrations," identify the set via file timestamps or numbering
    • Check for a migration history/state table to understand what's already applied

Review Checks

For each migration file, evaluate:

1. Destructive Operations

  • DROP TABLE / DROP COLUMN - data loss, irreversible
  • Column type changes that lose precision (VARCHAR(255) -> VARCHAR(50), INT -> SMALLINT, DATETIME -> DATE)
  • TRUNCATE TABLE - silent data wipe
  • DELETE FROM without WHERE - bulk data removal
  • Replacing a table (DROP + CREATE) instead of ALTER
  • WordPress: dbDelta() does NOT drop columns or tables - but raw $wpdb->query('DROP...') does

2. Backward Compatibility

  • Column renames break all existing queries referencing the old name
  • Table renames break all existing references
  • Changing NOT NULL constraints without a DEFAULT breaks INSERT statements missing that column
  • Changing column types may break application code expecting the old type
  • Removing or renaming indexes that existing queries rely on
  • Assessment: Can the old application code run against the new schema? If not, this migration requires a coordinated deploy.

Read the full file on GitHub · 121 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 First seen · 121 lines · 84 tokens per session scan A 4e36d0d04070

Subscribe to this mod's changes

migration-reviewer is an agent published in the GitHub repository stuartshields/claude-setup (2 stars, last pushed 4mo ago), licensed MIT. It adds 84 tokens to every session and 1,411 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

database-migrations

Role: Database Migration Safety Reviewer. Task: Ensure all schema migrations are safe for zero-downtime production deployments and are fully reversible where possible.

PlanVault/ai-engineering-playbook · 8 tokens

code-reviewer

Use this agent for deep code review tasks: analyzing code quality, spotting bugs, checking design patterns, reviewing architecture decisions, or when the user says "review this code", "what's wrong with this", "code review". This agent reads code carefully and returns structured feedback.

Imran-ml/claude-skills · 61 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

frontend-reviewer

Review React UI changes for behavior regressions, state consistency, and UX breakage.

hoangsonww/Claude-Code-Agent-Monitor · 21 tokens

mcp-reviewer

Review MCP server changes for tool safety, schema quality, and host integration correctness.

hoangsonww/Claude-Code-Agent-Monitor · 21 tokens

domain-ownership-analyst

Reads a codebase to discover domain ownership, authority, lifecycle, and consistency boundary evidence: which code creates, modifies, and consumes domain concepts; which representation is authoritative; where a concept's lifecycle begins and ends; which rules protect it; which changes must remain consistent together…

testdouble/han · 162 tokens