
Convex Realtime
Ship reactive Convex-backed UIs with correct subscriptions, optimistic UX, caching, and paginated live queries without fighting stale or flickering data.
Overview
Convex Realtime is an agent skill for the Build phase that teaches subscription management, optimistic updates, cache behavior, and paginated queries for reactive Convex applications.
Install
npx skills add https://github.com/waynesutton/convexskills --skill convex-realtimeWhat is this skill?
- Subscription management patterns for live Convex queries and connection-aware UI states
- Optimistic update flows that reconcile with Convex mutations and rollback safely
- Cache behavior guidance so reactive reads stay consistent across navigations and refetches
- Paginated query patterns for large realtime lists without breaking reactivity
- Convex-specific reactive app structure rather than generic REST polling advice
- Covers four pattern areas: subscription management, optimistic updates, cache behavior, and paginated queries
Adoption & trust: 2.3k installs on skills.sh; 402 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You wired Convex queries and mutations but subscriptions leak, optimistic UI fights the server truth, caches go stale, or paginated lists break live updates.
Who is it for?
Solo builders shipping a SaaS or agent UI on Convex who need repeatable realtime UX patterns during feature implementation.
Skip if: Teams not using Convex, greenfield architecture-only sessions with no reactive client yet, or operators who only need deploy/monitoring runbooks.
When should I use this skill?
Building or refactoring reactive features on Convex that use live queries, optimistic mutations, client cache, or paginated subscription-backed lists.
What do I get? / Deliverables
Your agent applies Convex realtime patterns so subscriptions, optimistic flows, cache rules, and paginated queries stay consistent and production-ready.
- Concrete subscription and teardown patterns for Convex-powered UI
- Optimistic update and reconciliation steps aligned with Convex mutations
- Paginated query approach that preserves reactive updates
Recommended Skills
Journey fit
Convex realtime patterns land in Build because they govern how queries, subscriptions, and client cache behave while you implement product features on Convex. Backend is the canonical shelf: subscription lifecycle, optimistic update semantics, server query pagination, and cache rules are core Convex backend-and-client integration concerns.
How it compares
Convex-focused reactive client patterns—not a generic WebSocket tutorial or an MCP database bridge.
Common Questions / FAQ
Who is convex-realtime for?
Indie and solo developers building on Convex who want agent-guided patterns for live data, optimistic mutations, caching, and paginated reactive lists.
When should I use convex-realtime?
During Build backend work when you add or refactor Convex subscriptions, optimistic UI, client cache strategy, or paginated live queries; also when debugging flicker or stale data before Ship.
Is convex-realtime safe to install?
Treat it like any third-party agent skill: review the Security Audits panel on this Prism page and skim SKILL.md before granting shell or network access in your agent.
SKILL.md
READMESKILL.md - Convex Realtime
interface: icon_small: "./assets/small-logo.svg" icon_large: "./assets/large-logo.png" <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_3_23)"> <g clip-path="url(#clip1_3_23)"> <path d="M10.0643 12.5735C12.3769 12.3166 14.5572 11.0843 15.7577 9.02756C15.1892 14.1148 9.62646 17.3302 5.08583 15.356C4.66743 15.1746 4.30728 14.8728 4.06013 14.4848C3.03973 12.8825 2.7043 10.8437 3.18626 8.99344C4.56327 11.37 7.3632 12.8267 10.0643 12.5735Z" fill="#F3B01C"/> <path d="M3.1018 7.50072C2.16436 9.66714 2.12376 12.2034 3.27303 14.2907C-0.771507 11.2479 -0.72737 4.7362 3.2236 1.72378C3.58904 1.44535 4.02333 1.2801 4.47881 1.25494C6.3519 1.15614 8.25501 1.88006 9.58963 3.22909C6.87799 3.25604 4.23695 4.99308 3.1018 7.50072Z" fill="#8D2676"/> <path d="M10.8974 3.89562C9.52924 1.98794 7.38779 0.68921 5.04156 0.649695C9.57686 -1.40888 15.1555 1.92867 15.7629 6.86314C15.8194 7.32119 15.7452 7.78824 15.5421 8.20138C14.6948 9.92223 13.1236 11.2569 11.2876 11.7508C12.6328 9.25579 12.4668 6.20748 10.8974 3.89562Z" fill="#EE342F"/> </g> </g> <defs> <clipPath id="clip0_3_23"> <rect width="16" height="16" fill="white"/> </clipPath> <clipPath id="clip1_3_23"> <rect width="16" height="16" fill="white"/> </clipPath> </defs> </svg> --- name: convex-realtime displayName: Convex Realtime description: Patterns for building reactive apps including subscription management, optimistic updates, cache behavior, and paginated queries with cursor-based loading version: 1.0.0 author: Convex tags: [convex, realtime, subscriptions, optimistic-updates, pagination] --- # Convex Realtime Build reactive applications with Convex's real-time subscriptions, optimistic updates, intelligent caching, and cursor-based pagination. ## Documentation Sources Before implementing, do not assume; fetch the latest documentation: - Primary: https://docs.convex.dev/client/react - Optimistic Updates: https://docs.convex.dev/client/react/optimistic-updates - Pagination: https://docs.convex.dev/database/pagination - For broader context: https://docs.convex.dev/llms.txt ## Instructions ### How Convex Realtime Works 1. **Automatic Subscriptions** - useQuery creates a subscription that updates automatically 2. **Smart Caching** - Query results are cached and shared across components 3. **Consistency** - All subscriptions see a consistent view of the database 4. **Efficient Updates** - Only re-renders when relevant data changes ### Basic Subscriptions ```typescript // React component with real-time data import { useQuery } from "convex/react"; import { api } from "../convex/_generated/api"; function TaskList({ userId }: { userId: Id<"users"> }) { // Automatically subscribes and updates in real-time const tasks = useQuery(api.tasks.list, { userId }); if (tasks === undefined) { return <div>Loading...</div>; } return ( <ul> {tasks.map((task) => ( <li key={task._id}>{task.title}</li> ))} </ul> ); } ``` ### Conditional Queries ```typescript import { useQuery } from "convex/react"; import { api } from "../convex/_generated/api"; function UserProfile({ userId }: { userId: Id<"users"> | null }) { // Skip query when userId is null const user = useQuery( api.users.get, userId ? { userId } : "skip" ); if (userId === null) { return <div>Select a user</div>; } if (user === undefined) { return <div>Loading...</div>; } return <div>{user.name}</div>; } ``` ### Mutations with Real-time Updates ```typescript import { useMutation, useQuery } from "convex/react"; import { api } from "../convex/_generated/api"; function TaskManager({ userId }: { userId: Id<"users"> }) { const tasks = useQuery(api.tasks.list, { userId }); const createTask = useMutation(api.tasks.create); const toggleTask = useMutation(api.tasks.toggle); const handleCreate = async (title: string) => { // Mutation triggers automatic re-render when data changes