Skip to content
Back to skills

Write Migration

ASecurity

Drafts an up and down migration for the schema change you describe, then checks it for table locks, data loss and rollout order.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 15, 2026
ai-agentsgodjangorailsdatabase

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill write-migration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Migration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Migration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-write-migration/badge)](https://www.skillsdirectory.com/skills/workspace-templates-write-migration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-migration
description: Drafts an up and down migration for the schema change you describe, then checks it for table locks, data loss and rollout order.
argument-hint: "[describe the schema change]"
user-invocable: true
disable-model-invocation: true
---

Write a migration for: $ARGUMENTS

1. Find the migration tool (Prisma, Alembic, Rails, Flyway, Knex, Django, goose, Drizzle) and copy the naming and style of the latest migration. Read the current schema for the affected tables.
2. Write the up and the down. If the down cannot restore dropped data, say so plainly in a comment.
3. Review against the database dialect: does this take a long lock (ADD COLUMN with default on old Postgres, type change, index without CONCURRENTLY, NOT NULL on a big table)? Does it drop or truncate data? Is it safe with the old code still running?
4. Split risky changes into stages: add nullable column, deploy code that writes both, backfill in batches, then add the constraint, then drop the old one.
5. Never run the migration. Never edit a migration that has already been applied or merged.

Output the file(s), a risk list (lock, data loss, deploy order) and the exact command to test on a copy of the database. Ask before generating any follow-up stage.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.