---
name: ai-glasses-webapp-build
description: Create, redesign, or extend a web app for Meta Ray-Ban Display glasses. Use for application architecture, screens, routes, state, API-backed UI, persistence, offline behavior, or any product change; pair with ai-glasses-webapp-ui for toolkit setup and component composition. A complete initial app build includes a running local production preview and its URL.
argument-hint: "[app-name-or-feature] [app-directory]"
title: ai-glasses-webapp-build
canonical_url: https://skilld.dev/gh/meta/meta-wearables-webapp/ai-glasses-webapp-build
last_updated: 2026-11-02T20:04:29.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install meta/meta-wearables-webapp/ai-glasses-webapp-build`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/ai-glasses-webapp-build`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/meta/meta-wearables-webapp/ai-glasses-webapp-build) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/ai-glasses-webapp-build`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/ai-glasses-webapp-build --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/ai-glasses-webapp-build --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Build a Meta glasses web app

Use normal React knowledge for APIs, storage, routing, and service workers, then
apply the glasses-specific contract below. Use `ai-glasses-webapp-ui` for every new
application and UI change unless the user explicitly opts out of the toolkit.

## Start or inspect

For an empty destination, run the initializer from `ai-glasses-webapp-ui` before
writing application source. It creates the required React/Vite/TypeScript app
and installs the public npm packages only when they are not already usable. For
an existing app, inspect and preserve its working toolchain, then use the UI
skill's idempotent existing-app installer when the toolkit is absent. Never
introduce a machine-specific checkout, source alias, or `file:` dependency.

## Viewport and Toolkit authority

For a Toolkit application, use viewport `width=device-width,
initial-scale=1.0` (with `viewport-fit=cover` when appropriate), an app-specific
description, and `mrbd-web-app-capable=yes`. Give `html`, `body`, and `#root`
full available width and height. Derive layout from available space with
shrinkable grid/flex tracks; never hardcode device or viewport dimensions or
branch on them. Use `var(--uit-color-background-window)` for the whole window.

Before editing Toolkit application UI, read its
installed `wearables-ui-toolkit-web/SKILL.md` entrypoint, then load only the
production pattern or direct references it selects. The public repository at
<https://github.com/meta/meta-ray-ban-display-ui-toolkit-web/> contains the
documentation and LLM skills. Its UI guidance is authoritative for component
choice, route geometry, typography, and verification; the npm acquisition and
package-scope rules in `ai-glasses-webapp-ui` take precedence over stale setup
text. An explicit custom-UI opt-out keeps the custom scaffold's own mount
contract.

## Input and state

There is no free cursor or touchscreen. Directional input moves focus and
Select/EMG pinch activates the focused semantic control. Keep every command
reachable, preserve visible focus, and restore the originating control and
scroll position after Escape/Back, route return, or modal dismissal. Do not add
an in-app Back button.

Use stable geometry for loading, empty, stale, offline, denied, error, active,
and completion states that genuinely apply. Ordinary REST/WebSocket/storage/
offline code needs no separate skill: render a useful shell first, abort stale
work, close polling/sockets when hidden, and never bundle secrets.

## Composition boundaries

Follow the selected Toolkit pattern instead of imposing a host-specific screen
blueprint. In particular, keep exactly one vertical owner per route; never put
`ListItem` in `ScrollView` or nest `VerticalList` inside it. Keep a page-level
`Panel width="100%"` directly inside `ScrollView` when the selected pattern uses
one. When page commands exist, place them in a sibling bottom `ButtonRail` or
`ButtonGroup` dock with a shrinkable content track. Use action-less rows as
ordinary text rather than focus stops.

`TextStyle` members are exactly `NUMERAL1`, `NUMERAL2`, `DISPLAY1`, `HEADING1`,
`HEADING2`, `BODY1`, `BODY1_EMPHASIZED`, `BODY2`, `BODY2_EMPHASIZED`, `LABEL`,
`LABEL_EMPHASIZED`, `META1`, `META1_EMPHASIZED`, `META2`,
`META2_EMPHASIZED`, and `META3`. Routine product copy should stay at `BODY2`
or below; use larger roles only when the selected Toolkit pattern calls for
them.

## Performance and completion

Use `ai-glasses-webapp-optimize-performance` before release and whenever an app
is slow or its startup payload grows. Under its device profile, target first
paint under 1 second, usable content under 5 seconds, total first-load transfer
under 300 KB, warm launch under 2 seconds with 0 transferred bytes, fewer than
15 initial requests, and under 128 MB heap. The display is 30 Hz, so the frame
budget is 33 ms; never add a 60 fps loop for this panel.

Run timers, animation frames, sensors, polling, and sockets only while needed;
stop them on pause, hide, route exit, and unmount. Use local assets and bundled
icons; do not download icon packs.

Use `ai-glasses-webapp-device` for sensors or glasses-specific input, and
`ai-glasses-webapp-webmcp` when the wearer should be able to drive the app by
speaking to the assistant. Invoke
`ai-glasses-webapp-test` after implementation and fix every failure. Before a
release, complete the performance pass and rerun that gate. For Toolkit apps,
the gate runs the official structure validator and requires zero findings.

## Local preview completion contract

When the user's prompt asks for a complete app to be created or substantially
redesigned, the goal is not complete when the files and tests are finished.
After `ai-glasses-webapp-test` passes, start a separate production preview from
the app directory in a persistent terminal session:

```sh
npm run preview -- --host 127.0.0.1 --port 4173
```

The test gate's own preview is temporary and does not satisfy this requirement.
Keep the new preview process running, wait for its ready message, and verify the
reported loopback URL responds. Port 4173 is preferred, but when it is occupied,
use the actual fallback port printed by the server. If a preview of an older
build is running, stop it and start the newly validated build.

The final response must include a clickable local URL such as
`http://127.0.0.1:4173/`, tell the user the app is ready for local review, and
state that the server remains running until stopped. Do not claim the initial
app-build goal is complete without that URL. If the environment cannot keep a
local server running, report that limitation and provide the exact preview
command instead.

This local preview is not publishing. Never invoke Vercel or
`ai-glasses-webapp-publish` unless the user later explicitly asks to make the
app publicly accessible.
