convex-migration-helper

Plans and executes Convex schema and data migrations using widen-migrate-narrow workflows.

Updated May 28, 2026
One-click install
npx skills add https://github.com/mrisoli/pokerhouse --skill convex-migration-helper-mrisoli
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-migration-helper
Source: https://github.com/mrisoli/pokerhouse/tree/main/packages/backend/.agents/skills/convex-migration-helper
Command: npx skills add https://github.com/mrisoli/pokerhouse --skill convex-migration-helper-mrisoli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @convex-dev/migrations, and includes references (resource) components.

What problem does it solve? Breaking schema changes in Convex cannot deploy while existing data violates the new schema, forcing developers to coordinate multi-step migrations without downtime or data loss. ## Core Features & Use Cases - Widen-Migrate-Narrow Workflow: Guides the multi-deploy pattern of widening the schema, backfilling data, then narrowing the schema for breaking changes. - Migrations Component Integration: Uses @convex-dev/migrations for batched, resumable migrations with dry runs, status monitoring, and cancellation. - Pattern Library: Provides reference implementations for adding required fields, changing types, splitting tables, cleaning orphans, and zero-downtime dual-write or dual-read strategies. - Use Case: When renaming a boolean field to an enum on a production table, the Skill plans the deploy sequence, writes the backfill migration, and verifies completion before the final schema narrowing. ## Quick Start Ask the assistant to plan a safe migration for adding a required field to an existing Convex table with production data.

Frequently Asked Questions about convex-migration-helper

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a required field to an existing Convex table?▼

Add the field as optional first, deploy code that writes it for new documents, then run a migration with @convex-dev/migrations to backfill existing documents. After verifying all documents are migrated, deploy a final schema making the field required.

How do I run a Convex data migration in production?▼

Define the migration with migrations.define from @convex-dev/migrations, test it with a dry run using npx convex run migrations:myMigration '{"dryRun": true}', then execute it with npx convex run migrations:myMigration --prod and monitor status.

Why does Convex reject my schema deploy after changing a field?▼

Convex validates that the schema matches data at rest, so it rejects deploys where existing documents violate the new schema, such as missing a newly required field. Widen the schema to accept both formats, migrate the data, then narrow the schema.

When should I not use the Convex migrations component?▼

Skip it for greenfield schemas, adding optional fields, new tables, or index changes with no data impact. For small tables of a few thousand documents, a single internalMutation using .collect() is sufficient.

How do I handle zero-downtime during a Convex migration?▼

Use dual write, where code writes both old and new formats while reading the old format until migration completes, allowing safe rollback. Alternatively use dual read, reading both formats while writing only the new one.