UI Toolkit Build
SkillDocs & knowledgeBuild UI Toolkit screens with unity-cli. Use when the user asks to author UXML and USS, configure PanelSettings and UIDocument, bind C# callbacks, and verify the screen in Play Mode. Do not use for interacting with existing UI only; use `unity-ui-automation`. For scene-only creation use `unity-scene-create`, C#-only edits use `unity-csharp-edit`, and runtime capture alone use `unity-playmode-testing`.
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the UI Toolkit Build skill
What this skill tells your AI
The instructions your AI receives, as published by akiojin/unity-cli in .claude-plugin/plugins/unity-cli/skills/unity-ui-toolkit-build/SKILL.md and read by ahel’s review.
With --output json, results use {success, command, data, errors, warnings}. Check the exit status and envelope success first; tool-result fields in this skill are relative to data. Read failure codes from errors[0].code; see unity-cli-usage for exit-code recovery.
Take a runtime screen from UXML/USS through a saved UIDocument and C# binding to observed input, state changes, and Game-view captures. Use the existing tools and delegated skills; no separate UI authoring backend is required.
Use When
- Build a UI Toolkit screen with UXML/USS, PanelSettings, and UIDocument.
- Create a button/text-field form and bind its callback to a visible label.
- Complete the build → Play → input → inspect → capture loop in an existing project.
Do Not Use When
- Only inspect/click/set an existing UI:
unity-ui-automation. - Build a uGUI Canvas/prefab or a scene without UI Toolkit:
unity-scene-create. - Only edit the binding script:
unity-csharp-edit. - Only refresh/import assets:
unity-asset-management. - Only evaluate C# or inspect Editor diagnostics:
unity-editor-tools. - Only enter Play, simulate input, or capture media:
unity-playmode-testing.
Preferred Flow
- Read the runtime checklist, pin the project/port, and confirm
system ping. Inspect scene dirty state and console before mutation; preserve unrelated work. Confirm the target screen, paths, named controls, and expected post-click text. - Delegate scene creation/loading to
unity-scene-create. For an acceptance fixture useAssets/Scenes/Generated/E2E/; reuse the requested scene otherwise. - Follow the construction recipe. Delegate short Editor evaluations to
unity-editor-toolsto write UXML/USS source, import it, create PanelSettings via AssetDatabase, and assign a UIDocument. Never hand-edit.asset,.unity,.prefab, or.metaYAML. Refuse accidental overwrite of existing assets. - Delegate the MonoBehaviour binding to
unity-csharp-edit, using CLI C# write tools withrefresh:falseandwaitForCompile:false; run the refresh and compilation checks as separate calls in step 5. Register callbacks in OnEnable and unregister in OnDisable. Use stable, unique UXML names, validate queries, and support Unity 2022.3 as well as Unity 6. - Call
refresh_assets, wait for compilation/domain reload withget_compilation_state, and reconnect. If a write fails after saving a file, inspect that file and diagnostics before retrying; do not duplicate the write. Inspect diagnostics; attach the compiled binding component, save assets and scene, then reload to check persistence. Do not infer compilation success from a write response alone. - Delegate Play to
unity-playmode-testingand use the construction reference's Editor-eval Game capture recipe for UI Toolkit overlays. Wait until the document has a ready panel. Delegate discovery/state/input tounity-ui-automation; use the returneduitk:/Object#elementpaths, not uGUI hierarchy paths or screen coordinates guessed from an image. - Capture the initial Game view and label state. Set the text field, read its value back, click the button, and assert the label text changed to the expected value. Capture the resulting Game view. Inspect both images, console errors, and structured state; an interaction success response alone is insufficient.
- Exit Play, preserve the saved screen, and report paths and evidence. If an existing tool cannot perform a required operation, preserve the failing call and report the gap for a separate Issue; do not add bridge features here or claim a mocked/manual edit passed the automated loop.
Use a stable request ID for each mutating eval. After a timeout query
editor eval-status before retrying; timeout does not cancel execution.
Examples
- "Create a UI Toolkit sign-in form and verify its Submit button updates a label."
- "UXML と USS で名前入力画面を作り、Play 中のクリック結果まで確認して。"
For a new test scene, then a discovered document named ToolkitDemo:
unity-cli raw create_scene --json '{"sceneName":"ToolkitDemo","path":"Assets/Scenes/Generated/E2E/"}'
unity-cli raw find_ui_elements --json '{"namePattern":"submit","uiSystem":"uitk"}'
unity-cli raw get_ui_element_state --json '{"elementPath":"uitk:/ToolkitDemo#status"}'
unity-cli raw set_ui_element_value --json '{"elementPath":"uitk:/ToolkitDemo#player-name","value":"Ada"}'
unity-cli raw click_ui_element --json '{"elementPath":"uitk:/ToolkitDemo#submit"}'
unity-cli raw get_ui_element_state --json '{"elementPath":"uitk:/ToolkitDemo#status"}'
References
- runtime-checklist.md: connection and instance prerequisites.
- construction.md: source assets, Editor setup, binding, and expected checks.
- C# post-write pipeline issue #420: independent refresh/compile calls avoid this CLI failure.
- Game capture issue #422: use the Editor-eval ScreenCapture recipe for UI overlays.
Signals
- GitHub stars
- 106
- Forks
- 12
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
unity-ui-toolkit-build- Source
- github.com/akiojin/unity-cli
Related picks
Skill · akiojin
The pick for C#tia-csharp-common
Skill · czarnak
The pick for C#handsontable-playwright-e2e
Skill · handsontable
The pick for End-to-end testingmstar-e2e
Skill · btspoony
The pick for End-to-end testinghandoff
Skill · mattpocock
More in Docs & knowledgecanvas-design
Skill · anthropics
More in Docs & knowledge