convex-schema-validator

Define and validate typed Convex database schemas and migration plans.

1|1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/mauricioacp/tanstack-convex-better-auth-template --skill convex-schema-validator-mauricioacp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-schema-validator
Source: https://github.com/mauricioacp/tanstack-convex-better-auth-template/tree/main/.agents/skills/convex-schema-validator
Command: npx skills add https://github.com/mauricioacp/tanstack-convex-better-auth-template --skill convex-schema-validator-mauricioacp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Define and validate robust Convex database schemas with precise typing, index configuration, and migration planning to prevent drift and runtime errors.

Core Features & Use Cases

  • Type-safe schema definitions using convex/schema and defineTable
  • Support for complex field types including optionals, unions, and nested objects
  • Index configuration guidance and migration strategies for evolving schemas
  • Use case: maintain data integrity across schema changes in Convex-powered apps

Quick Start

Create a basic convex schema using defineSchema and test migrations in a local 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 type-safe schemas in Convex to prevent data drift?

To define type-safe Convex schemas and prevent data drift, use defineSchema and defineTable with explicit TypeScript types, optionals, and unions. This enforces strict data model validation and prevents runtime errors during development.

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

Planning incremental migrations for a Convex database involves defining structured migration plans alongside your schema. This approach validates changes incrementally, ensuring data integrity is maintained across schema updates without breaking existing application logic.

How do I configure indexes in Convex using TypeScript?

Configuring indexes in Convex requires applying robust index configurations within your defineTable definitions. By explicitly typing these structures in TypeScript, you ensure query performance optimization and prevent invalid index definitions.

Can I use complex field types like unions and nested objects in Convex schemas?

Yes, you can use complex field types including optionals, unions, and nested objects in Convex schemas. Defining these explicit types ensures your TypeScript data model accurately represents application data and passes strict validation checks.

Why does my Convex schema validation fail when adding optional fields?

Convex schema validation fails when optional fields lack explicit type definitions or proper migration steps. To fix this, ensure your schema explicitly defines optional fields and includes an incremental migration plan to handle existing data.