function-creator

Generate secure, type-safe Convex queries, mutations, and actions with validators and auth checks.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/MichaelFrieze/riffatlas --skill function-creator-michaelfrieze
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: function-creator
Source: https://github.com/MichaelFrieze/riffatlas/tree/main/.agents/skills/function-creator
Command: npx skills add https://github.com/MichaelFrieze/riffatlas --skill function-creator-michaelfrieze

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of building new Convex query, mutation, and action functions without skipping critical validation, authentication, or authorization logic.

Core Features & Use Cases

  • Type-safe function generation: Ensures every function defines args validators and returns validators for predictable runtime behavior.
  • Secure auth and authorization patterns: Recommends ctx.auth.getUserIdentity() checks and ownership/permission checks before reading or writing protected data.
  • Correct function classification: Guides you to use query for read-only access, mutation for transactional writes, and action for external API calls (including optional "use node" for Node.js-only SDKs).
  • Operational safety checklist: Emphasizes awaited promises, indexed querying guidance, descriptive errors, and correct use of internal.* for scheduled/backend-only work.

Quick Start

Use the function-creator skill to design a new Convex mutation for updating a user-owned resource by providing the resource id, the fields you want to allow updating, and the authorization rule that must be enforced.

Frequently Asked Questions about function-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create secure Convex functions with proper validation and authentication?

To create secure Convex functions, you define `args` and `returns` validators for type safety and enforce authorization using `ctx.auth.getUserIdentity()` checks before reading or writing protected data.

When should I use a Convex action versus a mutation for backend operations?

Use a Convex mutation for transactional writes and a Convex action for external API calls or integrations requiring Node.js-only SDKs, ensuring you correctly await promises within the action boundary.

How do I enforce ownership and permission checks in a Convex mutation?

You enforce ownership in a Convex mutation by calling `ctx.auth.getUserIdentity()` to authenticate the user, then applying explicit permission checks against the resource before executing the database write.

Can I use Node.js-only SDKs within my Convex backend functions?

Yes, you can use Node.js-only SDKs within Convex actions by including the `use node` directive, allowing you to safely integrate external APIs and libraries that require a Node runtime environment.

What is the best way to handle internal backend-only operations in Convex?

For backend-only operations like scheduled tasks, use `internal.*` function definitions to prevent external client calls, and apply descriptive error handling alongside indexed querying for operational safety.