lens-package-toolkit

Install, pack, unpack, version, and author Lens Studio native packages (.lsc/.lspkg).

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with Lens Studio native packages requires navigating two archive formats (.lsc and .lspkg), opaque editor APIs like IPackageActions and AssetManager, and subtle behaviors around unpacking, versioning, and setup scripts that are easy to get wrong. ## Core Features & Use Cases - Package Consumption: Install packages from the Asset Library, unpack archives for editing, pull updates via IPackageRegistry, and read files inside packed packages without mutating them. - Package Authoring: Bump semver versions on NativePackageDescriptor and ScriptAsset, export .lsc/.lspkg archives with the right PackagePolicy, and attach README/.d.ts documentation. - Setup Scripts: Author and inspect setup scripts that run on package instantiation, with worked YAML examples like UI Button ScreenTransform wiring. - Use Case: You need to ship an updated UI Button component — use this Skill to bump its version, attach a README and .d.ts, configure CanBeUnpacked policy, and re-export the .lsc archive. ## Quick Start Ask the agent to unpack the installed UI Button.lsc package, bump its patch version, and re-export it to the Packages folder.

Frequently Asked Questions about lens-package-toolkit

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

FAQPage Schema
How do I export a Lens Studio package as .lsc or .lspkg?

Use IPackageActions.exportScript for script custom components (.lsc) and IPackageActions.exportPackage for folder packages (.lspkg), passing an absolute destination path and ExportOptions. Set ExportOptions.packagePolicy to control whether consumers can unpack or view the archive.

What is the difference between .lsc and .lspkg in Lens Studio?

A .lsc archive has a ScriptAsset as its primary asset, where the script itself is the component. A .lspkg has a NativePackageDescriptor (package.native) as its primary asset and bundles a folder of assets. Both live under Packages/ after install.

How do I bump the version of a Lens Studio package?

Assign a fresh new Editor.Assets.Version(major, minor, patch, prerelease) to the descriptor or script — mutating fields in place does not persist. Then call model.project.save() and re-export the archive so consumers see the update.

Why does unpacking a Lens Studio package fail with a locked package error?

Unpacking fails when the package was exported with PackagePolicy CannotBeUnpacked (0) or CannotBeUnpackedTransparent (2). Consumers cannot unlock it; only packages exported with CanBeUnpacked or CanBeUnpackedTransparent can be unpacked.

Can I read files inside a packed Lens Studio package without unpacking?

Yes. Packed packages extract contents to the project Cache directory under the package meta UUID, which you can read directly with filesystem tools. You can also walk getNativePackageItems to discover the inner file tree without mutating the package.

How do Lens Studio setup scripts work when a package is instantiated?

A setup script is JavaScript stored in the descriptor that returns an instantiate(asset, scene, target, instantiator) function, run when the package is dragged into a scene or installed. If empty, Lens Studio falls back to default instantiation behavior.