Skip to content
Back to skills

Convex

ASecurity

Assists with building real-time reactive backends using Convex. Use when creating databases with automatic client sync, reactive queries, file storage, scheduled functions, or full-text and vector search. Trigger words: convex, reactive backend, real-time database, useQuery, useMutation, convex functions, convex schema.

  • 142 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 27, 2026
databasestypescriptgoreactnextjsapidatabasebackend

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 27, 2026

npx -y skills add TerminalSkills/skills --skill convex --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Convex?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Convex
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/terminalskills-convex/badge)](https://www.skillsdirectory.com/skills/terminalskills-convex)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: convex
description: >-
  Assists with building real-time reactive backends using Convex. Use when creating databases
  with automatic client sync, reactive queries, file storage, scheduled functions, or full-text
  and vector search. Trigger words: convex, reactive backend, real-time database, useQuery,
  useMutation, convex functions, convex schema.
license: Apache-2.0
compatibility: "Works with React, Next.js, Remix, React Native"
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: data-ai
  tags: ["convex", "real-time", "reactive", "backend", "database"]
---

# Convex

## Overview

Convex is a reactive backend platform where database queries, mutations, and actions are defined in TypeScript and data automatically syncs to connected clients in real-time. It eliminates WebSocket code, polling, and cache invalidation, providing ACID transactions and optimistic updates out of the box.

## Instructions

- When defining schemas, use `defineSchema()` with `defineTable()` and typed validators (`v.string()`, `v.number()`, `v.id("tableName")`), and define indexes for all filtered and sorted queries.
- When writing functions, use queries for reads (automatically reactive), mutations for writes (transactional, triggers reactive updates), and actions for external API calls (non-transactional).
- When building React UIs, use `useQuery()` for reactive data subscriptions that auto-update, `useMutation()` for writes with optimistic updates, and `usePaginatedQuery()` for infinite scroll.
- When handling authentication, use `convex-auth` for built-in auth or integrate Clerk/Auth0, and validate user identity at the start of every mutation with `ctx.auth.getUserIdentity()`.
- When processing background work, use `ctx.scheduler.runAfter()` for delayed execution and cron jobs for recurring tasks instead of making mutations slow.
- When storing files, use `ctx.storage.store()` for upload and `ctx.storage.getUrl()` for serving URLs without S3 or CDN configuration.
- When implementing search, use full-text search indexes with `searchIndex()` or vector search with `vectorIndex()` for AI/RAG applications, with metadata filtering.

## Examples

### Example 1: Build a real-time chat application

**User request:** "Create a real-time chat app with Convex and React"

**Actions:**
1. Define `messages` table with schema, author reference, and timestamp index
2. Create a query function that returns messages sorted by timestamp
3. Create a mutation for sending messages with auth validation
4. Use `useQuery()` in React to subscribe to messages with automatic real-time updates

**Output:** A chat application where messages appear instantly for all connected users without WebSocket code.

### Example 2: Add full-text and vector search

**User request:** "Implement search across articles with both keyword and semantic search"

**Actions:**
1. Define search index on article body field with `searchIndex()`
2. Define vector index on embedding field with `vectorIndex()`
3. Create query functions for text search and vector similarity search
4. Combine metadata filtering with search for scoped results

**Output:** A dual search system supporting both keyword matching and semantic similarity queries.

## Guidelines

- Use schema validation in production: `defineSchema()` catches type errors at deploy time, not runtime.
- Define indexes for all filtered/sorted queries to ensure efficient data access.
- Use queries for reads, mutations for writes, actions for external APIs; never mix concerns.
- Keep mutations small and fast since they hold a database lock; move heavy processing to actions.
- Use `ctx.scheduler.runAfter()` for background work instead of making mutations slow.
- Validate user identity at the start of every mutation to prevent unauthorized writes.
- Use optimistic updates for interactive UIs; the client sees the change instantly while the server confirms.

Files in this skill

  • SKILL.md3.8 KB
  • _scores.json1.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.