convex-best-practices

Enforce Convex code quality with the @convex-dev/eslint-plugin.

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/mikeyfennelly1/hackeurope--210226 --skill convex-best-practices-mikeyfennelly1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-best-practices
Source: https://github.com/mikeyfennelly1/hackeurope--210226/tree/main/.agents/skills/convex-best-practices
Command: npx skills add https://github.com/mikeyfennelly1/hackeurope--210226 --skill convex-best-practices-mikeyfennelly1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides essential guidelines and patterns for developing robust, scalable, and maintainable applications on the Convex framework, ensuring code quality and efficient development.

Core Features & Use Cases

  • Code Quality Enforcement: Integrates with @convex-dev/eslint-plugin for build-time validation of function syntax, argument validation, table IDs, and runtime imports.
  • Best Practice Implementation: Details on function organization, argument/return validation, efficient query patterns using indexes, effective error handling with ConvexError, and strategies for avoiding write conflicts.
  • Use Case: A new developer joining a Convex project can use this Skill to quickly understand and implement the team's established best practices, ensuring consistency and reducing the learning curve.

Quick Start

Follow the provided instructions to set up the Convex ESLint plugin for your project.

Frequently Asked Questions about convex-best-practices

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

FAQPage Schema
What are the best practices for organizing Convex functions in a production app?

Organizing Convex functions involves separating internal logic from public endpoints, standardizing CRUD patterns, and enforcing argument validation. Using the `@convex-dev/eslint-plugin` ensures this structure maintains code quality and prevents common architectural pitfalls.

How do I handle errors and validation in Convex functions?

Error handling and validation in Convex functions require defining strict argument and return types using TypeScript. You should throw `ConvexError` for expected runtime failures, while the Convex ESLint plugin automatically validates function syntax and table IDs during build time.

How can I avoid write conflicts and optimize query patterns in Convex?

To avoid write conflicts and optimize Convex queries, you should implement efficient query patterns using database indexes. Following the "Zen of Convex" design philosophy helps structure data access correctly to minimize transactional collisions and maximize throughput.

Does Convex work well with TypeScript for database schema validation?

Convex works seamlessly with TypeScript for database schema validation by enforcing end-to-end type safety. The framework automatically infers types from your schema, and the `@convex-dev/eslint-plugin` validates table IDs and runtime imports at build time.

What is the difference between internal and public functions in Convex?

Internal Convex functions are hidden helper modules used for shared backend logic, while public functions are exposed endpoints callable by the client. Separating them ensures secure, production-ready applications by strictly controlling API surface access.

Why should I use the Convex ESLint plugin in my project?

Using the `@convex-dev/eslint-plugin` in your Convex project enforces code quality by automatically catching function syntax errors, missing argument validations, invalid table IDs, and unsafe runtime imports during development before they reach production.