convex-best-practices

convex-best-practices is a skill for Claude Code, Codex from waynesutton/convexskills. It costs 40 tokens per session (2,373 once invoked), scanned A, original, Apache-2.0.

Development guidance for production-ready Convex apps, covering function structure, database queries, validation, TypeScript, errors, and Convex's design principles.

In plain words
What is it for?
Use it when writing or reviewing Convex functions, schemas, queries, error handling, and TypeScript code.
Why use it?
It helps prevent invalid function definitions, unsafe inputs, inefficient database access, runtime-import mistakes, and other implementation errors.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the convexskills plugin — 14 skills shipped together

Good fit Use it when writing or reviewing Convex functions, schemas, queries, error handling, and TypeScript code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/waynesutton/convexskills/convex-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add waynesutton/convexskills --skill convex-best-practices
Clone the repo
git clone --depth 1 https://github.com/waynesutton/convexskills

Made for: Claude Code, Codex.

Or install convexskills, the plugin that ships this one along with the rest of its 14 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for convex-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/waynesutton/convexskills/convex-best-practices/github.svg)](https://agentmods.dev/skills/waynesutton/convexskills/convex-best-practices)
Your own site
<a href="https://agentmods.dev/skills/waynesutton/convexskills/convex-best-practices"><img src="https://agentmods.dev/badge/skills/waynesutton/convexskills/convex-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for convex-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/waynesutton/convexskills/convex-best-practices"><img src="https://agentmods.dev/badge/skills/waynesutton/convexskills/convex-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,373 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 18 Mar 2026
  • Snyk pass 17 Feb 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.02373
Opus 5 $0.00020 $0.01187
Sonnet 5 $0.00008 $0.00475
Haiku 4.5 $0.00004 $0.00237

Measured 12d ago against content hash 20e2298b8ebe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

convex-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

3 near-identical copies found in the catalogue:

skills/convex-best-practices/SKILL.md · 370 lines

How it starts

The opening of the file, as written. The whole thing — 370 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Convex Best Practices

Build production-ready Convex applications by following established patterns for function organization, query optimization, validation, TypeScript usage, and error handling.

Code Quality

All patterns in this skill comply with @convex-dev/eslint-plugin. Install it for build-time validation:

npm i @convex-dev/eslint-plugin --save-dev
// eslint.config.js
import { defineConfig } from "eslint/config";
import convexPlugin from "@convex-dev/eslint-plugin";

export default defineConfig([
  ...convexPlugin.configs.recommended,
]);

The plugin enforces four rules:

Rule What it enforces
no-old-registered-function-syntax Object syntax with handler
require-argument-validators args: {} on all functions
explicit-table-ids Table name in db operations
import-wrong-runtime No Node imports in Convex runtime

Docs: https://docs.convex.dev/eslint

Documentation Sources

Before implementing, do not assume; fetch the latest documentation:

Instructions

The Zen of Convex

  1. Convex manages the hard parts - Let Convex handle caching, real-time sync, and consistency
  2. Functions are the API - Design your functions as your application's interface
  3. Schema is truth - Define your data model explicitly in schema.ts
  4. TypeScript everywhere - Leverage end-to-end type safety
  5. Queries are reactive - Think in terms of subscriptions, not requests

Function Organization

Organize your Convex functions by domain:

// convex/users.ts - User-related functions
import { query, mutation } from "./_generated/server";
import { v } from "convex/values";

export const get = query({
  args: { userId: v.id("users") },
  returns: v.union(
    v.object({
      _id: v.id("users"),
      _creationTime: v.number(),
      name: v.string(),
      email: v.string(),
    }),
    v.null(),
  ),
  handler: async (ctx, args) => {
    return await ctx.db.get("users", args.userId);
  },
});

Read the full file on GitHub · 370 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 370 lines · 40 tokens per session scan A 20e2298b8ebe

Subscribe to this mod's changes

convex-best-practices is a skill published in the GitHub repository waynesutton/convexskills (404 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 40 tokens to every session and 2,373 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

sc-supabase

(STUB / NOT IMPLEMENTED YET) Supabase backend as an alternative to self-hosted Convex. Create project, apply migrations from supabase/migrations, deploy Edge Functions, generate types. For projects where Postgres + Row-Level-Security is a better fit than Convex's reactive query model.

rahmanef63/si-coder-agent · 67 tokens

convex

Expert guidance for Convex backend development including queries, mutations, actions, schemas, authentication, scheduling, file storage, search, and Next.js integration. Use when working with Convex functions, database operations, convex/ directory code, or Next.js App Router with Convex. Triggers: convex functions…

PolarCoding85/convex-agent-skillz · 203 tokens

convex-components

Universal patterns for Convex components including installation, configuration, and usage. Use when working with Rate Limiter, Aggregate, Workpool, Workflow, or any Convex component from the ecosystem.

PolarCoding85/convex-agent-skillz · 42 tokens

phoenix-contexts

Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries.

oliver-kriska/claude-elixir-phoenix · 46 tokens

511-frameworks-micronaut-jdbc

Use when you need programmatic JDBC in Micronaut — pooled DataSource, parameterized SQL, io.micronaut.transaction.annotation.Transactional, batching, and domain exception translation. This should trigger for requests such as Review JDBC or SQL data access in a Micronaut project; Improve transactions and parameter…

jabrena/plinth · 118 tokens

512-frameworks-micronaut-data

Use when you need data access with Micronaut Data — @MappedEntity, CrudRepository/PageableRepository, @Query with parameters, @Transactional services, projections, @Version, and @MicronautTest with TestPropertyProvider and Testcontainers. For raw java.sql access without generated repositories, use…

jabrena/plinth · 145 tokens