migration-audit

migration-audit is a skill for Claude Code from marcoguillermaz/Tierward. It costs 0 tokens per session (3,713 once invoked), scanned A, original, MIT.

A static safety check for database migration files, which are scripts that change a database's structure or data. It focuses on PostgreSQL and supports Prisma, Drizzle, Supabase CLI, and raw SQL.

In plain words
What is it for?
Use it to review one migration, a range of migrations, or the whole migration folder for destructive operations, unsafe column changes, missing defaults, and constraint-order problems.
Why use it?
It helps find changes that could lose data, lock a database, fail because of required values, or be difficult to undo before they are applied.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; mentions CLAUDE.md.

Part of the tierward plugin — 29 skills, 1 command, 1 hook, 1 MCP server shipped together

Good fit Use it to review one migration, a range of migrations, or the whole migration folder for destructive operations, unsafe column changes, missing defaults, and constraint-order problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/marcoguillermaz/tierward/migration-audit
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 marcoguillermaz/Tierward --skill migration-audit
Clone the repo
git clone --depth 1 https://github.com/marcoguillermaz/Tierward

Made for: Claude Code.

Or install tierward, the plugin that ships this one along with the rest of its 29 skills, 1 command, 1 hook, 1 MCP server.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/marcoguillermaz/tierward/migration-audit/github.svg)](https://agentmods.dev/skills/marcoguillermaz/tierward/migration-audit)
Your own site
<a href="https://agentmods.dev/skills/marcoguillermaz/tierward/migration-audit"><img src="https://agentmods.dev/badge/skills/marcoguillermaz/tierward/migration-audit/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-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcoguillermaz/tierward/migration-audit"><img src="https://agentmods.dev/badge/skills/marcoguillermaz/tierward/migration-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,713 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.00000 $0.03713
Opus 5.5 $0.00000 $0.01485
Sonnet 5.5 $0.00000 $0.00743
Haiku 4.5 $0.00000 $0.00371

Measured 18d ago against content hash a1437cb8979c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

migration-audit 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 18d 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.

packages/cli/templates/tier-l/.claude/skills/migration-audit/SKILL.md · 261 lines

How it starts

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

Configuration (adapt before first run)

Replace these placeholders:

  • [MIGRATIONS_PATH] - e.g. prisma/migrations/, drizzle/, supabase/migrations/, db/migrations/
  • [APP_SOURCE_PATH] - path to application source for column-reference cross-checks (e.g. src/, app/)
  • [STAGING_DB_URL] - optional, for Step 4 applied-migration verification

Database scope: checks target PostgreSQL DDL patterns. MySQL and SQLite migrations may trigger false negatives on lock-heavy DDL checks (M1, M6) that use PostgreSQL-specific syntax.


Step 0 - Target resolution

Parse $ARGUMENTS for a target: or mode: token.

Pattern Meaning
target:file:<filename> Audit a single migration file (for debugging before apply)
target:range:<from>-<to> Audit a numeric range of migrations (e.g. target:range:042-051)
mode:all / no argument Full audit - every migration file discovered in Step 2.

STRICT PARSING: derive target ONLY from explicit text in $ARGUMENTS. Do NOT infer from conversation context, recent blocks, or memory.

Announce: Running migration-audit - scope: [FULL | target: <resolved>] - stack: <pending detection>


Step 1 - Stack detection

Detect the migration framework in this priority order. First matching marker wins.

Framework Marker file(s) Path pattern for migrations
Prisma prisma/schema.prisma prisma/migrations/*/migration.sql
Drizzle drizzle.config.ts / drizzle.config.js drizzle/*.sql (journal at drizzle/meta/_journal.json)
Supabase CLI supabase/config.toml supabase/migrations/*.sql
Raw SQL .sql files in migrations/ or db/migrations/ same
Rails config/application.rb + Gemfile db/migrate/*.rb
Django manage.py + any */migrations/*.py */migrations/*.py
Alembic alembic.ini alembic/versions/*.py
Flyway flyway.conf or flyway.toml **/db/migration/V*__*.sql
golang-migrate go.mod + migrations/*.up.sql (numeric prefix NNNNNN_name.up.sql) migrations/
goose go.mod + migrations/ with -- +goose Up comment in .sql, OR .go migration files migrations/
atlas atlas.hcl or atlas.sum migrations/

Read the full file on GitHub · 261 lines

Files

What ships with it

1 file 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. 18d ago Changed · +1 lines a1437cb8979c
  2. 2mo ago First seen · 260 lines · 0 tokens per session scan A 0e2a309120f1

Subscribe to this mod's changes

migration-audit is a skill published in the GitHub repository marcoguillermaz/Tierward (4 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,713 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-31.

Related

Other skills, from other repositories

managing-supabase

Supabase CLI for database management, Edge Functions, migrations, and local development. Use for managing Postgres databases, deploying serverless functions, and debugging Supabase projects.

FortiumPartners/ensemble · 40 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens

neon

Use when you have picked Neon (serverless Postgres) and need to connect correctly from a serverless or edge runtime, wire database branching into dev, preview and CI, or stop being burned by scale-to-zero cold starts and pooler limits — including choosing HTTP versus WebSocket connections and pooled versus direct…

ericrisco/rsc-harness · 93 tokens

mesh-memory

Self-hosted semantic memory for AI agents via MCP. Save worklogs, decisions, and notes, then recall them across sessions by meaning, not keyword. Postgres + pgvector with auto-tagging.

skillmds/skillmd · 44 tokens

diesel-guard

Lints Diesel and SQLx Postgres migrations for unsafe schema changes that lock tables or cause downtime, and authors custom Rhai checks. Use when reviewing, writing, or fixing SQL migrations, when diesel-guard reports a violation, when configuring diesel-guard.toml, or when the user mentions migration safety, table…

ayarotsky/diesel-guard · 77 tokens

database

Query and manage SQLite, PostgreSQL, and MySQL databases from the command line. Use when the user asks to run SQL queries, inspect database schemas, create or alter tables, import or export data, manage indexes, analyze query performance with EXPLAIN, back up or restore databases, or perform CRUD operations via…

bug-ops/zeph · 76 tokens