Set up UI Verify, end to end
Goal: take a repo from no visual testing to a green UI Verify check on every PR, with the first
stories authored the cheap + deterministic way so the setup doesn't start flaky or expensive. This
skill is the conductor — it decides the capture path, wires CI, then hands the authoring and
determinism work to the focused skills.
Step 0 — sign in
Before the first upload, sign in the way https://uiverify.ai/install.md does: run npx -y uiverify login.
It prints a link and a short code (and opens the browser when it can). Show the user the link and the code,
tell them to sign in or sign up there and approve, and while it says it is still waiting, run the same command
again (same code). It exits 0 once signed in and prints "Signed in as ...". Say that line to the user. The
first signed-in upload creates their team and project, and passes --project <team>/<slug> when they already
made one on the website.
If npx uiverify login can't finish for any reason (it can't write its config folder, the keychain can't be
reached, there is no browser and the user can't open the link, the approval never comes before the code
expires, the CLI doesn't know a login command, or any other error), stop retrying it. Ask the user for a
project key instead: it starts with uv_proj_, and their UI Verify project's settings show it under API keys (create one for CI there if none is listed; no
project yet: they create one at uiverify.ai/onboarding, under "Create a project"). Then run the same upload
with the key as UIVERIFY_API_KEY. In CI the key is always what authenticates the upload (Step 4).
Step 1 — pick the capture path (don't ask the user; detect it)
UI Verify captures UI five ways. If the request is the one-line setup (it says to fetch
https://uiverify.ai/install.md), follow that guide's framework step instead of this one: a setup line that
carries the project (a project key, or "My UI Verify project is <team>/<slug>") and names Storybook may be the project's preselected default, and the guide decides
when to set up the framework the repo already uses. Otherwise, if the user named one ("set up UI Verify for
Storybook"), use it.
Otherwise pick it the way the one-line setup (https://uiverify.ai/install.md) does, so a repo gets the
same framework whichever way it was set up:
- A native-only app (iOS, Android, React Native) with no web front end: the **screenshot-upload
path**. A repo that also has a web front end uses the list below, and you mention the native app at the end.
- A web app: the first that matches.
1. Storybook — the repo has Storybook (a .storybook/ folder or a storybook / @storybook/*
dependency).
2. Playwright — the repo already has Playwright tests (@playwright/test and a playwright.config).
3. Bun — the repo runs its tests with bun test.
4. Vitest — the repo uses Vitest, has tests in another runner (Jest, Mocha), or has no tests at all.
If more than one matches, set up the first in this order and, at the end, tell the user which others UI
Verify could also cover. Don't ask which one, and don't scaffold Storybook into a repo that has none
unless the user asked for Storybook.
What each path captures:
- Storybook path — each story is a snapshot.
- Playwright path — assembled real pages (the app, staging, or prod), not isolated components.
Each test that uses the built-in page archives its final UI state for UI Verify to replay + diff.
- Bun path — visual tests run on
bun testwith@uiverify/bun, drive the installed Chrome, and
archive each test's final page: real pages of the app (run({ webServer })) or components on a page
serveBundle() builds. No Node test runner or browser download needed.
- Vitest path — component tests in Vitest browser mode (
@vitest/browserwith a Playwright
provider); each browser-mode test archives its final DOM. A repo with no browser-mode tests yet gets
visual tests in their own config next to its existing tests (Step 2).
- Screenshot-upload path — the repo is native / mobile / React Native (or otherwise can't
render in a browser) but already produces finished screenshots from its own harness (Detox, Maestro,
native snapshot tests). Upload those PNGs directly with --screenshots; UI Verify diffs, judges, and
baselines them with no rendering. There are no stories to author and determinism is owned by your
capture harness, so Steps 2-3 (client SDK + story authoring) don't apply — install the CLI
(npm i -D uiverify), then jump to Step 4 and wire the CI upload with --screenshots ./screenshots
in place of --static-dir. Upload only the screens a PR changed and the rest carry forward.
iOS / Swift app with no screenshot harness yet: use swift-snapshot-testing; the helper, test, run