convex-schema-validator

Design and validate Convex database schemas with type-safe fields and indexes.

Updated May 4, 2024
One-click install
npx skills add https://github.com/kcrlee/dots --skill convex-schema-validator-kcrlee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-schema-validator
Source: https://github.com/kcrlee/dots/tree/main/claude/.claude/skills/convex-schema-validator
Command: npx skills add https://github.com/kcrlee/dots --skill convex-schema-validator-kcrlee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design Convex database schemas that stay type-safe, queryable, and migration-friendly as your app evolves.

Core Features & Use Cases

  • Schema Definition: Model tables with explicit field validators for strings, numbers, booleans, IDs, arrays, objects, records, and unions.
  • Index Planning: Add single-field, compound, and search indexes that match your query patterns and naming conventions.
  • Safe Schema Changes: Handle optional fields, nullable values, backfills, and phased migrations without breaking existing data.
  • Use Case: Use this Skill when you are adding a new Convex table, changing an existing column, or preparing a production-safe migration strategy.

Quick Start

Ask the AI to review or generate a Convex schema for your app and include the right validators, indexes, and migration steps.

Frequently Asked Questions about convex-schema-validator

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

FAQPage Schema
How do I create a type-safe Convex database schema with nested objects and unions?

To create a type-safe Convex database schema, model tables with explicit field validators for strings, numbers, booleans, IDs, arrays, objects, records, and unions. This ensures your application data structures remain queryable and consistently validated.

What's the best way to add search indexes to a Convex schema?

The best way to add search indexes to a Convex schema is to plan single-field, compound, and search indexes that match your specific query patterns. Use descriptive index names to maintain clarity as your application evolves.

How do I handle optional fields and backfills during a Convex schema migration?

To handle optional fields and backfills during a Convex schema migration, use staged migration strategies that preserve existing data. This approach tightens validation safely without breaking production records while columns are updated.

When do I need explicit field validators in my Convex tables?

You need explicit field validators in Convex tables when modeling application data structures that contain optional fields, unions, records, or nested objects. Explicit schemas ensure data remains consistent and type-safe during queries.

Can I update an existing column in a Convex table without breaking data?

Yes, you can update an existing column in a Convex table without breaking data by implementing phased migrations. This involves backfilling existing records and tightening validation gradually to preserve production data integrity.