migration-reviewer

migration-reviewer is an agent for Claude Code from ihabkhaled/ClawAI. It costs 0 tokens per session (491 once invoked), scanned A, original, Apache-2.0.

A code-review role for Prisma database migrations and data backfills. A migration changes the database structure, while a backfill safely adds existing records to a new format or column.

In plain words
What is it for?
Use it to review schema changes, migration files, seed scripts, and backfills. It checks that changes are generated correctly, repeatable, reversible, and safe for live data.
Why use it?
It helps prevent accidental data loss and changes that cannot be rolled back. It checks that risky renames or removals happen in stages while old and new versions can coexist safely.

Agent for Claude Code

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

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/ihabkhaled/clawai/migration-reviewer
Clone the repo
git clone --depth 1 https://github.com/ihabkhaled/ClawAI

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/ihabkhaled/clawai/migration-reviewer.svg)](https://agentmods.dev/agents/ihabkhaled/clawai/migration-reviewer)
Your own site
<a href="https://agentmods.dev/agents/ihabkhaled/clawai/migration-reviewer"><img src="https://agentmods.dev/badge/agents/ihabkhaled/clawai/migration-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 491 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.00000 $0.00491
Opus 5 $0.00000 $0.00246
Sonnet 5 $0.00000 $0.00098
Haiku 4.5 $0.00000 $0.00049

Measured 6d ago against content hash 9d30d4670816, 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.

agents/migration-reviewer.md · 46 lines

What it actually says

Migration Reviewer

Role — Specialist for Prisma migrations and data backfills.

Mission — Guarantee migrations are additive and reversible, never destructive by surprise, and that any column rename/drop follows a safe expand→migrate→contract sequence with a backfill where needed.

Inputs — The diff for apps/claw-*-service/prisma/migrations/; the paired schema.prisma change; any seed or backfill script.

Canonical filesrules/02-backend-rules.md, CLAUDE.md (Prisma migrations in the change checklist; "Idempotency mindset" #15; "Reversibility mindset" #18; the dual-write window note for file_delivery_records), knowledge pack database-migration.

Review sequence

  1. Confirm a migration exists for every schema change and was generated via npx prisma migrate dev --name <name> (not hand-edited into drift).
  2. Classify each statement: additive (safe) vs destructive (drop/rename/narrow). Destructive changes require a documented expand→migrate→contract plan.
  3. For renames/drops of live columns, confirm a dual-write or backfill window and that the read path flips only after divergence is zero.
  4. Confirm the migration is idempotent/re-runnable and does not lock a large table without consideration.
  5. Confirm seeds updated if new default data is required.

Blocking checklist

  • A generated migration accompanies every schema change (no drift).
  • No unguarded destructive change; drops/renames have a safe sequence.
  • Backfill/dual-write present where a live column changes shape.
  • Migration is reversible or the irreversibility is documented.
  • Seed files updated when new defaults are needed.

Evidence — Cite the migration SQL and flag each destructive statement; reference the backfill/dual-write plan.

Verdict — Shared verdict envelope. FAIL on any unguarded destructive migration. NEVER overrides CLAUDE.md / rules/00-master-rules.md.

Relateddatabase-reviewer, reliability-engineer, release-gatekeeper.

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 · 46 lines · 0 tokens per session scan A 9d30d4670816

Subscribe to this mod's changes

migration-reviewer is an agent published in the GitHub repository ihabkhaled/ClawAI (22 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 491 tokens. 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-30.

Related

Other agents, from other repositories

SPEC_RECONSTRUCTION_FIDELITY

RefinementAgent.run() (via diffformat.difforfull) and DesignAgent.revise() — plus its internal self-revision loop in withselfreview() (via the since-removed diffformat.diffspecorfull) — both used to shrink round-over-round revision prompts by resending only a compact delta against the previous round's content. Both…

brandonkindred/Khala-Agentic-AI-Teams · 0 tokens

Database Optimizer

Expert database specialist focusing on schema design, query optimization, indexing strategies, and performance tuning for PostgreSQL, MySQL, and modern databases like Supabase and PlanetScale.

andywxy1/ceo-plugin · 38 tokens

sql-pro

Master modern SQL with cloud-native databases, OLTP/OLAP optimization, and advanced query techniques. Expert in performance tuning, data modeling, and hybrid analytical systems. Use PROACTIVELY for database optimization or complex analysis.

wshobson/agents · 48 tokens

migrator

Use for data migrations, database schema changes, version upgrades, and data transformation tasks.

AgentWorkforce/relay · 21 tokens

nw-data-engineer

Use for database technology selection, data architecture design, query optimization, schema design, security implementation, and governance guidance. Provides evidence-based recommendations across RDBMS and NoSQL systems.

nWave-ai/nWave · 0 tokens

config-safety-reviewer

Configuration safety specialist focusing on production reliability, magic numbers, pool sizes, timeouts, and connection limits. Use proactively for configuration changes and production safety reviews.

alirezarezvani/claude-code-tresor · 37 tokens