Migration Safety Review (framework-agnostic)

Migration Safety Review (framework-agnostic) is a skill for Claude Code from s977043/river-review. It costs 89 tokens per session (1,550 once invoked), scanned A, original, MIT.

A framework-independent review guide for database and data migrations. A migration is a controlled change to database structure or existing data, such as adding, changing, or removing a column.

In plain words
What is it for?
Use it to review migrations written with Prisma, TypeORM, Rails, Django, Alembic, or raw SQL, including expand-and-contract rollouts.
Why use it?
It identifies data loss, long database locks, incomplete rollback steps, and changes that are unsafe to apply in stages.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the river-review plugin — 138 skills, 18 commands, 5 agents, 3 hooks shipped together

Good fit Use it to review migrations written with Prisma, TypeORM, Rails, Django, Alembic, or raw SQL, including expand-and-contract rollouts.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/s977043/river-review/migration-safety
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.

Any agent
npx skills add s977043/river-review --skill migration-safety
Clone the repo
git clone --depth 1 https://github.com/s977043/river-review

Made for: Claude Code.

Or install river-review, the plugin that ships this one along with the rest of its 138 skills, 18 commands, 5 agents, 3 hooks.

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 Safety Review (framework-agnostic)

README.md
[![agentmods](https://agentmods.dev/badge/skills/s977043/river-review/migration-safety/github.svg)](https://agentmods.dev/skills/s977043/river-review/migration-safety)
Your own site
<a href="https://agentmods.dev/skills/s977043/river-review/migration-safety"><img src="https://agentmods.dev/badge/skills/s977043/river-review/migration-safety/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 Safety Review (framework-agnostic)

Your own site · 80×15
<a href="https://agentmods.dev/skills/s977043/river-review/migration-safety"><img src="https://agentmods.dev/badge/skills/s977043/river-review/migration-safety.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,550 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.00089 $0.01550
Opus 5 $0.00044 $0.00775
Sonnet 5 $0.00018 $0.00310
Haiku 4.5 $0.00009 $0.00155

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

Security

Grade A, and why

Migration Safety Review (framework-agnostic) 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.

skills/upstream/migration-safety/SKILL.md · 93 lines

How it starts

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

Pattern declaration

Primary pattern: Reviewer Secondary patterns: Inversion Why: 移行の破壊的・ロック誘発・不可逆操作をチェックリスト型で検査するが、移行を含まない差分では実行を止めるゲートが必要。

Goal / 目的

  • ORM やフレームワークに依存せず、スキーマ/データ移行に共通する運用事故(データ損失・本番ロック・ロールバック不能・反復不能)を検出する。
  • 特定フレームワーク固有の深い規約(例: Laravel change() の修飾子消失)は専用 skill に委ね、本 skill は横断的な安全性に集中する。

Non-goals / 扱わないこと

  • データモデル設計の妥当性(正規化・関連設計)は data-model-db-design のスコープ。
  • フレームワーク固有の細則(Laravel 固有は laravel-migration-safety)。
  • アプリ側のクエリ効率(N+1 等)。

Pre-execution Gate / 実行前ゲート

このスキルは以下の条件がすべて満たされない限り NO_REVIEW を返す。

  • 差分にスキーマ/データ移行(migrations ディレクトリ・schema.prisma*.sqlALTER/CREATE/DROP を含む変更)が含まれている
  • diff コンテキストが利用可能である

ゲート不成立時の出力: NO_REVIEW: migration-safety — 移行の変更なし

False-positive guards / 抑制条件

  • 新規テーブル作成内の index/制約追加は既存行へのロックが無いため指摘しない。
  • 不可逆な down/rollback は、データ変換系移行で完全な逆操作が原理的に不可能なケースが正当(コメントで明示があれば許容)。
  • 破壊的操作が「別 PR で deprecate 済み/expand-contract の contract フェーズ」と明示されている場合は指摘しない。
  • 小規模テーブルが diff/文脈から確実な場合はロック懸念を断定しない(questions で確認)。

Rule / ルール

横断的に以下を確認する(該当するもののみ):

  1. 破壊的スキーマ変更: カラム/テーブル/制約の DROP、型の縮小変換(例: textvarchar(n))、リネームは、データ損失と後方互換を確認する。
  2. ロック誘発: 大規模テーブルへの index 追加・ALTER TABLENOT NULL 追加は本番でロック/長時間化し得る。PostgreSQL なら CREATE INDEX CONCURRENTLY、MySQL なら online DDL / pt-osc 等の非ロック手段を検討する。
  3. NOT NULL + default 無し: 既存行があるテーブルへ default 無しの NOT NULL カラム追加は失敗/全行書込みになる。default 付与または backfill 後に制約化(expand-contract)を推奨。
  4. backfill 安全性: 大量 UPDATE/INSERT はバッチ分割・タイムアウト・レプリケーション遅延を考慮する。1 トランザクションでの巨大更新を避ける。
  5. ロールバック可逆性: down/rollback が up の逆操作として整合し、データを失わず戻せるか。不可逆なら明示する。
  6. 段階適用(expand-contract): 破壊的変更はコードのデプロイと移行の順序(expand→migrate→contract)で無停止化できないか。

Evidence / 根拠の取り方

  • 指摘は <file>:<line> で差分に紐づけ、検出した操作(DROP / ALTER / NOT NULL / 大量 backfill 等)を引用する。
  • テーブル規模が diff から不明な場合は断定せず questions で確認する。
  • フレームワーク固有 API には触れず、移行操作の意味(ロック/損失/不可逆)で説明する。

Output / 出力(短文版の推奨)

コメントは日本語で返す。

(migration-safety):1: [要約] 最も危険な移行操作は〈1文〉

<file>:<line>: [移行リスク] <タイトル>
  操作: <DROP / ALTER / NOT NULL 追加 / 大量 backfill / 不可逆 down>
  影響: <データ損失 / 本番ロック / ロールバック不能 / 反復不能>
  Fix: <CONCURRENTLY / default 付与 + backfill / expand-contract / down 整合 の最小案>

Read the full file on GitHub · 93 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 93 lines · 89 tokens per session scan A 37b22848753e

Subscribe to this mod's changes

Migration Safety Review (framework-agnostic) is a skill published in the GitHub repository s977043/river-review (3 stars, last pushed yesterday), licensed MIT. It adds 89 tokens to every session and 1,550 once invoked, about $0.0004 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-09-03.

Related

Other skills, from other repositories

Database Migration Testing

Testing database migration scripts for correctness, rollback safety, data integrity, and zero-downtime migration patterns.

PramodDutta/qaskills · 25 tokens

database-migration-assistant

PostgreSQL migration assistant that plans, applies, and rolls back schema changes with drift detection for safe AI-agent execution.

XSpoonAi/spoon-awesome-skill · 30 tokens

migration-ready-schema

Data-model rules that make a schema importable from day one, so the migration-import-engineer is never blocked on missing columns. Every SMB Product-Builder product must let a customer bring their data from an incumbent (ServiceTitan/Toast/Mindbody/Shopify) — that requires provenance (sourceref) and rollback…

avelikiy/great_cto · 133 tokens

logic-health

Sweep a directory, module, or full codebase for logic correctness and produce a scored health dashboard with systemic patterns. Trigger when the user requests a health view — "audit the whole codebase", "health check", "health overview", "logic health overview", "audit src/", "audit auth and payments modules", "where…

hyhmrright/logic-lens · 180 tokens

ia-postgresql

PostgreSQL schema design, query optimization, indexing, and administration. Use when working with PostgreSQL, JSONB, partitioning, RLS, CTEs, window functions, or EXPLAIN ANALYZE.

iliaal/whetstone · 49 tokens

db-audit

Database performance and safety audit. 70+ checks across 13 dimensions (DB1-DB13): query patterns, indexes, schema design, connections, transactions, migrations, caching, query optimization, ORM anti-patterns, observability, data lifecycle, DB security, and migration deployment safety. Code-level checks for all ORMs.…

greglas75/zuvo · 115 tokens