Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计提醒

a2uia2ui 命令行

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,521

周安装

64

GitHub Stars

6

下载量

532
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/kobe4cn/a2ui_skills --skill a2ui

简介

a2ui 用于生成符合 A2UI 协议的交互式前端界面代码。

  • 适合在 React、Next.js 等项目中构建组件结构,支持状态更新与渲染控制。
  • 可结合现有设计系统和路由方式使用,避免生成孤立片段。
  • 涉及页面改动时,应配合本地预览和构建检查确认视觉效果。
  • a2ui 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

A2UI Development Skill

This skill helps you generate A2UI (Agent to UI) protocol compliant code for building rich, interactive user interfaces that AI agents can stream to clients.

Protocol Version

This skill targets A2UI Protocol v0.8 (Stable Release).

Standard Catalog ID: https://github.com/google/A2UI/blob/main/specification/0.8/json/standard_catalog_definition.json

Core Concepts

1. Message Types

A2UI uses four message types in a JSONL stream:

MessagePurpose
surfaceUpdateDefine or update UI components
dataModelUpdatePopulate or update application state
beginRenderingSignal client to start rendering
deleteSurfaceRemove a UI surface

2. Adjacency List Model

Components are defined as a flat list with ID references, not nested trees:

{"surfaceUpdate": {"surfaceId": "main", "components": [
  {"id": "root", "component": {"Column": {"children": {"explicitList": ["header", "content"]}}}},
  {"id": "header", "component": {"Text": {"text": {"literalString": "Welcome"}, "usageHint": "h1"}}},
  {"id": "content", "component": {"Text": {"text": {"path": "/user/name"}}}}
]}}

3. Data Binding (BoundValue)

Three patterns for binding values:

// Literal only - static value
{"literalString": "Hello"}

// Path only - dynamic from data model
{"path": "/user/name"}

// Both - initialization shorthand (sets default AND binds)
{"path": "/form/email", "literalString": "user@example.com"}

4. Styles Configuration

Customize appearance in beginRendering:

{"beginRendering": {
  "surfaceId": "main",
  "root": "root",
  "styles": {
    "font": "Roboto",
    "primaryColor": "#1976D2"
  }
}}
PropertyDescription
fontPrimary font family
primaryColorTheme color (hex format #RRGGBB)

Standard Catalog Components

Layout Components

  • Row - Horizontal container with distribution and alignment
  • Column - Vertical container with distribution and alignment
  • List - Scrollable list with direction (vertical/horizontal)
  • Card - Material card wrapper with single child
  • Tabs - Tab navigation with tabItems array
  • Modal - Dialog with entryPointChild and contentChild
  • Divider - Separator with axis (horizontal/vertical)

Display Components

  • Text - Text display with usageHint (h1-h5, caption, body). Supports simple Markdown.
  • Image - Image with url, fit, usageHint
  • Icon - Icon from standard set (see components reference)
  • Video - Video player with url
  • AudioPlayer - Audio with url and description

Input Components

  • Button - Clickable with child and action
  • TextField - Text input with label, textFieldType
  • CheckBox - Toggle with label and value
  • DateTimeInput - Date/time picker with enableDate/enableTime
  • MultipleChoice - Selection with options and maxAllowedSelections
  • Slider - Range input with minValue/maxValue

Component Weight

Use weight on components inside Row/Column for flex layout:

{"id": "sidebar", "weight": 1, "component": {"Column": {...}}},
{"id": "main", "weight": 3, "component": {"Column": {...}}}

Generating A2UI Messages

Basic Flow

  1. Define components via surfaceUpdate
  2. Populate data via dataModelUpdate
  3. Trigger render via beginRendering

Complete Example: Simple Form

{"surfaceUpdate": {"surfaceId": "booking", "components": [
  {"id": "root", "component": {"Column": {"children": {"explicitList": ["title", "name_field", "date_field", "submit_btn"]}}}},
  {"id": "title", "component": {"Text": {"text": {"literalString": "Book a Table"}, "usageHint": "h2"}}},
  {"id": "name_field", "component": {"TextField": {"label": {"literalString": "Your Name"}, "text": {"path": "/form/name"}}}},
  {"id": "date_field", "component": {"DateTimeInput": {"value": {"path": "/form/date"}, "enableDate": true}}},
  {"id": "submit_btn", "component": {"Button": {"child": "submit_text", "action": {"name": "submit_booking", "context": [{"key": "name", "value": {"path": "/form/name"}}, {"key": "date", "value": {"path": "/form/date"}}]}}}},
  {"id": "submit_text", "component": {"Text": {"text": {"literalString": "Confirm Booking"}}}}
]}}
{"dataModelUpdate": {"surfaceId": "booking", "contents": [{"key": "form", "valueMap": [{"key": "name", "valueString": ""}, {"key": "date", "valueString": ""}]}]}}
{"beginRendering": {"surfaceId": "booking", "root": "root"}}

Event Handling

User Actions

When a user interacts (e.g., clicks a button), the client sends userAction:

{
  "userAction": {
    "name": "submit_booking",
    "surfaceId": "booking",
    "sourceComponentId": "submit_btn",
    "timestamp": "2025-01-01T10:00:00Z",
    "context": {"name": "John Doe", "date": "2025-01-15"}
  }
}

Error Reporting

Clients report errors via error message:

{
  "error": {
    "type": "RENDER_ERROR",
    "message": "Component 'user_card' references missing child",
    "surfaceId": "main",
    "componentId": "user_card",
    "timestamp": "2025-01-01T10:30:05Z"
  }
}

Best Practices

  1. Unique IDs: Every component needs a unique id within its surface
  2. Flat Structure: Use ID references for parent-child relationships
  3. Data Separation: Keep UI structure in surfaceUpdate, dynamic values in dataModelUpdate
  4. Path Convention: Use JSON Pointer format for paths (e.g., /user/profile/name)
  5. Progressive Rendering: Send beginRendering after essential components are defined
  6. Clean up surfaces: Use deleteSurface when flows complete

Reference Documentation

Core References

Advanced Topics

Examples

Basic Patterns

Advanced Patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

32.4%
按下载量换算172

Cursor

21.51%
按下载量换算114

Antigravity

18.59%
按下载量换算99

Gemini CLI

12.83%
按下载量换算68

OpenCode

7.23%
按下载量换算38

Codex

3.31%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills