convex-create-component
यह क्या करती है
यह स्किल डेवलपर्स को बैकएंड लॉजिक को दोबारा इस्तेमाल होने वाले Convex कंपोनेंट में पैक करने में मदद करती है। यह स्वतंत्र हिस्से बनाने के लिए है जो अपना डेटा रखते हैं और कई ऐप में साझा हो सकते हैं।
कब इस्तेमाल करें
- ✓जब आप बैकएंड सुविधा को ऐसे हिस्से में बदलना चाहें जिसे दूसरे Convex ऐप दोबारा इस्तेमाल कर सकें।
- ✓जब आप किसी तीसरे पक्ष के इंटीग्रेशन पर काम कर रहे हों जिसे अपनी तालिकाएँ चाहिए।
- ✓जब आप मुख्य ऐप के लॉजिक से अलग दोबारा इस्तेमाल होने वाला बैकएंड कोड रखना चाहें।
Skill का लिंक
https://github.com/openclaw/clawhub/blob/main/.agents/skills/convex-create-component/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे भुगतान संभालने वाले कोड को अपनी डेटा तालिकाओं वाले दोबारा इस्तेमाल होने वाले Convex कंपोनेंट में बदलिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले जाँचता है कि कंपोनेंट सही चुनाव है या नहीं, फिर योजना बनाता है कि उसे कौन सी तालिकाएँ और फ़ंक्शन चाहिए, उसकी config और schema फ़ाइलें बनाता है, और ऐप के लिए API को छोटा रखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
कंपोनेंट सही चुनाव कब नहीं है?
जब लॉजिक एक बार का हो, या कोई साधारण यूटिलिटी हो जिसे अपनी तालिकाएँ या फ़ंक्शन न चाहिएँ। सामान्य लाइब्रेरी काफ़ी हो सकती है।
ऐप को क्या पास करना होता है?
जैसे प्रमाणीकरण विवरण, environment मान और parent रिकॉर्ड id, जिन्हें ऐप कंपोनेंट को देता है।
क्या यह सिर्फ़ नए कंपोनेंट के लिए काम करती है?
नहीं। यह नए कंपोनेंट के साथ मौजूदा बैकएंड लॉजिक को एक कंपोनेंट में निकालने को भी कवर करती है।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 9.5k
- रैंकिंग में स्थान
- #12239
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
axiom-alerting
9.5kआपके एजेंट को Axiom API से Axiom मॉनिटर और सूचना मार्ग बनाने और प्रबंधित करने में मदद करती है, और यह जाँचती है कि अलर्ट अपेक्षित ढंग से काम करते हैं।
axiom-sre
9.5kआपके एजेंट को प्रोडक्शन घटनाओं और बग की जाँच चरण-दर-चरण करने देती है, निष्कर्ष निकालने से पहले हर अनुमान को Axiom लॉग से परखते हुए।
building-dashboards
9.5kआपके एजेंट को Axiom डैशबोर्ड डिज़ाइन करने में मदद करती है, जिसमें सही चार्ट, क्वेरी और फ़िल्टर हों, और शुरुआत उन फ़ैसलों से होती है जिन्हें डैशबोर्ड सहारा देगा।
controlling-costs
9.5kआपके एजेंट को Axiom में अनुपयोगी डेटा ढूँढने और ऐसे डैशबोर्ड व मॉनिटर बनाने में मदद करती है जो लॉगिंग लागत को ट्रैक करें और घटाएँ।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।