convex-create-component
Was er macht
Dieser Skill hilft Entwickelnden, Backend-Logik in einer wiederverwendbaren Convex-Komponente zu bündeln. Er ist für in sich geschlossene Bausteine gedacht, die ihre eigenen Daten besitzen und über mehrere Apps geteilt werden können.
Wann du ihn nutzt
- ✓Wenn du eine Backend-Funktion in einen Baustein verschieben willst, den andere Convex-Apps wiederverwenden können.
- ✓Wenn du eine Integration eines Drittanbieters baust, die eigene Tabellen braucht.
- ✓Wenn du wiederverwendbaren Backend-Code getrennt von der Logik der Haupt-App halten willst.
Link zum Skill
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-create-component/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Mach aus meinem Code zur Zahlungsabwicklung eine wiederverwendbare Convex-Komponente mit eigenen Datentabellen.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent prüft zuerst, ob eine Komponente die richtige Wahl ist, plant dann, welche Tabellen und Funktionen sie braucht, erstellt die Konfigurations- und Schema-Dateien und hält die Schnittstelle zur App klein.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen
Wann ist eine Komponente nicht die richtige Wahl?
Wenn die Logik einmalig ist oder ein einfaches Hilfswerkzeug, das keine eigenen Tabellen oder Funktionen braucht. Eine normale Bibliothek kann dann reichen.
Was muss die App übergeben?
Dinge wie Authentifizierungsdaten, Umgebungswerte und IDs übergeordneter Datensätze, die die App der Komponente gibt.
Funktioniert es nur für neue Komponenten?
Nein. Es deckt neue Komponenten ab und auch das Herauslösen vorhandener Backend-Logik in eine Komponente.
Details
Originalbeschreibung des Autors
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
Beliebtheit
- GitHub-Sterne
- 9.5k
- Platz im Ranking
- #12239
- Lizenz
- MIT
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
axiom-alerting
9.5kHilft deinem Agenten, Axiom-Monitore und Benachrichtigungswege über die Axiom-API anzulegen und zu verwalten und zu prüfen, ob Warnungen wie erwartet funktionieren.
axiom-sre
9.5kHilft deinem Agenten, Produktionsstörungen und Fehler Schritt für Schritt zu untersuchen und jede Vermutung gegen Axiom-Logs zu prüfen, bevor er ein Ergebnis zieht.
building-dashboards
9.5kHilft deinem Agenten, Axiom-Dashboards mit passenden Diagrammen, Abfragen und Filtern zu entwerfen, ausgehend von den Entscheidungen, die das Dashboard stützen muss.
controlling-costs
9.5kHilft deinem Agenten, ungenutzte Daten in Axiom zu finden und Dashboards und Monitore aufzubauen, die die Logging-Kosten verfolgen und senken.
Ähnliche Skills
api-connector-builder
280kLässt deinen Agenten neue API-Anbindungen nach dem bestehenden Muster bauen. Nutze es, wenn du eine weitere Integration ergänzen willst, ohne neue Wege einzuführen.
api-design
280kHilft deinem Agenten, REST-APIs nach Best Practices zu entwerfen. Nützlich für die Kommunikation, die Fehlerausgabe und die Organisation von Daten.
backend-patterns
280kHilft deinem Agenten bei Architekturmustern für die Serverseite und bei der Datenbankoptimierung. Nützlich zum Bauen und Prüfen von Server-Code.