html-to-ugui

html-to-ugui is a skill for Claude Code from Alex-Rachel/TEngine. It costs 150 tokens per session (1,472 once invoked), scanned A, original, MIT.

A pipeline for turning HTML interface prototypes into Unity UGUI Prefabs, which are reusable Unity interface objects. It uses browser-rendered layout data to preserve positions, images, text, controls, and device-adaptation intentions.

In plain words
What is it for?
Use it to generate Unity interfaces from natural-language requirements or HTML, bake layouts into JSON, import images as Sprites, and create interfaces that adapt to PC, mobile, and tablet screens.
Why use it?
It connects web-style prototypes with maintainable Unity UI instead of leaving the design as a static screenshot. It also records layout information for different screen sizes.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to generate Unity interfaces from natural-language requirements or HTML, bake layouts into JSON, import images as Sprites, and create interfaces that adapt to PC, mobile, and tablet screens.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alex-rachel/tengine/html-to-ugui
About the project

TEngine is a Unity framework for building games, providing modules for asynchronous work, hot updates, asset management, configuration tables, and user interfaces. It is for Unity developers and teams making commercial projects across desktop, mobile, web, and WeChat Mini Game targets, with catalogue skills supporting its AI-assisted development workflow.

Alex-Rachel/TEngine · 2,334 stars · on GitHub

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 Alex-Rachel/TEngine --skill html-to-ugui
Clone the repo
git clone --depth 1 https://github.com/Alex-Rachel/TEngine

Made for: Claude Code.

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 html-to-ugui

README.md
[![agentmods](https://agentmods.dev/badge/skills/alex-rachel/tengine/html-to-ugui/github.svg)](https://agentmods.dev/skills/alex-rachel/tengine/html-to-ugui)
Your own site
<a href="https://agentmods.dev/skills/alex-rachel/tengine/html-to-ugui"><img src="https://agentmods.dev/badge/skills/alex-rachel/tengine/html-to-ugui/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 html-to-ugui

Your own site · 80×15
<a href="https://agentmods.dev/skills/alex-rachel/tengine/html-to-ugui"><img src="https://agentmods.dev/badge/skills/alex-rachel/tengine/html-to-ugui.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 150 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,472 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.00150 $0.01472
Opus 5 $0.00075 $0.00736
Sonnet 5 $0.00030 $0.00294
Haiku 4.5 $0.00015 $0.00147

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

Security

Grade A, and why

html-to-ugui 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.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/bake_html_to_json.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

UnityProject/.claude/skills/html-to-ugui/SKILL.md · 127 lines

How it starts

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

HTML to UGUI 智能 Prefab 管线

你是 Unity UGUI 原型和 Prefab 生成专家。你的任务不是只做静态截图式原型,而是生成可被 HtmlToUGUIBaker.cs 消费的 UI-DSL HTML,并通过 JSON v2 把布局、图片、文本、控件和适配意图带回 Unity。

核心链路:

自然语言需求 -> UI-DSL HTML -> Playwright/浏览器 JSON v2 -> Unity HtmlToUGUIBaker -> UGUI Prefab

Step 1: 生成 UI-DSL HTML

先读取 references/ui-dsl-spec.md,再生成 HTML。

硬性规则:

  • 唯一根节点必须声明 data-u-type="div"data-u-name="m_xxx",并有明确 width/height
  • 所有需要导入 Unity 的节点必须有 data-u-namedata-u-type
  • 允许类型:divimagetextbuttoninputscrolltogglesliderdropdown
  • 图片节点优先使用 data-u-type="image",并提供 srcdata-u-src
  • 背景图片使用 CSS background-image: url(...),必要时配合 data-u-fit="cover|contain|stretch"
  • 多终端适配要显式表达意图:data-u-layout 可使用 stretchtop-barbottom-barleft-panelright-panelcenterfixed
  • 需要安全区的全屏/边缘节点使用 data-u-safe-area="true"

Step 2: 烘焙 HTML -> JSON v2

推荐脚本:

python scripts/bake_html_to_json.py input.html -o output.json -w 1920 -H 1080

也可以打开 Unity 项目内的浏览器转换页:

Assets/TEngine/Extension/HtmlToUGUI/HtmlToJson/HTML 转 JSON 坐标烘焙器.html

JSON v2 会保留 v1 字段,并额外输出:

  • schemaVersion
  • designWidth / designHeight
  • sourcePath / sourceDirectory
  • imageSrc / backgroundImageSrc
  • imageFit
  • layoutHint
  • safeArea
  • 可选 anchorMin / anchorMax / pivot / offsetMin / offsetMax

完整结构见 references/json-schema.md

Step 3: 导入 Unity 生成 Prefab

  1. 打开 Tools > UI Architecture > HTML to UGUI Baker (Full Controls)
  2. 分配 HtmlToUGUIConfig 和目标 Canvas。
  3. 在配置中确认图片导入目录,默认推荐 Assets/AssetRaw/UIRaw/Raw/HtmlToUGUI
  4. 选择 JSON 文件或粘贴 JSON 字符串。
  5. 点击“执行烘焙生成”。

Unity baker 会:

  • 对 v1 JSON 使用固定左上坐标,保持兼容。
  • 对 v2 JSON 优先应用显式 anchor/offset,再用 layoutHint,再用几何启发式,最后回退固定坐标。
  • 解析 <img src>data-u-src、CSS background-image
  • Assets/Packages/ 路径直接加载 Sprite。
  • 对本地相对路径按 HTML/JSON 目录解析,并复制导入到配置的 Unity 目录。
  • 图片缺失时继续生成 Prefab 并输出 warning。

控件映射见 references/control-mapping.md

Read the full file on GitHub · 127 lines

Files

What ships with it

5 files 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. 11d ago First seen · 127 lines · 150 tokens per session scan A 84dfabe6342d

Subscribe to this mod's changes

html-to-ugui is a skill published in the GitHub repository Alex-Rachel/TEngine (2,334 stars, last pushed yesterday), licensed MIT. It adds 150 tokens to every session and 1,472 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

et-eui

ET EUI client UI workflow for this project's cn.etetet.eui framework. Use when creating or modifying DlgXxx windows, ESxxx reusable sub-UI, ItemXxx loop items, AUIEvent handlers, WindowID registration, widget binding (E via UIFindHelper), ShowWindow/Hide/Close flow, EUI root layers, or LoopScrollRect lists.…

FlameskyDexive/Legends-Of-Heroes · 98 tokens

et-code

ET framework C# code authoring and review workflow. Use when creating or modifying Entity, Component, System, Helper, message handlers, package dependencies, assemblies, module analyzer boundaries, C# file placement, .meta handling, ECS layering, or component contract logic in WOW/ET packages.

FlameskyDexive/Legends-Of-Heroes · 61 tokens

fantasy-net

This guide applies to development and code review for Fantasy / Fantasy.Net / Fantasy.Unity written in C#. Use it when a task involves Fantasy server code or Unity client code using Fantasy, ECS entities/components/systems, scenes and subscenes, FTask, network handlers/messages/protocols, Address or Roaming routing…

qq362946/Fantasy · 157 tokens

reflection-method-call

Call a C# method by reflection — including private methods. Requires a method schema obtained via 'reflection-method-find'. Supports static methods, instance methods (with optional target deserialization), and main-thread / off-thread execution.

IvanMurzak/Unity-MCP · 48 tokens

script-execute

Compiles and executes C# code dynamically using Roslyn. Supports a full-code mode (default) and a body-only mode — see the skill body for the difference and for how to pass Unity object references as parameters.

IvanMurzak/Unity-MCP · 48 tokens

reflection-method-find

Find C# methods across every loaded assembly by name / type / parameters — including private methods. Returns serialized MethodData entries usable as schemas for 'reflection-method-call'.

IvanMurzak/Unity-MCP · 39 tokens