LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

runtime

Guide to the assistant-ui runtime system, single-thread state, and the imperative runtime API in @assistant-ui/react. Use when creating a runtime (useLocalRuntime with a ChatModelAdapter, useExternalStoreRuntime for Redux/Zustand, useRemoteThreadListRuntime), wiring AssistantRuntimeProvider, or reading/mutating thread, message, and composer state and events. Covers the unified hooks useAui, useAuiState, useAuiEvent (composer.send, thread.runStart, thread.runEnd), legacy hooks (useAssistantRuntim

16stars2forksUpdated 6/15/2026
Web Development#assistant-ui#chat-interface#react#runtime#state-management#typescript

Security Assessment

Safe(90/100)

Detected risks:

Sensitive File Access([references/local-runtime.md] .env)
Security Score90/100

About runtime

The runtime skill provides comprehensive guidance for working with the assistant-ui runtime system, a hierarchical state management architecture designed for conversational AI interfaces. It addresses the challenge of managing complex chat state, including threads, messages, composer input, and real-time updates in React applications. The skill covers the modern API patterns using hooks like useAui, useAuiState, and useAuiEvent for accessing and manipulating runtime state.

This skill encompasses the complete runtime hierarchy from AssistantRuntime at the top level down through ThreadListRuntime for thread management, ThreadRuntime for current conversation state, and MessageRuntime for individual message handling. It provides patterns for common operations like appending messages, canceling generation, editing content, and reloading responses. The skill also covers advanced features including event handling, capability checking, and efficient state selection to prevent unnecessary re-renders.

The primary use cases include building custom chat interfaces, implementing message management systems, handling real-time AI responses, and creating conversational UIs with React. It's targeted at frontend developers working with assistant-ui, particularly those building AI chat applications that require fine-grained control over conversation state, message lifecycle, and user interactions. The skill is essential for anyone integrating the assistant-ui library into React applications.

FAQ

How do I access the current thread's messages and running state?

Use useAuiState with selectors: `const messages = useAuiState(s => s.thread.messages)` and `const isRunning = useAuiState(s => s.thread.isRunning)`. This provides reactive access to thread state with optimal re-render performance.

What's the difference between useAui and useAuiState?

useAui returns the API object for performing actions like thread.append() or message.edit(), while useAuiState is used to subscribe to state changes reactively. Use useAui for operations and useAuiState for reading state.

How do I handle message operations like editing or reloading?

Get the message API using `api.thread().message(index)`, then call methods like `message.edit()` or `message.reload()`. The index refers to the message position in the thread's message array.

What are the requirements for using these hooks?

All runtime hooks must be called inside an AssistantRuntimeProvider component. If you get 'Cannot read property of undefined' errors, verify that your components are wrapped with the provider.

How do I listen to runtime events like message sending or run completion?

Use the useAuiEvent hook with event names like 'composer.send', 'thread.runStart', or 'thread.runEnd'. Example: `useAuiEvent('composer.send', (e) => { console.log('Sent in thread:', e.threadId); })`

All Files

6 files
references/state-hooks.md6.1 KB
View
references/local-runtime.md6.4 KB
View
references/thread-list.md7.1 KB
View
references/external-store.md7.3 KB
View
references/types.md3.7 KB
View
SKILL.md3.3 KB
View

Install runtime

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

assistant-ui/skills

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901