assistant-ui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAssistant UI
Assistant UI
Overview
概述
Use this skill to implement or debug assistant-ui integration end to end: CLI setup, runtime wiring, UI primitives, tool UI, and migration-safe upgrades. Load only the reference file needed for the current subtask to keep context focused.
使用此技能可端到端实现或调试assistant-ui集成:CLI设置、运行时集成、UI原语、工具UI以及可安全迁移的升级。仅加载当前子任务所需的参考文件,以保持上下文聚焦。
Workflow
工作流
- Classify the task before coding.
Determine whether the request is setup, runtime wiring, primitives, tools, cloud persistence, or migration.
If the request includes explicit exclusion language (), stop and do not use this skill.
without/no/not assistant-ui - Select runtime and architecture first. Choose AI SDK, LangGraph, or external-store path before editing components.
- Apply setup commands with minimum blast radius.
Prefer the smallest CLI operation (for existing projects,
addfor new projects).create - Wire provider and thread lifecycle.
Ensure and runtime hook are configured before Thread/Composer work.
AssistantRuntimeProvider - Implement tool UI using current APIs.
Prefer for registration; use
useAui + Tools({ toolkit })for UI-only bindings.makeAssistantToolUI - Validate and migrate safely. Run dry-run upgrade checks first, then codemods, then verification.
- 编码前先对任务进行分类。
确定请求属于设置、运行时集成、原语、工具、云端持久化还是迁移类别。
如果请求包含明确的排除语言(),则停止操作,不要使用此技能。
without/no/not assistant-ui - 先选择运行时和架构。 在编辑组件之前,选择AI SDK、LangGraph或外部存储路径。
- 使用影响范围最小的设置命令。
优先选择最小的CLI操作(现有项目用,新项目用
add)。create - 集成提供程序和线程生命周期。
在进行Thread/Composer相关工作之前,确保已配置和运行时钩子。
AssistantRuntimeProvider - 使用当前API实现工具UI。
优先使用进行注册;对于仅UI绑定的场景,使用
useAui + Tools({ toolkit })。makeAssistantToolUI - 安全验证与迁移。 先运行试运行升级检查,然后执行代码迁移工具(codemods),最后进行验证。
Runtime Decision Rules
运行时决策规则
- Choose AI SDK runtime when backend communication is a chat endpoint and no graph thread state is required.
- Choose LangGraph runtime when thread lifecycle () and interrupts are required.
initialize/create/load - Choose external store runtime when app state is controlled outside assistant-ui.
- Add Assistant Cloud only when persistence, auth-linked thread continuity, or multi-device resume is required.
Load for the matrix and expected outputs.
references/runtime-selection.md- 当后端通信为聊天端点且不需要图线程状态时,选择AI SDK运行时。
- 当需要线程生命周期()和中断功能时,选择LangGraph运行时。
initialize/create/load - 当应用状态由assistant-ui外部控制时,选择外部存储运行时。
- 仅当需要持久化、与认证关联的线程连续性或多设备恢复功能时,才添加Assistant Cloud。
加载查看决策矩阵和预期输出。
references/runtime-selection.mdExecution Protocol
执行协议
- Read for command sequence and flags.
references/setup-and-cli.md - Read exactly one runtime reference.
- Read for LangGraph.
references/langgraph-runtime.md - Read for AI SDK or external-store decisions.
references/runtime-selection.md
- Read only if tools are in scope.
references/tool-ui-patterns.md - Read only if cloud is in scope.
references/cloud-persistence.md - Read only when failures appear.
references/troubleshooting.md
- 阅读了解命令序列和参数。
references/setup-and-cli.md - 仅阅读一个运行时参考文件。
- 若使用LangGraph,阅读。
references/langgraph-runtime.md - 若选择AI SDK或外部存储,阅读。
references/runtime-selection.md
- 仅当工具在任务范围内时,阅读。
references/tool-ui-patterns.md - 仅当云端功能在任务范围内时,阅读。
references/cloud-persistence.md - 仅当出现故障时,阅读。
references/troubleshooting.md
Output Contract
输出合约
When implementing assistant-ui tasks, deliver these artifacts unless the user scope explicitly excludes them:
- Runtime provider wiring that matches the chosen runtime.
- Thread and composer integration that compiles with the chosen runtime.
- Tool registration and rendering behavior consistent with current APIs.
- Environment variable expectations for cloud flows.
- Upgrade path or migration notes if dependency upgrades are requested.
在实现assistant-ui任务时,除非用户明确排除,否则需交付以下成果:
- 与所选运行时匹配的运行时提供程序集成代码。
- 与所选运行时兼容的Thread和Composer集成代码。
- 符合当前API的工具注册与渲染逻辑。
- 云端流程所需的环境变量说明。
- 若请求依赖项升级,需提供升级路径或迁移说明。
Guardrails
防护措施
- Prefer over legacy registration helpers.
Tools({ toolkit }) - Use only for UI bindings to already-defined backend tools.
makeAssistantToolUI - Keep LangGraph thread handling explicit: ,
initialize, andcreate.load - Execute upgrade sequence in this order: ->
update --dry->upgrade-> test.codemod - Avoid broad documentation dumps; load only relevant references.
- Do not activate this workflow for comparison-only requests that do not require assistant-ui implementation changes.
- 优先使用而非旧版注册助手。
Tools({ toolkit }) - 仅在为已定义的后端工具绑定UI时使用。
makeAssistantToolUI - 明确处理LangGraph线程:、
initialize和create。load - 按以下顺序执行升级流程:->
update --dry->upgrade-> 测试。codemod - 避免大量输出文档;仅加载相关参考文件。
- 对于仅需对比、无需修改assistant-ui实现的请求,不要激活此工作流。
Reference Map
参考地图
- Setup and CLI:
references/setup-and-cli.md - Runtime selection:
references/runtime-selection.md - LangGraph runtime wiring:
references/langgraph-runtime.md - Tool UI patterns:
references/tool-ui-patterns.md - Cloud persistence:
references/cloud-persistence.md - Debug and recovery:
references/troubleshooting.md
- 设置与CLI:
references/setup-and-cli.md - 运行时选择:
references/runtime-selection.md - LangGraph运行时集成:
references/langgraph-runtime.md - 工具UI模式:
references/tool-ui-patterns.md - 云端持久化:
references/cloud-persistence.md - 调试与恢复:
references/troubleshooting.md