| name | convex-review |
| description | 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. |
Convex Code Review
Security Checklist
1. Argument AND Return Validators
Search: query({, mutation({, action({ - check each has args: AND returns:
2. Error Handling
Search: throw new Error should be throw new ConvexError
3. Access Control
Search: ctx.auth.getUserIdentity should appear in most public functions
4. Internal Functions
Search: api. in convex directory - should not be used for scheduling/running
5. Table Names in DB Calls
Search: db.get(, db.patch( - first arg should be quoted string
Performance Checklist
6. Database Queries
Search: \.filter\(\(?q, \.collect\(
7. Indexes
Review: schema.ts index definitions
8. Date.now() in Queries
9. Promise Handling
ESLint: no-floating-promises
Architecture Checklist
10. Action Usage
11. Code Organization
12. Transaction Consistency
Quick Regex Searches
| 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.* |
Production Readiness
- Security: Validators + ConvexError + Auth checks + Internal functions
- Performance: Indexes + Bounded queries + No Date.now()
- Architecture: Helper functions + Proper action usage + "use node"
- Code Quality: Awaited promises + Table names + Return validators