specs-build-ui

Generates TypeScript UI panels for Lens Studio using SpectaclesUIKit FlexLayout and GridLayout components.

16|2|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-build-ui-lens-studio-devs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: specs-build-ui
Source: https://github.com/lens-studio-devs/ls-extensions/tree/main/plugins/ls-clad/skills/specs-build-ui
Command: npx skills add https://github.com/lens-studio-devs/ls-extensions --skill specs-build-ui-lens-studio-devs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building world-space 2D UI for Snap Specs in Lens Studio requires deep knowledge of SpectaclesUIKit's component APIs, initialization ordering, z-fighting rules, and flex/grid layout semantics, where small mistakes produce silent rendering bugs that compile cleanly. ## Core Features & Use Cases - UIKit Panel Generation: Produces a TypeScript BaseScriptComponent under Assets/Scripts/ composing Frame, BackPlate, FlexLayout, GridLayout, Button, Switch, Slider, and TextInputField with correct import paths and initialization order. - Scene Wiring: When invoked standalone, creates the root SceneObject at z=-110 cm, attaches the ScriptComponent, sets @input properties via scene-graphql, recompiles, and captures a preview screenshot. - Gotcha Prevention: Encodes hard-won fixes for Frame init timing, Slider/Switch size-before-init, GridLayout autoRows collapse, ElementContent row collapse, and text alignment traps. - Use Case: Ask for a settings panel with two toggles and a volume slider, and receive a production-ready cm-based world-space UI module wired into your Lens Studio scene. ## Quick Start Ask the agent to build a status HUD with a connecting message for your Specs project using this skill.

Frequently Asked Questions about specs-build-ui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a UI panel in Lens Studio for Snap Specs?

Use SpectaclesUIKit components composed through FlexLayout or GridLayout inside a TypeScript BaseScriptComponent. Create a Component.Canvas at the root, add a Frame or BackPlate surface, offset content +0.6 cm in Z, and place the panel at z=-110 cm for full binocular overlap.

What is the difference between Frame and BackPlate in SpectaclesUIKit?

Frame is a movable, billboarded window with drag, resize, and close/follow buttons, while BackPlate is a lightweight static panel with no interaction. Use Frame for windowed UI and BackPlate for static panels whose size is driven by FlexLayout's onLayoutComplete event.

Why does my SpectaclesUIKit Frame not appear or stay hidden?

Frame initializes on OnStartEvent, so disabling its host SceneObject synchronously in onAwake prevents initialization entirely. Build all content inside frame.onInitialized.add and make enabled = false the last statement of that callback, and set autoShowHide = false.

Why do my GridLayout items stack at the origin in Lens Studio?

Creating GridItem or FlexItem components is necessary but not sufficient; the layout only positions children registered via layout.addItems(). GridLayout does not reliably auto-discover children, especially for content built inside frame.onInitialized, so always call addItems explicitly.

Can I set renderOrder on UIKit components to fix z-fighting?

No. The root Canvas uses Hierarchy sorting, so render order is determined by depth-first SceneObject hierarchy position, and manual renderOrder values fight that pass and cause flicker. Fix z-fighting with a +0.6 cm content offset and by ordering siblings in the hierarchy instead.

When should I not use this UI generation approach?

Do not invoke it standalone for a full from-scratch Specs experience; that flow belongs to the lens-studio-router orchestrator which coordinates meshes, audio, and scene construction. Standalone use is correct only when the project is already set up and you want a single UI module added.