convex-best-practices

Provide guidelines for developing Convex applications with ESLint integration.

Updated Aug 30, 2025
One-click install
npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-best-practices-kristofferaas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-best-practices
Source: https://github.com/kristofferaas/deep-stortinget/tree/main/.agents/skills/convex-best-practices
Command: npx skills add https://github.com/kristofferaas/deep-stortinget --skill convex-best-practices-kristofferaas

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 coding standards.
  • Function Organization: Demonstrates domain-specific organization for better code management.
  • Validation & Error Handling: Guides on implementing argument/return validators and using ConvexError for user-facing errors.
  • Optimistic Concurrency Control: Explains patterns to avoid write conflicts.
  • TypeScript Integration: Highlights best practices for type safety.

Quick Start

Follow the instructions in the documentation 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?

Convex functions should be organized by domain to improve code management and maintainability. Domain-specific organization groups related queries and mutations together, making large applications easier to navigate, debug, and scale effectively.

How do I handle user-facing errors in Convex?

User-facing errors in Convex should be handled using the ConvexError class. Throwing ConvexError allows you to return meaningful error messages to the client safely, ensuring robust error handling without exposing internal application logic.

How does optimistic concurrency control work in Convex?

Optimistic concurrency control in Convex prevents write conflicts by checking data consistency at commit time. Implementing specific patterns ensures that concurrent mutations do not overwrite each other, maintaining data integrity in production.

Can I use ESLint to enforce Convex coding standards?

Yes, you can integrate the Convex ESLint plugin to automatically enforce coding standards. This integration ensures adherence to the Zen of Convex design philosophy, catching common pitfalls and promoting high code quality across your project.

Why do I need argument and return validation in Convex?

Argument and return validation in Convex ensures type safety and data integrity at runtime. Using built-in validators guarantees that your queries and mutations receive correctly typed data, preventing unexpected runtime crashes.

What is the best way to structure TypeScript types in a Convex application?

The best way to structure TypeScript types in Convex is to leverage built-in validators for end-to-end type safety. Aligning TypeScript usage with Convex's validation system ensures compile-time checks match your runtime data structures.