convex-functions

Implement Convex queries, mutations, actions, and HTTP actions with validation.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/wixels/sab-colour-profile --skill convex-functions-wixels
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-functions
Source: https://github.com/wixels/sab-colour-profile/tree/main/.agents/skills/convex-functions
Command: npx skills add https://github.com/wixels/sab-colour-profile --skill convex-functions-wixels

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common pain point of developers writing Convex backend functions that are inefficient, insecure, or non-compliant with platform best practices, leading to bugs, performance issues, and security vulnerabilities in full-stack applications.

Core Features & Use Cases

  • Full function type coverage: Provides clear guidance and examples for Convex queries, mutations, actions, HTTP actions, internal functions, and scheduled functions, with explicit use cases for each type.
  • Production-ready patterns: Includes mandatory argument validation, proper error handling with ConvexError, secure internal function access, and correct database access patterns to avoid common pitfalls.
  • Real-world code examples: Offers complete, working samples for common workflows like user data fetching, task management, external payment processing, webhook handling, and scheduled notifications. Use case example: For a task management app, use this Skill to implement reactive cached queries for user task lists, transactional mutations for creating and deleting tasks, and actions for integrating with external payment APIs.

Quick Start

Use the convex-functions skill to write a validated Convex mutation that creates a new task for a user with proper error handling for missing users.

Frequently Asked Questions about convex-functions

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

FAQPage Schema
How do I write a Convex mutation with argument validation and error handling in TypeScript?

To write a Convex mutation with validation, define argument validators on your TypeScript mutation function and throw ConvexError for invalid inputs or missing database records. This ensures transactional database writes fail safely without silent data corruption.

What is the difference between Convex queries, mutations, and actions?

Convex queries provide reactive read-only data access, mutations execute transactional database writes, and actions handle external API integrations and side effects. Using the correct function type ensures your full-stack application follows platform best practices for data access.

How do I set up HTTP actions and webhooks in a Convex backend?

Set up Convex HTTP actions by defining HTTP route handlers in your backend to process incoming webhook requests. This enables external API integrations, allowing your full-stack application to securely receive and process external event payloads.

Can I use Convex scheduled functions for delayed background task execution?

Yes, you can use Convex scheduled functions to execute delayed background tasks. This feature enables workflows like scheduled notifications and timed background processing while maintaining compliance with Convex platform best practices.

How do I secure internal Convex functions to prevent unauthorized access?

Secure internal Convex functions by restricting their access so they can only be called by other backend functions, not directly from the client. This prevents unauthorized access and ensures your reactive queries and mutations remain secure.

What are common pitfalls when implementing Convex database access patterns?

Common pitfalls when implementing Convex database access include skipping argument validation, improper error handling, and insecure internal function exposure. Following production-ready patterns with correct queries and mutations prevents these performance and security issues.