convex-migrate — Claude Code skill: Convex schema migrations
A skill that walks the agent through schema changes and data backfills on a deployed Convex app using @convex-dev/migrations. Useful when the app is already live.
npx skills add convex/agent-skills --skill convex-migrate -a claude-codeWhat convex-migrate does
The skill lays out the order of work for changing a schema on a running Convex app. Add the new field as optional first, so the deploy does not reject existing rows. Then install @convex-dev/migrations and write a migration that brings old rows into the new shape. Once the backfill finishes, the validator can be tightened and the field made required.
Inside there is a single SKILL.md with the workflow and its rules. The rules are blunt: never tighten a validator before the backfill completes, add fields as optional first, check row counts before and after. That first rule is the one that matters — do it the other way and existing rows stop passing validation, which breaks the live app.
The skill does not run the migration itself. It gives the agent a sequence to follow; the migration code and the run stay with you.
What it helps with
- change a schema on a deployed app without breaking live queries
- add a field and fill it in on existing rows
- write a backfill with @convex-dev/migrations
- compare row counts before and after a migration
- make a field required only once the data is in shape
Example prompts for the agent
- help me migrate the Convex schema: add the field as optional, write the backfill, check the rows
- I need to tighten the validator after the backfill — walk me through the steps
- write a @convex-dev/migrations migration for the existing rows
How to install convex-migrate
1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-migrate -a claude-code2Manually: put the files in place
~/.claude/skills/convex-migrate/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/convex-migrate/
1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-migrate -a codex2Manually: put the files in place
.agents/skills/convex-migrate/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-migrate -a cursor2Manually: put the files in place
.cursor/skills/convex-migrate/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install convex/agent-skills convex-migrate2Manually: put the files in place
.github/skills/convex-migrate/SKILL.md1Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-migrate -a gemini-cli2Platform CLI
gemini skills install https://github.com/convex/agent-skills --path skills/convex-migrateManually: put the files in place
.devin/skills/convex-migrate/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add convex/agent-skills --skill convex-migrate -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about convex-migrate
How do I install convex-migrate in Claude?
Run npx skills add convex/agent-skills --skill convex-migrate -a claude-code. The skill lands in ~/.claude/skills/convex-migrate/SKILL.md.
What does convex-migrate do?
It guides the agent through a schema migration and data backfill on a deployed Convex app with @convex-dev/migrations.
Why can't I make the field required right away?
The validator rejects existing rows, which breaks the live app. Backfill first, tighten later.
Source text
SKILL.md · Apache-2.0
--- name: convex-migrate description: "Migrate schema + backfill data on a deployed Convex app using @convex-dev/migrations." --- <!-- GENERATED from convex-agents content/capabilities/migrate.json — do not edit by hand. --> # Migrate the schema / data on a live app Change a deployed schema without breaking existing data: stage the schema change, install @convex-dev/migrations, write a backfill that makes old rows valid, run it, and verify before tightening the validator. ## Workflow 1. Make the new field optional first (so deploy doesn't reject existing rows). 2. Install @convex-dev/migrations; write a migration that backfills/transforms existing rows. 3. Run the migration; verify all rows are valid. 4. Tighten the validator (make the field required) once the backfill is complete. ## Rules - Never tighten a validator before the backfill completes — it rejects existing rows and breaks the live app. - Add new fields as optional first, migrate, then require. - Verify row counts before and after.
© convex · Apache-2.0 · convex/agent-skills