Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

convex-quickstart凸快速入门

Agent Skill

convex-quickstart 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

821,784

周安装

35,313

GitHub Stars

25

下载量

288,048
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:convex-quickstart(凸快速入门)
来源仓库:https://github.com/get-convex/agent-skills
仓库路径:skills/convex-quickstart
安装命令:
npx skills add https://github.com/get-convex/agent-skills --skill convex-quickstart
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/get-convex/agent-skills --skill convex-quickstart

简介

搭建新的 Convex 项目或将 Convex 集成到现有的前端应用程序中。

  • 支持两种路径:从模板搭建脚手架(React + Vite、Next.js、Vue、Svelte 或裸后端)或通过手动提供程序设置将 Convex 添加到现有应用程序
  • 模板包括预配置的前端框架、Tailwind、shadcn/ui 和可选的身份验证(Clerk、Convex Auth、Lucia)
  • 需要运行 npx 凸开发
  • 作为一个长期运行的进程来同步后端代码和管理部署;云代理可以通过 CONVEX_AGENT_MODE=anonymous 使用匿名模式
  • 提供 React (Vite)、Next.js App Router 的分步连接,以及 Vue、Svelte、React Native、Remix 和 Node.js 指南的链接

SKILL.md

Convex Quickstart

Set up a working Convex project as fast as possible.

When to Use

  • Starting a brand new project with Convex
  • Adding Convex to an existing React, Next.js, Vue, Svelte, or other app
  • Scaffolding a Convex app for prototyping

When Not to Use

  • The project already has Convex installed and convex/ exists - just start building
  • You only need to add auth to an existing Convex app - use the convex-setup-auth skill

Workflow

  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

Path 1: New Project (Recommended)

Use the official scaffolding tool. It creates a complete project with the frontend framework, Convex backend, and all config wired together.

Pick a template

TemplateStack
react-vite-shadcnReact + Vite + Tailwind + shadcn/ui
nextjs-shadcnNext.js App Router + Tailwind + shadcn/ui
react-vite-clerk-shadcnReact + Vite + Clerk auth + shadcn/ui
nextjs-clerkNext.js + Clerk auth
nextjs-convexauth-shadcnNext.js + Convex Auth + shadcn/ui
nextjs-lucia-shadcnNext.js + Lucia auth + shadcn/ui
bareConvex 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

Scaffold the project

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

Start the dev loop

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:

  • Create a Convex project and dev deployment
  • Write the deployment URL to .env.local
  • Create the convex/ directory with generated types
  • Watch for changes and sync continuously

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.

Start the frontend

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.

What you get

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_URL

The template already has:

  • ConvexProvider wired into the app root
  • Correct env var names for the framework
  • Tailwind and shadcn/ui ready (for shadcn templates)
  • Auth provider configured (for auth templates)

Proceed to adding schema, functions, and UI.

Path 2: Add Convex to an Existing App

Use this when the user already has a frontend project and wants to add Convex as the backend.

Install

npm install convex

Initialize and start dev loop

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.

Wire up the provider

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>;
}

React (Vite)

// src/main.tsx
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { ConvexProvider, ConvexReactClient } from "convex/react";
import App from "./App";

const convex = new ConvexReactClient(import.meta.env.VITE_CONVEX_URL as string);

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <ConvexProvider client={convex}>
      <App />
    </ConvexProvider>
  </StrictMode>,
);

Next.js (App Router)

// app/ConvexClientProvider.tsx
"use client";

import { ConvexProvider, ConvexReactClient } from "convex/react";
import { ReactNode } from "react";

const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!);

export function ConvexClientProvider({ children }: { children: ReactNode }) {
  return <ConvexProvider client={convex}>{children}</ConvexProvider>;
}
// app/layout.tsx
import { ConvexClientProvider } from "./ConvexClientProvider";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <ConvexClientProvider>{children}</ConvexClientProvider>
      </body>
    </html>
  );
}

Other frameworks

For Vue, Svelte, React Native, TanStack Start, Remix, and others, follow the matching quickstart guide:

Environment variables

The env var name depends on the framework:

FrameworkVariable
ViteVITE_CONVEX_URL
Next.jsNEXT_PUBLIC_CONVEX_URL
RemixCONVEX_URL
React NativeEXPO_PUBLIC_CONVEX_URL

npx convex dev writes the correct variable to .env.local automatically.

Agent Mode (Cloud and Headless Agents)

When running in a cloud or headless agent environment where interactive browser login is not possible, set CONVEX_AGENT_MODE=anonymous to use a local anonymous deployment.

Add CONVEX_AGENT_MODE=anonymous to .env.local, or set it inline:

CONVEX_AGENT_MODE=anonymous npx convex dev

This runs a local Convex backend on the VM without requiring authentication, and avoids conflicting with the user's personal dev deployment.

Verify the Setup

After setup, confirm everything is working:

  1. The user confirms npx convex dev is running without errors
  2. The convex/_generated/ directory exists and has api.ts and server.ts
  3. .env.local contains the deployment URL

Writing Your First Function

Once the project is set up, create a schema and a query to verify the full loop works.

convex/schema.ts:

import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

export default defineSchema({
  tasks: defineTable({
    text: v.string(),
    completed: v.boolean(),
  }),
});

convex/tasks.ts:

import { query, mutation } from "./_generated/server";
import { v } from "convex/values";

export const list = query({
  args: {},
  handler: async (ctx) => {
    return await ctx.db.query("tasks").collect();
  },
});

export const create = mutation({
  args: { text: v.string() },
  handler: async (ctx, args) => {
    await ctx.db.insert("tasks", { text: args.text, completed: false });
  },
});

Use in a React component (adjust the import path based on your file location relative to convex/):

import { useQuery, useMutation } from "convex/react";
import { api } from "../convex/_generated/api";

function Tasks() {
  const tasks = useQuery(api.tasks.list);
  const create = useMutation(api.tasks.create);

  return (
    <div>
      <button onClick={() => create({ text: "New task" })}>Add</button>
      {tasks?.map((t) => (
        <div key={t._id}>{t.text}</div>
      ))}
    </div>
  );
}

Development vs Production

Always use npx convex dev during development. It runs against your personal dev deployment and syncs code on save.

When ready to ship, deploy to production:

npx convex deploy

This pushes to the production deployment, which is separate from dev. Do not use deploy during development.

Next Steps

  • Add authentication: use the convex-setup-auth skill
  • Design your schema: see Schema docs
  • Build components: use the convex-create-component skill
  • Plan a migration: use the convex-migration-helper skill
  • Add file storage: see File Storage docs
  • Set up cron jobs: see Scheduling docs

Checklist

  • Determined starting point: new project or existing app
  • If new project: scaffolded with npm create convex@latest using appropriate template
  • If existing app: installed convex and wired up the provider
  • User has npx convex dev running and connected to a deployment
  • convex/_generated/ directory exists with types
  • .env.local has the deployment URL
  • Verified a basic query/mutation round-trip works

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.45%
按下载量换算110,754

Claude

31.18%
按下载量换算89,813

Cursor

18.69%
按下载量换算53,836

Gemini CLI

8.61%
按下载量换算24,801

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills