convex-create-component 是什么?
convex-create-component 为Convex建立可复用后端组件,让组件拥有自己的表与函数,通过小而明确的API连接主应用。主应用保留登录、环境变量和HTTP挂载,避免把隔离边界当普通目录拆分。
中文说明由本站依据来源整理;英文原文保留在页面下方。
适合用在
- 跨应用复用的后端功能、第三方集成或需要独立数据表的模块。
这些情况不适合
- 一次性业务函数或普通TypeScript工具库,没有必要引入组件数据边界。
同名项目,请核对仓库和目录
怎么接入你的 Agent?
- 定位完整 Skill 目录
打开本项目来源,核对
SKILL.md及其引用的脚本和资料。 - 交给你正在用的 Agent
在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。
- 确认识别,再做具体任务
让 Agent 回报安装目录和识别到的名称
convex-create-component,然后按本页使用示例提供材料。
展开并复制给 Codex 的安装指令
安装并检查 convex-create-component
请在 Codex 的当前工作环境中安装并检查 convex-create-component 这个 Skill。
项目身份:get-convex/agent-skills / convex-create-component
来源:https://github.com/get-convex/agent-skills/blob/3fa4a566ba5d843d8a3db303983839ba93e8531d/skills/convex-create-component/SKILL.md
已定位的源文件:skills/convex-create-component/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Claude Code 的安装指令
安装并检查 convex-create-component
请在 Claude Code 的当前工作环境中安装并检查 convex-create-component 这个 Skill。
项目身份:get-convex/agent-skills / convex-create-component
来源:https://github.com/get-convex/agent-skills/blob/3fa4a566ba5d843d8a3db303983839ba93e8531d/skills/convex-create-component/SKILL.md
已定位的源文件:skills/convex-create-component/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 Cursor 的安装指令
安装并检查 convex-create-component
请在 Cursor Agent 的当前工作环境中安装并检查 convex-create-component 这个 Skill。
项目身份:get-convex/agent-skills / convex-create-component
来源:https://github.com/get-convex/agent-skills/blob/3fa4a566ba5d843d8a3db303983839ba93e8531d/skills/convex-create-component/SKILL.md
已定位的源文件:skills/convex-create-component/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。展开并复制给 当前 Agent 的安装指令
安装并检查 convex-create-component
请在 当前 Agent 的当前工作环境中安装并检查 convex-create-component 这个 Skill。
项目身份:get-convex/agent-skills / convex-create-component
来源:https://github.com/get-convex/agent-skills/blob/3fa4a566ba5d843d8a3db303983839ba93e8531d/skills/convex-create-component/SKILL.md
已定位的源文件:skills/convex-create-component/SKILL.md
1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。装好以后,具体怎么用?
准备哪些材料
- 已有Convex工程和部署上下文,明确组件拥有的表、对外函数、主应用传入的数据;选择本地、打包或混合形态并读对应参考。
会得到什么
- 独立组件、应用注册和包装API,以及真实codegen与类型检查结果。
实际使用顺序
- 先判断是否确实需要组件,默认本地形式放在convex/components下。
- 编写组件自己的convex.config.ts、schema与函数,函数从自身_generated/server导入,并给公开函数写args和returns验证。
- 在应用配置中app.use注册,通过components引用调用;登录和密钥在应用侧解析,客户端入口使用应用包装函数。
- 先做组件和应用codegen,再运行开发验证;跨组件分页等特殊模式按对应参考处理。
从一个具体任务开始
本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。
复制一个具体任务
用 convex-create-component 把现有通知逻辑评估为本地组件。先判断是否需要独立表,若适合,明确未读通知API和应用侧鉴权包装。父应用用户ID跨边界用字符串,不让组件直接读ctx.auth或process.env。生成后验证codegen,未配置部署时明确阻碍。预期组件职责与应用职责清楚,客户端不能绕过应用鉴权;本站未执行本例。
使用条件与边界
- 组件没有主应用ctx.auth和环境变量,父应用表ID也不属于组件的表命名空间。
- 来源要求组件分页使用convex-helpers的paginator,不能把普通应用paginate照搬跨边界。
常见问题
可以把组件函数直接暴露给React吗?
来源要求先在主应用写包装函数,做鉴权、环境及HTTP接入,再调用组件内部API。
来源原文与资料状态
- 源文件
- 已保存 SKILL.md,抓取于 2026-11-17T10:50:43.010Z
- 中文使用说明
- 已针对下方源文件版本整理用途、用法和常见问题
- 安装与任务测试
- 本站未执行安装或任务测试
- 来源复核
- 本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料
skills/convex-create-component/SKILL.md · 抓取时间 2026-11-17T10:50:43.010Z
以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。
抓取成功不代表已完成安装或任务测试。
Builds reusable Convex components with isolated tables and app-facing APIs. Use for new components, reusable backend modules, integrations, or component boundary work.
查看源文件章节 / Source sections
- 原文:Convex Create Component
- 原文:When to Use
- 原文:When Not to Use
- 工作流程 / Workflow
- 原文:Choose the Shape
- 原文:Default Approach
- 原文:Component Skeleton
- 原文:Critical Rules
- 原文:Patterns
- 原文:Authentication and environment access
- 原文:Client-facing API
- 原文:IDs across the boundary
- 原文:Advanced Patterns
- 原文:Validation
- 原文:Reference Files
- 原文:Checklist
原文: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
1. 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. 2. Choose the shape using the decision tree below and read the matching reference file. 3. 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. 4. 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 5. Create the component structure with `convex.config.ts`, `schema.ts`, and function files. 6. Implement functions using the component's own `./_generated/server` imports, not the app's generated files. 7. Wire the component into the app with `app.use(...)`. If the app does not already have `convex/convex.config.ts`, create it. 8. Call the component from the app through `components.<name>` using `ctx.runQuery`, `ctx.runMutation`, or `ctx.runAction`. 9. If React clients, HTTP callers, or public APIs need access, create wrapper functions in the app instead of exposing component functions directly. 10. Run `npx convex dev` and 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 own `convex.config.ts` - Install it from the app's `convex/convex.config.ts` with `app.use(...)` - Let `npx convex dev` generate the component's own `_generated/` files
文件 SHA256:71c4781ec586f9dde750de892242848a3981f4b0003ec5d362c2921eb27017e9
仓库许可证记录:未提供;not-established,查看来源。
Builds reusable Convex components with isolated tables and app-facing APIs. Use for new components, reusable backend modules, integrations, or component…
这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。
历史收录数据
| Skill标识 | convex-create-component |
|---|---|
| 来源仓库 | get-convex/agent-skills |
| 榜单快照 | 2026-07-28 |
| 榜单口径 | Skills.sh累计安装量 |
| 快照名次 | 234 |
| 快照累计安装量 | 91885 |
历史资料说明
- 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
- 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。
此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。
