schema-builder

Create Convex schemas with validators, indexes, and foreign keys.

7|1|Updated Nov 6, 2025
One-click install
npx skills add https://github.com/robertguss/web-app-starter-kit --skill schema-builder-robertguss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-builder
Source: https://github.com/robertguss/web-app-starter-kit/tree/main/.claude/skills/schema-builder
Command: npx skills add https://github.com/robertguss/web-app-starter-kit --skill schema-builder-robertguss

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design Convex schemas with proper validation, indexes, and relationships to enforce data integrity and scalable queries.

Core Features & Use Cases

  • Define schemas using defineSchema and defineTable to model entities with type-safe validators.
  • Create and enforce indexes for common query patterns and implement foreign-key relationships with id references.
  • Convert nested data structures into relational tables when migrating from denormalized models.

Quick Start

Create a new convex/schema.ts with a basic users table and a related posts table.

Frequently Asked Questions about schema-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define a Convex schema with proper validation and relationships?

Migrate denormalized data into relational tables by converting nested data structures into separate Convex tables, defining explicit foreign keys for relationships, and applying type-safe validators to enforce data integrity during the transition.

When do I need to add indexes to a Convex database schema?

You need to add indexes to a Convex database schema when you want to enforce predictable performance for common query patterns, ensuring efficient data retrieval and scalable queries across your relational tables.

How do I convert nested data structures into relational tables in Convex?

Convert nested data structures into relational tables by breaking them down into separate Convex tables, defining explicit foreign keys to maintain relationships, and using type-safe validators to enforce data integrity across the new schema.

Does this approach work for extending an existing convex/schema.ts file?

Yes, this approach works for extending an existing convex/schema.ts by allowing you to refine relationships, add new tables with type-safe validators, and implement additional index definitions to support evolving query patterns.

What is the best way to enforce data integrity in a Convex schema?

The best way to enforce data integrity in a Convex schema is by using type-safe validators with defineTable, establishing explicit foreign keys for relationships, and creating proper index definitions to support robust and predictable queries.