Migrating a Lens to SPECS 27
Move a Spectacles (2024) Lens project to the latest Lens Studio and the SPECS 27 APIs with the specs-27-migration skill, and see which APIs change.
Lenses built for Spectacles (2024) use Lens Studio 5.15 and APIs that SPECS 27 has replaced. This
guide moves an existing Lens Studio project to the latest Lens Studio version and the SPECS 27 APIs
with your coding agent. The specs-27-migration skill in
CLAD runs the migration.
Before you migrate a Lens project
Complete these steps first to avoid problems during the migration:
- Install the latest Lens Studio. The migration upgrades the project to the latest Lens Studio version installed on your computer. See Set Up Lens Studio for SPECS.
- Sign in to Lens Studio.
- Check the project's current version. Confirm that the project runs in Lens Studio 5.15.4. Migrations from older versions often succeed, but migrating from 5.15.4 is the most likely to succeed.
- Check the packages. Don't customize the packages the project uses: each one must be packed in the Packages section of the Asset Browser.
- Back up your work. Make a backup of the project, and commit all current changes to source control.
Migrate a Lens project with the specs-27-migration skill
The migration runs in two steps, both handled by your coding agent.
Step 1: Upgrade the project
- Go to your project folder.
- Open the coding agent of your choice.
- Run the
specs-27-migrationskill.
The agent upgrades the project to the latest Lens Studio version and opens it in Lens Studio.
At this point, the project usually doesn't run yet. The agent pauses and asks you to restart it, so that it can connect to the Lens Studio MCP (Model Context Protocol) server.
Step 2: Reconnect and fix errors
- Close your coding agent, then open it again in the project folder.
- Resume your previous session, or start a new one.
- Run the
specs-27-migrationskill again.
The agent connects to the Lens Studio MCP server, then:
- updates every package in the project;
- replaces the deprecated APIs the project uses;
- fixes the errors the upgrade introduced.
APIs that change for SPECS 27
The migration looks for these Spectacles (2024) APIs in the project's scripts and moves each one to its SPECS 27 replacement.
| Spectacles (2024) | SPECS 27 | What changes |
|---|---|---|
RemoteServiceModule for fetch, HTTP, WebSocket, and WebView | InternetModule | A module swap with the same method signatures. createAPIWebSocket stays on RemoteServiceModule. |
RemoteMediaModule.loadAs… from a URL | RemoteMediaModule.loadResourceAs… | Create the resource first with InternetModule.makeResourceFromUrl(). |
Remote Assets (RemoteReferenceAsset) | Snap Cloud Storage | The files are hosted in a Snap Cloud bucket and loaded with RemoteMediaModule. |
StereoCameraModule, CameraRawModule | CameraModule | Loaded with require() instead of an input, and used with requests and responses. |
DepthTextureProvider, WorldDepthTextureProvider, sampleDepthAtPoint | DepthModule | A new, session-based flow rather than a one-to-one swap: the agent shows you the code before and after for you to confirm. |
MotionControllerModule with a phone as the controller | Bluetooth controllers | SPECS 27 doesn't support a phone as a motion controller. The signatures don't change; the agent asks where to tell users that no controller is available. |
SyncKit StorageProperty<number> and other TypeScript primitives | StorageProperty with a StorageTypes member | A type-only change: the generics take a StorageTypes member, and the values stay primitives. |
VoiceML speech transcription (VoiceMLModule) | ASR Module | Transcription moves to the ASR Module. |
| VoiceML voice commands (keyword and intent models, system commands) | None | Voice commands are removed, with no ASR equivalent. |
LeaderboardModule | Global Leaderboard (Snap Cloud) | Needs a one-time database setup. Friends mode and automatic reset intervals aren't available. |
If the project uses Remote Assets, the agent moves them to Snap Cloud during the migration. You may be asked to sign in to Snap Cloud, or to create a Snap Cloud account.
Related
- Convert a Project to SPECS: set up a project for SPECS with CLAD.
- CLAD Agents and Skills: the migration skill and the other CLAD skills.