
Convex Core
- 76 installs
- 125 repo stars
- Updated February 4, 2026
- igorwarzocha/opencode-workflows
Build Convex schemas, queries, mutations, and actions with strict validators and indexes, and use the generated client hooks.
About
The baseline skill for Convex data modeling and function authoring. A developer uses it to design tables with indexes, write validated functions, optimize queries with withIndex, and use useQuery hooks.
- defineSchema/defineTable, v validators, discriminated unions, and Id types
- Index-backed reads via withIndex range expressions; pagination and system tables
Convex Core by the numbers
- 76 all-time installs (skills.sh)
- +3 installs in the week ending Aug 2, 2026 (Skillselion tracking)
- Ranked #3,062 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/igorwarzocha/opencode-workflows --skill convex-coreAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 76 |
|---|---|
| repo stars | ★ 125 |
| Last updated | February 4, 2026 |
| Repository | igorwarzocha/opencode-workflows ↗ |
What it does
Build Convex schemas, queries, mutations, and actions with strict validators and indexes, and use the generated client hooks.
Files
<overview> Core Convex modeling and function authoring patterns. This skill is the default baseline for Convex work. </overview>
<reference>
- 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
</reference>
<context name="Core Concepts">
- Schema:
defineSchema/defineTableinconvex/schema.ts; usevvalidators. - Options:
schemaValidation: falsedisables runtime validation;strictTableNameTypes: falseallows undeclared tables in TS types. - Validation:
args/returnsvalidators for queries/mutations/actions; objects reject extra props;undefinedis invalid (usenull). - Discriminated Unions: Use
v.unionandv.literalwithas constfor type-safe state/kind definitions. - Types: Use
v.int64()for 64-bit integers (notv.bigint());v.null()for explicit null returns. - IDs: Use
Id<"table">andv.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,.partialon object validators.
</context>
<rules>
Schema Rules
- You MUST define all tables in
convex/schema.tswithdefineSchema/defineTable. - System Fields:
_id(v.id(tableName)) and_creationTime(v.number()) are added automatically. - You MUST use
v.*validators for every field; SHOULD avoidv.any()unless necessary. - Index naming: include all fields in the name, e.g.,
"by_field1_and_field2".
</rules>
- Index rules:
- You MUST use
.index(name, [fields...]). - Field order matters; range expressions MUST follow index order.
- Limits: 16 fields per index, 32 indexes per table.
Function Rules
- You MUST use new function syntax with
args,returns, andhandler. - You MUST always validate
argsandreturns(HTTP actions excluded). - Use
queryfor reads,mutationfor writes, andactionfor external/long-running. - Actions MUST NOT access
ctx.db; You MUST usectx.runQuery/ctx.runMutation. - Circular Dependencies: When calling a function in the same file via
ctx.run*, You MUST add explicit return type annotations to the receiver variable.
Database Operations
- You MUST provide the explicit table name as the first argument to
ctx.db.get,ctx.db.patch,ctx.db.replace, andctx.db.delete. - Replacement: Use
ctx.db.replacefor full document replacement (throws if missing). - Patching: Use
ctx.db.patchfor shallow merge updates (throws if missing). - Deletion: Convex queries do NOT support
.delete(). You MUST.collect()results and iterate to callctx.db.delete(id). - Unique: Use
.unique()for single document results; it MUST throw if multiple documents match. - You MUST NOT use
filterin production queries; use indexes and.withIndex.
TypeScript Best Practices
- You MUST use
as constfor string literals in discriminated unions. - You MUST define arrays as
const array: Array<T> = [...]and records asconst record: Record<K, V> = {...}. - You MUST prefer
Id<"table">overstringfor all document identifiers.
Query Performance
- You SHOULD prefer
.withIndexover.filteron large tables. - If using
.withIndexwithout a range, You MUST pair it withtake,first,unique, orpaginate. - Search limits:
collect()throws if >1024 docs; You SHOULD usetake(n),paginate(), orfor awaititeration for large sets. - Async iteration: Use
for await (const row of query)instead of.collect()for streaming large result sets.
Pagination
- You MUST use
paginationOptsValidatorin args. .paginate()returns{ page, isDone, continueCursor }.- Pages are reactive; size MAY change.
- You SHOULD avoid strict
returnsvalidators for the full.paginate()result object; validatepageor usev.any().
Client Patterns
- You MUST use
api.*references fromconvex/_generated/api. - React hooks:
useQuery,useMutation,useAction,usePaginatedQuery. - You MUST NOT call mutations or actions during render.
Safety
- You MUST enforce auth per function; check identity via
ctx.authhelpers. - You MUST NOT expose sensitive logic in public functions; MUST use internal ones.
</rules>