convex-migration-helper

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

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/hpark0011/mirror --skill convex-migration-helper-hpark0011
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-migration-helper
Source: https://github.com/hpark0011/mirror/tree/main/.agents/skills/convex-migration-helper
Command: npx skills add https://github.com/hpark0011/mirror --skill convex-migration-helper-hpark0011

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Convex rejects deployments when the schema does not match existing data, so breaking changes like adding required fields, changing types, or splitting tables require careful multi-step migrations. This Skill guides you through safe widen-migrate-narrow workflows so you can evolve your schema without downtime or failed deploys. ## Core Features & Use Cases - Multi-Deploy Migration Planning: Structures breaking changes into widen-schema, migrate-data, narrow-schema phases with code that handles both old and new formats. - Batched Migrations Component: Uses @convex-dev/migrations for cursor-based pagination, resume from failure, dry runs, and status monitoring on large tables. - Zero-Downtime Strategies: Provides dual-write and dual-read patterns so your app keeps serving requests during the migration window. - Use Case: You need to change a boolean isPro field into a plan enum on a teams table with production data. The Skill walks you through adding the optional new field, backfilling with a migration, verifying completion, and narrowing the schema in a final deploy. ## Quick Start Ask the assistant to plan a safe migration for your breaking Convex schema change, describing the current field shape and the target shape.

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 backfill existing documents with a migration. After verifying all documents have the value, deploy a final schema that makes the field required.

How do I run a data migration in Convex without downtime?▼

Use the @convex-dev/migrations component, which processes documents in batches with cursor-based pagination while your app keeps serving requests. During the migration window, use dual-write or dual-read patterns so code handles both old and new data formats.

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

Convex validates that the schema matches data at rest, so existing documents with the old type block the deploy. Widen the schema to accept both formats, migrate the data, then narrow the schema in a follow-up deploy.

Can I test a Convex migration before changing production data?▼

Yes, run the migration with dryRun set to true, which executes one batch and rolls back so you can inspect what it would change. This catches logic bugs before they touch real documents.

When should I avoid using the migrations component?▼

Skip it for greenfield schemas, optional fields needing no backfill, new tables, or index changes. For very small tables, a single internalMutation using .collect() is sufficient instead of the full component.