convex-schema-validator

Designs and validates Convex database schemas with typed tables and indexes.

1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/cgRGM/rivercitymd --skill convex-schema-validator-cgrgm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-schema-validator
Source: https://github.com/cgRGM/rivercitymd/tree/main/.cursor/skills/convex-schema-validator
Command: npx skills add https://github.com/cgRGM/rivercitymd --skill convex-schema-validator-cgrgm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design Convex database schemas that are type-safe, explicit, and ready for real application queries, reducing schema mistakes that can break development or migration work.

Core Features & Use Cases

  • Schema Definition: Define tables with required, optional, nullable, union, array, object, and reference fields using Convex validators.
  • Index Planning: Configure single-field, compound, and search indexes that match your query patterns and sorting needs.
  • Migration Guidance: Plan safe schema changes by introducing optional fields first, backfilling data, and then tightening requirements.
  • Use Cases: Model users, appointments, invoices, reviews, and other business records for production Convex apps with clear validation rules.

Quick Start

Use this skill to review your Convex schema design and produce a validated table structure with the right fields, 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 define optional fields and union types in a Convex schema?

Convex schema validation allows you to define optional, nullable, and union fields using built-in validators. You structure table definitions explicitly to ensure type safety for application queries.

What is the best way to plan indexes for a Convex database?

Planning indexes in Convex involves configuring single-field, compound, and search indexes that match your query patterns. Explicit index configuration ensures sorting and filtering operations run efficiently.

How do I safely migrate existing data when changing a Convex schema?

Safe schema migration in Convex requires introducing optional fields first, backfilling existing data, and then tightening requirements. This workflow prevents breaking development or migration operations.

Can I use search indexes and compound indexes together in Convex?

Convex schemas support both search and compound indexes within the same table definition. You configure descriptive indexes based on specific query patterns and sorting needs for production records.

Why does adding a required field break my Convex database migration?

Adding required fields without backfilling breaks Convex migrations because existing records lack the new data. You must introduce optional fields first, backfill the data, then tighten validation rules.