Expanded documentation image

Agents and Skills

CLAD comes with many agents and skills that make it possible for an AI to build in a closed-loop, agentic development flow. Below we discuss some of the key agents and skills that make this possible.

Note: The AI will usually pick up the right skills and agents automatically as it works — you don't have to name them. This page is provided so you can drive them explicitly when you'd like more control over a specific step.

Example Workflow

There are many ways CLAD can empower your workflow — from helping you build autonomously, to helping you craft specific parts of your Lens.

Automatic end-to-end loop using SPECS Experience Builder

You can trigger the entire closed-loop agentic development end to end on its own by invoking the specs-experience-builder agent. This agent will plan and build an entire interactive SPECS AR experience on its own: it generates meshes, sound, music, UI, and icons, writes the scripts, and assembles the scene. After it builds, the loop verifies the result in the live preview and offers next steps — LEAF tests, optimization, publishing — and more!

build me an interactive solar system for SPECS

Do it yourself

If you're working on an existing project, or you only want to use certain parts of CLAD, you can trigger each part of CLAD individually. For example, you might trigger some of the following skills, agents, and more when creating a solar-system Lens for SPECS:

  • /scene-construction — lay out the sun and planets orbiting it.
  • /lens-api — make the planets orbit around the sun.
  • /build-mesh — generate custom models (a rocket, an asteroid) to fly around the solar system.
  • /shader-graph — make the sun glow realistically.
  • /specs-build-ui, /icon-selector, /font-selector — on planet tap, show a panel with information about the planet.
  • /build-music + /build-sfx — add an ambient soundtrack and tap sounds.
  • /verify-preview — after each change, confirm that tapping a planet shows its info panel (read-only, during development).
  • live-lens-tester (agent) — when you're ready to lock it in, it writes a re-runnable LEAF test for that tap-to-reveal interaction so future changes can't silently break it.

Tip: /lens-studio-field-notes contains tips and tricks that help an AI agent succeed. Loading it early in your session gives the AI the context it needs to handle Lens Studio projects. (The router loads it for you automatically; you rarely invoke it by hand.)

Note: Running the above is an illustrative workflow where you are driving the progress, working with AI, and using CLAD skills and agents to execute some tasks. SPECS Experience Builder will get into significantly more detail in order to achieve a one-shot.

Specialist Agents

In addition to the overall SPECS Experience Builder agent, CLAD comes with specialists you might use while building your Lens. The three most valuable to know about:

  • script-author — writes the TypeScript behavior code (and compile-checks it); doesn't touch the scene layout.
  • editor-api-specialist — handles heavy, multi-step project edits, keeping the noise out of the main conversation.
  • specs-project-migrator — upgrades an older Spectacles (2024) project to SPECS 27, separating auto-fixes from manual follow-ups.

The remaining specialists are spawned automatically by an orchestrator as part of the relevant step in the loop, and are called out in those sections below.

Tip: Agents are useful because they can spawn within another context — so you keep your main context smaller and more compact!

The Loop

Below we list some of the skills that the SPECS Experience Builder goes through when building a Lens end to end.

Getting Started & Setup

  • /lens-studio-router — the front door for any LS task; checks readiness, picks the platform, routes to the right workflow.
  • /specs-project-init — validate a SPECS project (camera, world tracking, required packages, preview device).
  • /ensure-package-installed — verify a package is installed; install it (and its dependencies) from the Asset Library if missing.

Tip: Before generating a fresh scene, /reset-preview-environment gives you a clean preview to build on — it recenters the camera, disables stray objects left over from a previous build, and captures a log baseline so you only read new output. It's safe and idempotent: it does not delete your scripts or assets and leaves the permanent environment (lighting, skybox, tracking) in place.

Note: A few skills shell out to external tools (Node.js, ffmpeg, Blender) — each is called out inline on the skill that needs it. /specs-project-init probes for the optional ones and warns you when something a workflow needs is missing.

Design & Prototype Loop

  • /scene-construction — the hub for adding and arranging objects (read → presets → apply → save).
  • /camera-and-rendering — set up cameras, on-screen 2D content, and debug invisible objects.
  • /materials — color, shininess, and textures via presets. The default "make it look like X."
  • /shader-graph — custom surface looks no preset can do (glow, animated, procedural).
  • /vfx-graph — particle effects: smoke, sparks, trails, magic.
  • /physics — gravity, collisions, joints, draggable/throwable props; objects colliding with face/hand/world.
  • /build-mesh — generate a finished 3D model from a text description (optionally animated). It picks from four peer backends per asset, by what the asset needs:
    • SPECS text-to-3D — the default for static props. Snap's hosted text-to-3D API (authenticated through your signed-in session, no API key); best texture fidelity, any style, and supports image→3D. Static only and asynchronous (create → poll → download, minutes per job).
    • FAST3D — faster static AI props, synchronous, no local dependencies; lower fidelity than SPECS. Used only when you explicitly ask for fast/draft meshes.
    • Code-authored / procedural MeshBuilder — build geometry from TypeScript at runtime (lathe, extrude, tube, skinned meshes); best for anything that must move, articulate, or be generated parametrically. Hands off to /mesh-builder-scripting and yields a TypeScript artifact instead of a GLB; zero pipeline latency, but a low realism ceiling (no canvas textures).
    • Blender voxel — a blocky voxel look, and the only backend that produces a rigged GLB (skinned skeleton). Needs Blender installed.
    • Requires Node.js for asset processing; the AI backends (SPECS, FAST3D) need Lens Studio sign-in with API access; the voxel / rigged-GLB backend needs Blender (optional — static AI meshes don't).
  • /mesh-builder-scripting — build or reshape geometry from code at runtime (vs. the pre-made models of /build-mesh).
  • /lens-package-toolkit — install, unpack, inspect, and author reusable Lens Studio packages.
  • /update-lens-packages — update libraries (SIK, UI Kit, Sync Kit) to their latest versions (or a pinned version when you ask for one).

Scripting & Editor Automation

  • /lens-api — writing TypeScript that runs inside a live Lens (events, taps, screen-to-world, runtime objects).
  • /editor-api — code that automates the Lens Studio editor for bulk edits (a different runtime — never mix the two).
  • /lens-studio-field-notes — the shared "house rules" loaded automatically by the router (mostly behind the scenes).

UI & Typography

  • /specs-build-ui — world-space UI panels for SPECS (HUDs, menus, sliders, switches, text inputs).
  • /font-selector — search fonts by mood or name and apply to text.
  • /icon-selector — find and import the right Material icon for a button or panel.

Tip: /specs-build-ui consumes icons and fonts — it doesn't generate them. Run /icon-selector and /font-selector first; the UI skill then reads the icons on disk and the font path you pass in. (The orchestrator enforces this order: icons and fonts before UI.)

Hand Interaction & Input

  • /specs-interaction-recipes — the playbook for hand actions: pinch, hover, grab, swipe, throw, custom gestures.
  • /specs-keyboard — show an AR keyboard for text input (text, URL, numpad, phone).
  • /specs-asr — real-time speech-to-text (40+ languages); great for dictation and voice → AI chat.

Tip: /specs-build-ui and /specs-interaction-recipes cover two different layers. UI panels, buttons, and dialogs (anything flat the user reads or taps) belong to /specs-build-ui — a UIKit Button already handles its own tap. Hand gestures on 3D objects (grab a planet, throw a ball) belong to /specs-interaction-recipes. They connect through an event bus: the UI module emits events your main script subscribes to. Don't hand-roll a button with a collider — that's the anti-pattern the builder guards against.

Audio

  • /build-music — compose original music: melodies, beats, jingles. Offline, license-clean.
    • Requires Node.js; uses ffmpeg (if present) to verify the track isn't silent — without ffmpeg it still renders, just skips that check.
  • /build-sfx — generate sound effects: clicks, impacts, whooshes, ambient textures, 8-bit.
    • Requires Node.js.
  • /specs-audio — how sound plays on-device: power-saving vs. low-latency, Snap recording, mic input.

SPECS Platform Capabilities

  • /specs-ai-remote-service — connect to AI services via the Remote Service Gateway (RSG). It fronts several providers, picked by what you're building:
    • Gemini — text / multimodal chat. For image generation use the Imagen endpoint.
    • OpenAI — chat completions and Realtime voice.
    • Snap3D — AI image / 3D generation.
    • Key split: chat-completions + ASR (hold-to-talk; simpler wiring, just mic + RSG) vs Gemini Live / OpenAI Realtime (full live voice — needs the websocket + dynamic-audio hierarchy).
  • /specs-camera — access camera frames for computer vision, AR overlays, and ML/AI.
  • /specs-depth — per-pixel depth for correct-distance placement and occlusion.
  • /specs-world-query — ray-cast to find real surfaces (floor, table, wall) and drop objects on them.
  • /specs-location — GPS, heading, and Snap Places for outdoor and map-based AR.
  • /specs-custom-locations — anchor content to one scanned real-world place.
  • /specs-snap-cloud — cloud backend (Supabase) for saved data, leaderboards, uploads, edge functions.
  • /specs-sync-kit — shared multiplayer / colocated experiences synced across people.
  • /specs-internet — HTTP requests and downloading remote media (images, video, audio, glTF).
  • /specs-websocket — persistent two-way connections for live feeds and streaming.
  • /specs-spatial-image — turn a 2D photo into a viewable 3D depth image.
  • /specs-ndk — add a native C++ module for advanced, high-performance code (engineers only).
    • Requires CMake, Python 3, and a C++ toolchain. Also needs the Google Cloud SDK only as a fallback — if downloading the SpecsNDK toolchain returns a 401/403 it installs gcloud and runs gcloud auth login to authorize; the default download is anonymous and needs no gcloud.

Agent: After a multiplayer build with /specs-sync-kit, the specs-sync-kit-validator agent runs a read-only structural check for the common setup mistakes (leftover sample content, wrong start mode, misplaced game content, missing camera tracking) and reports concrete fixes.

Testing, Migration & Optimization Loop

Debugging

  • /lens-debug — start here for bugs. Describe the symptom; it routes you to the right specialist.
  • /specs-debug — add-on layer for SPECS-only bugs (SIK, AI gateway, sync, tracking, world-space UI).
  • /lens-log-analysis — how to read the logs correctly (a clean compile ≠ the Lens actually ran).
  • /lens-js-debugger — interactive debugger: breakpoints, step, inspect live values.
  • /preview-inspection — query the live scene: find objects, read transforms, capture a render.
  • /specs-preview-interaction — drive the preview with simulated hand actions (pinch, drag, tap) to test behavior, no glasses needed. The action-driving sibling of /preview-inspection.
  • /verify-preview — confirm an edit produced the behavior you expected. Read-only; use after each change.

Tip: /verify-preview runs inline in the main agent, with full code context — it recompiles, captures the running preview, can drive an interaction and check the logs, then judges the result against what the code should do. It keeps the main context lean by being a tight, focused pass (and can offload bulk screenshots to an ad-hoc helper under context pressure).

Testing with LEAF

LEAF lets you instrument your Lens for testing. You can create repeatable scenarios that run to make sure the pieces of your Lens continue to work. CLAD can create and run LEAF scenarios automatically!

  • /specs-leaf-install-packages — install the LEAF framework before writing or running tests.
  • /specs-leaf-write-scenarios — author and attach automated test scenarios for a Lens.
  • /specs-leaf-run-in-preview — run those scenarios in the preview panel; the fastest iteration loop.

To learn more about LEAF, including how to install it and write scenarios yourself, see Test Your Lens With LEAF.

Tip — /verify-preview vs. LEAF: While building, use /verify-preview for quick "did my last edit work?" checks — it writes nothing and is the right tool most of the time. When the experience is far enough along that you want protection against regressions, use the live-lens-tester agent (or the LEAF skills directly) to write a persistent, re-runnable test suite. Rule of thumb: building → /verify-preview; locking in → LEAF.

Optimizing

  • /specs-capture-perf-trace — record a .pftrace from one or more preview panels.
  • /perfetto-trace-analysis — analyze a trace to find frame drops and jank, with honest confidence levels.
  • /specs-lens-perf-attribution — pin down which system eats frame time (ms/frame) and produce a plan.
  • /specs-lens-perf-optimize — apply the recommended fixes one at a time, verifying and committing each.
  • /specs-optimize-lens-mesh — cut draw calls by merging same-material meshes and decimating geometry.

Agents: /specs-lens-perf-optimize drives two worker agents in a loop — perf-attribution-runner measures where frame time goes (ms/frame per system), and perf-fix-applicator applies one undoable fix at a time with before/after capture. Both are spawned automatically; you just invoke the skill.

Migration

  • /specs-27-migration — migrate an older Lens to the SPECS 27 APIs (updates deprecated features).

Publishing

  • /specs-publish — take a SPECS Lens to "submitted for review" in five guided phases.