
Convex Component Authoring
Author and publish reusable Convex components with correct isolation, exports, and packaging so other apps can install your backend module cleanly.
Overview
Convex Component Authoring is an agent skill for the Build phase that teaches how to create, structure, and publish self-contained Convex components with proper isolation and exports.
Install
npx skills add https://github.com/waynesutton/convexskills --skill convex-component-authoringWhat is this skill?
- Guides creation of self-contained Convex components with proper isolation between package and host app
- Covers structure, exports, and publishing workflow for redistributable backend building blocks
- Aligned with Convex’s component model for sharing queries, mutations, and internal modules
- Reduces foot-guns when splitting monolith Convex code into installable packages
- Pairs with ConvexSkills repo patterns for logo/branding assets in skill packaging
Adoption & trust: 1k installs on skills.sh; 402 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Convex logic is trapped in one app repo and you do not know how to package it as an isolated, publishable component other projects can import safely.
Who is it for?
Indie devs standardizing Convex modules (auth, chat, billing) across multiple apps or open-sourcing a small backend kit.
Skip if: Greenfield apps with no Convex dependency, frontend-only UI work, or teams that only need a single monolithic convex/ folder with no reuse.
When should I use this skill?
Creating, structuring, or publishing self-contained Convex components with isolation and exports.
What do I get? / Deliverables
You end with a component-shaped Convex package—clear boundaries, exports, and publish steps—ready for reuse across solo projects or shared templates.
- Component directory layout with documented export surface
- Publish-ready Convex component package configuration
Recommended Skills
Journey fit
Build phase is where you implement and package server-side Convex modules as shareable components rather than one-off app code. Backend subphase fits component schemas, functions, and publish boundaries for Convex’s server runtime.
How it compares
Skill package for Convex component boundaries—not a hosted MCP server and not generic Firebase extension scaffolding.
Common Questions / FAQ
Who is convex-component-authoring for?
Solo and small-team Convex developers who want to publish or internally reuse backend modules as official-style components with clean export surfaces.
When should I use convex-component-authoring?
During Build/backend work when splitting shared Convex code into a package, before publishing to npm, or when refactoring a monolith convex directory into an installable component.
Is convex-component-authoring safe to install?
It is documentation-heavy authoring guidance; check the Security Audits panel on this page and review any generated publish scripts or registry tokens before running deploy commands.
SKILL.md
READMESKILL.md - Convex Component Authoring
interface: icon_small: "./assets/small-logo.svg" icon_large: "./assets/large-logo.png" <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <g clip-path="url(#clip0_3_23)"> <g clip-path="url(#clip1_3_23)"> <path d="M10.0643 12.5735C12.3769 12.3166 14.5572 11.0843 15.7577 9.02756C15.1892 14.1148 9.62646 17.3302 5.08583 15.356C4.66743 15.1746 4.30728 14.8728 4.06013 14.4848C3.03973 12.8825 2.7043 10.8437 3.18626 8.99344C4.56327 11.37 7.3632 12.8267 10.0643 12.5735Z" fill="#F3B01C"/> <path d="M3.1018 7.50072C2.16436 9.66714 2.12376 12.2034 3.27303 14.2907C-0.771507 11.2479 -0.72737 4.7362 3.2236 1.72378C3.58904 1.44535 4.02333 1.2801 4.47881 1.25494C6.3519 1.15614 8.25501 1.88006 9.58963 3.22909C6.87799 3.25604 4.23695 4.99308 3.1018 7.50072Z" fill="#8D2676"/> <path d="M10.8974 3.89562C9.52924 1.98794 7.38779 0.68921 5.04156 0.649695C9.57686 -1.40888 15.1555 1.92867 15.7629 6.86314C15.8194 7.32119 15.7452 7.78824 15.5421 8.20138C14.6948 9.92223 13.1236 11.2569 11.2876 11.7508C12.6328 9.25579 12.4668 6.20748 10.8974 3.89562Z" fill="#EE342F"/> </g> </g> <defs> <clipPath id="clip0_3_23"> <rect width="16" height="16" fill="white"/> </clipPath> <clipPath id="clip1_3_23"> <rect width="16" height="16" fill="white"/> </clipPath> </defs> </svg> --- name: convex-component-authoring displayName: Convex Component Authoring description: How to create, structure, and publish self-contained Convex components with proper isolation, exports, and dependency management version: 1.0.0 author: Convex tags: [convex, components, reusable, packages, npm] --- # Convex Component Authoring Create self-contained, reusable Convex components with proper isolation, exports, and dependency management for sharing across projects. ## Documentation Sources Before implementing, do not assume; fetch the latest documentation: - Primary: https://docs.convex.dev/components - Component Authoring: https://docs.convex.dev/components/authoring - For broader context: https://docs.convex.dev/llms.txt ## Instructions ### What Are Convex Components? Convex components are self-contained packages that include: - Database tables (isolated from the main app) - Functions (queries, mutations, actions) - TypeScript types and validators - Optional frontend hooks ### Component Structure ``` my-convex-component/ ├── package.json ├── tsconfig.json ├── README.md ├── src/ │ ├── index.ts # Main exports │ ├── component.ts # Component definition │ ├── schema.ts # Component schema │ └── functions/ │ ├── queries.ts │ ├── mutations.ts │ └── actions.ts └── convex.config.ts # Component configuration ``` ### Creating a Component #### 1. Component Configuration ```typescript // convex.config.ts import { defineComponent } from "convex/server"; export default defineComponent("myComponent"); ``` #### 2. Component Schema ```typescript // src/schema.ts import { defineSchema, defineTable } from "convex/server"; import { v } from "convex/values"; export default defineSchema({ // Tables are isolated to this component items: defineTable({ name: v.string(), data: v.any(), createdAt: v.number(), }).index("by_name", ["name"]), config: defineTable({ key: v.string(), value: v.any(), }).index("by_key", ["key"]), }); ``` #### 3. Component Definition ```typescript // src/component.ts import { defineComponent, ComponentDefinition } from "convex/server"; import schema from "./schema"; import * as queries from "./functions/queries"; import * as mutations from "./functions/mutations"; const component = defineComponent("myComponent", { schema, functions: { ...queries, ...mutations, }, }); export default component; ``` #### 4. Component Functions ```typescript // src/functions/queries.ts import { query } from "../_generated/server"; import { v } from "convex/values"; export const list = query({ args: { limit: v.optional(v.number()), },