Source profileQuality 90/100

openclaw/clawhub/.agents/skills/convex-migration-helper/SKILL.md

convex-migration-helper

Plans Convex schema and data migrations with widen-migrate-narrow and @convex-dev/migrations. Use for breaking schema changes, backfills, table reshaping, or zero-downtime rollouts.

Source repository stars
9,347
Declared platforms
0
Static risk flags
0
Last source update
2026-08-25
Source checked
2026-08-25

Decision brief

What it does: where it fits

Safely migrate Convex schemas and data when making breaking changes.

Best for

  • Adding new required fields to existing tables
  • Changing field types or structure
  • Splitting or merging tables

Not for

  • Greenfield schema with no existing data in production or dev
  • Adding optional fields that do not need backfilling

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/openclaw/clawhub --skill ".agents/skills/convex-migration-helper"
Safe inspection promptEditorial

Inspect the Agent Skill "convex-migration-helper" from https://github.com/openclaw/clawhub/blob/b4aaa3113a11b0359bbd06203f3c264f6406fd06/.agents/skills/convex-migration-helper/SKILL.md at commit b4aaa3113a11b0359bbd06203f3c264f6406fd06. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Schema Validation Drives the Workflow

    Convex will not let you deploy a schema that does not match the data at rest. This is the fundamental constraint that shapes every migration:

    You cannot add a required field if existing documents don't have itYou cannot change a field's type if existing documents have the old typeYou cannot remove a field from the schema if existing documents still have it
  2. 02

    Breaking Changes: The Deployment Workflow

    Every breaking migration follows the same multi-deploy pattern:

    Update schema to allow both old and new formats (e.g., add optional newUpdate code to handle both formats when readingUpdate code to write the new format for new documents
  3. 03

    When to Use

    Adding new required fields to existing tables

    Adding new required fields to existing tablesChanging field types or structureSplitting or merging tables
  4. 04

    When Not to Use

    Greenfield schema with no existing data in production or dev

    Greenfield schema with no existing data in production or devAdding optional fields that do not need backfillingAdding new tables with no existing data to migrate
  5. 05

    Key Concepts

    Convex will not let you deploy a schema that does not match the data at rest. This is the fundamental constraint that shapes every migration:

    You cannot add a required field if existing documents don't have itYou cannot change a field's type if existing documents have the old typeYou cannot remove a field from the schema if existing documents still have it

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score90/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars9,347SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
openclaw/clawhub
Skill path
.agents/skills/convex-migration-helper/SKILL.md
Commit
b4aaa3113a11b0359bbd06203f3c264f6406fd06
License
MIT
Collected
2026-08-25
Default branch
main
View the original SKILL.md

Convex Migration Helper

Safely migrate Convex schemas and data when making breaking changes.

When to Use

  • Adding new required fields to existing tables
  • Changing field types or structure
  • Splitting or merging tables
  • Renaming or deleting fields
  • Migrating from nested to relational data

When Not to Use

  • Greenfield schema with no existing data in production or dev
  • Adding optional fields that do not need backfilling
  • Adding new tables with no existing data to migrate
  • Adding or removing indexes with no correctness concern
  • Questions about Convex schema design without a migration need

Key Concepts

Schema Validation Drives the Workflow

Convex will not let you deploy a schema that does not match the data at rest. This is the fundamental constraint that shapes every migration:

  • You cannot add a required field if existing documents don't have it
  • You cannot change a field's type if existing documents have the old type
  • You cannot remove a field from the schema if existing documents still have it

This means migrations follow a predictable pattern: widen the schema, migrate the data, narrow the schema.

Online Migrations

Convex migrations run online, meaning the app continues serving requests while data is updated asynchronously in batches. During the migration window, your code must handle both old and new data formats.

Prefer New Fields Over Changing Types

When changing the shape of data, create a new field rather than modifying an existing one. This makes the transition safer and easier to roll back.

Don't Delete Data

Unless you are certain, prefer deprecating fields over deleting them. Mark the field as v.optional and add a code comment explaining it is deprecated and why it existed.

Safe Changes (No Migration Needed)

Adding Optional Field

// Before
users: defineTable({
  name: v.string(),
});

// After - safe, new field is optional
users: defineTable({
  name: v.string(),
  bio: v.optional(v.string()),
});

Adding New Table

posts: defineTable({
  userId: v.id("users"),
  title: v.string(),
}).index("by_user", ["userId"]);

Adding Index

users: defineTable({
  name: v.string(),
  email: v.string(),
}).index("by_email", ["email"]);

Breaking Changes: The Deployment Workflow

Every breaking migration follows the same multi-deploy pattern:

Deploy 1 - Widen the schema:

  1. Update schema to allow both old and new formats (e.g., add optional new field)
  2. Update code to handle both formats when reading
  3. Update code to write the new format for new documents
  4. Deploy

Between deploys - Migrate data:

  1. Run migration to backfill existing documents
  2. Verify all documents are migrated

Deploy 2 - Narrow the schema:

  1. Update schema to require the new format only
  2. Remove code that handles the old format
  3. Deploy

Using the Migrations Component

For any non-trivial migration, use the @convex-dev/migrations component. It handles batching, cursor-based pagination, state tracking, resume from failure, dry runs, and progress monitoring.

See references/migrations-component.md for installation, setup, defining and running migrations directly with npx convex run migrations:myMigration, dry runs, status monitoring, and configuration options.

Common Migration Patterns

See references/migration-patterns.md for complete patterns with code examples covering:

  • Adding a required field
  • Deleting a field
  • Changing a field type
  • Splitting nested data into a separate table
  • Cleaning up orphaned documents
  • Zero-downtime strategies (dual write, dual read)
  • Small table shortcut (single internalMutation without the component)
  • Verifying a migration is complete

Common Pitfalls

  1. Making a field required before migrating data: Convex rejects the deploy because existing documents lack the field. Always widen the schema first.
  2. Using .collect() on large tables: Hits transaction limits or causes timeouts. Use the migrations component for proper batched pagination. .collect() is only safe for tables you know are small.
  3. Not writing the new format before migrating: Documents created during the migration window will be missed, leaving unmigrated data after the migration "completes."
  4. Skipping the dry run: Use dryRun: true to validate migration logic before committing changes to production data. Catches bugs before they touch real documents.
  5. Deleting fields prematurely: Prefer deprecating with v.optional and a comment. Only delete after you are confident the data is no longer needed and no code references it.
  6. Using crons for migration batches: The migrations component handles batching via recursive scheduling internally. Crons require manual cleanup and an extra deploy to remove.

Migration Checklist

  • Identify the breaking change and plan the multi-deploy workflow
  • Update schema to allow both old and new formats
  • Update code to handle both formats when reading
  • Update code to write the new format for new documents
  • Deploy widened schema and updated code
  • Define migration using the @convex-dev/migrations component
  • Test with npx convex run migrations:myMigration '{"dryRun": true}'
  • Run migration directly with npx convex run migrations:myMigration and monitor status
  • Verify all documents are migrated
  • Update schema to require new format only
  • Clean up code that handled old format
  • Deploy final schema and code
  • Remove migration code once confirmed stable

Frequently asked questions

What to verify before installation and use

What does the convex-migration-helper source document cover?

Safely migrate Convex schemas and data when making breaking changes.

How do I install convex-migration-helper?

The source record exposes this install command: npx skills add https://github.com/openclaw/clawhub --skill ".agents/skills/convex-migration-helper". Inspect the command and pinned source before running it.

Alternatives

Compare before choosing