Develop and iterate on IWSDK PanelUI components. Use when the user wants to create, modify, debug, or improve UI panels in their IWSDK application. Covers UIKITML editing, full-screen preview with ScreenSpace, and visual verification.
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "iwsdk-ui" 技能: 1. 下载 https://raw.githubusercontent.com/facebook/immersive-web-sdk/main/packages/starter-assets/claude-injections/skills/iwsdk-ui/SKILL.md 2. 保存为 ~/.claude/skills/iwsdk-ui/SKILL.md 3. 装好后重载技能,告诉我可以用了
Efficiently develop and iterate on IWSDK PanelUI panels using ScreenSpace for full-screen 2D preview. The workflow has a required core (setup for iteration) and optional extensions (the actual UI work, driven by user intent).
User request is in $ARGUMENTS.
Find the panel entity and its UIKITML source file.
PanelUI component. Use ecs_find_entities with withComponents: ["PanelUI"] to find them.PanelUI component's config field with ecs_query_entity to find the JSON path (e.g., ./ui/welcome.json).ui/ with the same name but .uikitml extension (e.g., ui/welcome.uikitml).The ScreenSpace component positions a panel in front of the camera so it appears as a 2D UI — ideal for fast iteration.
If the entity already has ScreenSpace: Note the current settings so they can be restored later.
ecs_query_entity(entityIndex, components: ["ScreenSpace"]) → save the values
If the entity does not have ScreenSpace: You will need to add it in code.
Either way, set ScreenSpace to fill the entire viewport in code:
.addComponent(ScreenSpace, {
top: "0px",
left: "0px",
width: "100vw",
height: "100vh",
});
Setting this in code (not via ecs_set_component) ensures it persists across hot reloads.
Take a browser_screenshot to confirm the panel fills the screen and is ready for iteration.
This is where the user's request drives the work. Edit the .uikitml file in ui/.
mcp__iwsdk-reference__search_code to query for supported UIKITML element types and CSS properties. Search for things like "uikitml interpret container text" or specific element types you need.#id and .class (via PanelDocument's querySelector).width: 50 = 50cm). World space uses meters. 100cm = 1m..uikitml file. Changes are auto-compiled by the vite plugin and hot-reloaded..json file in public/ui/ should never be modified directly, but can be read for quick debugging to inspect the compiled element tree, class definitions, and properties.After each edit to the .uikitml file:
browser_screenshot to visually verify the change.public/ui/<name>.json) to debug layout issues or inspect computed properties.Repeat the edit-screenshot cycle as needed.
When done with UI work, always restore the ScreenSpace component to its original state.
If it had ScreenSpace before: Restore the original values that were noted in Step 2.
// Restore original settings
.addComponent(ScreenSpace, {
top: "20px",
left: "20px",
height: "40%",
// ... whatever was noted
});
If it did not have ScreenSpace before: Remove the ScreenSpace component addition from code.
Take a final browser_screenshot to confirm the panel is back to its normal state.
.uikitml, never the compiled .json — the JSON is auto-generated and will be overwritten.getElementById(id) or querySelector(selector) on the PanelDocument to access UI elements programmatically in systems. Elements can be named with .name = "id" to make them discoverable in the scene hierarchy.…
Test grab system (distance grab, one-hand grab, two-hand grab) against the grab example using the iwsdk CLI.
Test XR interactions (ray, poke/touch, dual-mode, audio, UI panel) against the poke example using the iwsdk CLI.
Find and click a target object in XR. Use when testing UI interactions, clicking buttons, or verifying interactable elements work correctly.
IWSDK project planning and best practices guide. Use when planning new IWSDK features, designing systems/components, reviewing IWSDK code architecture, or when the user asks about IWSDK patterns, ECS design, signals, or reactive programming in this codebase.
Develop and iterate on IWSDK UI panels efficiently. Use when working on PanelUI components, debugging UI layout, or improving UI design in IWSDK applications.
Test level system (LevelRoot, LevelTag, default lighting, scene hierarchy) against the poke example using the iwsdk CLI.