Provides comprehensive guidance for Convex backend development including database operations, queries, mutations, actions, schemas, authentication, file storage, real-time subscriptions, scheduling, HTTP APIs, search, AI agents, and deployment. MUST activate when user asks about: backend data operations, Convex functions, database queries, schemas, real-time data, auth setup, file uploads, scheduled jobs, HTTP endpoints, or any Convex-specific implementation questions. DO NOT activate for frontend UI/styling or general React component questions unrelated to Convex.
Before proceeding with ANY Convex-related implementation:
MANDATORY activation for:
DO NOT use for:
All Convex documentation is located in: .claude/skills/convex/docs
Key documentation areas:
docs/database/ - Reading, writing, schemas, types, paginationdocs/functions.mdx - Queries, mutations, actionsdocs/auth/ - Authentication patterns and providersdocs/file-storage/ - Upload and manage filesdocs/scheduling/ - Cron jobs and scheduled functionsdocs/http-api/ - External HTTP endpointsdocs/search/ - Full-text search implementationdocs/agents.mdx, docs/ai.mdx - AI integrationdocs/components/ - Reusable Convex componentsdocs/production/ - Deployment, hosting, integrationsdocs/testing/ - Test patterns for Convex functionsdocs/cli.md - Command-line interfaceuseQuery hook for reactive datauseMutationdefineSchemav validatorsexport const listItems = query({
args: { limit: v.optional(v.number()) },
handler: async (ctx, args) => {
return await ctx.db.query("items")
.withIndex("by_creation_time")
.order("desc")
.take(args.limit ?? 10);
},
});
export const createItem = mutation({
args: { name: v.string(), description: v.string() },
handler: async (ctx, args) => {
const identity = await ctx.auth.getUserIdentity();
if (!identity) throw new Error("Unauthenticated");
return await ctx.db.insert("items", {
name: args.name,
description: args.description,
userId: identity.subject,
createdAt: Date.now(),
});
},
});
export const sendEmail = action({
args: { to: v.string(), subject: v.string(), body: v.string() },
handler: async (ctx, args) => {
// Call external API
await fetch("https://api.email-service.com/send", {
method: "POST",
body: JSON.stringify(args),
});
},
});
Only read documentation files when necessary:
Never read entire documentation at once. Use targeted searches.
Generate code that:
query, mutation, action)v validatorsStandard Convex project structure:
convex/schema.ts - Database schema definitionsconvex/*.ts - Function definitions (queries, mutations, actions)convex/_generated/api.d.ts - Generated API typesconvex.json - Configuration file.env.local - Environment variables (CONVEX_URL, etc.)Check docs/database/schemas.mdx for schema patterns and validation.
Check docs/auth/ for authentication provider integration.
Check docs/file-storage/ for file storage patterns.
Check docs/search/ for full-text search implementation.
Check docs/scheduling/ for cron and scheduled function patterns.
Check docs/http-api/ for external API endpoint creation.
Check docs/testing/ for test patterns and setup.
v validatorsctx.db for database operations, not direct database accessctx.auth for authentication, not manual token parsingCategory:other