convex-schema-validator

Define and validate Convex database schemas with TypeScript.

Updated Aug 30, 2025
One-click install
npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-schema-validator-kristofferaas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-schema-validator
Source: https://github.com/kristofferaas/deep-stortinget/tree/main/.agents/skills/convex-schema-validator
Command: npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-schema-validator-kristofferaas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of defining robust, type-safe database schemas in Convex, ensuring data integrity and simplifying schema evolution.

Core Features & Use Cases

  • Schema Definition: Define tables with precise data types, optional fields, unions, and nested objects.
  • Index Configuration: Create single, compound, and search indexes for efficient querying.
  • Migration Strategies: Provides guidance on safely adding fields and backfilling data.
  • Use Case: Ensure all user records have a unique email and an optional avatar URL, and that order items have a defined product ID and quantity.

Quick Start

Define a new schema for users with name and email fields in your convex/schema.ts file.

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 Convex database schema in TypeScript?

To define a Convex database schema in TypeScript, you use a validator to construct tables with precise data types, optional fields, discriminated unions, and nested objects directly in your schema file.

Can I create compound indexes and full-text search indexes in Convex?

Yes, you can configure single, compound, and full-text search indexes in Convex. This Skill supports index configuration to ensure efficient querying across your defined database tables.

What is the best way to handle schema migration when adding fields to a Convex database?

The best way to handle schema migration in Convex is to follow provided best practices for safely adding fields and backfilling data, which ensures data integrity during schema evolution.

Does Convex support discriminated unions and nullable values in table schemas?

Yes, Convex supports discriminated unions, typed fields, optional values, and nullable values within table schemas, enabling robust and type-safe data validation for complex records.

How do I validate that user records have a unique email and optional avatar URL in Convex?

You validate user records by defining a schema in Convex that specifies required fields like a unique email and an optional avatar URL, ensuring data integrity through type-safe validation.