Agent skill

Convex Component Authoring

by waynesutton in waynesutton/builder-skills

Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup.

Apache-2.0Auto-check passed

Install Convex Component Authoring

skills CLI
$ npx skills add waynesutton/builder-skills --skill convex-component-authoring -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install waynesutton/builder-skills convex-component-authoring --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/waynesutton/builder-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/convex-component-authoring .claude/skills/convex-component-authoring && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
convex-component-authoring
GitHub stars
406
Token cost
~2.6k tokens
SKILL.md length
750 words
Files
5 (incl. references, assets)
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup.

  • Extracting a feature into a package
  • SKILL.md covers When to reach for this, Component or helper function, Folder layout and Define the component, plus 6 more sections
  • Calls npx; needs API_KEY
  • Building something for the Convex component directory

What it does

Convex Component Authoring is an agent skill from waynesutton/builder-skills. Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup. Use when extracting a feature into a package, building something for the Convex component directory, or when a component's functions are not showing up in the parent app.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files and assets (for example `agents/openai.yaml` and `references/publishing.md`).

It works with npm. The repository describes itself as: Builder skills for Convex apps. Convex patterns plus a PRD, task.md, changelog, and files.md workflow for Claude Code, Codex, Cursor, and OpenCode. The licence is Apache-2.0.

When your agent uses it

  • Extracting a feature into a package
  • Building something for the Convex component directory
  • A components functions are not showing up in the parent app

Example prompts

  • “Use the convex-component-authoring skill to create reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an…”
  • “/convex-component-authoring”

Requirements

  • Node.js
  • A credential in API_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit 82d1ce2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.convex.dev
    • convex.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Convex Component Authoring loads about 2.6k tokens when it runs, and up to ~4k if it reads all its reference files. Until then it costs about 81 tokens; SKILL.md has 750 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from waynesutton/builder-skills at commit 82d1ce2, republished under its Apache-2.0 licence (© waynesutton). 750 words, ~2,582 tokens.

Download SKILL.mdSave it as .claude/skills/convex-component-authoring/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
convex-component-authoring
description
Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup. Use when extracting a feature into a package, building something for the Convex component directory, or when a component's functions are not showing up in the parent app.

Convex component authoring

Produces a self contained component: its own convex.config.ts, schema, functions, and a typed client wrapper the parent app calls. The one rule: a component cannot read the parent's tables, ctx.auth, or process.env. Whatever it needs, the app passes in as arguments.

When to reach for this

  • Extracting a feature (counters, rate limits, audit logs, notifications) into a package
  • Building something for the Convex component directory
  • A component's functions are missing from components.<name> in the parent app
  • A third party integration should own its own tables and background jobs
  • The same backend module is needed in several apps

Component or helper function

NeedUse
Shared logic over the app's own tablesPlain TypeScript helper in convex/lib/
Its own tables with a schema the app cannot touchComponent
Isolated functions that run in their own transactionComponent
Reuse across apps with one install lineComponent
A React hook or client utility onlynpm library, no component

If the feature does not need persistent state behind an API boundary, a helper function is less work and easier to type.

Folder layout

my-component/
  package.json
  src/
    component/
      convex.config.ts     # defineComponent("counter")
      schema.ts            # tables only this component can see
      public.ts            # queries, mutations, actions
      _generated/          # created by npx convex codegen
    client/
      index.ts             # wrapper class the app imports
  example/
    convex/
      convex.config.ts     # app.use(counter) for local testing

For a local only component, put the component/ contents at convex/components/<name>/ and skip client/ and package.json.

Define the component

typescript
// src/component/convex.config.ts
import { defineComponent } from "convex/server";

const component = defineComponent("counter");
export default component;
typescript
// src/component/schema.ts
import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";

export default defineSchema({
  counters: defineTable({
    name: v.string(),
    value: v.number(),
  }).index("by_name", ["name"]),
});

Functions import query and mutation from the component's own _generated/server, never from the app's. Every public function needs args and returns validators; without them the parent sees any.

typescript
// src/component/public.ts
import { v } from "convex/values";
import { mutation, query } from "./_generated/server.js";

export const add = mutation({
  args: { name: v.string(), amount: v.number() },
  returns: v.number(),
  handler: async (ctx, args) => {
    const existing = await ctx.db
      .query("counters")
      .withIndex("by_name", (q) => q.eq("name", args.name))
      .unique();
    if (!existing) {
      await ctx.db.insert("counters", { name: args.name, value: args.amount });
      return args.amount;
    }
    const value = existing.value + args.amount;
    await ctx.db.patch(existing._id, { value });
    return value;
  },
});

export const get = query({
  args: { name: v.string() },
  returns: v.number(),
  handler: async (ctx, args) => {
    const counter = await ctx.db
      .query("counters")
      .withIndex("by_name", (q) => q.eq("name", args.name))
      .unique();
    return counter?.value ?? 0;
  },
});

Register it in the parent

typescript
// convex/convex.config.ts (parent app)
import { defineApp } from "convex/server";
import counter from "@acme/counter/convex.config.js";
// local component: import counter from "./components/counter/convex.config.js";

const app = defineApp();
app.use(counter);
// A second instance under a different name:
// app.use(counter, { name: "pageViews" });
export default app;

Run npx convex dev. It generates components.counter in the app's convex/_generated/api and the component's own _generated/ folder. The reference path mirrors the file: a function in public.ts is components.counter.public.add.

Component functions arrive in the parent as internal references. Call them with ctx.runQuery and ctx.runMutation; clients cannot hit them directly.

Client wrapper class

The wrapper runs in the app's environment, so it can read ctx.auth and process.env and pass what the component needs. It takes the component reference first and options second.

typescript
// src/client/index.ts
import type {
  GenericDataModel,
  GenericMutationCtx,
  GenericQueryCtx,
} from "convex/server";
import type { ComponentApi } from "../component/_generated/component.js";

// Pick only the capabilities each method needs so any ctx with runQuery works
type QueryCtx = Pick<GenericQueryCtx<GenericDataModel>, "runQuery">;
type MutationCtx = Pick<GenericMutationCtx<GenericDataModel>, "runMutation">;

export class Counter {
  constructor(
    public component: ComponentApi,
    private options: { prefix?: string } = {},
  ) {}

  private key(name: string): string {
    return this.options.prefix ? `${this.options.prefix}:${name}` : name;
  }

  async add(ctx: MutationCtx, name: string, amount = 1): Promise<number> {
    return await ctx.runMutation(this.component.public.add, {
      name: this.key(name),
      amount,
    });
  }

  async get(ctx: QueryCtx, name: string): Promise<number> {
    return await ctx.runQuery(this.component.public.get, { name: this.key(name) });
  }
}
typescript
// convex/counter.ts (parent app)
import { v } from "convex/values";
import { mutation, query } from "./_generated/server";
import { components } from "./_generated/api";
import { Counter } from "@acme/counter";

const counter = new Counter(components.counter, { prefix: "app" });

// The app owns auth. The component only sees the string it is handed.
export const incrementMine = mutation({
  args: {},
  returns: v.number(),
  handler: async (ctx) => {
    const identity = await ctx.auth.getUserIdentity();
    if (!identity) throw new Error("Not authenticated");
    return await counter.add(ctx, identity.subject);
  },
});

export const getMine = query({
  args: {},
  returns: v.number(),
  handler: async (ctx) => {
    const identity = await ctx.auth.getUserIdentity();
    if (!identity) throw new Error("Not authenticated");
    return await counter.get(ctx, identity.subject);
  },
});

These app side functions are what React calls through api.counter.incrementMine. The app decides on auth and rate limits; the component stays generic.

Boundary rules

  • No parent tables. v.id("users") inside a component refers to a component table named users, not the app's. Accept parent ids as v.string().
  • Ids become strings. Every Id<"counters"> in the component is string in ComponentApi. Return them as strings on purpose.
  • No ctx.auth. Resolve the user in the app and pass userId.
  • No app process.env. Declare typed env in defineComponent("name", { env: { API_KEY: v.string() } }) and let the app supply it with app.use(c, { env: { API_KEY: ... } }), or pass the value as a function argument.
  • .paginate() does not work across the boundary. Use paginator from convex-helpers inside the component.
  • HTTP routes in a component's http.ts are mounted by the app with httpPrefix. Component HTTP actions have no ctx.auth.
  • Callbacks into the app travel as function handles: createFunctionHandle(internal.x.y) in the app, stored as v.string(), cast to FunctionHandle<"mutation"> in the component.

Publishing to npm (exports map, build order, README, versioning) is covered in references/publishing.md; open it when the component will be installed from a package rather than a local folder.

Show full SKILL.md (249 more words)Show less

Common mistakes

MistakeWhy it breaksDo instead
Functions missing from components.<name>app.use(...) not added, or npx convex dev has not run sinceRegister in convex.config.ts, run dev, check the reference path matches the file name
Importing mutation from the app's _generated/serverThe function registers on the app, not the componentImport from the component's own ./_generated/server.js
Calling api.counter.add from ReactComponent functions are internal references in the parentWrite an app mutation that calls ctx.runMutation(components.counter.public.add)
v.id("users") in component argsTable numbers differ per component, validation failsv.string() at the boundary
ctx.auth.getUserIdentity() inside the componentAlways returns no userAuthenticate in the app, pass userId
process.env.MY_KEY inside the componentUndefined at runtimeDeclare env in defineComponent or pass as an argument
Public function without returnsParent sees any, loses type safetyAdd validators to every public function
Reading component env at module scopeUndefined during deploy analysisRead env.X inside the handler

Checklist

  • Decided a component is needed rather than a helper function
  • convex.config.ts calls defineComponent("<name>") and exports it
  • Schema lives in the component; no v.id() for parent tables anywhere
  • Functions import from the component's own _generated/server
  • Every public function has args and returns validators
  • Parent registers with app.use(...) and npx convex dev runs clean
  • Client wrapper takes ComponentApi first, options second, uses Pick ctx types
  • App side wrapper functions handle auth and pass ids as strings
  • No ctx.auth, process.env, or .paginate() inside the component
  • Tested through an example app that installs the component

Docs

© waynesutton, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references, assets) in skills/convex-component-authoring of waynesutton/builder-skills.

  • SKILL.md
  • agents/openai.yaml
  • assets/large-logo.png
  • assets/small-logo.svg
  • references/publishing.md

Open the folder on GitHubat commit 82d1ce2

Compare with similar skills

Convex Component Authoring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Convex Component Authoring compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Convex Component Authoring this skillwaynesutton/builder-skills406—~2.6kAutomated safety check: PassApache-2.0
Defuddlekepano/obsidian-skills49k11 repos~208Automated safety check: PassMIT
Vercel Deploybytedance/deer-flow84k10 repos~797Automated safety check: PassMIT
MCP Server BuildershareAI-lab/learn-claude-code78k5 repos~1.2kAutomated safety check: PassMIT
Knap Markdown Templateskepano/obsidian-skills49k2 repos~986Automated safety check: PassMIT
Nx Run Tasksnomcopter/react-mosaic4.8k8 repos~613Automated safety check: PassCustom licence

Similar skills

  • Defuddle

    kepano/obsidian-skills

    Uses the Defuddle CLI to pull clean, readable Markdown, JSON or metadata from web pages, stripping navigation, ads and clutter to save tokens.

    49k GitHub starsUsed in 11 repos~208 tokens
    Knowledge ManagementAuto-check passed
  • Vercel Deploy

    bytedance/deer-flow

    Deploys a project to Vercel with one script and no login, then returns a live preview URL and a claim link for moving the deployment into your own Vercel account.

    84k GitHub starsUsed in 10 repos~797 tokens
    DevOps & CloudAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 5 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Knap Markdown Templates

    kepano/obsidian-skills

    Renders Markdown notes from Knap templates and JSON data on the command line, including notes built from Defuddle web page output.

    49k GitHub starsUsed in 2 repos~986 tokens
    Documents & OfficeAuto-check passed
  • Nx Run Tasks

    nomcopter/react-mosaic

    Helps with running tasks in an Nx workspace. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~613 tokens
    DevelopmentAuto-check passed
  • Validates OpenHarness features by running real multi-turn agent loops with live LLM calls against an unfamiliar codebase, checking actual tool execution.

    16k GitHub starsUsed in 1 repo~2.1k tokens
    Testing & QAAuto-check: notes

More from waynesutton/builder-skills

All 17 skills in this repo
  • Convex Agents

    waynesutton/builder-skills

    Builds AI agents on the Convex agent component: threads, messages, tools that call queries and mutations, streaming, RAG with vector search, and workflows for multi step jobs.

    406 GitHub stars~2.2k tokensUpdated 11 days ago
    Auto-check passed
  • Convex Best Practices

    waynesutton/builder-skills

    Production patterns for Convex apps and the rules the @convex-dev/eslint-plugin enforces: validators, indexes, idempotent mutations, avoiding OCC conflicts, thin function wrappers, error handling.

    406 GitHub stars~2.6k tokensUpdated 11 days ago
    Auto-check passed
  • Convex Cron Jobs

    waynesutton/builder-skills

    Schedules work in Convex: cron jobs in convex/crons.ts, one off scheduled functions with runAfter and runAt, batching large jobs, and cancelling or inspecting the queue.

    406 GitHub stars~2k tokensUpdated 11 days ago
    Auto-check passed
  • Convex HTTP Actions

    waynesutton/builder-skills

    Adds HTTP endpoints in convex/http.ts: webhook receivers with signature checks, REST style routes, CORS, auth headers, streaming responses, and file uploads over HTTP.

    406 GitHub stars~2.6k tokensUpdated 11 days ago
    Auto-check passed
  • Convex Migrations

    waynesutton/builder-skills

    Changes a live Convex schema without downtime: make a field optional, backfill in batches, flip the validator, then clean up.

    406 GitHub stars~2.1k tokensUpdated 11 days ago
    Auto-check passed
  • Convex Security Audit

    waynesutton/builder-skills

    Deep security review of a Convex app: authorization model, data access paths per table, HTTP action exposure, rate limiting, file storage access, scheduled function trust, and a written findings…

    406 GitHub stars~2.6k tokensUpdated 11 days ago
    Auto-check passed

Works with

Questions about Convex Component Authoring

What does Convex Component Authoring do?

Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup. Convex Component Authoring is an agent skill from waynesutton/builder-skills. Creates reusable Convex components with defineComponent, a clean client wrapper, their own schema, and an npm publish setup.

When should I use Convex Component Authoring?

Convex Component Authoring fits situations like: extracting a feature into a package; building something for the Convex component directory; A components functions are not showing up in the parent app.

How do I install Convex Component Authoring in Claude Code?

Run `npx skills add waynesutton/builder-skills --skill convex-component-authoring -a claude-code`. Or copy the skill folder (skills/convex-component-authoring in waynesutton/builder-skills) into .claude/skills/convex-component-authoring in your project. Claude Code loads it when a task matches its description.

How do I install Convex Component Authoring in Codex?

Run `npx skills add waynesutton/builder-skills --skill convex-component-authoring -a codex`. Or copy the skill folder (skills/convex-component-authoring in waynesutton/builder-skills) into .agents/skills/convex-component-authoring in your project. Codex loads it when a task matches its description.

Can I use Convex Component Authoring in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add waynesutton/builder-skills --skill convex-component-authoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/convex-component-authoring, .gemini/skills/convex-component-authoring, .github/skills/convex-component-authoring and .opencode/skills/convex-component-authoring in your project.

What does Convex Component Authoring need to run?

Going by SKILL.md and its folder, Convex Component Authoring needs the command-line tools its instructions call (npx) and credentials named API_KEY. Our summary lists: Node.js; A credential in API_KEY.

Does Convex Component Authoring access the network?

SKILL.md names 2 domains. As links in the text: docs.convex.dev and convex.dev. This is read from the text; nothing was executed.

Is Convex Component Authoring safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Convex Component Authoring use?

Convex Component Authoring is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Convex Component Authoring use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.

What are the alternatives to Convex Component Authoring?

Skills that share tags, products or a category with Convex Component Authoring: Defuddle (kepano/obsidian-skills, 49k stars), Vercel Deploy (bytedance/deer-flow, 84k stars), MCP Server Builder (shareAI-lab/learn-claude-code, 78k stars) and Knap Markdown Templates (kepano/obsidian-skills, 49k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Convex Component Authoring?

waynesutton (a GitHub user) maintains it in waynesutton/builder-skills, which has 406 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on September 28, 2026.

Source: waynesutton/builder-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.