convex-create-component

Creates reusable Convex components with isolated tables and app-facing APIs.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/Tehzeeb07/CodeRush --skill convex-create-component-tehzeeb07
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: convex-create-component
Source: https://github.com/Tehzeeb07/CodeRush/tree/main/.agents/skills/convex-create-component
Command: npx skills add https://github.com/Tehzeeb07/CodeRush --skill convex-create-component-tehzeeb07

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building reusable backend modules in Convex requires navigating component boundaries, isolated tables, and app-facing APIs, and mistakes like leaking auth or env access into components cause runtime failures. This Skill guides the design and implementation of Convex components with correct boundaries from the start. ## Core Features & Use Cases - Component Scaffolding: Creates the component structure with convex.config.ts, schema.ts, and function files using the component's own generated server imports. - Boundary Enforcement: Keeps authentication, environment variables, and HTTP route mounting in the app while passing parent IDs as strings across the component boundary. - Shape Selection: Supports local, packaged (npm-published), and hybrid component layouts with dedicated reference guides for each path. - Use Case: You want to extract notification logic into a reusable module. The Skill creates a notifications component with its own tables and functions, wires it into the app with app.use(...), and adds app-side wrapper mutations that handle auth before calling the component. ## Quick Start Ask the assistant to create a Convex component for your feature, describing what tables and public functions it should own.

Frequently Asked Questions about convex-create-component

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

FAQPage Schema
How do I create a reusable Convex component?▼

Define the component with defineComponent in its own convex.config.ts under convex/components/<name>/, add a schema.ts with its tables, and write functions importing from the component's own ./_generated/server. Then install it in the app's convex/convex.config.ts using defineApp and app.use(...).

How do I call a Convex component function from my app?▼

Call component functions from app code using ctx.runQuery, ctx.runMutation, or ctx.runAction with references like components.<name>.lib.myFunction. Clients cannot call component functions directly, so create app-side wrapper queries or mutations that handle auth first.

Can Convex components access ctx.auth or environment variables?▼

No, component functions cannot use ctx.auth or read process.env. The app must resolve the user identity and environment values, then pass them explicitly as arguments when calling the component.

Why can't I use v.id for app tables inside a Convex component?▼

Components have no access to the app's table namespace, so v.id("users") is invalid in component args or schema. Pass parent app IDs across the boundary as v.string() instead, since Id types become plain strings in the ComponentApi.

When should I not use a Convex component?▼

Avoid components for one-off business logic that belongs in the main app, thin utilities without tables or functions, or cases where a normal TypeScript library suffices. Components are justified only when you need isolated tables, backend functions, or reusable persistent state.