convex-schema-validator

Define and validate Convex schemas with defineSchema and defineTable.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/Noisemaker111/be-my-valentine --skill convex-schema-validator-noisemaker111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-schema-validator
Source: https://github.com/Noisemaker111/be-my-valentine/tree/main/.agents/skills/convex-schema-validator
Command: npx skills add https://github.com/Noisemaker111/be-my-valentine --skill convex-schema-validator-noisemaker111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Convex schema definitions often lack a formal, type-safe foundation, leading to runtime errors and migration pitfalls; this Skill provides a structured approach to declare and validate database schemas with strong typing, index configuration, and migration strategies.

Core Features & Use Cases

  • Typed schemas: defineTable and v types to enforce data contracts and prevent runtime mismatches.
  • Index & query planning: guidance for creating robust, performant indexes and discriminated unions.
  • Migration strategies: templates for adding fields, backfilling data, and evolving schemas safely.
  • Use cases: build maintainable data models for Convex-powered apps and ensure schema changes are auditable and safe.

Quick Start

Create a convex/schema.ts using defineSchema and defineTable, then run your first validation pass in a Convex project.

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 and validate Convex schemas using TypeScript?

To define and validate Convex schemas, use defineSchema and defineTable with v types to enforce data contracts, configure indexes, and prevent runtime mismatches in your schema.ts file.

What is the best way to handle schema migrations in Convex?

Handle Convex schema migrations by applying structured strategies for adding fields, backfilling data, and evolving schemas safely to ensure changes remain auditable and prevent migration pitfalls.

How do I configure indexes and optional fields in a Convex schema?

Configure Convex indexes and optional fields within defineTable definitions to support robust query planning and discriminated unions, ensuring performant data access and typed data modeling.

Does this schema validation approach work with discriminated unions in Convex?

Yes, this schema validation supports discriminated unions in Convex by enforcing type-safe structures through v types, ensuring correct typing across optional fields and complex data models.

Why do I need type-safe schema validation for my Convex database?

You need type-safe Convex schema validation because unstructured definitions often cause runtime errors; formal schema enforcement with defineSchema prevents mismatches and ensures safe data model evolution.