Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

convex-agents-fundamentals凸 Agent 基本原理

Agent Skill

convex-agents-fundamentals 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

4,925

周安装

100

GitHub Stars

23

下载量

1,141
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:convex-agents-fundamentals(凸 Agent 基本原理)
来源仓库:https://github.com/sstobo/convex-skills
仓库路径:skills/convex-agents-fundamentals
安装命令:
npx skills add https://github.com/sstobo/convex-skills --skill 'Convex Agents Fundamentals'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sstobo/convex-skills --skill 'Convex Agents Fundamentals'

简介

convex-agents-fundamentals 指导 Convex Agent 的基础搭建与响应生成流程。

  • 适用于首次集成 Agent 到项目或配置系统提示词、模型参数场景。
  • 涵盖线程创建、消息历史管理与 JSON 对象结构化输出方法。
  • 需安装 agent 组件并导入 Convex 客户端,绑定 chat model 与 embedding model。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Purpose

Guides you through the core patterns for setting up Convex agents, managing conversation threads, and generating LLM responses. This is the foundation upon which all other agent capabilities build.

When to Use This Skill

  • Setting up your first Convex agent in a project
  • Creating or continuing conversation threads with users
  • Generating text responses or structured JSON objects from an LLM
  • Configuring agent defaults (system prompt, chat model, embedding model)
  • Building basic chat interfaces that need message history

How to Use It

1. Install and Configure

Add the agent component to your convex.config.ts:

// convex/convex.config.ts
import { defineApp } from "convex/server";
import agent from "@convex-dev/agent/convex.config";

const app = defineApp();
app.use(agent);

export default app;

Run npx convex dev to generate the required code.

2. Define Your Agent

Create an agent instance with a chat model:

// convex/agents/myAgent.ts
import { components } from "../_generated/api";
import { Agent } from "@convex-dev/agent";
import { openai } from "@ai-sdk/openai";

export const myAgent = new Agent(components.agent, {
  name: "My Assistant",
  languageModel: openai.chat("gpt-4o-mini"),
  instructions: "You are a helpful assistant.", // Optional: default system prompt
});

3. Create Threads

Create a thread for a user to manage their conversation history:

// convex/threads.ts
import { action } from "../_generated/server";
import { v } from "convex/values";
import { myAgent } from "./agents/myAgent";

export const createNewThread = action({
  args: { userId: v.string() },
  handler: async (ctx, { userId }) => {
    const { thread } = await myAgent.createThread(ctx, {
      userId,
      title: "New Conversation",
    });
    return { threadId: thread.getMetadata().threadId };
  },
});

4. Generate Responses

Generate text or structured responses in a thread:

// convex/generation.ts
export const generateReply = action({
  args: { threadId: v.string(), prompt: v.string() },
  handler: async (ctx, { threadId, prompt }) => {
    const { thread } = await myAgent.continueThread(ctx, { threadId });
    const result = await thread.generateText({ prompt });
    return result.text;
  },
});

Key Principles

  • Thread isolation: Each user/conversation gets its own thread for independent history
  • Automatic message storage: Generated responses are automatically saved to the thread
  • Context by default: Each generation includes recent message history automatically
  • Async-friendly: Use actions for LLM calls; mutations for transactional writes
  • Type safety: Always provide explicit return types to avoid circular reference errors

Common Patterns

  • Per-user organization: Always include userId when creating threads
  • Message history: Automatically included in LLM context
  • Thread reuse: Same thread can be used by multiple agents

Next Steps

  • Manage threads: See threads skill for conversation management
  • Work with messages: See messages skill for saving and retrieving
  • Add tools: See tools skill to let agents take actions

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.56%
按下载量换算383

Claude

32%
按下载量换算365

Cursor

16.84%
按下载量换算192

Gemini CLI

9.45%
按下载量换算108

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills