convex-create-componen…
Create reusable Convex components with clear boundaries and a small app-facing API.
Set up a working Convex project as fast as possible.
$ npx -y skills add get-convex/convex-backend --skill convex-quickstart --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/convex-quickstartContext preview
The summary Claude sees to decide when to auto-load this skill.
Set up a working Convex project as fast as possible.
name: convex-quickstart description: Initializes a new Convex project from scratch or adds Convex to an existing app. Use this skill when starting a new project with Convex, scaffolding with npm create convex@latest, adding Convex to an existing React, Next.js, Vue, Svelte, or other frontend, wiring up ConvexProvider, configuring environment variables for the deployment URL, or running npx convex dev for the first time, even if the user just says "set up Convex" or "add a backend."
Set up a working Convex project as fast as possible.
building
`convex-setup-auth` skill
1. Determine the starting point: new project or existing app 2. If new project, pick a template and scaffold with `npm create convex@latest` 3. If existing app, install `convex` and wire up the provider 4. Run `npx convex dev` to connect a deployment and start the dev loop 5. Verify the setup works
Use the official scaffolding tool. It creates a complete project with the frontend framework, Convex backend, and all config wired together.
| Template | Stack | | -------------------------- | ----------------------------------------- | | `react-vite-shadcn` | React + Vite + Tailwind + shadcn/ui | | `nextjs-shadcn` | Next.js App Router + Tailwind + shadcn/ui | | `react-vite-clerk-shadcn` | React + Vite + Clerk auth + shadcn/ui | | `nextjs-clerk` | Next.js + Clerk auth | | `nextjs-convexauth-shadcn` | Next.js + Convex Auth + shadcn/ui | | `nextjs-lucia-shadcn` | Next.js + Lucia auth + shadcn/ui | | `bare` | Convex backend only, no frontend |
If the user has not specified a preference, default to `react-vite-shadcn` for simple apps or `nextjs-shadcn` for apps that need SSR or API routes.
You can also use any GitHub repo as a template:
npm create convex@latest my-app -- -t owner/repo npm create convex@latest my-app -- -t owner/repo#branch
Always pass the project name and template flag to avoid interactive prompts:
npm create convex@latest my-app -- -t react-vite-shadcn cd my-app npm install
The scaffolding tool creates files but does not run `npm install`, so you must run it yourself.
To scaffold in the current directory (if it is empty):
npm create convex@latest . -- -t react-vite-shadcn npm install
`npx convex dev` is a long-running watcher process that syncs backend code to a Convex deployment on every save. It also requires authentication on first run (browser-based OAuth). Both of these make it unsuitable for an agent to run directly.
**Ask the user to run this themselves:**
Tell the user to run `npx convex dev` in their terminal. On first run it will prompt them to log in or develop anonymously. Once running, it will:
The user should keep `npx convex dev` running in the background while you work on code. The watcher will automatically pick up any files you create or edit in `convex/`.
**Exception - cloud or headless agents:** Environments that cannot open a browser for interactive login should use Agent Mode (see below) to run anonymously without user interaction.
The user should also run the frontend dev server in a separate terminal:
npm run dev
Vite apps serve on `http://localhost:5173`, Next.js on `http://localhost:3000`.
After scaffolding, the project structure looks like:
my-app/
convex/ # Backend functions and schema
_generated/ # Auto-generated types (check this into git)
schema.ts # Database schema (if template includes one)
src/ # Frontend code (or app/ for Next.js)
package.json
.env.local # CONVEX_URL / VITE_CONVEX_URL / NEXT_PUBLIC_CONVEX_URLThe template already has:
Proceed to adding schema, functions, and UI.
Use this when the user already has a frontend project and wants to add Convex as the backend.
npm install convex
Ask the user to run `npx convex dev` in their terminal. This handles login, creates the `convex/` directory, writes the deployment URL to `.env.local`, and starts the file watcher. See the notes in Path 1 about why the agent should not run this directly.
The Convex client must wrap the app at the root. The setup varies by framework.
Create the `ConvexReactClient` at module scope, not inside a component:
// Bad: re-creates the client on every render
function App() {
const convex = new ConvexReactClient(
import.meta.env.VITE_CONVEX_URL as string,
);
return <ConvexProvider client={convex}>...</ConvexProvider>;
}
// Good: created once at module scope
const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string);
function App() {
return <ConvexProvider client={convex}>...</ConvexProvider>;
}// src/main.tsx
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ConveRepo: get-convex/convex-backend
Create reusable Convex components with clear boundaries and a small app-facing API.
Safely migrate Convex schemas and data when making breaking changes.
Diagnose and fix performance problems in Convex applications, one problem class at a time.
Implement secure authentication in Convex with user management and access control.