skills/convex-review/SKILL.md
Comprehensive Convex code review checklist for production readiness. Use when auditing a Convex codebase before deployment, reviewing pull requests, or checking for security and performance issues in Convex functions.
npx skillsauth add aaronvanston/skills-convex convex-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
query, mutation, action have args validatorsreturns validatorsv.any() for sensitive dataSearch: query({, mutation({, action({ - check each has args: AND returns:
ConvexError for user-facing errors (not plain Error){ code: "NOT_FOUND", message: "..." }Search: throw new Error should be throw new ConvexError
ctx.auth.getUserIdentity() where neededrequireAuth, requireRole)Search: ctx.auth.getUserIdentity should appear in most public functions
ctx.runQuery, ctx.runMutation, ctx.runAction use internal.* not api.*ctx.scheduler.runAfter uses internal.* not api.*crons.ts use internal.* not api.*Search: api. in convex directory - should not be used for scheduling/running
ctx.db.get, patch, replace, delete include table name as first argSearch: db.get(, db.patch( - first arg should be quoted string
.filter() on queries (use .withIndex() or filter in code).collect() only with bounded results (<1000 docs)Search: \.filter\(\(?q, \.collect\(
by_foo + by_foo_and_bar).withIndex()Review: schema.ts index definitions
Date.now() in query functionsctx.scheduler, ctx.db.*)ESLint: no-floating-promises
"use node"; if using Node.js APIsctx.runAction only when switching runtimesctx.runMutation/ctx.runQuery (combine for consistency)convex/model/)convex/lib/auth.ts| Issue | Regex | Fix |
|-------|-------|-----|
| .filter() | \.filter\(\(?q | Use .withIndex() |
| Missing returns | handler:.*async without returns: | Add returns: |
| Plain Error | throw new Error\( | Use ConvexError |
| Missing table name | db\.(get\|patch)\([^"'] | Add table name |
| Date.now() in query | Date\.now\(\) | Remove from queries |
| api.* scheduling | api\.[a-z] | Use internal.* |
tools
Security best practices for Convex functions including ConvexError handling, argument/return validation, authentication helpers, access control, rate limiting, and internal functions. Use when writing public queries/mutations/actions, implementing authentication, adding authorization checks, handling errors, or reviewing Convex functions for security.
data-ai
Realtime subscriptions and optimistic updates in Convex. Use when implementing live data updates, optimistic UI, pagination with realtime, presence indicators, typing indicators, or any feature requiring instant data synchronization.
data-ai
Best practices for Convex database queries, indexes, and filtering. Use when writing or reviewing database queries in Convex, working with `.filter()`, `.collect()`, `.withIndex()`, defining indexes in schema.ts, or optimizing query performance.
tools
Code organization patterns and TypeScript best practices for Convex. Use when structuring a Convex project, writing helper functions, defining schemas, working with types like QueryCtx/MutationCtx/ActionCtx, or organizing code in a convex/model directory.