| name | convex-core |
| description | Build Convex schemas, queries, mutations, actions, and client usage with strict validators and indexes.
Use for data modeling, function authoring, argument/return validation, and performance guidance.
Use proactively when work touches convex/schema.ts, functions, or api.* references.
Examples:
- user: "Design tables for multi-tenant app" → defineSchema/defineTable with indexes
- user: "Write a mutation" → args/returns validators + auth checks
- user: "Optimize query" → add index and withIndex range expression
- user: "Use useQuery" → show generated hook usage |
Core Convex modeling and function authoring patterns. This skill is the default baseline for Convex work.
- **Schemas**: https://docs.convex.dev/database/schemas
- **Reading data + indexes**: https://docs.convex.dev/database/reading-data/indexes
- **Validation**: https://docs.convex.dev/functions/validation
- **Functions**: https://docs.convex.dev/functions
- **Pagination**: https://docs.convex.dev/database/pagination
- **System tables**: https://docs.convex.dev/database/advanced/system-tables
- Schema: `defineSchema`/`defineTable` in `convex/schema.ts`; use `v` validators.
- Options: `schemaValidation: false` disables runtime validation; `strictTableNameTypes: false` allows undeclared tables in TS types.
- Validation: `args`/`returns` validators for queries/mutations/actions; objects reject extra props; `undefined` is invalid (use `null`).
- Discriminated Unions: Use `v.union` and `v.literal` with `as const` for type-safe state/kind definitions.
- Types: Use `v.int64()` for 64-bit integers (not `v.bigint()`); `v.null()` for explicit null returns.
- IDs: Use `Id<"table">` and `v.id("table")` instead of raw strings.
- Records: `v.record(keys, values)` keys MUST be ASCII, non-empty, and NOT start with `_` or `$`.
- Validator composition: `Infer`, `.pick`, `.omit`, `.extend`, `.partial` on object validators.
Schema Rules
- You MUST define all tables in
convex/schema.ts with defineSchema / defineTable.
- System Fields:
_id (v.id(tableName)) and _creationTime () are added automatically.