convex-conventions
Skill0 starsChanged 31 days agoUnlicenseView on GitHub
Applies the user's Convex backend conventions while deferring mechanics to upstream Convex skills and current APIs to the live Convex docs. Use when scaffolding, reviewing, or refactoring Convex functions, schemas, or auth.
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 6 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Verify each touched API against live Convex docs and the installed version.
- Distinctive: line 22
Read release notes before a major or minor upgrade.
- Very specific: line 27
Keep convex/ at root and never edit _generated/.
- Distinctive: line 30
Keep one module each for reusable table validators, semantic validation, auth helpers, and rate-limit configuration.
- Very specific: line 32
Add crons.ts and http.ts only when used.
- Very specific: line 41
Every public function authenticates at the top and declares both args and returns validators.
- Distinctive: line 43
Use internal functions for scheduling, sensitive side effects, and cross-function reuse that must not be public.
- Distinctive: line 45
Keep structural validation in validators and semantic checks such as date correctness, length caps, and sanitization in the handler.
- Distinctive: line 79
Prefer official Convex components for existing capabilities and verify each component README.
- Very specific: line 89
No public function lacks auth, args, or returns.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Convex conventions
These are house-style defaults, not a Convex manual. Use current official Convex skills, when installed, for scaffolding, auth, migrations, performance work, components, and API mechanics; this skill adds project policy. Apply only what the requested change touches.
Authority
Verify each touched API against live Convex docs and the installed version. Read release notes before a major or minor upgrade. Live docs win over this skill; memory and prior turns do not establish current API behavior.
Layout and shared shapes
- Keep
convex/at root and never edit_generated/. schema.tsownsdefineSchemaand table declarations.auth.config.tsowns the Clerk JWT provider.- Keep one module each for reusable table validators, semantic validation, auth helpers, and rate-limit configuration.
- Add
crons.tsandhttp.tsonly when used. - Public feature surfaces and their tests are co-located.
- Define table validators once and compose them into schema,
args, andreturns; do not redeclare an existing shape inline.
Auth and public functions
- Clerk is the identity provider. Server code derives identity from
ctx.auth.getUserIdentity()through one helper; clients never submituserId. - Every public function authenticates at the top and declares both
argsandreturnsvalidators. - Use internal functions for scheduling, sensitive side effects, and cross-function reuse that must not be public.
- Keep structural validation in validators and semantic checks such as date correctness, length caps, and sanitization in the handler.
Reads, writes, and effects
- Indexes narrow candidates; further filtering happens in code. Give indexes semantic names and avoid redundant ones.
- Cap every otherwise unbounded query with
.take(); comment only when the cap is load-bearing. - Queries are pure and deterministic: no
Date.now()inside them. - Mutations write. Actions call external systems. An action persists through an internal mutation rather than mixing the roles.
- Rate-limit every public mutation with the current
@convex-dev/rate-limiterAPI. Token bucket suits high-frequency operations; fixed window suits low-frequency operations.
Stored data
- User-created rows use soft deletion with optional numeric
deletedAt; public mutations do not hard-delete them. - Audit trails are append-only records.
- Server metadata such as identity and timestamps comes from handler context, never client args.
- Data-at-rest schema changes use widen, migrate, then narrow through the official migration workflow.
- Aggregate additions include a backfill. Aggregate synchronization failure must not block the primary write.
Client types and components
- Derive client types from generated
Doc<...>andId<...>. - One dedicated module re-exports semantic client aliases; app code imports
there, never directly from
convex/_generated, and never manually copies table shapes. - Prefer official Convex components for existing capabilities and verify each component README. Use the official component workflow when authoring a new reusable component.
Completion
- Codegen and typecheck pass.
- Relevant function tests and the project gate pass.
- Any schema migration ran against the development deployment and its result is recorded.
- No public function lacks auth,
args, orreturns; no public mutation lacks rate limiting; no unbounded query lacks a cap.
In this repository26 other files it gives its agents.
- address-feedbackSkill
- agent-behavior-auditSkill
- agent-writingSkill
- bleeding-edgeSkill
- codebase-auditSkill
- code-reviewSkill
- create-issueSkill
- create-prSkill
- create-releaseSkill
- deep-diveSkill
- deliverSkill
- delivery-waitSkill
- git-workflowSkill
- implementSkill
- maintain-project-skillsSkill
- milestone-rushSkill
- native-nostalgia-stackSkill
- project-structureSkill
- react-stackSkill
- roadmap-reviewSkill
- run-retroSkill
- software-engineering-excellenceSkill
- status-reportSkill
- test-against-specSkill
- typescript-stackSkill
- update-prSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

