Skip to content
Skillpedia
APIs & servers (backend)81k · #1659

migrate-validate

What it does

This skill reviews database migration files that have not been applied yet, looking for common safety problems. It is for developers who want to catch mistakes before changing a live database.

When to use it

  • ✓When you have pending migrations and want to check them before applying.
  • ✓When a migration removes tables or columns and needs a safety review.
  • ✓When you want a naming and safety check as part of your release process.

Skill link

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-validate/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-migrations/skills/migrate-validate/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Check my pending database migrations for any risky changes before I apply them.”

5 new skills a week. 1 minute to read.

How it works

The skill finds the pending migration files, reads their SQL and checks foreign key targets, default values on new required columns, undo completeness, destructive operations, safe wording and table naming.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Migrate Validate

Validate all pending database migrations for correctness, safety, and adherence to best practices.

When to use

Before applying migrations to catch issues early -- foreign key references to non-existent tables, missing rollback SQL, destructive operations without safeguards, and naming convention violations.

Steps

  1. Find pending migrations -- use Glob to list all migration files, cross-reference with applied history via mcp__plugin_ruflo-core_ruflo__memory_search --namespace migrations (or memory_list) to identify pending ones. The memory_* tool family routes by namespace; agentdb_hierarchical-* does NOT (it routes by tier), so use memory_* here.
  2. Parse SQL -- use Read to load each pending .up.sql and .down.sql file and parse the SQL statements
  3. Check foreign keys -- verify that all REFERENCES targets exist in the current schema or in prior migrations (both applied and pending)
  4. Check NOT NULL defaults -- verify that any ADD COLUMN with NOT NULL has a DEFAULT value
  5. Check rollback completeness -- verify every CREATE/ALTER in the UP file has a corresponding DROP/ALTER in the DOWN file
  6. Flag destructive ops -- warn on DROP TABLE, DROP COLUMN, TRUNCATE without explicit confirmation
  7. Check idempotency -- verify IF EXISTS / IF NOT EXISTS is used for safety
  8. Check naming -- verify table names are plural, column names are snake_case, index names follow idx_table_column convention
  9. Store validation patterns -- two paths (per ruflo-cost-tracker ADR-0001 dual-path pattern):
    • Pattern store (typed, recommended): mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store with type: 'migration-validation'. No namespace arg — ReasoningBank routes it.
    • Plain store (namespace-routable): mcp__plugin_ruflo-core_ruflo__memory_store --namespace migrations for validation results tied to a specific migration number.
  10. Report -- display: errors (must fix), warnings (should fix), info (suggestions), with file path and line number for each issue

CLI alternative

npx @claude-flow/cli@latest memory search --query "migration validation results" --namespace migrations
FAQ

What counts as a destructive change?

Drop table, drop column and truncate statements are flagged so you can confirm them.

Does it change the migration files?

The description covers checking and reporting, so review the findings and decide what to change.

How does it know which migrations are pending?

It compares the migration files with the history stored in the migrations memory namespace.

Details

Original description by the author

Validate pending migrations for foreign key consistency, rollback safety, and best practices

repo: ruvnet/ruflo

Popularity

GitHub stars
81k
Ranking position
#1659
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills