anyui-template-authoring

anyui-template-authoring is a skill for Claude Code, Codex from Pretend-to/mio-chat-backend. It costs 148 tokens per session (4,643 once invoked), scanned A, original, MIT.

A guide for creating responsive HTML cards and templates for AnyUI, a system that renders interactive content inside MioChat. It covers layouts such as forms, game interfaces, and visual-novel dialogue cards, with isolated styles and optional image rendering.

In plain words
What is it for?
Use it to define or invoke AnyUI templates, send custom HTML cards, describe template fields with JSON Schema, or build dialogue and other interactive cards.
Why use it?
It provides the rules and template syntax needed for cards to render consistently across screen sizes. It also explains how templates, fields, and images connect to the available UI tools.

Skill for Claude CodeCodex

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

Good fit Use it to define or invoke AnyUI templates, send custom HTML cards, describe template fields with JSON Schema, or build dialogue and other interactive cards.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pretend-to/mio-chat-backend/anyui-template-authoring
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.

Any agent
npx skills add Pretend-to/mio-chat-backend --skill anyui-template-authoring
Clone the repo
git clone --depth 1 https://github.com/Pretend-to/mio-chat-backend

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 anyui-template-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/pretend-to/mio-chat-backend/anyui-template-authoring/github.svg)](https://agentmods.dev/skills/pretend-to/mio-chat-backend/anyui-template-authoring)
Your own site
<a href="https://agentmods.dev/skills/pretend-to/mio-chat-backend/anyui-template-authoring"><img src="https://agentmods.dev/badge/skills/pretend-to/mio-chat-backend/anyui-template-authoring/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for anyui-template-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/pretend-to/mio-chat-backend/anyui-template-authoring"><img src="https://agentmods.dev/badge/skills/pretend-to/mio-chat-backend/anyui-template-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 148 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,643 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00148 $0.04643
Opus 5 $0.00074 $0.02322
Sonnet 5 $0.00030 $0.00929
Haiku 4.5 $0.00015 $0.00464

Measured 11d ago against content hash 58debd4edd11, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

anyui-template-authoring 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 11d 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.

lib/plugins/anyui-plugin/skills/anyui-template-authoring/SKILL.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AnyUI 模板与卡片设计专家规范

AnyUI 用于在 MioChat 聊天流中输出高保真、响应式且可直接交互的 HTML 卡片。前端通过 Shadow DOM 同文档渲染(样式完全隔离于主页面)。


一、核心设计哲学:前后端解耦与模板原生视觉掌控

1. 零轮次开销内置异步生图(无需调用单独的 draw 工具)

AnyUI 原生打通了后端生图服务。在调用 send_ui 时:

  • 文生图模式:直接传入 promptimagePrompt,后端只负责创建任务并传递 taskId。初始状态下 imageUrl 保持为空,由 HTML 模板通过原生 CSS/DOM 呈现精美的骨架屏与极光流体动效;图片绘制完成后前端通过 WebSocket 直接将真实 URL 回填至 img.src 并平滑淡入!无需调用 draw 工具,前后端完全解耦
  • 静态图片模式:传入已有图片链接 imageUrlimgurl,直接即时渲染。
  • 图生图模式:同时传入 imageUrl(参考图)+ prompt(重绘提示词),自动进行图生图并在完成后替换。

2. 全局通用模板库(Global Templates)

系统内置全局共享模板目录 templates/global/,所有用户与智能体可直接免定义调用:

  • gal_dialogue_card:Galgame / 视觉小说通用卡片(桌面端 480px 宽度约束,原生流体极光骨架屏,自适应 object-fit: contain 比例留白,支持章节标题、三行滚动对白、剧情分支选项、全屏画廊预览与异步生图)。

二、可用工具与模板语法

1. 三大工具

  • send_ui(template?, html?, variables?, prompt?, imageUrl?)
    • 优先使用:指定全局或已有模板 template: "gal_dialogue_card" + variables: JSON.stringify({...}) + 可选 prompt
    • 也可传 html 直接发送自定义内联 HTML。
  • define_ui_template(name, html, description?, schema?):保存新模板到模板库;schema 接收标准 JSON Schema(如 {"type":"object","properties":{...},"required":[...]}),用于为每个字段定义类型、说明和必填约束,保存后 manage_ui_templates 的 list/get 均可查看标准 Schema 与字段规范。
  • manage_ui_templates(action: 'list' | 'get' | 'delete', name?):管理与查询可用模板列表;list 返回每个模板的名称、描述与标准 JSON Schema,get 返回完整正文与 Schema 详情。

2. 模板语法规范(支持 JSX 组件与经典 HTML 双模)

  • JSX / JS 组件模式(推荐):使用 export default function Card(props, html)(props, html) => html\...`` 编写。
    • 支持完整的 JavaScript 动态逻辑(条件渲染 ${hasImage && html\...`}、动态数组循环 ${items.map(it => html`...`)}`、默认值兜底等);
    • 内部通过 html 模板标签构建安全、自动转义的 HTML 结构。
  • 经典 HTML 模式(向后兼容){{var}} 变量替换与 {{#each items}}...{{/each}} 循环。

三、Shadow DOM 交互 API(window.__mio)

API 参数 行为与使用场景
window.__mio.sendText(text) string 填入输入框并在约 30ms 后自动提交(用于按钮/选项点击触发继续推进剧情)
window.__mio.setInput(text) string 仅填入输入框并自动聚焦,等待用户继续编辑
window.__mio.previewImage(url) string 全屏画廊遮罩预览图片(Teleport 到 body,脱离 Shadow DOM 局限)

Read the full file on GitHub · 197 lines

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. 11d ago First seen · 197 lines · 148 tokens per session scan A 58debd4edd11

Subscribe to this mod's changes

anyui-template-authoring is a skill published in the GitHub repository Pretend-to/mio-chat-backend (38 stars, last pushed 2d ago), licensed MIT. It adds 148 tokens to every session and 4,643 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

frontend-ui-ux-system

A company-level guide for designing web interfaces and user experiences. It covers visual styles, design tokens (named values for colors, spacing, and typography), layout, interaction, accessibility, motion, and review checks.

hashgraph-online/awesome-codex-plugins · 60 tokens

kernel-chat-web-design

Guides the design, layout, styling, and interactivity of kernel.chat editorial spreads and standalone artifact editions. Use this skill when editing or creating pages, React components, CSS files, or single-file HTML artifacts in the kernel.chat project to enforce the POPEYE-inspired bilingual design grammar and the…

isaacsight/kernel · 71 tokens

kernel-chat-design-qa

Audits kernel.chat pages for responsive visual craft, accessibility, motion safety, interaction truth, runtime health, and production rendering. Use when reviewing an issue or artifact, checking whether a design is finished, comparing desktop and mobile, validating reduced motion or print, finding overflow and broken…

isaacsight/kernel · 73 tokens

Color Palette Generator

Create beautiful, accessible color schemes for any project.

eddiebelaval/squire · 13 tokens

frontend-design-studio

Direct, design, implement, animate, critique, audit, polish, and deploy distinctive production frontend interfaces for websites, landing pages, web apps, dashboards, mobile concepts, and desktop shells. Use for new frontend builds, redesigns, bland or visually generic UI, messy interfaces, design systems, Vue Bits or…

TIKAZI/TIKAZ-AI-Skills · 126 tokens

frontend-design

Orchestrate product-aware frontend art direction, implementation, responsive QA, code impact analysis, and engineering handoff. Use for websites, landing pages, web apps, dashboards, mobile concepts, and desktop shells that need one coherent visual world and objective verification.

TIKAZI/TIKAZ-AI-Skills · 54 tokens