/ls-clad:preview-inspectionfrom ls-clad
Inspects live Lens Studio previews by querying scene state, discovering objects by component or property, reading transforms/bounds/component values, exploring hierarchy, and capturing orthographic renders. Works across Specs and Snapchat Lenses.
Ships in ls-clad. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Inspect the Lens Studio preview via QueryRuntimeSceneTool and CaptureRuntimeViewTool — see Tools below.
Scope: Both tools work on any Lens Studio preview — Specs or Snapchat Lenses. No IK dependency. The companion specs-preview-interaction skill covers driving the scene with hand actions and is Specs-only.
Lens-side setup: The preview tools install the AiPreviewAgentInspect.lspkg package and its AgentInspectScript component automatically. If queries still time out with NO_PREVIEW, check that the component is on a SceneObject.
Verification surfaces:
.esproj is configured correctly): @input bindings, scriptAsset UUIDs, requireAsset paths, asset library entries, authored components and transforms. Verified via scene-graphql / asset-graphql / Editor API (ExecuteEditorCode).Interactable, runtime audio children, material clones), current property values, post-interaction state. Verified via this skill + RunAndCollectLogsTool + CaptureRuntimeViewTool.This skill covers the runtime side only. Editor-side fields are not queryable through QueryRuntimeSceneTool — the runtime consumes them at instantiation and no longer carries them as data. An empty runtime response for an editor-side field means the runtime doesn't track it, not that the feature is missing. If you need to verify both sides, use both tool families in sequence.
Both tools work against the live preview. They accept optional previewName (which preview — see Preview routing) and timeoutMs (defaults to 5000).
| Tool | Purpose |
|---|---|
QueryRuntimeSceneTool | Unified GraphQL endpoint. Roots: sceneObjects(filter, limit, sortBy) for filtered walks, sceneObject(uniqueId) for single-object deep reads, sceneRoots for top-level walks, capabilities for live introspection. Composable AND-filters, projection-driven payloads, single round-trip per query. |
CaptureRuntimeViewTool | Orthographic render of the runtime scene. Object mode when uniqueIds are passed (auto-frames the bounding box, isolate hides everything else). Scene mode otherwise (looks at center, ortho size from distance). |
QueryRuntimeSceneTool projection shortcuts to know about:
summary — single JSON blob with all 7 cheap fields ({name, uniqueId, enabled, parentName, parentUniqueId, childCount, componentTypes}). Use instead of typing each.descendantsTree(maxDepth, enabledOnly) — nested JSON tree of summaries (server cap depth 5). Replaces nested children { children { ... } } boilerplate. enabledOnly: true prunes disabled subtrees.capabilities { digest } — one-shot JSON dump of every queryable field. The "what can I ask?" escape hatch.transform { worldPosition } and get {x,y,z}. Never write worldPosition { x y z } (no subselection on JSON scalars). Same for bounds { min max center extents }.All scene queries go through QueryRuntimeSceneTool with a GraphQL string. Pass enum values without quotes; project only the fields you need.
| Step | Query | Key Argument |
|---|---|---|
| Orient (top-level) | { sceneRoots { summary descendantsTree(maxDepth: 2) } } | — |
| Drill into subtree | { sceneObject(uniqueId: "X") { summary descendantsTree(maxDepth: 3, enabledOnly: true) } } | uniqueId, maxDepth, enabledOnly |
| Spatial query | { sceneObjects(filter: {nearPoint: {point: {x,y,z}, radius: N}}, sortBy: DISTANCE) { matches { summary distance } } } | nearPoint, radius |
| Discover interactables | { sceneObjects(filter: {hasComponents: ["Interactable"], enabledOnly: true}) { matches { summary } } } | hasComponents, enabledOnly |
| Find by type | { sceneObjects(filter: {hasComponents: ["Text"]}) { matches { summary } } } | hasComponents |
| Find by name | { sceneObjects(filter: {nameContains: "Launch"}) { matches { summary } } } | nameContains (case-insensitive) |
| AND multiple components | { sceneObjects(filter: {hasComponents: ["Interactable", "Button"]}) { matches { summary } } } | hasComponents (array is AND) |
| Find by value | { sceneObjects(filter: {property: {componentType: "Text", propertyName: "text", operator: CONTAINS, value: "hi"}}) { matches { summary matchedProperty { value } } } } | property |
| Subtree-scoped find | { sceneObjects(filter: {descendantOf: "<rootUid>", hasComponents: ["Text"]}) { matches { summary } } } | descendantOf |
| Negative existence | { sceneObjects(filter: {nameContains: "X"}) { matches { summary } totalScanned } } — assert matches is empty | nameContains, totalScanned |
| Read state | { sceneObject(uniqueId: "X") { summary transform { worldPosition worldScale } components(filter: ["Text"]) { type properties } } } | uniqueId, projection |
| Get bounds | { sceneObject(uniqueId: "X") { bounds { min max center extents } } } | uniqueId |
| Self-introspect | { capabilities { digest } } | — |
| Scene view | CaptureRuntimeViewTool(center: {x,y,z}, distance: N) | center, distance, viewAngle, detail |
| Object view | CaptureRuntimeViewTool(uniqueIds: ["..."]) | uniqueIds, viewAngle, isolate, distance, detail |
Build a mental model of the scene by composing GraphQL queries through QueryRuntimeSceneTool. Cheap fields (summary) are always free; lazy fields (transform, bounds, components, parent, children) require explicit selection. See the Quick Reference table above for all query patterns.
Many IK and UIKit behaviors aren't built-in component types — they're ScriptComponents whose script asset is named after the behavior (Interactable, InteractableManipulation, InteractableColorFeedback, UIKit Button). componentTypes and presentComponents surface those script-asset names alongside real types, and hasComponents matches them:
{ sceneObjects(filter: {hasComponents: ["Button"]}) { matches { summary } } } — finds every UIKit Button in the scene{ sceneObjects(filter: {hasComponents: ["Interactable", "Switch"]}) { matches { summary } } } — AND-combine literal types with syntheticsCaveat: synthetic names work in hasComponents but not in property filter (which requires a registered reader). To filter ScriptComponents by their script-asset name, use the registered ScriptComponent reader: property: { componentType: "ScriptComponent", propertyName: "scriptAsset", operator: EQUALS, value: "Button" }. The predicate iterates all ScriptComponents on each object, so it correctly finds Buttons regardless of script attachment order.
An IK Interactable typically has 2-5 ScriptComponents on the same SceneObject (e.g. Interactable + UIKit Button, or Interactable + InteractableAudioFeedback + InteractableColorFeedback). components { type properties } returns all of them, distinguished by properties.scriptAsset. Don't assume one entry per type.
property filter accepts five operators (passed as enum values, no quotes):
| Operator | Applies to | Behavior |
|---|---|---|
EQUALS | any | Strict equality. |
CONTAINS | strings | Case-insensitive substring match. String values only. |
GT | numbers | Greater-than. Numeric values only. |
LT | numbers | Less-than. Numeric values only. |
EXISTS | any | The property is present. value is not required. |
Type-mismatch behavior: when an operator is used against a property of an incompatible type (e.g. GT against a string, CONTAINS against a number), the predicate silently returns false for that object rather than throwing — so the match list is empty and filterBreakdown.afterProperty is 0. This is by design (lets you compose filters across mixed-type readers without errors) but means an empty result doesn't necessarily indicate "no matches" — it can also mean "operator/type mismatch." If you suspect a type mismatch, use EXISTS first to confirm the property is present, then check its actual type via a components { properties } projection.
filterBreakdownIf sceneObjects(...) { matches } returns [], project totalScanned and filterBreakdown to learn which filter culled the results:
{ sceneObjects(filter: {...}) {
matches { summary }
totalScanned
filterBreakdown { afterEnabledOnly afterNameContains afterComponent afterNearPoint afterProperty }
} }
Each breakdown field is null when the filter wasn't applied; otherwise the count of objects surviving up to that stage in cheap-first order. Reads as a funnel.
errors[].extensions.codeGraphQL errors carry a stable extensions.code for branching:
| Code | Meaning | Recovery |
|---|---|---|
UNKNOWN_COMPONENT | property filter targets an unregistered reader | extensions.registered lists valid names |
UNKNOWN_PROPERTY | reader exists but propertyName is unknown | extensions.availableProperties lists what the reader exposes |
NOT_FOUND | descendantOf uniqueId not in scene | re-query for a fresh uniqueId |
INVALID_FILTER | sceneObjects called without any predicate | use sceneRoots for unfiltered top-level walks |
INVALID_PARAMS | bad limit, or sortBy: DISTANCE without nearPoint | follow the message |
TIMEOUT / NO_PREVIEW | bridge problem | retry, ensure preview is open and AgentInspectScript is wired |
INTERNAL_ERROR | unexpected Lens-side exception | report; not retryable |
CaptureRuntimeViewTool renders the runtime scene as an orthographic image. It has two modes selected by whether you pass uniqueIds:
| Mode | When | What you control |
|---|---|---|
| Object mode | uniqueIds: ["..."] is non-empty | Camera auto-frames the combined bounding box. viewAngle is object-relative for a single uniqueId (so front means the front of that object); world-aligned for multi-id framing. isolate: true hides every other scene object so nothing occludes the targets. distance adds extra padding around the box (cm). |
| Scene mode | uniqueIds omitted | Camera looks at center (defaults to origin) inside a cube of half-size distance / 2 (default 100 → ±50 extent). isolate is ignored — there's no object set to isolate against. viewAngle is world-aligned. |
Common to both modes:
viewAngle: isometric (default) | top | front | back | left | rightdetail: low (256×192, quick checks) | medium (512×384, default) | high (1024×768, fine details / text)previewName: which preview — see Preview routingtimeoutMs: bridge timeout, default 5000uniqueIds. Let the framing do the math. Add isolate: true if something is in the way. Use a single-element array for one object; the camera will use that object's rotation so viewAngle: "front" is its actual front face.uniqueIds and pass center (or omit it for origin).transform { worldPosition } via QueryRuntimeSceneTool if you need a precise center for scene mode.CaptureRuntimeViewTool over CapturePanelScreenshotTool for Lens verification — it renders from any angle and can isolate targets.Every preview tool takes an optional previewName; its description says what omitting it targets and which names it accepts. Follow the tool descriptions.
previewName (or omit it everywhere) to every tool in one check, so interaction, queries, captures and logs observe the same preview.PreviewPanelTool listPreviews or openPreview. Never invent a label such as "Player 1"; if a tool rejects a name, call listPreviews again.lsdbg). It attaches only to a visible panel, never to a hidden preview, so a check that pairs these tools with lsdbg passes the previewName that lsdbg attach returns to every tool — see lens-js-debugger → Debugging alongside Lens Studio MCP preview tools.RunAndCollectLogsTool refresh does not reload the visible panel. Scene edits are applied live to the panel's running Lens without restarting it, so startup code does not re-run against them. When a working milestone lands (the Lens runs cleanly after a build, a verified fix, or just before telling the user to try it), reload the visible panel once with PreviewPanelTool refresh, previewName set to its exact title from listPreviews (usually "Preview 1") and waitForReady: true. With several visible panels, refreshPreviews reloads them together. Do it once per milestone, not after every tool call. It resets the Lens's runtime state in that panel, so skip it while the user is mid-interaction there.{ sceneRoots { summary descendantsTree(maxDepth: 2) } } for a shallow view, then drill into subtrees via sceneObject(uniqueId) or filter via sceneObjects(filter: {hasComponents: ["Interactable"]}).parentName to disambiguate. Multiple objects share the same name in scenes with repeated UI templates — parentName tells you which is which. The summary projection includes it for free.{ sceneObject(uniqueId) { transform { worldPosition } } } — don't guess coordinates.CaptureRuntimeViewTool — see Capture above for mode selection and detail levels.sceneObjects without a filter (INVALID_FILTER) — use sceneRoots for unfiltered walks.worldPosition { x y z } or min { x y z } etc. — Vec3 leaves are JSON scalars, no subselection (see Tools above).property: { componentType: "Button", ... } — see Synthetic component types above.components { type properties } returns one entry per type — see Multi-component reads above.GetRuntimeObjectsByComponent, InspectRuntimeObject, GetRuntimeSceneOverview, etc. Those tools no longer exist. Use QueryRuntimeSceneTool for all scene queries.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub lens-studio-devs/ls-extensions --plugin ls-clad74 skills in this plugin
/build-imageGenerate a 2D image from a text prompt via SPECS text-to-image, to Assets/GeneratedImages/<Name>.png (build-mesh reference, texture, or screen-space). Transparent RGBA cutout, cropped tight, by default; opt out for an opaque image.
/build-meshGenerate a 3D mesh, model, or asset for a Lens — build, create, or make props, characters, scenery. Four peer backends chosen per asset: SPECS text-to-3D (static default — best texture fidelity, async minutes-long jobs), FAST3D (faster static AI props), code-authored MeshBuilder via the mesh-builder-scripting skill (articulated, animated, parametric TypeScript content), and Blender voxel (blocky aesthetic; the only source of rigged GLBs). GLB backends return the file plus AABB metadata so the caller can size colliders and place the mesh in the world.
/build-musicGenerate musical phrases, chord progressions, beats, jingles, and short pieces via local algorithmic synthesis. Sample-free, license-clean, fully offline. Scale-degree composition, pattern-based arrangement, frequency-separated mixing rules. Outputs 44.1 kHz stereo WAV to Assets/GeneratedSFX/./build-sfxGenerate non-pitched sound effects (UI, impacts, sweeps, foley, ambient textures, retro 8-bit) via local algorithmic synthesis. Outputs 44.1 kHz WAV to Assets/GeneratedSFX/. For musical phrases or chord progressions use /build-music instead./camera-and-renderingCamera configuration, 2D/screen-space rendering, RenderMeshVisual patterns, and visibility debugging for Lens Studio scene construction. Use when setting up cameras (orthographic/perspective), creating screen-space content (ScreenTransform, Image, Text), debugging invisible objects, or planning any scene involving rendering config./editor-apiExecuteEditorCode contract and Editor API paradigms — runtime, access patterns, gotchas, references. Use before writing Editor API TS (`pluginSystem.findInterface`, `LensStudio:*`), grepping `editor.d.ts`, or routing to scene/asset-graphql.Other plugins' skills for the same job