database-migrations

database-migrations is a skill for Claude Code from shennawardana23/skillme. It costs 84 tokens per session (1,041 once invoked), scanned C, original, Apache-2.0.

A process for changing a PostgreSQL database's tables, columns, indexes, or data through versioned migration files. PostgreSQL is a database system used to store application data.

In plain words
What is it for?
Use it to plan reversible schema changes, separate data backfills from structure changes, build indexes without blocking writes, and review migrations before production.
Why use it?
Unsafe changes can lock tables, lose data, or cause downtime, especially when production tables are much larger than development copies.

Skill for Claude Code

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

Part of the skillme plugin — 137 skills, 2 commands shipped together

Good fit Use it to plan reversible schema changes, separate data backfills from structure changes, build indexes without blocking writes, and review migrations before production.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shennawardana23/skillme/database-migrations
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 shennawardana23/skillme --skill database-migrations
Clone the repo
git clone --depth 1 https://github.com/shennawardana23/skillme

Made for: Claude Code.

Or install skillme, the plugin that ships this one along with the rest of its 137 skills, 2 commands.

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 database-migrations

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/shennawardana23/skillme/database-migrations"><img src="https://agentmods.dev/badge/skills/shennawardana23/skillme/database-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,041 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00084 $0.01041
Opus 5 $0.00042 $0.00521
Sonnet 5 $0.00017 $0.00208
Haiku 4.5 $0.00008 $0.00104

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

Security

Grade C, and why

database-migrations scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

replication lag, ran `rm -rf` against what they believed was the secondary
skills/database-migrations/SKILL.md · 96 lines

How it starts

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

Database Migrations

Every schema change is a migration file, never a manual psql session against production. Migrations are forward-only once deployed — a mistake is fixed with a new migration, not by editing or deleting the one that ran.

Core rules

  1. Schema changes (DDL) and data backfills (DML) are separate migrations — mixing them makes a migration slow, lock-prone, and hard to roll back independently.
  2. NOT NULL on a new column requires a default, or a nullable column followed by a backfill and a later constraint migration — adding NOT NULL with no default to an existing table locks it for a full rewrite.
  3. Indexes on existing tables use CREATE INDEX CONCURRENTLY — a plain CREATE INDEX blocks writes for the duration of the build.
  4. Test migrations against a production-sized copy, not a 100-row dev database — lock duration and rewrite cost scale with table size, and a migration that's instant at 100 rows can lock for minutes at 10M.

Zero-downtime pattern (expand → migrate → contract)

EXPAND:   add new column/table (nullable or defaulted); app writes to BOTH old and new
MIGRATE:  backfill; app reads from NEW, still writes to BOTH; verify consistency
CONTRACT: app uses NEW only; drop the OLD column/table in a separate, later migration

Renaming a column in production always goes through this pattern — never a direct ALTER TABLE ... RENAME COLUMN on a table any running application code still references by the old name.

Go (golang-migrate) — this org's default

migrate create -ext sql -dir migrations -seq add_reservation_notes
migrate -path migrations -database "$DATABASE_URL" up
migrate -path migrations -database "$DATABASE_URL" down 1
-- 000004_add_reservation_notes.up.sql
ALTER TABLE reservations ADD COLUMN notes TEXT;
CREATE INDEX CONCURRENTLY idx_reservations_notes ON reservations (notes) WHERE notes IS NOT NULL;

-- 000004_add_reservation_notes.down.sql
DROP INDEX IF EXISTS idx_reservations_notes;
ALTER TABLE reservations DROP COLUMN IF EXISTS notes;

Read the full file on GitHub · 96 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 · 96 lines · 84 tokens per session scan C 0a6724c6b622

Subscribe to this mod's changes

database-migrations is a skill published in the GitHub repository shennawardana23/skillme (2 stars, last pushed 12d ago), licensed Apache-2.0. It adds 84 tokens to every session and 1,041 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

postgresql-development-cloudbase

Use when building, debugging, or evaluating CloudBase PostgreSQL / CloudBase PG / PG mode apps, including Postgres schema setup, queryPgDatabase/managePgDatabase, JS SDK v3 app.rdb() CRUD/RPC, PG HTTP API fallback, RLS-style permissions, username-password auth, and Web CMS/admin CRUD flows backed by CloudBase PG.

sutchan/Agent-Skills-Hub · 77 tokens

database-architecture

MANDATORY when designing schemas, writing migrations, creating indexes, or making architectural database decisions - enforces PostgreSQL 18 best practices including AIO, UUIDv7, temporal constraints, and modern indexing strategies.

troykelly/claude-skills · 45 tokens

postgis

MANDATORY when working with geographic data, spatial queries, geometry operations, or location-based features - enforces PostGIS 3.6.1 best practices including STCoverageClean, SFCGAL 3D functions, and bigint topology.

troykelly/claude-skills · 52 tokens

timescaledb

MANDATORY when working with time-series data, hypertables, continuous aggregates, or compression - enforces TimescaleDB 2.24.0 best practices including lightning-fast recompression, UUIDv7 continuous aggregates, and Direct Compress.

troykelly/claude-skills · 50 tokens

postgres-rls

MANDATORY when touching auth tables, tenant isolation, RLS policies, or multi-tenant database code - enforces Row Level Security best practices and catches common bypass vulnerabilities.

troykelly/claude-skills · 38 tokens

alloydb-basics

Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.

google/skills · 72 tokens