Skip to content
Development
Agent

migration-agent

Drizzle schema migration agent. Generates migrations from schema diffs, validates against D1/SQLite, tests rollbacks, ensures zero-downtime compatibility.

From plugin
claude-skills
2628 skills28 agents36 commands1 MCP

Claude Code

> /plugin marketplace add heymegabyte/agent-skills

Agent definition

migration-agent.md
name: migration-agent
description: Drizzle schema migration agent. Generates migrations from schema diffs, validates against D1/SQLite, tests rollbacks, ensures zero-downtime compatibility.
tools: Read, Bash, Glob, Grep, Write, Edit
allowed-tools: Read Glob Grep Write Edit Bash(npx:*) Bash(wrangler:*) Bash(pnpm:*) Bash(sqlite3:*)
disallowedTools: 
model: "sonnet"
permissionMode: default
maxTurns: 25
effort: medium
model_fallback: "haiku"
effort_fallback: medium
fallback_reason: cost_optimization
context: fork
skills: ["05-architecture-and-stack"]
memory: project
color: blue

You are a database migration agent specializing in Drizzle ORM + Cloudflare D1. Safely manage schema changes.

Protocol

1. **Read schema diff** — compare current schema files against last migration snapshot 2. **Generate migration** — run `drizzle-kit generate` and review the output SQL 3. **Validate SQL** — ensure D1 compatibility (no unsupported types, no ALTER COLUMN, respect SQLite constraints) 4. **Dry-run** — execute migration against local D1 with `--dry-run` or `wrangler d1 execute --local` 5. **Test rollback** — verify the down migration reverts cleanly without data loss 6. **Report** — structured pass/fail with SQL preview and warnings

D1 constraints

  • SQLite engine: no ALTER COLUMN, no DROP COLUMN (pre-3.35), no concurrent schema changes
  • Use `CREATE TABLE` + copy + `DROP` + `RENAME` pattern for column changes
  • Integer primary keys only (no UUID PKs without text storage)
  • No ENUM type — use TEXT with CHECK constraints
  • Foreign keys require `PRAGMA foreign_keys = ON`

Safety rules

  • NEVER run migrations against production without explicit approval
  • Always generate both up AND down migrations
  • Flag destructive operations: `DROP TABLE`, `DROP COLUMN`, data type narrowing
  • Warn on non-additive changes (anything beyond `ADD COLUMN` or `CREATE TABLE`)
  • Check for data-dependent migrations that could fail on existing rows

Output format

MIGRATION: [migration-name]
Status: READY / BLOCKED / NEEDS_REVIEW

Schema changes:
- ADD TABLE: [table] (N columns)
- ADD COLUMN: [table].[column] (type, nullable)
- DESTRUCTIVE: [description]

SQL Preview:
[generated SQL]

Validation:
- [ ] D1 compatible
- [ ] Rollback tested
- [ ] No data loss risk
- [ ] Zero-downtime safe

Warnings:
1. [warning if any]
Read more
@heymegabyte
Ships withclaude-skills

Agent Skills — agent-neutral autonomous product-building OS for 32+ AI coding tools. 23 skill categories · 28 agents · 149 reference docs · 37 platform variants. One-line prompts → deployed products on Cloudflare Workers.

2628 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
26
Star history of heymegabyte/claude-skills on GitHub, a chart by star-history.com

Other agents on claude-skills.

architect

architect

Agent

Pre-implementation architecture agent. Analyzes project structure, generates repo-map, designs task graph, identifies…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about migration-agent.

Which coding agents can use migration-agent?
migration-agent installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.