delegate-to-agent
它能做什么
这项技能说明应用按钮或工作流应如何把 AI 工作交给智能体聊天。确定性的操作留在应用内,而智能体负责推理和多步骤任务。适合为应用添加 AI 功能的开发者。
适用场景
- ✓当你要添加一个需要 AI 推理、研究或生成的按钮的时候。
- ✓当一个工作流包含多个步骤,用户应能观察并引导的时候。
- ✓当后续操作应当由聊天中的智能体处理的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/.agents/skills/delegate-to-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能让我应用中的“总结”按钮把文档发送到智能体聊天中,这样我可以跟进总结过程吗?”
每周 5 个新技能,1 分钟读完。
工作原理
应用把用户的请求连同简短的支持上下文发送到智能体聊天,并打开侧边栏,使工作过程可见。智能体通过应用授权的操作读取私有数据。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Delegate AI Work to Agent Chat
Rule
Use the agent chat for work that needs AI reasoning, research, generation, or multi-step decisions. Keep app actions deterministic; let the agent orchestrate them so the user can see and steer the work.
Start a visible agent turn
Call sendToAgentChat() from the UI and open the AgentSidebar for user-initiated
work:
import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
sendToAgentChat({
message: userRequest,
context: JSON.stringify({ documentId }),
submit: true,
openSidebar: true,
});
Keep the user's request in message. Put only concise supporting context—such
as a selected record id, current view, or bounded excerpt—in context. Use
attachments or image fields for files and visuals; do not serialize full
records or credentials into a prompt. The agent should read private or large
data through the app's authorized actions.
Use submit: true when a clear user action already states the intent. Use
submit: false to open the composer with a prefill when the user should review
or complete the request. Do not auto-submit a generic generation prompt before
the user has supplied the request.
Reserve background: true with openSidebar: false for work the product
intentionally runs silently, such as a system-initiated task. A button that
asks the user to do AI work should open the sidebar.
Keep the boundary clear
- Use focused actions for provider reads, validation, deterministic transformations, database writes, and other explicit operations.
- Let the agent choose and sequence those actions for AI-shaped workflows.
- Keep a user's freeform prompt in the AgentSidebar composer. Use controls for structured parameters; do not add a second prompt or follow-up textbox.
- Do not call model-provider SDKs,
completeText(), or AI SDK generation functions from app UI, actions, or server helpers. Do not make an action a hidden second agent.
Related skills
actions— define deterministic operations shared by the UI and agent.context-awareness— provide navigation and selected-record context.
常见问题
每个 AI 按钮都应自动提交吗?
不应该。技能说明只有当用户的操作明确表达了意图时,才应自动提交。
大型记录应该放进消息中吗?
不应该。技能要求只发送简洁的上下文,并让智能体通过授权操作读取数据。
什么时候允许后台工作?
只允许产品有意运行的系统启动任务,而不允许用户点击的按钮这样做。
详情
作者的原始描述
Route user-facing AI work through the app's agent chat. Use when adding an AI-powered button, workflow, research task, generation flow, or follow-up.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13154
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …