convex-create-component
Qué hace
Esta habilidad ayuda a los desarrolladores a empaquetar la lógica del backend en un componente reutilizable de Convex. Está pensada para crear piezas autocontenidas que gestionan sus propios datos y pueden compartirse entre apps.
Cuándo usarla
- ✓Cuando quieres pasar una función de backend a una pieza que otras apps de Convex puedan reutilizar.
- ✓Cuando estás creando una integración de terceros que necesita sus propias tablas.
- ✓Cuando quieres mantener el código reutilizable del backend separado de la lógica de la app principal.
Link de la skill
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-create-component/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Convierte mi código de gestión de pagos en un componente reutilizable de Convex con sus propias tablas de datos.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente primero comprueba que un componente sea la elección correcta, después planifica qué tablas y funciones necesita, crea sus archivos de configuración y esquema, y mantiene pequeña la API que ve la app.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Convex Create Component
Create reusable Convex components with clear boundaries and a small app-facing API.
When to Use
- Creating a new Convex component in an existing app
- Extracting reusable backend logic into a component
- Building a third-party integration that should own its own tables and workflows
- Packaging Convex functionality for reuse across multiple apps
When Not to Use
- One-off business logic that belongs in the main app
- Thin utilities that do not need Convex tables or functions
- App-level orchestration that should stay in
convex/ - Cases where a normal TypeScript library is enough
Workflow
- Ask the user what they are building and what the end goal is. If the repo already makes the answer obvious, say so and confirm before proceeding.
- Choose the shape using the decision tree below and read the matching reference file.
- Decide whether a component is justified. Prefer normal app code or a regular library if the feature does not need isolated tables, backend functions, or reusable persistent state.
- Make a short plan for:
- what tables the component owns
- what public functions it exposes
- what data must be passed in from the app (auth, env vars, parent IDs)
- what stays in the app as wrappers or HTTP mounts
- Create the component structure with
convex.config.ts,schema.ts, and function files. - Implement functions using the component's own
./_generated/serverimports, not the app's generated files. - Wire the component into the app with
app.use(...). If the app does not already haveconvex/convex.config.ts, create it. - Call the component from the app through
components.<name>usingctx.runQuery,ctx.runMutation, orctx.runAction. - If React clients, HTTP callers, or public APIs need access, create wrapper functions in the app instead of exposing component functions directly.
- Run
npx convex devand fix codegen, type, or boundary issues before finishing.
Choose the Shape
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.
Default Approach
Unless the user explicitly wants an npm package, default to a local component:
- Put it under
convex/components/<componentName>/ - Define it with
defineComponent(...)in its ownconvex.config.ts - Install it from the app's
convex/convex.config.tswithapp.use(...) - Let
npx convex devgenerate the component's own_generated/files
Component Skeleton
A 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_read", ["userId", "read"]),
});
// 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() },
returns: v.id("notifications"),
handler: async (ctx, args) => {
return await ctx.db.insert("notifications", {
userId: args.userId,
message: args.message,
read: false,
});
},
});
export const listUnread = query({
args: { userId: v.string() },
returns: v.array(
v.object({
_id: v.id("notifications"),
_creationTime: v.number(),
userId: v.string(),
message: v.string(),
read: v.boolean(),
}),
),
handler: async (ctx, args) => {
return awai
Preguntas frecuentes
¿Cuándo no es buena elección un componente?
Cuando la lógica es puntual o es una utilidad sencilla que no necesita tablas ni funciones propias. Puede bastar una biblioteca normal.
¿Qué tiene que pasarle la app?
Cosas como datos de autenticación, valores de entorno e ids de registros padre, que la app entrega al componente.
¿Solo sirve para componentes nuevos?
No. Cubre componentes nuevos y también extraer a uno la lógica de backend existente.
Detalles
Descripción original del autor
Builds reusable Convex components with isolated tables and app-facing APIs. Use for new components, reusable backend modules, integrations, or component boundary work.
repo: openclaw/clawhub
Popularidad
- Estrellas en GitHub
- 9,5 mil
- Posición en el ranking
- #12239
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
axiom-alerting
9,5 milAyuda a tu agente a crear y gestionar monitores de Axiom y rutas de notificación mediante la API de Axiom, y a comprobar que las alertas se comportan como se espera.
axiom-sre
9,5 milAyuda a tu agente a investigar incidencias y errores de producción paso a paso, comprobando cada hipótesis con los registros de Axiom antes de sacar una conclusión.
building-dashboards
9,5 milAyuda a tu agente a diseñar paneles de Axiom con gráficos, consultas y filtros adecuados, partiendo de las decisiones que el panel debe respaldar.
controlling-costs
9,5 milAyuda a tu agente a encontrar datos sin uso en Axiom y a construir paneles y monitores que sigan y reduzcan el coste de los registros.
Skills parecidas
api-connector-builder
280 milHace que tu agente cree nuevas conexiones de API siguiendo el patrón existente. Úsalo para añadir una integración más sin inventar otra forma de hacer las cosas.
api-design
280 milAyuda a tu agente a diseñar APIs REST según las buenas prácticas. Es útil para definir cómo se comunican las APIs, cómo se muestran los errores y cómo organizar los datos.
backend-patterns
280 milAyuda a tu agente con patrones de arquitectura del lado del servidor y optimización de bases de datos. Es útil para crear o revisar código que se ejecuta en el servidor.