Agent-UI-Design
Design patterns for chat interfaces, agent UX, streaming UI, and tool visualization. Based on 21st.dev Agents SDK and award-winning agent products.
Scope
Use this skill when:
- You are designing a chat interface for an AI application
- You need to visually represent agent tool calls
- You are implementing streaming rendering for real-time text output
- You are visualizing sandbox states and execution environments
- You are designing a three-panel layout for agent dashboards
Principles
1. Agent-Ready Design
Components must natively support streaming content, tool calls, and asynchronous state transitions. Chat UIs are a core pattern, not an add-on.
2. Transparency over Magic
The user must know at all times what the system is doing. No silent background work -- every agent step is visible.
3. Progressive Complexity
The default view shows the essentials. Details (tool parameters, raw data, logs) are available on demand.
4. Streaming as Experience
Real-time text output is not a technical detail but a deliberately designed UX element. The speed at which text appears influences perceived intelligence.
5. Errors as Design Cases
Tool errors, timeouts, and unexpected results are normal states, not exceptions. They require dedicated visual design.
Rules
Chat Architecture
- DO: Three-column chat architecture following the 21st.dev pattern:
- Thread Sidebar (left): List of past conversations, scrollable, with search.
- Chat Panel (center): Message stream with input field. Primary interaction.
- Context Panel (right): Optional, for results, previews, forms.
- DO: Lazy-load message history. Only the last N messages initially, older ones on scroll-up.
- DON'T: Keep the entire message history in client state. Use server-side persistence.
- DON'T: Chat panel without a visible input field. It must always be clear where to type.
Message Types
- DO: Differentiate messages by role:
- User Message: Right-aligned, accent color, compact layout.
- Assistant Message: Left-aligned, neutral, expandable for tool results.
- System Message: Centered, subtle, informational.
- Tool Call: Visually distinct with status indicator.
- DO: Markdown rendering in assistant messages (headings, lists, code blocks).
- DO: Code blocks with syntax highlighting and copy button.
- DON'T: Style all message types identically. Visual differentiation provides orientation.
Streaming Rendering
- DO: Display text character- or word-by-word with a cursor indicator.
- DO: AI SDK
useChat hook or SSE streaming for real-time rendering.
- DO: During streaming: auto scroll-to-bottom, stop button visible.
- DON'T: Block rendering during generation. The user must be able to scroll at all times.
- DON'T: Streaming without a visual cursor. The user must see that more text is coming.
Tool Visualization
- DO: Display tool calls within the chat stream:
- Tool Name: As label/badge before the result.
- Input Parameters: Collapsible, viewable for power users.
- Result: Formatted by type (text, table, code, image).
- Status: Loading spinner > success checkmark > error icon.
- DO: Tool results as embedded cards in the message stream.
- DO: Error states explicitly: what went wrong, what the user can do.
- DON'T: Tool calls without visual feedback. No silent execution.
- DON'T: Raw JSON output. Always format for human readability.
Sandbox UI
- DO: Visually communicate sandbox state:
- Created: Indicator that the environment is ready.
- Active: Green status dot.
- Executing: Animated state with progress indication.
- Terminated: Final state with result summary.
- DO: File trees as interactive tree structures with file preview.
- DON'T: Sandbox details in the default view. Use progressive disclosure.
Extended rules and examples: see references/implementation.md
Patterns
| Pattern |
Usage |
Core Idea |
| Streaming Chat Message |
Every AI chat app |
SSE stream, cursor, Markdown rendering |
| Tool Execution Card |
Agent performs an action |
Badge + collapsible params + status |
| Three-Panel Layout |
Agent dashboards |
Threads + Chat + Context |
| Form-Agent Hybrid |
Form assistants |
Form + Chat, agent populates fields |
| Real-Time Status Dashboard |
Monitoring agents |
Live updates, color-coded tiles |
Detailed patterns: see references/patterns.md
Anti-Patterns
- Chatbot without context panel -- Results only inline in the chat. Complex outputs need their own space.
- Tool results as JSON dump -- Raw API responses. Always present in human-readable format.
- Invisible agent work -- No feedback during tool execution. The user thinks the system is frozen.
- Single message design -- All messages styled identically. Role differentiation is mandatory.
- Endless streaming without stop -- No cancel button during generation.
- Modal tool results -- Tool outputs as modals instead of inline. Interrupts the conversation flow.
- Thread sidebar without search -- With more than 10 conversations, search and filter are essential.
- Missing retry option -- Tool errors without the ability to retry.
Checklist
Cross-References
component-patterns -- Base component architecture and token system
design-trends -- AI-native interface as a current trend
ui-patterns -- Command palette and general UI patterns
visual-direction -- Color palettes and typography for agent interfaces
usability -- Usability fundamentals for chat interfaces
accessibility -- Screen reader compatibility for chat UIs
responsive-design -- Mobile strategies for three-panel layouts
1---2name: agent-ui-design3description: Design patterns for chat interfaces, agent UX, streaming UI, and tool visualization. Covers chat architecture, message types, streaming rendering, tool execution cards, and sandbox UI derived from 21st.dev Agents SDK documentation and templates.4---56# Agent-UI-Design78> Design patterns for chat interfaces, agent UX, streaming UI, and tool visualization. Based on 21st.dev Agents SDK and award-winning agent products.910## Scope1112Use this skill when:13- You are designing a chat interface for an AI application14- You need to visually represent agent tool calls15- You are implementing streaming rendering for real-time text output16- You are visualizing sandbox states and execution environments17- You are designing a three-panel layout for agent dashboards1819## Principles2021### 1. Agent-Ready Design22Components must natively support streaming content, tool calls, and asynchronous state transitions. Chat UIs are a core pattern, not an add-on.2324### 2. Transparency over Magic25The user must know at all times what the system is doing. No silent background work -- every agent step is visible.2627### 3. Progressive Complexity28The default view shows the essentials. Details (tool parameters, raw data, logs) are available on demand.2930### 4. Streaming as Experience31Real-time text output is not a technical detail but a deliberately designed UX element. The speed at which text appears influences perceived intelligence.3233### 5. Errors as Design Cases34Tool errors, timeouts, and unexpected results are normal states, not exceptions. They require dedicated visual design.3536## Rules3738### Chat Architecture39- **DO**: Three-column chat architecture following the 21st.dev pattern:40 - **Thread Sidebar** (left): List of past conversations, scrollable, with search.41 - **Chat Panel** (center): Message stream with input field. Primary interaction.42 - **Context Panel** (right): Optional, for results, previews, forms.43- **DO**: Lazy-load message history. Only the last N messages initially, older ones on scroll-up.44- **DON'T**: Keep the entire message history in client state. Use server-side persistence.45- **DON'T**: Chat panel without a visible input field. It must always be clear where to type.4647### Message Types48- **DO**: Differentiate messages by role:49 - **User Message**: Right-aligned, accent color, compact layout.50 - **Assistant Message**: Left-aligned, neutral, expandable for tool results.51 - **System Message**: Centered, subtle, informational.52 - **Tool Call**: Visually distinct with status indicator.53- **DO**: Markdown rendering in assistant messages (headings, lists, code blocks).54- **DO**: Code blocks with syntax highlighting and copy button.55- **DON'T**: Style all message types identically. Visual differentiation provides orientation.5657### Streaming Rendering58- **DO**: Display text character- or word-by-word with a cursor indicator.59- **DO**: AI SDK `useChat` hook or SSE streaming for real-time rendering.60- **DO**: During streaming: auto scroll-to-bottom, stop button visible.61- **DON'T**: Block rendering during generation. The user must be able to scroll at all times.62- **DON'T**: Streaming without a visual cursor. The user must see that more text is coming.6364### Tool Visualization65- **DO**: Display tool calls within the chat stream:66 - **Tool Name**: As label/badge before the result.67 - **Input Parameters**: Collapsible, viewable for power users.68 - **Result**: Formatted by type (text, table, code, image).69 - **Status**: Loading spinner > success checkmark > error icon.70- **DO**: Tool results as embedded cards in the message stream.71- **DO**: Error states explicitly: what went wrong, what the user can do.72- **DON'T**: Tool calls without visual feedback. No silent execution.73- **DON'T**: Raw JSON output. Always format for human readability.7475### Sandbox UI76- **DO**: Visually communicate sandbox state:77 - **Created**: Indicator that the environment is ready.78 - **Active**: Green status dot.79 - **Executing**: Animated state with progress indication.80 - **Terminated**: Final state with result summary.81- **DO**: File trees as interactive tree structures with file preview.82- **DON'T**: Sandbox details in the default view. Use progressive disclosure.8384Extended rules and examples: see `references/implementation.md`8586## Patterns8788| Pattern | Usage | Core Idea |89|---|---|---|90| Streaming Chat Message | Every AI chat app | SSE stream, cursor, Markdown rendering |91| Tool Execution Card | Agent performs an action | Badge + collapsible params + status |92| Three-Panel Layout | Agent dashboards | Threads + Chat + Context |93| Form-Agent Hybrid | Form assistants | Form + Chat, agent populates fields |94| Real-Time Status Dashboard | Monitoring agents | Live updates, color-coded tiles |9596Detailed patterns: see `references/patterns.md`9798## Anti-Patterns991001. **Chatbot without context panel** -- Results only inline in the chat. Complex outputs need their own space.1012. **Tool results as JSON dump** -- Raw API responses. Always present in human-readable format.1023. **Invisible agent work** -- No feedback during tool execution. The user thinks the system is frozen.1034. **Single message design** -- All messages styled identically. Role differentiation is mandatory.1045. **Endless streaming without stop** -- No cancel button during generation.1056. **Modal tool results** -- Tool outputs as modals instead of inline. Interrupts the conversation flow.1067. **Thread sidebar without search** -- With more than 10 conversations, search and filter are essential.1078. **Missing retry option** -- Tool errors without the ability to retry.108109## Checklist110111- [ ] Chat messages differentiated by role (user, assistant, system, tool)112- [ ] Streaming rendering with visible cursor implemented113- [ ] Stop button visible during generation114- [ ] Tool calls have loading/success/error states115- [ ] Tool results formatted, not raw JSON output116- [ ] Tool parameters available as collapsible117- [ ] Three-panel layout: threads + chat + context118- [ ] Message history lazy-loaded (not all in client)119- [ ] Code blocks with syntax highlighting and copy button120- [ ] Markdown rendering in assistant messages121- [ ] Sandbox states visually communicated122- [ ] Retry button on tool errors123- [ ] Mobile: chat panel as fullscreen, sidebar as drawer124- [ ] Keyboard shortcuts: Enter to send, Shift+Enter for line break125126## Cross-References127128- `component-patterns` -- Base component architecture and token system129- `design-trends` -- AI-native interface as a current trend130- `ui-patterns` -- Command palette and general UI patterns131- `visual-direction` -- Color palettes and typography for agent interfaces132- `usability` -- Usability fundamentals for chat interfaces133- `accessibility` -- Screen reader compatibility for chat UIs134- `responsive-design` -- Mobile strategies for three-panel layouts