migration-safety-auditor

migration-safety-auditor is an agent for Claude Code from Hainrixz/claude-db. It costs 60 tokens per session (896 once invoked), scanned A, original, MIT.

A read-only checker for database changes called migrations, which update a database’s structure over time.

In plain words
What is it for?
It checks migration files for reversibility, locking, table rewrites, destructive operations, unsafe enum changes, and schema drift.
Why use it?
It helps detect changes that could lock tables, rewrite large amounts of data, delete information, or leave the declared schema out of sync.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the claude-db plugin — 36 skills, 6 agents, 1 hook shipped together

Good fit It checks migration files for reversibility, locking, table rewrites, destructive operations, unsafe enum changes, and schema drift.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/hainrixz/claude-db/migration-safety-auditor
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/Hainrixz/claude-db

Made for: Claude Code.

Or install claude-db, the plugin that ships this one along with the rest of its 36 skills, 6 agents, 1 hook.

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-auditor

README.md
[![agentmods](https://agentmods.dev/badge/agents/hainrixz/claude-db/migration-safety-auditor/github.svg)](https://agentmods.dev/agents/hainrixz/claude-db/migration-safety-auditor)
Your own site
<a href="https://agentmods.dev/agents/hainrixz/claude-db/migration-safety-auditor"><img src="https://agentmods.dev/badge/agents/hainrixz/claude-db/migration-safety-auditor/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-auditor

Your own site · 80×15
<a href="https://agentmods.dev/agents/hainrixz/claude-db/migration-safety-auditor"><img src="https://agentmods.dev/badge/agents/hainrixz/claude-db/migration-safety-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 896 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.00060 $0.00896
Opus 5 $0.00030 $0.00448
Sonnet 5 $0.00012 $0.00179
Haiku 4.5 $0.00006 $0.00090

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

Security

Grade A, and why

migration-safety-auditor 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 9d 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-safety-auditor.md · 58 lines

How it starts

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

migration-safety-auditor

You are a read-only database migration-safety specialist. During an audit you analyze the migration history and pending migrations for operational hazards and return their findings. You feed the Performance & Scale score.

Assigned modules

You own and must produce findings for ONLY this module:

  • M22 db-migration-safety (performance) — reversibility, lock level (e.g. ACCESS EXCLUSIVE), full-table rewrites, destructive ops (DROP/TRUNCATE), unsafe enum mutation, and schema drift between declared models and migration state. A destructive, irreversible migration is a sev5 capable of capping the Performance & Scale score.

Do not touch other modules — they belong to other agents.

How you work

Trigger the db-migration-safety project skill by task — it is a model-invocable skill in this same plugin; describe the task and let it load. The core verification tool is scripts/lint-migration.mjs: run it over the migration files to detect lock-heavy DDL, table rewrites, destructive statements, unsafe enum changes, and non-reversible operations, e.g. node scripts/lint-migration.mjs <migrations-dir>. It lints a directory natively — every *.sql in sorted order, each finding tagged with its originating file — so a multi-file migrations/ is fully covered in one pass; it always emits JSON (there is no --json flag). Combine its output with a static read of the migration source and the declared schema to detect drift. Tier-0 catches the structural hazards; when confirming actual lock behavior or rewrite cost needs a live database (Tier-1 --dry-run / EXPLAIN against $DATABASE_URL) and none is available, emit status: "needs_api" with confidence at most directional — never a silent pass.

Output contract

Return a single JSON array of findings, each conforming to schema/finding.schema.json with: id, module, title, status, severity, scope, evidence, expected, recommendation, fixable, verification, and expected_impact (axis/confidence/magnitude/rationale).

  • module is M22; set verification.method appropriately (e.g. migration_lint or dry_run_migration).
  • evidence.observed must quote the real migration statement verbatim, with secrets redacted; cite the offending file/line in location.
  • verification.reproduce must be a runnable command — typically the lint-migration.mjs invocation or a --dry-run against $DATABASE_URL, never a literal credential.
  • expected_impact.axis is performance; magnitude is banded and confidence is tagged — no naked percentages, no fabricated lock durations or row counts. Only established findings cap; speculative never caps. Emit findings ONLY within M22. You do NOT render the final report or compute scores.

Read the full file on GitHub · 58 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. 9d ago First seen · 58 lines · 60 tokens per session scan A a1c4144cb6a6

Subscribe to this mod's changes

migration-safety-auditor is an agent published in the GitHub repository Hainrixz/claude-db (19 stars, last pushed 2mo ago), licensed MIT. It adds 60 tokens to every session and 896 once invoked, about $0.0003 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-30.

Related

Other agents, from other repositories

db-sql-expert

Elite SQL expert specializing in advanced query patterns, execution plan optimization, and DBA-level database performance tuning across PostgreSQL, MySQL/MariaDB, SQL Server, and Oracle.

andisab/swe-marketplace · 41 tokens

MS-SQL Database Administrator

Work with Microsoft SQL Server databases using the MS SQL extension.

github/awesome-copilot · 18 tokens

lens

Turns raw data into actionable decisions — dashboards, metric definitions, SQL analytics, funnel and cohort analysis across BI platforms. Use when designing a dashboard, defining KPIs, or running funnel analysis. Trigger with "design a dashboard", "analyze our funnel".

jeremylongshore/tons-of-skills-marketplace · 53 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

django-migrations-specialist

Database specialist for Django, runs in the "database" extra phase after development. Finalizes model field types and Meta indexes/constraints, runs makemigrations, reviews generated SQL with sqlmigrate, runs migrate, verifies with migrate --check. Do NOT use for: application logic (django-architect), tests…

AratKruglik/claude-sdlc · 85 tokens

sql-expert

Usa este agente para cualquier tarea relacionada con base de datos en FacturaScripts: diseñar esquemas de tabla XML, optimizar consultas con DbQuery y Where, crear índices y constraints, escribir migraciones SQL, analizar rendimiento de queries, usar transacciones, trabajar con DataBaseWhere/DataBase/DbQuery, diseñar…

FacturaScripts/fs-claude-plugin · 102 tokens