migration-audit

migration-audit is a skill for Claude Code from marcoguillermaz/Tierward. It costs 0 tokens per session (3,709 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,709 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.03709
Opus 5 $0.00000 $0.01854
Sonnet 5 $0.00000 $0.00742
Haiku 4.5 $0.00000 $0.00371

Measured 10d ago against content hash 0e2a309120f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 10d 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 · 260 lines

How it starts

The opening of the file, as written. The whole thing — 260 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 · 260 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. 10d 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,709 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

databases

Work with PostgreSQL, MongoDB, and Redis for schema design, query optimization, migrations, and data modeling. Use when designing or optimizing data layers.

ihatesea69/kiro-kit · 34 tokens

sqlike

Check SQL with sqlike — deterministic static analysis (validity, anti-patterns, rewrites, index advice) and query-equivalence verification. Use whenever you write, edit, review, or rewrite a SQL query, or need to prove two queries return the same results. Requires the sqlike MCP server (@sqlike/mcp) or the sqlike CLI…

orifisher2/sqlike · 81 tokens

israeli-postgres-toolkit

Best practices for PostgreSQL in Israeli apps, covering Supabase patterns, Hebrew text indexing with ICU collation, shekel/NIS currency handling, Israeli date formats, and Asia/Jerusalem timezone gotchas. Use when user asks to "set up Hebrew full-text search", "handle NIS currency in Postgres", "tipul b'ivrit…

squadcodercom/squadcoder · 199 tokens

postgresql

You are working with a PostgreSQL database. Apply these best practices.

andresquirogadev/skillsense · 0 tokens

supabase-postgres-best-practices

Use when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations — including indexing, connection pooling, RLS policies, and locking. Postgres performance best practices from Supabase.

patrickserrano/lacquer · 50 tokens