specs-leaf-write-scenarios

Writes LEAF integration test scenarios for Lens Studio Lenses and registers them in the scene.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing integration tests for Lens Studio Lenses requires knowing the LEAF framework's APIs, the exact scene object names, and correct interactor selection. This Skill automates the full authoring workflow: exploring the scene, writing scenarios with verified assertions, registering them in LeafIndex, and attaching the index to the scene. ## Core Features & Use Cases - Scene Exploration: Queries the Lens Studio scene hierarchy via MCP tools to record exact object names, components, and expected values before writing any assertions. - Scenario Authoring: Generates LEAF scenario classes using the correct interactor (DefaultLeafInteractor, LeafHandInteractor, or IK interactor) with relative/delta assertions instead of guessed absolute values. - Registration & Bootstrap: Writes or updates LeafIndex.ts with the @scenariosIndex decorator and attaches it to a new SceneObject via the Lens Studio MCP server. - Use Case: Ask the agent to add tests for a Lens with a coin-collection interaction; it inspects the scene, writes scenarios covering the interaction loop and HUD state changes, adds IK reachability coverage for buttons, and compiles a clean build. ## Quick Start Ask the agent to write LEAF test scenarios for the current Lens project covering its main interaction flow.

Frequently Asked Questions about specs-leaf-write-scenarios

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

FAQPage Schema
How do I write integration tests for a Lens Studio Lens?

Use the LEAF framework: create classes extending Scenario with an async run() method, interact via DefaultLeafInteractor or hand interactors, assert with expect(), and register scenarios in LeafIndex.ts using the @scenariosIndex decorator.

Which LEAF interactor should I use for Lens UI tests?

Use DefaultLeafInteractor for scripted functional flows, LeafHandInteractor.get(hand) for gesture and two-hand scale tests, and createIKInteractor() when validating that a real user can physically reach and operate the UI.

Does LEAF support two-hand gestures in Lens tests?

Yes. Get both hands via LeafHandInteractor.get("left") and LeafHandInteractor.get("right") and drive them concurrently with Promise.all. When both hands drag the same interactable, LEAF auto-synchronizes them into a two-hand scale gesture.

Why do my LEAF scenarios fail to find scene objects?

Object names must exactly match the scene hierarchy, and many Lenses defer initialization via DelayedCallbackEvent. Add await sleep(1500) at the start of run() and verify names through scene inspection before referencing them.

Can LEAF tests assert absolute state values like coin counts?

No. Scenarios run sequentially against the same live Lens instance, so state carries over between scenarios. Read the current value before the interaction and assert the expected delta instead of an absolute final value.