skills/unity-uitoolkit/SKILL.md
Use this skill to build runtime UI with Unity UI Toolkit — UXML templates, USS styling, C# controller bindings, and custom controls. Accepts design docs, images, or verbal descriptions as input and asks clarifying questions for ambiguous requirements. Use when the user says "create a UI screen," "build a menu," "make a HUD," "UI from this mockup," or any request involving UXML, USS, or runtime UI panels. Do not use for editor-only UI — use unity-code for that.
npx skillsauth add cuozg/oh-my-skills unity-uitoolkitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build production runtime UI using UI Toolkit. Parse design input (document, image, description) → clarify unknowns → create UXML + USS + C# controller.
.uxml for structure, .uss for styling, .cs for logic. No inline styles.block, block__element, block--modifier.name="kebab-case" for C# querying via Q<T>("name").Q<T>() / Query<T>() results in fields — never query in Update/callbacks.OnEnable, unregister in OnDisable. Always pair.this.visibility: hidden to hide elements (cheapest). Avoid display: none for frequently toggled UI.:root { --var: value; }) for colors, spacing, fonts — enable theming.ScaleWithScreenSize on PanelSettings for responsive UI (reference: 1920×1080).unity-standards.Write all files directly. Report: file list with paths, element hierarchy, and compilation status.
When Unity MCP is available, use these tools to wire up UI in the scene:
| Action | Tool |
|--------|------|
| Create UIDocument GameObject | Unity.ManageGameObject(create) + add_component with UIDocument |
| Find existing UIDocument in scene | Unity.ManageGameObject(find) with search_term="UIDocument" |
| Assign UXML/USS references | Unity.ManageGameObject(set_component_property) on UIDocument component |
| Create asset folders for UI files | Unity.ManageAsset(CreateFolder) |
| Verify no compile errors | Unity.ReadConsole or Unity.GetConsoleLogs |
| Visual verification | Unity.ManageEditor(Play) then Unity.Camera_Capture |
For the full MCP tool decision tree, load read_skill_file("unity-standards", "references/other/unity-mcp-routing-matrix.md") — see Scene Branch and Asset Management Branch.
All UI Toolkit references live in unity-standards. Load on demand:
ui-toolkit/setup.md — UIDocument, PanelSettings, scale modes, multi-panel, file orgui-toolkit/performance.md — pooling, visibility cost, selectors, UsageHints, profiler markersui-toolkit/uxml-patterns.md — UXML structure, templates, BEM naming, reusable snippetsui-toolkit/uss-styling.md — USS selectors, variables, responsive patterns, themingui-toolkit/csharp-bindings.md — UQuery, event callbacks, data binding, focus managementui-toolkit/custom-controls.md — UxmlElement, UxmlAttribute, custom VisualElement creationLoad via read_skill_file("unity-standards", "references/ui-toolkit/<file>").
tools
Generate Unity raster image assets through Unity MCP: game sprites, item art, backgrounds, UI icons, portraits, concept images, transparent cutouts, image edits, upscales, background removal, and Unity scene or Game View screenshots. Use when a Unity project needs image files imported under Assets or screenshots captured from the editor. Do not use for meshes, audio, animation, materials, gameplay code, UI Toolkit layout, or generic non-Unity image generation.
tools
Create Unity technical solution documents from user requirements, feature ideas, bug goals, specs, or codebase problems. Use when the user asks for a technical approach, architecture, implementation strategy, solution options, feasibility analysis, system design, or "how should we build/fix this" for Unity runtime, Editor, tools, assets, data, UI, WebGL, SDKs, or production pipelines.
tools
Orchestrate Unity Editor via MCP (Model Context Protocol) tools and resources. Use when working with Unity projects through MCP for Unity - creating/modifying GameObjects, editing scripts, managing scenes, running tests, or any Unity Editor automation. Provides best practices, tool schemas, and workflow patterns for effective Unity-MCP integration.
development
Convert a spec document into an implementation TODO list in the same spec folder. U se when the user says goal-todo, todo from spec, generate tasks from spec, turn this spec into todos, create implementation checklist, extract tasks, or asks to read a Docs/Specs design doc and produce what must be implemented. Includes UI/UX review and codebase investigation before writing the checklist. Do not use for implementing the tasks, creating new goal files, writing test cases, or verifying completed work.