migration-helper

migration-helper is a skill for Claude Code, Codex from waynesutton/markdown-site. It costs 31 tokens per session (893 once invoked), scanned A, original, MIT.

A safety guide and set of procedures for changing Convex database schemas and updating existing data. Convex is a backend service that stores an application's data and does not automatically update old records when the schema changes.

In plain words
What is it for?
Adding fields or tables, changing data types, renaming or splitting data, and writing backfills that update old records while the application continues running.
Why use it?
It prevents schema changes from breaking existing records or taking the application offline.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/waynesutton/markdown-site/migration-helper
Any agent
npx skills add waynesutton/markdown-site --skill migration-helper
Clone the repo
git clone --depth 1 https://github.com/waynesutton/markdown-site

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for migration-helper

README.md
[![agentmods](https://agentmods.dev/badge/skills/waynesutton/markdown-site/migration-helper.svg)](https://agentmods.dev/skills/waynesutton/markdown-site/migration-helper)
Your own site
<a href="https://agentmods.dev/skills/waynesutton/markdown-site/migration-helper"><img src="https://agentmods.dev/badge/skills/waynesutton/markdown-site/migration-helper.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 893 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00893
Opus 5 $0.00015 $0.00447
Sonnet 5 $0.00006 $0.00179
Haiku 4.5 $0.00003 $0.00089

Measured 4d ago against content hash 6a5ae18bc740, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migration-helper scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/migration-helper/SKILL.md · 149 lines

How it starts

The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 fields
  • Migrating from nested to relational data

Migration Principles

  1. No Automatic Migrations: Convex doesn't automatically migrate data
  2. Additive Changes are Safe: Adding optional fields or new tables is safe
  3. Breaking Changes Need Code: Required fields, type changes need migration code
  4. Zero-Downtime: Write migrations to keep app running during migration

Safe Changes (No Migration Needed)

  • Adding optional fields
  • Adding new tables
  • Adding indexes

Breaking Changes (Migration Required)

Adding Required Field

Solution: Add as optional first, backfill data, then make required.

// Step 1: Add as optional
users: defineTable({
  name: v.string(),
  email: v.optional(v.string()),
})

// Step 2: Create migration
export const backfillEmails = internalMutation({
  args: {},
  handler: async (ctx) => {
    const users = await ctx.db.query("users").collect();
    for (const user of users) {
      if (!user.email) {
        await ctx.db.patch(user._id, {
          email: `user-${user._id}@example.com`,
        });
      }
    }
  },
});

// Step 3: Run migration via dashboard or CLI
// npx convex run migrations:backfillEmails

// Step 4: Make field required (after all data migrated)
users: defineTable({
  name: v.string(),
  email: v.string(),
})

Renaming Field

// Step 1: Add new field (optional)
// Step 2: Copy data with internalMutation
// Step 3: Update schema (remove old field)
// Step 4: Update all code to use new field name

Migration Patterns

Batch Processing

For large tables, process in batches:

export const migrateBatch = internalMutation({
  args: {
    cursor: v.optional(v.string()),
    batchSize: v.number(),
  },
  handler: async (ctx, args) => {
    const items = await ctx.db.query("largeTable").take(args.batchSize);

    for (const item of items) {
      await ctx.db.patch(item._id, { /* migration logic */ });
    }

    return {
      processed: items.length,
      hasMore: items.length === args.batchSize,
    };
  },
});

Read the full file on GitHub · 149 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 149 lines · 31 tokens per session scan A 6a5ae18bc740

Subscribe to this mod's changes

migration-helper is a skill published in the GitHub repository waynesutton/markdown-site (630 stars, last pushed 3mo ago), licensed MIT. It adds 31 tokens to every session and 893 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.