Builds reusable Convex components with isolated tables and app-facing APIs. Use for new components, reusable backend modules, integrations, or component boundary work.
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "convex-create-component" 技能: 1. 下载 https://raw.githubusercontent.com/openclaw/clawhub/main/.agents/skills/convex-create-component/SKILL.md 2. 保存为 ~/.claude/skills/convex-create-component/SKILL.md 3. 装好后重载技能,告诉我可以用了
Create reusable Convex components with clear boundaries and a small app-facing API.
convex/convex.config.ts, schema.ts, and
function files../_generated/server imports,
not the app's generated files.app.use(...). If the app does not
already have convex/convex.config.ts, create it.components.<name> using
ctx.runQuery, ctx.runMutation, or ctx.runAction.npx convex dev and fix codegen, type, or boundary issues before
finishing.Ask the user, then pick one path:
| Goal | Shape | Reference |
|---|---|---|
| Component for this app only | Local | references/local-components.md |
| Publish or share across apps | Packaged | references/packaged-components.md |
| User explicitly needs local + shared library code | Hybrid | references/hybrid-components.md |
| Not sure | Default to local | references/local-components.md |
Read exactly one reference file before proceeding.
Unless the user explicitly wants an npm package, default to a local component:
convex/components/<componentName>/defineComponent(...) in its own convex.config.tsconvex/convex.config.ts with app.use(...)npx convex dev generate the component's own _generated/ filesA minimal local component with a table and two functions, plus the app wiring.
// convex/components/notifications/convex.config.ts
import { defineComponent } from "convex/server";
export default defineComponent("notifications");
// convex/components/notifications/schema.ts
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
export default defineSchema({
notifications: defineTable({
userId: v.string(),
message: v.string(),
read: v.boolean(),
}).index("by_user", ["userId"]),
});
// convex/components/notifications/lib.ts
import { v } from "convex/values";
import { mutation, query } from "./_generated/server.js";
export const send = mutation({
args: { userId: v.string(), message: v.string() },
…
Sets up Convex auth, identity mapping, and access control. Use for login, auth providers, users tables, protected functions, or roles in a Convex app.
Routes general Convex requests to the right project skill. Use when the user asks which Convex skill to use or gives an underspecified Convex app task.
Use for ClawHub staff moderation actions with the repo-local clawhub-mod tool: unhide skills, ban or unban users, change roles, and verify moderation state.
Use when reviewing, triaging, validating, or discussing ClawHub GitHub issues or pull requests, including author context, CI, UI proof, evidence, labels, close decisions, and maintainer handoff.
Use when ClawHub UI changes need visual proof, before/after comparison, new-feature screenshots, temporary Playwright scenarios, or Crabbox desktop recordings.
Plans Convex schema and data migrations with widen-migrate-narrow and @convex-dev/migrations. Use for breaking schema changes, backfills, table reshaping, or zero-downtime rollouts.