/ls-clad:lens-studio-field-notesfrom ls-clad
Provides Lens Studio plugin-specific field notes covering scene/asset tool selection (VirtualScene-first), Editor API delegation, and scene-prep slash commands. Loaded by /lens-studio-router.
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.
The canonical copies of the cross-cutting rules other ls-clad skills and agents reference.
No raw HTTP, no Bash workarounds for MCP. Never use curl, fetch, wget, or any raw HTTP/REST call to reach the Lens Studio MCP server — or to fetch an asset a Lens Studio MCP tool already provides — and never shell out to tsc/Node via Bash to compile or "fix" what an MCP tool owns (use the RecompileTypeScriptTool MCP tool). Always use the Lens Studio MCP tools in your tool list. If an MCP tool fails or seems absent, treat it as the naming/schema/retry issue in rule 2 — never as license to work around it. A hand-downloaded or hand-placed asset file is invisible to Lens Studio until imported through the proper tool.
Naming MCP tools across runtimes — name by bare tool name; resolve the prefix per runtime. In skill/agent prose, refer to a Lens Studio MCP tool by its bare CamelCase name (ExecuteEditorCode, VirtualScene, scene-graphql) — never the fully-qualified mcp__<server>__<Tool> literal. Only the server prefix + separator vary by runtime; the tool name itself is invariant:
mcp__lens-studio__<Tool> (hyphen server, __ separator). These tools are deferred — a tool "not in your list" or an InputValidationError means the schema is NOT LOADED YET (it does not mean the tool is missing): run ToolSearch({query: "select:mcp__lens-studio__<Tool>"}) once to load it, then call the tool. First-turn retry gate, never a permanent fallback.mcp__lens_studio.<Tool> (underscore server, . separator), surfaced directly — no ToolSearch step.ToolSearch step.The fully-qualified literal is correct in exactly two places: the query argument of a Claude-only ToolSearch({query: "select:…"}) call (gate such lines with "On Claude Code, …" so other runtimes skip them), and Claude-only manifests (.claude-plugin/settings.json, agent tools: frontmatter) — leave those literal. Everywhere else, use the bare name and resolve the prefix to your runtime's form. Never fall back to curl/HTTP or silently degrade because a tool "isn't in your list."
Units & coordinates (runtime). Lens Studio uses a right-handed coordinate system: +X cross +Y gives +Z. The vec3 constant forward is defined as (0, 0, 1) (+Z). A camera with identity rotation faces towards world −Z. World units are centimeters (cm). Rotations are degrees in the Editor API but radians at runtime — convert at the boundary.
One writer surface — no mixed-surface patching. Build/repair the scene through a single surface (VirtualScene is the default; see ls-clad:scene-construction). Do NOT reach for scene-graphql setProperty/addComponent or ExecuteEditorCode to "patch around" a malformed VirtualScene apply — that mixed-surface path leaves orphaned partial state in the user's project. The recovery path for a bad apply is re-issuing a corrected VirtualScene apply, not patching it on another surface.
Bounded tool-failure fallback — degrade in-surface, don't loop. When a Lens Studio tool is correctly invoked (schema loaded per rule 2) and still fails or reports unavailable/unusable, do not re-issue the same call in a loop and do not switch to a raw-HTTP/Bash workaround (rule 1). After at most one retry, fall back to the documented alternative — or to the underlying signal the tool would have produced — continue the build, and note the degraded step in your report. Decide this from the tool's own result only; never branch on an assumption about the runtime or environment (e.g. "this is CI"). Each tool's owner states its specific fallback (for example IconSelector → a text/emoji glyph or omitted icon). Note one non-fallback: a failed/absent RecompileTypeScriptTool has no substitute that proves type validity — a types-stripped transpile is not a type-check — so report the build type-unverified rather than accepting the transpile as a pass.
MCP liveness probe. Outside the router (its Gate uses gate-diagnose.ts), check that the Lens Studio MCP server is up with this probe; it works on Lens Studio builds without a GUI. On Claude Code, preload the schema first: ToolSearch({ query: "select:mcp__lens-studio__ExecuteEditorCode", max_results: 1 }). Then call ExecuteEditorCode once with inline code return "ok";. "ok" → reachable. InputValidationError → the schema is not loaded (rule 2), not unreachable: run the preload and probe again. Any other error → unreachable. The probe does not check that a project is loaded — the platform init skill (specs-project-init / snapchat-project-init) does.
Specs packages were renamed in Lens Studio 5.25, and every Specs package restarts at version 4.0.0. SpectaclesInteractionKit is now InteractionKit, SpectaclesUIKit is UIKit, SpectaclesSyncKit is SyncKit, and several other packages lost their prefix. Before you install, import, detect or update any Specs package, read /specs-package-renames: an installed package under either name counts as installed, never install a second copy beside the legacy one, and imports, prefab names and scene-object names follow the installed packages (4.0: IK from the IK.ts entry, prefab/scene object InteractionKit, SyncKit; legacy: SIK, SpectaclesInteractionKit, SpectaclesSyncKit). Other skills may still use a legacy name; read them through that table.
This plugin ships to Claude Code, Cursor, and Codex from one source. The orchestration primitives below differ per runtime — apply them by intent, not by the literal Claude tool name. (MCP tool naming is Hard Rule 2.) This is the canonical home; other skills/agents point here.
Agent({ subagent_type: "ls-clad:<name>" }) (plugin-qualified; the bare name fails to resolve); Cursor: its subagent facility; Codex: a generic spawn (e.g. multi_agent_v1.spawn_agent) given the agent's instructions — there is no typed ls-clad: interface there. If named Markdown agents are unsupported, read ls-clad/agents/<name>.md and pass its instructions to a general-purpose subagent. Run inline only when no supported subagent mechanism exists; this is not a missing install. Only treat a spawn failure as a bad install when the agent's source file is genuinely absent.Agent withheld from its tools list instead.SendMessage({ to: <agentId> }) to reuse a spawned verifier/worker across turns (on failure, spawn fresh). Runtimes without a persistent-subagent-session facility: spawn fresh each time, or run the agent's procedure inline.Skill tool / /<skill-name> (plugin-qualified ls-clad:<skill>); otherwise read ls-clad/skills/<skill>/SKILL.md and follow it inline.AskUserQuestion (blocking); Cursor: its ask tool (non-blocking — end your turn and wait yourself; it does not recognize the literal AskUserQuestion); Codex: an ask tool in Plan mode only (codex exec is non-interactive). Block only when no human can answer in this run at all — never merely because the literal symbol is absent.TaskCreate/TaskUpdate; runtimes without a task facility: terse inline per-phase status lines. The requirement is visible progress, not the specific tool.The canonical verification recipe — other skills point here. Run it after each meaningful change:
RecompileTypeScriptTool is the type-check of record — read the errors, not just the exit status. A LensifyTS / tsc-only transpile (or a "not configured" result) does not establish type validity: it strips types without checking them, so enum-vs-string, wrong imports, and non-existent members pass silently. If RecompileTypeScriptTool did not run a real type-check, treat the build as type-unverified — say so in your report; do not claim it compiles, and do not accept a transpile as a pass (Hard Rule 5). Strict enforcement is the harness's job (a tsc --noEmit gate against the installed package declarations), not a Bash workaround here (Rule 1).RunAndCollectLogsTool — capture an error baseline before the change, diff after. New errors are yours.CaptureRuntimeViewTool — capture the running preview. For text, cross-check: it can drop Text components when several labels are in frame, so judge text rendering from CapturePanelScreenshotTool instead.QueryRuntimeSceneTool scene data says, suspect the instrument before the scene: cross-check with the other capture tool (~5s) before acting on the discrepancy.Verification runs inline in the main agent — the point is multimodal judgment on your own output. Under context pressure, delegate a batch of captures to a generic ad-hoc subagent and have it report back; never maintain a standing verifier.
Temporary instrumentation. When a capture looks wrong and the cause isn't obvious: inject a temporary log probe (a script edit or an ExecuteEditorCode print), run, observe the logs, read the source, fix the cause — then REMOVE the probe and grep to confirm no leftovers.
Blind-spot checklist — what a single screenshot cannot show:
asset-graphql queries.GetBoundingBox, not just the visible frame.onAwake, hand-written .mat YAML, CW winding. Grep for these.Capture hygiene. Frame the object under test. Never re-read a stale capture after the scene has changed — capture again.
Outcome checks, not steps — verify these before declaring a build done; how and in what order is your call:
.meta exists. Hand-placed files are invisible to the project.<Name>UI.ts module, wired via @input typed as the UI class (never ScriptComponent + getScript casts). No hand-rolled BackPlate (RenderMeshVisual + SimplePBR), hand-rolled Button (collider + Interactable + Text), hand-made panel close button, or hand-positioned label stacks — these compile clean and render, which is exactly why they need a deliberate check. Dismissal is the Frame's built-in close button.@input is actually connected — no unwired required inputs. A required @input left unset throws Input <name> was not provided for the object <X> on the first frame, before your own null-guards run, and it only shows at runtime. For a reference you create during the build, wire it into the component's input through VirtualScene (the same write that creates the objects), or hold the reference you already have in code — never declare a required @input and rely on Inspector wiring the code-first build never performs. Verify: the first seconds of playback contain no was not provided error.VirtualScene and saved.RecompileTypeScriptTool clean — a real type-check against the installed package declarations, not a types-stripped transpile; if it could not run, the build is type-unverified, not clean. RunAndCollectLogsTool clean at runtime.name to IconSelector.Escalation rule: if one specific item regresses repeatedly, promote that ONE item to a hard rule — do not rebuild enforcement machinery around the whole list.
Before writing against any unfamiliar Lens Studio API, grep Support/StudioLib.d.ts (or the project's bundled .d.ts) for the class/enum/method signature — the d.ts always wins over any cheatsheet. For conceptual/behavioral questions, query the QueryLensStudioKnowledgeBase MCP tool.
For a separately versioned package, use the skill that owns it (for example UIKit:
/specs-build-ui, Sync Kit: /specs-sync-kit, renamed 4.0 packages:
/specs-package-renames) and confirm every symbol in the installed declarations
under Cache/TypeScript/Src/Packages. Never substitute behavior remembered from
another package revision.
Tool surfaces for building scenes, in order of preference:
apply call (creates, modifies, deletes; mixed scene objects and assets). Use read to introspect (serializes the scene to .virtual-scene.json for grep/file-tool inspection at zero MCP cost). This is the default surface for any scene write. A single apply replaces 50+ scene-graphql/asset-graphql mutations.presets { ... }, __type / __schema, allAssets(nameContains: ..., typeFilter: ...) / assetsByName(name: ..., typeFilter: ...) to search the broader asset library (including package-imported assets like IK prefabs that VirtualScene read doesn't index well), and createSceneObjectFromPreset for the few SceneObject presets VirtualScene doesn't cover (Camera Object, Image Object, Text Object). Do NOT use setProperty / createSceneObject / addComponent / createAssetFromPreset — those go through VirtualScene.ExecuteEditorCode (LensStudio:* modules, complex traversals, bulk mutations sharing execution context). Before any ExecuteEditorCode call, load the ls-clad:editor-api skill — it carries the findInterface namespace / I-prefix rules and the editor.d.ts lookup workflow that prevent the most common Editor API failures (guessed Editor.* symbols that don't exist). For heavy work (2+ EEC calls or several editor.d.ts lookups), delegate to the editor-api-specialist subagent instead — it auto-loads editor-api and keeps the noise out of your context. Never hand-roll Editor API code from memory.For VirtualScene apply syntax and instruction details, read ls-clad:scene-construction → references/virtual-scene.md. For GraphQL syntax (when discovery/introspection genuinely requires it), read ls-clad:scene-construction → references/scene-graphql.md or references/asset-graphql.md before writing queries — wrong syntax causes silent failures. The ls-clad:scene-construction skill covers cross-tool selection.
VirtualScene { command: "read" } (callable any time — before or between applys) serializes the scene to .virtual-scene.json at the project root. For inspection-only reads (filtering one object, checking a property, extracting an ID), use jq against that file directly — it's zero-cost and zero-MCP. Don't reach for python3 -c "import json..." heredocs.
# Find SocialFeed object's components
jq '.sceneObjects[] | select(.name=="SocialFeed") | {id, comps: [.components[].type]}' .virtual-scene.json
Safety: this file is VirtualScene's view of state. Trust it between consecutive VirtualScene applies in a single-writer session. Do NOT trust it after ExecuteEditorCode mutations, scene-graphql mutations, UI interactions, or runtime changes — re-run VirtualScene cmd=read instead.
For exact GraphQL discovery syntax, do NOT invent argument names — load the authoritative references instead:
ls-clad:scene-construction and read references/scene-graphql.md or references/asset-graphql.md.preview-inspection skill, or run the See-and-fix loop (above) for multi-step verification.Lens Studio has two phases, and most scene data (bounds, transforms, materials, component values) is readable/writable from a different surface in each. Reach for the wrong-phase surface and you get a silent no-op or a "method doesn't exist" error, not a helpful one. Match the surface to the phase:
| Author / editor time (building the scene, not running) | Runtime (preview running) | |
|---|---|---|
| Surface | MCP tools (VirtualScene, GetBoundingBox, …), scene/asset-graphql, ExecuteEditorCode | runtime Lens API in .ts scripts, QueryRuntimeSceneTool (preview-inspection) |
| Bounds / AABB | GetBoundingBox MCP tool | rmv.worldAabbMin()/worldAabbMax() in script, or QueryRuntimeSceneTool { … bounds } |
| Material color | setProperty(propertyPath: "passInfos.0.baseColor") | mat.mainPass.baseColor = … |
The same author-vs-runtime split is documented per-property in materials § Editor/GraphQL vs Runtime API and lens-debug § Layout wrong at runtime (the AABB card). When in doubt about which phase you're in: if a preview is running and you want what's actually on screen, that's runtime; everything else is author time.
{ allSceneObjects(nameContains: "X") { id name } }{ allSceneObjects(hasComponent: "Camera") { id name } }{ sceneObject(id: "uuid") { id name components { type } } }{ rootSceneObjects { id name } }nameContains, hasComponent, hasProperty, limit, offset. There is no filter: and no scene root field.The rule for all Editor API work: load the ls-clad:editor-api skill before writing any ExecuteEditorCode code. Never hand-roll Editor API code from memory. The skill carries the findInterface namespace / I-prefix rules and the editor.d.ts lookup workflow.
Load inline vs. delegate — the skill is loaded either way:
ls-clad:editor-api and call ExecuteEditorCode yourself.editor-api-specialist subagent (it auto-loads editor-api), so the intermediate noise stays out of your context.When in doubt between the two, delegate: an unnecessary subagent call is one round-trip; hand-rolled Editor API code is a debug spiral.
Delegate (rather than load inline) whenever you need to:
LensStudio:* modules — FileSystem, Shell, Network, Preview, App; hidden/internal modules such as Engine only after checking public declarations or using a guarded workflow-specific importExecuteEditorCode calls or several editor.d.ts lookups for one taskThe subagent starts fresh with no context about your scene. Give it specific, actionable instructions — not high-level goals:
Include: target object names and IDs, exact property values, parent-child relationships, and order of operations. The more specific your delegation, the fewer round-trips needed.
Invoke these skills during planning, not just execution — they document requirements that cause hours of debugging when missed. For the full domain-skill table (camera-and-rendering, materials, shader-graph, vfx-graph, physics, lens-api, lens-debug) and when to invoke each, see ls-clad:scene-construction. The three scene-construction reference files are:
| Reference | When to read |
|---|---|
ls-clad:scene-construction → references/virtual-scene.md | Batch scene + asset manipulation via the VirtualScene MCP tool — read/apply, instruction format, reference syntax (@id:, aliases), phase ordering. Read before any scene-write work; this is the default scene/asset surface. |
ls-clad:scene-construction → references/scene-graphql.md | Exact GraphQL syntax for scene-graphql discovery operations — presets, __type/__schema, the few preset creates VirtualScene doesn't cover. Read when introspection actually requires GraphQL. |
ls-clad:scene-construction → references/asset-graphql.md | Exact GraphQL syntax for asset-graphql discovery — allAssets, assetsByName, asset library search including package-imported assets. Read when searching the broader asset library. |
Project target, camera tracking mode, and preview simulation input are platform-dependent and must match the Lens's intent before you preview — defaults are frequently wrong, and a wrong default yields a build that looks fine in the editor but does nothing in preview. Don't hand-roll these; run the platform init skill:
specs-project-init (auto-fixes Spectacles target, Perspective + DeviceTracking World, Specs preview device).snapchat-project-init (inline checklist: tracking mode, preview input, target — each inferred from what the Lens does).For a full guided build (not just setup), lens-studio-router hands off to the platform's builder — Specs invokes the specs-build-experience skill (a step-decomposed orchestrator that spawns fresh ls-clad:step-* agents per pipeline step; the single-agent specs-experience-builder is retained only as an opt-in whole-build fallback), Snapchat spawns the snapchat-experience-builder agent — each running the matching init skill above as part of its pipeline.
Before any scene generation task or when starting fresh:
/reset-preview-environment to clear existing objects, reset the camera, and establish a log baseline/ensure-package-installed to verify required packages are present before buildingWhat 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