agent-elements
БесплатноБез исполняемых скриптовНе проверенUse whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from…
от 21st-dev★ 113 звёзд на GitHubОб этом скилле
Agent Elements skill
Project-aware context for building chat and agent UIs with Agent Elements —
an open-source shadcn registry at https://agent-elements.21st.dev.
What this skill gives you
When this skill loads, you know:
- The registry is shadcn-compatible. Every component is installed with
npx shadcn@latest add https://agent-elements.21st.dev/r/<component>.json. Files land undercomponents/agent-elements/(the library's internalcomponents/prefix is stripped — see Paths below). - The API is typed around the Vercel AI SDK. Messages are
UIMessage[]fromai, status isChatStatus.useChat()plugs in directly. - The full component catalog with API shapes and composition rules (see sections below).
- Theming guardrails — the Tailwind tokens Agent Elements depends on.
Detection
Consider this project "Agent Elements-ready" if any of these are true:
components/agent-elements/exists on diskcomponents.jsonincludes an alias or registry reference to Agent Elementspackage.jsondependencies includeai+@tabler/icons-reactand the user mentions Agent Elements
If the folder does not exist yet, install on demand with:
npx shadcn@latest add https://agent-elements.21st.dev/r/agent-chat.json
agent-chat transitively pulls every other component it needs via
registryDependencies (MessageList, InputBar, tool renderers, shared utils).
Paths (post-install layout)
After shadcn add, files sit under @/components/agent-elements/ with this
shape:
components/agent-elements/
agent-chat.tsx
message-list.tsx
input-bar.tsx
markdown.tsx
user-message.tsx
error-message.tsx
text-shimmer.tsx
spiral-loader.tsx
input/
attachment-button.tsx
send-button.tsx
file-attachment.tsx
suggestions.tsx
model-picker.tsx
mode-selector.tsx
tools/
bash-tool.tsx
edit-tool.tsx
search-tool.tsx
todo-tool.tsx
plan-tool.tsx
tool-group.tsx
subagent-tool.tsx
mcp-tool.tsx
thinking-tool.tsx
generic-tool.tsx
question/
question-tool.tsx
hooks/use-tool-complete.ts
utils/cn.ts
types.ts
Import rule: always import from the exact file, never from a barrel.
// ✅
import { AgentChat } from "@/components/agent-elements/agent-chat";
import { BashTool } from "@/components/agent-elements/tools/bash-tool";
// ❌ — no barrel exists
import { AgentChat } from "@/components/agent-elements";
Component catalog
Chat surface
- AgentChat — the full chat shell. Renders
MessageList+InputBar, handles tool invocations viatoolRenderers, shows an empty state with optionalsuggestions. Props:messages,status,onSend,onStop,toolRenderers?,suggestions?,attachments?,classNames?,slots?. - MessageList — transcript only. Use when you need the input bar somewhere
else. Accepts
toolRenderersandshowCopyToolbar. - UserMessage / ErrorMessage / Markdown — low-level message pieces.
Markdownstreams safely (external links getrel="noreferrer"by default).
Input
- InputBar — composer. Props:
status,onSend({ content }),onStop,value?+onChange?(controlled),attachedImages/attachedFileswith their remove handlers,leftActions/rightActionsslots,suggestions?,questionBar?,infoBar?. - Suggestions — quick-prompt chips for the empty state or inline.
- ModelPicker / ModeSelector — designed to drop into
leftActions. Both accept a simple{ id, name, version? }/{ id, label, icon?, description? }shape. Do not importCLAUDE_MODELS— it was removed; supply your own array. - SendButton / AttachmentButton / FileAttachment — usable standalone if you're building a custom composer.
Tool cards
All tool cards accept a part prop of type
Extract<UIMessage["parts"][number], { type: \tool-from the AI SDK. Register them viatoolRenderersonAgentChat/MessageList`:
<AgentChat
toolRenderers={{
Bash: BashTool,
Edit: EditTool,
Write: EditTool, // Write reuses EditTool
Search: SearchTool,
WebSearch: SearchTool,
TodoWrite: TodoTool,
PlanWrite: PlanTool,
Task: SubagentTool,
Thinking: ThinkingTool,
}}
/>
Cards available:
- BashTool — command + stdout, collapsible.
- EditTool — diff card. Supports
input.old_string/input.new_stringoroutput.structuredPatch, plus an approval footer viainput.approval. - SearchTool — grouped search results. Pass
resultsor useoutput.results. - TodoTool — diffed todo list from
input.todosvsoutput.oldTodos. - PlanTool — plan title + summary with approve/reject footer.
- ToolGroup — collapses consecutive tool calls into one row.
- SubagentTool — sub-agent task with nested tools.
- McpTool — generic MCP tool output; use
parseMcpToolTypefrom@/components/agent-elements/tools/tool-registry
Установить agent-elements в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл agent-elements?
Use whenever the user wants to build or modify a chat, agent, or tool-calling UI in a React 19 + Tailwind v4 project — especially if the code imports from `@/components/agent-elements/*` or the project has that folder on disk. Triggers: "agent chat", "tool call UI", "streaming chat", "plan approval", "AgentChat", "InputBar", "tool renderer", mentions of Agent Elements, or requests to add a new agent surface with shadcn. Do NOT use for plain chat UIs that don't need tool/plan/approval cards, or for projects already committed to a different agent UI kit.
Как установить скилл agent-elements?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agent-elements запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic