Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

database-migration-assistant

FreeRuns bundled scriptsNot checked

PostgreSQL migration assistant that plans, applies, and rolls back schema changes with drift detection for safe AI-agent execution.

jiayaoqijiaby jiayaoqijia★ 81 GitHub stars

About this skill

Database Migration Assistant with Rollback

A PostgreSQL migration assistant that makes schema changes safe and repeatable.
It provides plan/apply/rollback workflows with drift detection, and exposes stable CLI tools for AI agents to call.
Designed for production safety: preview first, confirm, then execute.

Quick Start

from spoon_ai.agents import SpoonReactSkill

agent = SpoonReactSkill(
    name="db_migration_agent",
    skill_paths=["./ai-productivity"],
    scripts_enabled=True
)

result = await agent.run("Plan database migrations for this project")
print(result)

Scripts

Script Purpose
plan_migrations.py Build a migration plan and detect drift
apply_migrations.py Apply pending up migrations (supports dry-run)
rollback_migrations.py Roll back the latest migration or to a target version
generate_migration.py Generate a new migration SQL template

Environment Variables

Variable Required Description
DB_URL Yes PostgreSQL connection string, e.g. postgresql://user:pass@host:5432/db

Best Practices

  1. Always run plan and review the output before apply.
  2. In production, require explicit confirmation and a recent backup.
  3. Treat migration files as append-only; never edit applied migrations.

Install database-migration-assistant in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

README.mdSOURCE.mdTRUST.auto.yamlexamples/demo_agent.pyexamples/demo_prompt.txtexamples/example.envexamples/example_usage.mdmigrations/20260208_091909_create_users_table.sqlscripts/apply_migrations.pyscripts/generate_migration.pyscripts/migration_utils.pyscripts/plan_migrations.pyscripts/rollback_migrations.py

FAQ

What does the database-migration-assistant skill do?

PostgreSQL migration assistant that plans, applies, and rolls back schema changes with drift detection for safe AI-agent execution.

How do I install the database-migration-assistant skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the database-migration-assistant skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare database-migration-assistant with