convex-best-practices
Production-ready Convex patterns for function organization, validation, query optimization, TypeScript safety, and error handling.
- Covers five core areas: function organization by domain, argument and return type validation, indexed query patterns, ConvexError handling, and write conflict avoidance through idempotent mutations
- Enforces code quality via
@convex-dev/eslint-pluginwith four rules covering function syntax, validators, table IDs, and runtime imports - Includes complete CRUD examples, internal vs. public function patterns, and TypeScript best practices using
IdandDoctypes - Emphasizes the "Zen of Convex" philosophy: let Convex manage caching and real-time sync, design functions as your API, and think in reactive subscriptions rather than requests
Convex Best Practices
Build production-ready Convex applications by following established patterns for function organization, query optimization, validation, TypeScript usage, and error handling.
Code Quality
All patterns in this skill comply with @convex-dev/eslint-plugin. Install it for build-time validation:
npm i @convex-dev/eslint-plugin --save-dev
// eslint.config.js
import { defineConfig } from "eslint/config";
import convexPlugin from "@convex-dev/eslint-plugin";
More from waynesutton/convexskills
convex
Umbrella skill for all Convex development patterns. Routes to specific skills like convex-functions, convex-realtime, convex-agents, etc.
5.5Kconvex-functions
Writing queries, mutations, actions, and HTTP actions with proper argument validation, error handling, internal functions, and runtime considerations
2.4Kconvex-schema-validator
Defining and validating database schemas with proper typing, index configuration, optional fields, unions, and migration strategies for schema changes
2.2Kconvex-realtime
Patterns for building reactive apps including subscription management, optimistic updates, cache behavior, and paginated queries with cursor-based loading
2.1Kconvex-cron-jobs
Scheduled function patterns for background tasks including interval scheduling, cron expressions, job monitoring, retry strategies, and best practices for long-running tasks
2.0Kconvex-http-actions
External API integration and webhook handling including HTTP endpoint routing, request/response handling, authentication, CORS configuration, and webhook signature validation
2.0K