schema-builder
Originally fromget-convex/convex-agent-plugins
Installation
Summary
Design and generate Convex database schemas with proper validation, indexes, and relationships.
- Provides schema templates and patterns for one-to-many, many-to-many, and hierarchical relationships using ID references instead of nesting
- Includes validator reference for all Convex types (
v.string(),v.id(),v.union(), etc.) and guidance on when to use arrays versus relational structures - Covers index strategy with single-field and compound index examples for common query patterns
- Offers migration patterns for converting nested data structures to flat, relational designs following Convex best practices
SKILL.md
Convex Schema Builder
Build well-structured Convex schemas following best practices for relationships, indexes, and validators.
When to Use
- Creating a new
convex/schema.tsfile - Adding tables to existing schema
- Designing data model relationships
- Adding or optimizing indexes
- Converting nested data to relational structure
Schema Design Principles
- Document-Relational: Use flat documents with ID references, not deep nesting
- Index Foreign Keys: Always index fields used in lookups (userId, teamId, etc.)
- Limit Arrays: Only use arrays for small, bounded collections (<8192 items)
- Type Safety: Use strict validators with
v.*types
Related skills
More from get-convex/agent-skills
convex-quickstart
Creates or adds Convex to an app. Use for new Convex projects, npm create
45.0Kconvex-performance-audit
Audits Convex performance for reads, subscriptions, write contention, and
44.5Kconvex-setup-auth
Sets up Convex auth, identity mapping, and access control. Use for login, auth
44.4Kconvex-migration-helper
Plans Convex schema and data migrations with widen-migrate-narrow and
44.3Kconvex-create-component
Builds reusable Convex components with isolated tables and app-facing APIs.
44.3Kconvex
Routes general Convex requests to the right project skill. Use when the user
20.9K