Agent skill · software engineering · assistant-ui
runtime
Guide to the assistant-ui runtime system, the state and action layer behind every chat surface, in @assistant-ui/react. Use when creating a runtime (useLocalRuntime with a ChatModelAdapter, useExternalStoreRuntime for Redux or Zustand backed stores, useRemoteThreadListRuntime, useCloudThreadListRuntime, useAssistantTransportRuntime), wiring AssistantRuntimeProvider, or reading and mutating thread, message, composer, and attachment state. Covers useAui, useAuiState, and useAuiEvent, including the one primitive or stable reference selector rule from hooks/state.mdx, the property scope accessors (aui.thread, aui.threads, aui.message, aui.composer, aui.part, aui.threadListItem) with source availability, the AuiConfig plus AuiProvider grammar (config, extends, isolated roots, and the config prop on AssistantRuntimeProvider), the s.optional.<scope> view, the threads.selectionChanged event and the events it replaced, RuntimeCapabilities including refetchThread, and the attachment, speech, dictation, feedback, suggestion, and history adapters. Route here for a provider error ('Cannot read property of undefined'), a removed v0.12 hook import, an infinite re-render from an object literal selector, or state not updating. For multi-thread list UI and switching between conversations use thread-list instead; for toolkit definitions and tool call UI use tools instead.
Why this skill is useful
Provides specific commands and patterns for managing state and runtime in the assistant-ui framework that the AI wouldn't reliably generate on its own.
What it needs
About 6k tokens when loaded. Last updated 2026-08-02. 20 stars on the source repository.
What this skill does
assistant-ui Runtime Always consult assistant-ui.com/llms.txt for the latest API. A runtime is the state and action layer behind a chat UI: it owns messages, threads, branching, and run lifecycle, and every primitive and hook reads from it through a uniform AssistantClient. There are two ways to build one. LocalRuntime (useLocalRuntime) owns the message store for you; you implement one ChatModelAdapter.run function and branching, editing, and regeneration come for free. ExternalStoreRuntime (useExternalStoreRuntime) is the inverse: you own the messages, and UI features turn on based on which callbacks you supply. Framework adapters such as useChatRuntime (@assistant-ui/ai-sdk) and protocol runtimes such as useAssistantTransportRuntime are built on one of these two. Once mounted under AssistantRuntimeProvider, every runtime is read and driven the same way, through useAui, useAuiState, and useAuiEvent. References ./references/local-runtime.md -- useLocalRuntime deep dive: streaming, tool calls, human-in-the-loop, approval gates, resumeRun ./references/external-store.md -- useExternalStoreRuntime deep dive: handler matrix, branching, queueing, tool results ./references/state-hooks.md -- useAui, useAuiState, useAuiEvent, state shape, removed legacy hooks ./references/types.md -- ThreadMessage, MessageStatus, MessagePart, attachment, and capability types ./references/adapters.md -- attachment, speech, dictation, feedback, suggestion, and history adapters ./references/voice.md -- realtime duplex voice with RealtimeVoiceAdapter ./references/runtime-concepts.md -- unstable policy, useAssistantTransportRuntime, MessageNotSentError, reloadMainThread, message timing Runtime hierarchy modelContext and tools resolve independently of the thread scope; see runtime-concepts.md and the tools skill. Every node in the tree is reachable from aui.<scope> (imperative) or s.<scope> inside a useAuiState selector (reactive), scoped automatically to where the calling component is rendered. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills assistant-ui/runtime