convex-best-practices

Enforce Convex coding standards with @convex-dev/eslint-plugin.

1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/aarsh21/better-issues --skill convex-best-practices-aarsh21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-best-practices
Source: https://github.com/aarsh21/better-issues/tree/main/.agents/skills/convex-best-practices
Command: npx skills add https://github.com/aarsh21/better-issues --skill convex-best-practices-aarsh21

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide to building robust, scalable, and maintainable applications using the Convex framework, addressing common pitfalls and promoting best practices.

Core Features & Use Cases

  • Code Quality Enforcement: Integrates with ESLint to ensure adherence to Convex-specific coding standards.
  • Architectural Guidance: Offers patterns for function organization, query optimization, and data validation.
  • Error Handling & Concurrency: Details strategies for robust error management and 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 patterns for creating new data mutations and queries, ensuring consistency and reducing bugs.

Quick Start

Follow the Convex best practices outlined in this skill to organize your Convex functions by domain.

Frequently Asked Questions about convex-best-practices

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

FAQPage Schema
How do I structure Convex functions for production backend development?

Organize Convex functions by domain to build production-ready backend applications. This approach ensures architectural consistency, maintainability, and scalable query patterns for your database operations.

Why should I use withIndex instead of filter for Convex database queries?

Using filter instead of withIndex in Convex database queries is a common pitfall that causes performance issues. You should use withIndex to ensure efficient querying and avoid scanning entire database tables.

How do I handle validation and error handling in Convex mutations?

Implement robust argument and return validation in Convex mutations using schema definitions and TypeScript. This strategy ensures data integrity and provides effective error handling for backend functions.

What is the best way to prevent write conflicts in Convex backend applications?

To prevent write conflicts and concurrency issues in Convex, implement idempotent mutations. This prevents duplicate data creation and ensures reliable error management during concurrent database operations.

Does Convex work with ESLint for enforcing backend code quality?

Yes, Convex integrates with ESLint using the @convex-dev/eslint-plugin to enforce code quality. This ensures adherence to TypeScript coding standards and helps avoid common architectural pitfalls.

When do I need to define a schema in my Convex application?

Define a schema in your Convex application when you need to enforce argument and return validation for database operations. Schema definitions provide type safety and prevent data validation errors.