convex-function-creator

Create Convex queries, mutations, actions, and internal functions with validators, auth checks, async safety, and correct runtime boundaries.

SKILL.md

GitHub

Convex Function Creator

Use this when writing or reviewing Convex functions.

Default requirements

  • Public functions should define args and returns.
  • Await all promises.
  • Use auth and authorization checks for protected data.
  • Use internal.* for scheduler and backend-only flows.
  • Keep wrappers thin and move reusable logic into plain TypeScript helpers.

Runtime boundaries

  • Queries and mutations stay in the default Convex runtime.
  • "use node" files may contain only actions and helper logic for actions.
  • In AgentForge, actions are still not the place for Mastra runtime orchestration.

Query design

  • Prefer .withIndex() over .filter() for primary lookups.
  • Avoid unbounded .collect() when pagination is the real requirement.
  • Never use Date.now() in queries.

References