migrate-create — Claude Code skill for SQL migrations
Creates sequential up/down SQL migration pairs for database schema changes. Use it when adding tables, columns, indexes, or constraints.
npx skills add ruvnet/ruflo --skill migrate-create -a claude-codeWhat migrate-create does
The skill scans existing migration files, finds the next number, and pads it to 3 digits. It then writes NNN_<name>.up.sql alongside NNN_<name>.down.sql. Forward SQL uses IF NOT EXISTS; rollback SQL uses IF EXISTS.
Its template follows the migration name: create_ selects a table template, add_ adds a column, drop_ prepares guarded removal, and names containing index create an index. Other names receive a general SQL template with placeholder comments. Naming the migration after the intended action matters here.
It searches for related earlier migrations with mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search, then records the new migration through mcp__plugin_ruflo-core_ruflo__memory_store in the migrations namespace. The final report includes the number, file paths, selected template, and related results.
What it helps with
- create paired up and down SQL files
- assign the next migration number
- choose a table or index SQL template
- write a reverse database operation
- record migration metadata for the agent
Example prompts for the agent
- Create a migration named `create_users`.
- Make a migration called `add_email_to_users`.
- Create the `create_orders_index` migration.
How to install migrate-create
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill migrate-create -a claude-code2Manually: put the files in place
~/.claude/skills/migrate-create/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/migrate-create/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill migrate-create -a codex2Manually: put the files in place
.agents/skills/migrate-create/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill migrate-create -a cursor2Manually: put the files in place
.cursor/skills/migrate-create/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install ruvnet/ruflo migrate-create2Manually: put the files in place
.github/skills/migrate-create/SKILL.md1Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill migrate-create -a gemini-cli2Platform CLI
gemini skills install https://github.com/ruvnet/ruflo --path plugins/ruflo-migrations/skills/migrate-createManually: put the files in place
.devin/skills/migrate-create/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add ruvnet/ruflo --skill migrate-create -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set104
The whole set →Similar
Questions about migrate-create
How do I install migrate-create in Claude Code?
Run this command twice: npx skills add ruvnet/ruflo --skill migrate-create -a claude-code. The skill file is placed at ~/.claude/skills/migrate-create/SKILL.md.
What does migrate-create do?
It generates a sequential database migration as matching up and down SQL files. The SQL template is selected from the migration name and covers tables, columns, removals, and indexes.
How does migrate-create store migration details?
It calls mcp__plugin_ruflo-core_ruflo__memory_store with the migrations namespace. The stored record includes the number, name, pending status, and file paths.
Source text
SKILL.md · MIT
---
name: migrate-create
description: Create a new sequentially numbered database migration with up/down SQL files
argument-hint: "<name>"
allowed-tools: Read Write Glob Bash mcp__plugin_ruflo-core_ruflo__memory_store mcp__plugin_ruflo-core_ruflo__memory_search mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search
---
# Migrate Create
Generate a new database migration with sequential numbering and up/down SQL file pair.
## When to use
When you need to create a new database migration for schema changes such as creating tables, adding columns, creating indexes, or modifying constraints.
## Steps
1. **Determine next number** -- use `Glob` to scan the migrations directory for existing migration files and find the highest number, then increment by 1 (zero-pad to 3 digits)
2. **Select template** -- based on the `<name>`, choose the appropriate SQL template:
- Names starting with `create_` -> CREATE TABLE template
- Names starting with `add_` -> ALTER TABLE ADD COLUMN template
- Names starting with `drop_` -> DROP with safety checks
- Names containing `index` -> CREATE INDEX template
- Other -> generic migration template with placeholder comments
3. **Generate up migration** -- write `NNN_<name>.up.sql` with the appropriate SQL using IF NOT EXISTS for idempotency
4. **Generate down migration** -- write `NNN_<name>.down.sql` with the reverse operation using IF EXISTS
5. **Search past patterns** -- call `mcp__plugin_ruflo-core_ruflo__agentdb_pattern-search` (ReasoningBank-routed; **don't** pass a `namespace` argument — pattern-* tools ignore it).
6. **Store metadata** -- call `mcp__plugin_ruflo-core_ruflo__memory_store --namespace migrations` to record the migration with number, name, status (pending), and file paths. The `memory_*` tool family routes by namespace; `agentdb_hierarchical-*` does NOT (it routes by tier `working|episodic|semantic`), so use `memory_*` here. See [ruflo-agentdb ADR-0001 §"Namespace convention"](../../../ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md).
7. **Report** -- display: migration number, file paths created, template used, any similar past migrations found
## CLI alternative
```bash
npx @claude-flow/cli@latest memory store --namespace migrations --key "migration-NNN_NAME" --value '{"number": NNN, "name": "NAME", "status": "pending"}'
```
© ruvnet · MIT · ruvnet/ruflo