闲社服务运行正常AI智能体自动化平台
c

CopilotKit代理模式

技能标识:copilotkit-agent-patterns

Patterns for building AI agents that integrate with CopilotKit. Use when designing agent architecture, implementing AG-UI event streaming, managing shared state between agent and UI, adding human-in-the-loop checkpoints, or emitting generative UI from agents. Triggers on agent implementation tasks involving CopilotKit runtime, BuiltInAgent, or AG-UI protocol.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.2
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

CopilotKit代理模式

CopilotKit 智能体模式

构建连接 CopilotKit 的 AI 智能体的架构与实现模式。包含 5 个类别共 20 条规则,按影响优先级排序。

适用场景

在以下情况参考这些指南:

  • - 设计 CopilotKit 集成的智能体架构
  • 实现 AG-UI 协议事件流
  • 管理智能体与前端的同步状态
  • 在智能体工作流中添加人工介入检查点
  • 发出在前端渲染生成式 UI 的工具调用

按优先级分类的规则类别

优先级类别影响前缀
1智能体架构关键architecture-
2
AG-UI 协议 | 高 | agui- | | 3 | 状态管理 | 高 | state- | | 4 | 人工介入 | 中 | hitl- | | 5 | 生成式 UI 发出 | 中 | genui- |

快速参考

1. 智能体架构(关键)

  • - architecture-built-in-agent - 对简单智能体使用 @copilotkit/runtime/v2 中的 BuiltInAgent
  • architecture-model-resolution - 使用 provider/model 字符串格式进行模型选择
  • architecture-max-steps - 设置 maxSteps 以防止无限工具调用循环
  • architecture-mcp-servers - 配置 MCP 端点以访问外部工具

2. AG-UI 协议(高)

  • - agui-event-ordering - 按正确顺序发出事件(开始 -> 内容 -> 结束)
  • agui-text-streaming - 增量流式传输文本,而非作为单个块
  • agui-tool-call-lifecycle - 遵循完整的工具调用事件生命周期
  • agui-state-snapshot - 发出 STATE_SNAPSHOT 事件以同步前端
  • agui-error-events - 失败时始终发出错误事件

3. 状态管理(高)

  • - state-snapshot-frequency - 在有意义的检查点发出状态快照
  • state-minimal-payload - 保持状态快照最小化且可序列化
  • state-conflict-resolution - 优雅处理双向状态冲突
  • state-thread-isolation - 按线程隔离状态,而非按智能体

4. 人工介入(中)

  • - hitl-approval-gates - 使用工具调用而非自定义事件实现审批关卡
  • hitl-timeout-fallback - 始终设置超时并附带回退行为
  • hitl-context-in-prompt - 在提示中包含足够上下文以供用户决策
  • hitl-resume-state - 审批后恢复时保留完整状态

5. 生成式 UI 发出(中)

  • - genui-tool-call-render - 发出映射到前端 useRenderTool 的工具调用
  • genui-streaming-args - 增量流式传输工具参数以实现实时 UI
  • genui-activity-messages - 对非工具状态更新使用文本消息

使用方法

阅读单个规则文件以获取详细说明和代码示例:

rules/architecture-built-in-agent.md
rules/agui-event-ordering.md

完整编译文档

如需包含所有规则扩展的完整指南:AGENTS.md

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 copilotkit-agent-patterns-1776320056 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 copilotkit-agent-patterns-1776320056 技能

通过命令行安装

skillhub install copilotkit-agent-patterns-1776320056

下载

⬇ 下载 copilotkit-agent-patterns v1.0.2(免费)

文件大小: 27.57 KB | 发布时间: 2026-4-16 16:42

v1.0.2 最新 2026-4-16 16:42
Version 2.0.0

- Updated agent architecture patterns to use BuiltInAgent from @copilotkit/runtime/v2 and clarified model selection format.
- Adjusted architecture guidance to reference MCP "endpoints" instead of servers.
- Standardized generative UI emission practices: use text messages for non-tool status updates.
- Incremented version metadata to reflect major changes in guidelines.
- No code changes; documentation improvements only.
返回顶部