Guide · Agent skill
How to use the Database Migration Patterns agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The database-migrations skill is a set of established practices for changing a database's structure, such as adding columns or indexes, moving data and rolling back changes. It is useful for developers and teams who need to make schema changes safely, especially on a live production database. After this guide you will know what the skill does, how to install it, how to ask for it in plain language and what to check before running any migration.
Quick start
- 1Download the ZIP. Download the skill ZIP file from this page.
- 2Choose an install location. Pick personal (~/.claude/skills/) or project (.claude/skills/) install, or upload the ZIP under Settings, Capabilities, Skills in the Claude apps.
- 3Unzip the skill. Extract the archive so the skill folder with SKILL.md sits in the chosen skills directory.
- 4Describe your schema change. Ask the agent in plain language, naming your database and tool, such as Prisma or Django.
- 5Review the checklist. Have the agent check the planned change against the safety checklist, including locks, defaults and backfill separation.
- 6Test on production-sized data. Run the migration against a copy of production data and write down the rollback plan before applying it.
What does the skill make the agent do?
When the skill is active, the agent follows database migration best practices for schema changes, data migrations, rollbacks and zero-downtime deployments. It checks each planned change against a safety checklist and then gives commands and examples for PostgreSQL and for tools such as Prisma, Drizzle, Django and golang-migrate.
The skill does not connect to your database. It guides the work that you or the agent do in your own project.
- Checks that every migration has an UP and DOWN, or is explicitly marked irreversible
- Flags full table locks on large tables and suggests concurrent operations
- Recommends new columns be nullable or have a default, never NOT NULL without a default
- Keeps index creation and data backfills in separate migrations from schema changes
- Recommends testing against a copy of production data and documenting a rollback plan
How do you install the database-migrations skill?
Download the ZIP file for the skill from this page. Then choose one of two methods.
Method one is a personal install. Unzip the file into ~/.claude/skills/ so the skill is available across your projects.
Method two is a project install. Unzip the file into the .claude/skills/ folder inside a specific project so that only that project uses it.
You can also upload the ZIP in the Claude apps under Settings, then Capabilities, then Skills.
- Personal: unzip into ~/.claude/skills/
- Project: unzip into .claude/skills/ inside your project folder
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
How do you trigger the skill with natural requests?
You do not need a special command. Describe the schema work you want to do in plain language and mention the database or tool you use. The skill is meant to activate when you are creating or altering tables, adding or removing columns or indexes, running data backfills or transforms, planning zero-downtime schema changes, or setting up migration tooling for a new project.
Mentioning PostgreSQL, MySQL, Prisma, Drizzle, Django or golang-migrate helps the agent pick the right section of guidance.
- Example: I need to add an avatar_url column to users in production. What is the safe way?
- Example: Help me rename the username column without taking the app offline.
- Example: Set up Drizzle migrations for a new Postgres project.
- Example: Write a Django data migration that backfills display_name in batches.
What are the core rules and examples?
The skill is built on a few principles. Every change is a migration, so production databases are never altered by hand. Migrations are forward-only in production, so rollbacks are done with new forward migrations. Schema and data migrations stay separate. Deployed migrations are never edited.
For PostgreSQL, the examples show adding a nullable column without a lock, adding an index with CONCURRENTLY, renaming a column with the expand-contract pattern, and running a large update in batches instead of one transaction.
- Expand-contract rename: add the new column, backfill it, update the application to use both, then drop the old column in a later migration
- Removing a column: remove application references first, deploy, then drop the column in the next migration
- Django: SeparateDatabaseAndState can remove a field from the model without an immediate DROP COLUMN
CREATE INDEX CONCURRENTLY idx_users_email ON users (email);How do you use the skill with Prisma, Drizzle, Django and golang-migrate?
Each tool has its own workflow section in the skill. Use the commands for the tool your project already uses. The skill notes that Prisma cannot generate CONCURRENTLY, so for concurrent indexes you create an empty migration and write the SQL by hand.
Drizzle's push command is marked as dev only because it does not create a migration file. Django's showmigrations command shows migration status. golang-migrate uses numbered up and down files and a force command to fix a dirty state.
- Prisma: migrate dev to create, migrate deploy to apply in production, generate after schema changes
- Drizzle Kit: generate, migrate, and push (dev only)
- Django: makemigrations, migrate, showmigrations, and makemigrations --empty for custom SQL
- golang-migrate: create, up, down 1, and force VERSION
npx prisma migrate deployWhat should you check before applying a migration to production?
The skill asks you to work through a checklist before any migration is applied. The checklist is the core value of the skill, because most production failures come from skipping one of these steps. Test on production-sized data, since a migration that works on 100 rows may lock a table with 10 million rows.
- Migration has both UP and DOWN, or is explicitly marked irreversible
- No full table locks on large tables
- New columns have defaults or are nullable
- Indexes are created concurrently for existing tables
- Data backfill is separate from the schema change
- Tested against a copy of production data
- Rollback plan is documented
Is the skill safe to run and what does it need?
The skill itself installs no software and does not run scripts or use the network. Its examples assume PostgreSQL and the relevant tool, such as Prisma, Drizzle Kit or Django, are already in your own project. Commands like migrate deploy or migrate reset can change or erase data, so review every command before running it against a real database.
The skill only provides guidance and examples. It will not run migrations for you.
- Runs scripts: no
- Uses network: no
- Requires: your own project with PostgreSQL and your migration tool
- Files: SKILL.md
What people use it for
- Adding a nullable column or index to a large production table without blocking writes
- Renaming a column using the expand-contract pattern with no application downtime
- Backfilling a new column in batches with a separate data migration
- Setting up Prisma, Drizzle or golang-migrate tooling in a new project
- Removing a Django model field without dropping the database column right away
Frequently asked questions
Is the database-migrations skill free to use?
The source describes the skill as MIT licensed. It is a set of guidance and examples in a SKILL.md file, and the source does not mention any price.
Does the skill run migrations on my database automatically?
No. The skill only provides guidance and examples. It does not connect to your database, so you or the agent must run each command yourself after reviewing it.
What do I need before using this skill?
The skill itself installs no software. Its examples assume PostgreSQL and the relevant tool, such as Prisma, Drizzle Kit or Django, are in your own project.
Which databases and tools does it cover?
It covers PostgreSQL and MySQL, plus Prisma, Drizzle, Django, TypeORM and golang-migrate. Other databases will get more generic guidance.
How do I rename or drop a column without taking the app offline?
The skill recommends the expand-contract pattern for renames: add the new column, backfill it, update the application, then drop the old column in a later migration. For drops, remove application references and deploy first, then drop the column.
Is this skill a good fit for a small hobby project?
Probably not. The skill is aimed at projects with a production database and real schema risk. For a project with no production database or only trivial schema needs, the checklist may add more overhead than value.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers and teams planning schema changes on a live production database, or setting up migration tooling for a new Prisma, Drizzle or Django project. It is a checklist and reference, not an automated migration runner, so you still need to review and run every command yourself. If your project has no production database or only simple schema needs, or you use a database outside the covered ones, a lighter approach may serve you better.
Download the skill