Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

agents-uiAgent 用户界面

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

783

周安装

32

GitHub Stars

3

下载量

253
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:agents-ui(Agent 用户界面)
来源仓库:https://github.com/codestackr/livekit-skills
仓库路径:skills/agents-ui
安装命令:
npx skills add https://github.com/codestackr/livekit-skills --skill agents-ui
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/codestackr/livekit-skills --skill agents-ui

简介

agents-ui 用于辅助界面设计、视觉规范和交互体验优化,适合在 Codex、Claude、Cursor、Gemini CLI 中生成 UI 方案或改进组件层级时调用。

  • 适用于构建基于 shadcn 的 React 前端界面,结合 LiveKit 语音 AI Agent 项目使用。
  • 提供页面结构整理、配色布局建议和视觉一致性检查等核心能力。
  • 涉及真实页面改动时应通过截图或浏览器预览验证文本溢出与响应式表现。
  • agents-ui 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

LiveKit Agents UI

Build React frontends for LiveKit voice AI agents with shadcn-based components.

LiveKit MCP server tools

This skill works alongside the LiveKit MCP server, which provides direct access to the latest LiveKit documentation, code examples, and changelogs. Use these tools when you need up-to-date information that may have changed since this skill was created.

Available MCP tools:

  • docs_search - Search the LiveKit docs site
  • get_pages - Fetch specific documentation pages by path
  • get_changelog - Get recent releases and updates for LiveKit packages
  • code_search - Search LiveKit repositories for code examples
  • get_python_agent_example - Browse 100+ Python agent examples

When to use MCP tools:

  • You need the latest API documentation or feature updates
  • You're looking for recent examples or code patterns
  • You want to check if a feature has been added in recent releases
  • The local references don't cover a specific topic

When to use local references:

  • You need quick access to core concepts covered in this skill
  • You're working offline or want faster access to common patterns
  • The information in the references is sufficient for your needs

Use MCP tools and local references together for the best experience.

References

Consult these resources as needed:

  • ./references/livekit-overview.md -- LiveKit ecosystem overview and how these skills work together
  • ./references/components.md -- All component APIs, props, and usage examples

Prerequisites

  • Node.js >= 18
  • React 19
  • Tailwind CSS 4
  • shadcn/ui initialized in your project

Installation

1. Add the LiveKit registry to your shadcn config

In your components.json:

{
  "registries": {
    "@agents-ui": "https://livekit.io/ui/r/{name}.json"
  }
}

2. Install components

# Install individual components
npx shadcn@latest add @agents-ui/agent-session-provider
npx shadcn@latest add @agents-ui/agent-control-bar
npx shadcn@latest add @agents-ui/agent-audio-visualizer-bar

# Or install multiple at once
npx shadcn@latest add @agents-ui/agent-session-provider @agents-ui/agent-control-bar

Components are copied to your components/agents-ui/ directory for full customization.

Quick start

Installation

Agents UI components require both livekit-client and @livekit/components-react:

npm install livekit-client @livekit/components-react

Setting up a TokenSource

Before using Agents UI components, you need a TokenSource from livekit-client to handle authentication.

For development (using LiveKit Cloud Sandbox):

import { TokenSource } from 'livekit-client';

const tokenSource = TokenSource.sandboxTokenServer({
  sandboxId: 'your-sandbox-id',
});

For production (using your own token endpoint):

import { TokenSource } from 'livekit-client';

const tokenSource = TokenSource.endpoint('/api/token');

Basic voice agent interface

Create a session using useSession from @livekit/components-react, then pass it to AgentSessionProvider:

'use client';

import { useRef, useEffect } from 'react';
import { useSession } from '@livekit/components-react';
import { TokenSource, TokenSourceConfigurable } from 'livekit-client';
import { AgentSessionProvider } from '@/components/agents-ui/agent-session-provider';
import { AgentControlBar } from '@/components/agents-ui/agent-control-bar';
import { AgentAudioVisualizerBar } from '@/components/agents-ui/agent-audio-visualizer-bar';

export function VoiceAgent() {
  // Use useRef to prevent recreating TokenSource on each render
  const tokenSource: TokenSourceConfigurable = useRef(
    TokenSource.sandboxTokenServer({ sandboxId: 'your-sandbox-id' })
  ).current;

  // Create session using useSession hook (required for AgentSessionProvider)
  const session = useSession(tokenSource, {
    agentName: 'your-agent-name',
  });

  // Auto-start session with cleanup
  useEffect(() => {
    session.start();
    return () => session.end();
  }, []);

  return (
    <AgentSessionProvider session={session}>
      <div className="flex flex-col items-center gap-8 p-8">
        <AgentAudioVisualizerBar />
        <AgentControlBar />
      </div>
    </AgentSessionProvider>
  );
}

Production example with token endpoint

'use client';

import { useRef, useEffect } from 'react';
import { useSession } from '@livekit/components-react';
import { TokenSource, TokenSourceConfigurable } from 'livekit-client';
import { AgentSessionProvider } from '@/components/agents-ui/agent-session-provider';
import { AgentControlBar } from '@/components/agents-ui/agent-control-bar';
import { AgentAudioVisualizerBar } from '@/components/agents-ui/agent-audio-visualizer-bar';

export function VoiceAgent() {
  const tokenSource: TokenSourceConfigurable = useRef(
    TokenSource.endpoint('/api/token')
  ).current;

  const session = useSession(tokenSource, {
    roomName: 'my-room',
    participantIdentity: 'user-123',
    participantName: 'John',
    agentName: 'my-agent',
  });

  useEffect(() => {
    session.start();
    return () => session.end();
  }, []);

  return (
    <AgentSessionProvider session={session}>
      <div className="flex flex-col items-center gap-8 p-8">
        <AgentAudioVisualizerBar />
        <AgentControlBar />
      </div>
    </AgentSessionProvider>
  );
}

Core components

AgentSessionProvider

Required wrapper that provides session state to all child components. It wraps SessionProvider from @livekit/components-react and includes RoomAudioRenderer for audio playback.

You must create a session using useSession from @livekit/components-react and pass it to AgentSessionProvider:

import { useRef, useEffect } from 'react';
import { useSession } from '@livekit/components-react';
import { TokenSource, TokenSourceConfigurable } from 'livekit-client';
import { AgentSessionProvider } from '@/components/agents-ui/agent-session-provider';

function MyApp() {
  // Create tokenSource with useRef to prevent recreation
  const tokenSource: TokenSourceConfigurable = useRef(
    TokenSource.endpoint('/api/token')
  ).current;

  // Create session using useSession hook (required)
  const session = useSession(tokenSource, { agentName: 'your-agent' });

  // Start session when component mounts
  useEffect(() => {
    session.start();
    return () => session.end();
  }, []);

  return (
    <AgentSessionProvider session={session}>
      {/* All Agents UI components must be inside this provider */}
    </AgentSessionProvider>
  );
}

AgentControlBar

Combined media controls with visualizer:

<AgentControlBar />

Audio visualizers

Five visualization styles:

// Bar visualizer (horizontal bars)
<AgentAudioVisualizerBar />

// Grid visualizer (dot matrix)
<AgentAudioVisualizerGrid />

// Radial visualizer (circular)
<AgentAudioVisualizerRadial />

// Wave visualizer (waveform)
<AgentAudioVisualizerWave />

// Aura visualizer (ambient glow effect)
<AgentAudioVisualizerAura />

Media controls

Individual track controls:

// Toggle microphone
<AgentTrackToggle source="microphone" />

// Toggle camera
<AgentTrackToggle source="camera" />

// Toggle screen share
<AgentTrackToggle source="screen_share" />

// Full track control with label
<AgentTrackControl source="microphone" />

Chat components

Display conversation transcripts:

// Full chat transcript
<AgentChatTranscript />

// Typing/thinking indicator
<AgentChatIndicator />

Session controls

// Disconnect button
<AgentDisconnectButton />

// Start audio (for browsers requiring user interaction)
<StartAudioButton />

Agent states

The AgentSessionProvider tracks these states:

  • initializing - Agent is starting up
  • listening - Agent is listening for user input
  • thinking - Agent is processing/generating response
  • speaking - Agent is speaking

Use these states to customize your UI with the local useAgentState hook (installed with the Agents UI components):

// This hook is local to your project (copied via shadcn CLI)
import { useAgentState } from '@/components/agents-ui/hooks/use-agent-state';

function StatusIndicator() {
  const state = useAgentState();

  return (
    <div className="flex items-center gap-2">
      <div className={cn(
        "w-2 h-2 rounded-full",
        state === "speaking" && "bg-green-500",
        state === "listening" && "bg-blue-500",
        state === "thinking" && "bg-yellow-500 animate-pulse",
      )} />
      <span className="capitalize">{state}</span>
    </div>
  );
}

Styling

Components use Tailwind CSS and support className overrides:

<AgentAudioVisualizerBar
  className="h-32 w-64 bg-slate-900 rounded-lg"
/>

<AgentControlBar
  className="gap-4 p-4 bg-white/10 backdrop-blur rounded-full"
/>

Customization

Since components are copied to your project, you can modify them directly:

// components/agents-ui/agent-control-bar.tsx
export function AgentControlBar({ className }: { className?: string }) {
  return (
    <div className={cn("flex items-center gap-2", className)}>
      {/* Customize the layout, add/remove controls */}
      <AgentTrackToggle source="microphone" />
      <AgentAudioVisualizerBar className="flex-1" />
      <AgentDisconnectButton />
    </div>
  );
}

Required packages

Install both livekit-client and @livekit/components-react:

npm install livekit-client @livekit/components-react

These packages provide:

  • TokenSource from livekit-client - Factory for creating token sources (sandbox, endpoint, custom)
  • useSession from @livekit/components-react - Required hook for creating sessions for AgentSessionProvider

You do NOT need UI components from @livekit/components-react (like LiveKitRoom, BarVisualizer, or VoiceAssistantControlBar) when using Agents UI components. Use Agents UI components instead for the UI.

Using hooks from @livekit/components-react

Agents UI requires @livekit/components-react for the useSession hook. You can also use additional hooks from this package for custom behavior. These hooks work inside AgentSessionProvider:

Required hook:

  • useSession - Creates the session object required by AgentSessionProvider

Additional hooks for custom behavior:

  • useAgent - Get full agent state with lifecycle helpers (requires session from useSession)
  • useVoiceAssistant - Get agent state, tracks, and transcriptions
  • useTrackToggle - Build custom track toggle buttons
  • useChat - Send and receive chat messages
  • useParticipants - Access all participants in the room
  • useConnectionState - Monitor connection status
import { useVoiceAssistant } from '@livekit/components-react';

// This works inside AgentSessionProvider
function CustomAgentDisplay() {
  const { state, audioTrack, agentTranscriptions } = useVoiceAssistant();

  return (
    <div>
      <p>Agent is {state}</p>
      {agentTranscriptions.map((t) => (
        <p key={t.id}>{t.text}</p>
      ))}
    </div>
  );
}

See the livekit-react-hooks skill for full hook documentation.

Best practices

  1. Always wrap with AgentSessionProvider - All Agents UI components require this context.
  2. Use useSession to create sessions - Create a session with useSession from @livekit/components-react and pass it to AgentSessionProvider.
  3. Use useRef for TokenSource - Always wrap TokenSource creation in useRef to prevent recreation on each render.
  4. Start and end sessions properly - Call session.start() in a useEffect and session.end() in the cleanup function.
  5. Handle audio permissions - Use StartAudioButton for browsers requiring user interaction.
  6. Customize via Tailwind - Use className props for styling adjustments.
  7. Modify source directly - Components are copied to your project for full control.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.54%
按下载量换算92

Claude

28.64%
按下载量换算72

Cursor

18.69%
按下载量换算47

Gemini CLI

9.74%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills