a2ui

a2ui is a skill for Claude Code, Codex from ntygod/ZhiWei. It costs 42 tokens per session (509 once invoked), scanned A, original, MIT.

A way to send interactive buttons, forms, lists, and filters from an agent to a front end, where a user action can send a response back.

In plain words
What is it for?
Use it for actionable to-do lists, buttons, text fields, filter choices, and other components that need a user response.
Why use it?
It prevents interactive tasks from being reduced to plain text when the user needs to choose something, enter information, or trigger an action.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ntygod/zhiwei/a2ui
Any agent
npx skills add ntygod/ZhiWei --skill a2ui
Clone the repo
git clone --depth 1 https://github.com/ntygod/ZhiWei

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for a2ui

README.md
[![agentmods](https://agentmods.dev/badge/skills/ntygod/zhiwei/a2ui.svg)](https://agentmods.dev/skills/ntygod/zhiwei/a2ui)
Your own site
<a href="https://agentmods.dev/skills/ntygod/zhiwei/a2ui"><img src="https://agentmods.dev/badge/skills/ntygod/zhiwei/a2ui.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 509 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00509
Opus 5 $0.00021 $0.00254
Sonnet 5 $0.00008 $0.00102
Haiku 4.5 $0.00004 $0.00051

Measured 6d ago against content hash f967bb47fac8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

a2ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/main/resources/skills/a2ui/SKILL.md · 50 lines

What it actually says

A2UI 组件输出指南

通过 ui_render 向前端提交组件树。用户点击组件触发 signal 回到后端继续 Agent 流程。判断依据:组件不需要 signal 就用 Markdown,不强行套 A2UI。

适用场景

  • 待办列表(点击完成)→ ListItem + signal
  • 操作按钮(触发动作)→ Button + signal
  • 表单输入(提交数据)→ TextField + signal
  • 选项切换(筛选 Chip)→ Chip + signal
  • 可点选列表(用户从中挑一个继续流程)

不适用场景

  • 纯展示表格 → Markdown 表格
  • 步骤路线图 / 有序列表 → Markdown 列表
  • 代码 → Markdown 代码块
  • 标题层级 → Markdown 标题
  • 数学公式 → KaTeX
  • 图片仅展示 → Markdown 图片

工作流

  1. 先判:要回调后端的内容用 A2UI;纯展示用 Markdown
  2. 选组件:从注册组件目录选(Button / TextField / Chip / ListItem / Card 等,详见参考)
  3. 先文字铺垫:调 ui_render 前先用一句话说"这里给你 X 个选项"等上下文
  4. 提交组件树:每次最多 50 个组件;signal 放组件顶层,不进 properties
  5. id 唯一:同一调用内组件 id 不能重复
  6. 多步流程:点击 signal → 后端处理 → 必要时再 ui_render 给下一步

详细参考

  • 注册组件完整目录 + 调用样例 + Markdown vs A2UI 选择矩阵:{skill_dir}/references/component-catalog.md
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 50 lines · 42 tokens per session scan A f967bb47fac8

Subscribe to this mod's changes

a2ui is a skill published in the GitHub repository ntygod/ZhiWei (137 stars, last pushed 25d ago), licensed MIT. It adds 42 tokens to every session and 509 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.