Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

migrate-validate — Claude Code skill: database migration validation

A skill that automatically validates pending database migrations for errors: broken foreign key references, incomplete rollbacks, naming violations. Catches issues before they reach the database.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ruvnet/ruflo --skill migrate-validate -a claude-code
Open on GitHub

What migrate-validate does

migrate-validate scans all migration files, identifies unapplied ones, and analyzes their SQL. It verifies that all REFERENCES point to existing tables, that DROP and ALTER statements have corresponding rollback SQL, and that NOT NULL columns receive DEFAULT values. The skill flags destructive operations like DROP TABLE and warns about naming violations: table names in plural, columns in snake_case, indexes following the idx_table_column pattern.

It uses ruflo-core tools — memory_search and memory_store for namespace-routed migration history, agentdb_pattern-store for typed validation patterns. Results include file path, line number, and severity level: errors (must fix), warnings (should fix), and info (suggestions).

Installs with a single command on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, or OpenCode. Once loaded, the skill is ready to validate migrations in your project.

What it helps with

  • Find foreign keys that reference non-existent tables
  • Verify that every UP migration has a complete corresponding DOWN for safe rollback
  • Check that NOT NULL columns receive DEFAULT values when added
  • Detect destructive operations without explicit safeguards
  • Validate table and index names against naming conventions

Example prompts for the agent

  • Validate all pending migrations before I apply them
  • Check my migrations for foreign key errors and incomplete rollbacks
  • Flag naming convention violations and destructive operations in these migration files

How to install migrate-validate

1Skills CLI (Vercel)

npx skills add ruvnet/ruflo --skill migrate-validate -a claude-code

2Manually: put the files in place

~/.claude/skills/migrate-validate/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/migrate-validate/

From the same set104

The whole set →
ruflo ruvnet This skill adds multi-agent orchestration, memory, routing, and MCP tools to a project. Use it for swarm tasks and multi-step workflows. Claude Code CX Codex Cursor +1 4,000installs Swarm Orchestration ruvnet Skill for managing agent swarms with parallel execution, dynamic topology, and automatic load balancing. Use when a single agent is not enough and you need to orchestrate specialists of different types. Claude Code CX Codex Cursor +1 2,100installs github-project-management ruvnet Turns issue triage and board upkeep into gh and ruv-swarm calls: labels, subtasks, duplicate lookup. Useful when the tracker holds more tickets than order. Claude Code CX Codex Cursor +1 1,400installs github-workflow-automation ruvnet Automates GitHub Actions with AI agent coordination. Generates optimised pipelines, manages pull requests, analyzes failed runs, and deploys updates with risk assessment. Claude Code CX Codex Cursor +1 1,300installs github-code-review ruvnet Runs a swarm of specialized AI agents to inspect GitHub pull requests for security, performance, and architecture issues. Claude Code CX Codex Cursor +1 1,300installs stream-chain ruvnet Chains sequential agent steps together using streaming JSON flow and provides ready-to-run pipelines. Claude Code CX Codex Cursor +1 1,200installs flow-nexus-swarm ruvnet Deploy cloud-based AI agent swarms and define event-driven workflows with message queues. Use it to coordinate tasks, inspect runs, and scale a swarm. Claude Code CX Codex Cursor +1 1,200installs performance-analysis ruvnet Detects bottlenecks in Claude Flow swarms, profiles agent operations, and generates reports with actionable optimization recommendations. Claude Code CX Codex Cursor +1 1,200installs

Similar

voice-ai-development sickn33 This skill guides work on voice applications and real-time voice agents. Use it when a task involves speech recognition, speech synthesis, or streamed audio. Claude Code CX Codex Cursor +1 959installs plaid-fintech sickn33 Provides integration patterns for the Plaid API, covering Link tokens, ACH Auth, transaction sync, balance checks, and webhook handling. Claude Code CX Codex Cursor +1 956installs convex-create-component convex A skill to design and build reusable Convex components with isolated tables and a clear API boundary. Useful when you need to extract backend logic into a self-contained module or package an integration that owns its own data. Claude Code CX Codex Cursor +1 130,600installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs lark-im larksuite This skill lets an agent work with Lark IM messages, chats, files, and interactive cards. Use it when coding tasks need access to team conversations. Claude Code CX Codex Cursor +1 472,300installs lark-event larksuite Listens to Lark/Feishu events and streams them as NDJSON. Use it for bots, message processing, and long-running subscribers. Claude Code CX Codex Cursor +1 466,200installs caveman-discover JuliusBrussee Finds and labels every LLM workflow in your repository so Caveman Cloud breaks down spend by actual job rather than grouping everything into one bucket. Claude Code CX Codex Cursor +1 103,500installs

Questions about migrate-validate

How do I install migrate-validate in Claude Code?

Run npx skills add ruvnet/ruflo --skill migrate-validate -a claude-code. The skill will load into ~/.claude/skills/migrate-validate/SKILL.md and be ready to use immediately.

What does migrate-validate do?

It scans unapplied database migrations and validates their correctness: verifies foreign key targets exist, checks rollback completeness, confirms NOT NULL columns have DEFAULT values, and validates naming conventions.

What checks does it perform?

Foreign key reference validation, rollback integrity (CREATE↔DROP, ALTER↔ALTER), idempotency (IF EXISTS), naming rules (plural tables, snake_case columns, idx_table_column index pattern), and warnings for destructive operations.

Source text

SKILL.md · MIT
---
name: migrate-validate
description: Validate pending migrations for foreign key consistency, rollback safety, and best practices
argument-hint: ""
allowed-tools: Read Glob Grep Bash mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__memory_list mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__agentdb_pattern-store mcp__plugin_ruflo-core_ruflo__agentdb_semantic-route
---

# 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

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

© ruvnet · MIT · ruvnet/ruflo

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor