convex-schema-validator

Define and validate Convex database schemas with typed validators.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/wixels/sab-colour-profile --skill convex-schema-validator-wixels
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-schema-validator
Source: https://github.com/wixels/sab-colour-profile/tree/main/.agents/skills/convex-schema-validator
Command: npx skills add https://github.com/wixels/sab-colour-profile --skill convex-schema-validator-wixels

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building Convex applications often leads to runtime database errors, slow queries, and data inconsistencies when schemas are incorrectly defined, indexes are missing, or schema changes are applied without proper migration strategies. This Skill eliminates those issues by providing clear, typed guidance for defining and validating Convex database schemas.

Core Features & Use Cases

  • Typed Schema Definition: Use Convex validators to define tables with proper types for strings, numbers, booleans, unions, nested objects, and arrays to enforce data integrity at the database level.
  • Index Configuration: Set up single-field, compound, and full-text search indexes aligned with your query patterns to ensure fast, reliable database queries.
  • Safe Schema Migrations: Evolve your schema over time by adding optional fields first, backfilling data, and converting fields to required without breaking existing application functionality.
  • Use Case: For example, when building a Convex e-commerce backend, use this Skill to define a products table with indexed category and inventory fields, set up a discriminated union for order statuses, and safely add a new optional discount field to the schema without disrupting existing orders.

Quick Start

Use the convex-schema-validator skill to define a typed users table with optional avatar fields and an indexed email field for my Convex backend.

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 a typed schema in Convex to prevent runtime database errors?

To define a typed Convex schema and prevent database errors, use Convex validators for strings, numbers, booleans, arrays, and nested objects. This enforces data integrity directly at the database level, catching invalid data before it causes runtime failures.

What is the best way to configure indexes in a Convex database schema?

Configuring Convex schema indexes involves setting up single-field, compound, and full-text search indexes that align with your specific query patterns. Proper index configuration ensures fast, reliable database queries and optimized query performance across your application.

Can I use discriminated unions and nested objects in Convex schema validators?

Yes, Convex schema validators fully support complex types including discriminated unions and nested objects. You can define tables with these complex types to accurately model structured data, such as representing various order statuses in an e-commerce backend.

How do I safely migrate a Convex schema without losing data?

Safely migrating a Convex schema without data loss requires a backward-compatible strategy: add optional fields first, backfill existing records with the new data, and finally convert the fields to required once all data is updated.

Why does adding a required field to my Convex schema break my existing application?

Adding a required field to a Convex schema breaks applications because existing documents lack the new field, violating data integrity. You must first introduce it as an optional field, backfill the data, and then enforce it as required.