Agent skill

UI Preview

by tingly-dev in tingly-dev/tingly-box

Capture headless-Chrome screenshots of the tingly-box frontend (running locally in mock mode) so frontend changes can be visually verified in environments without a real browser.

MPL-2.0Auto-check: notesTesting & QA

Install UI Preview

skills CLI
$ npx skills add tingly-dev/tingly-box --skill ui-preview -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tingly-dev/tingly-box ui-preview --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tingly-dev/tingly-box.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/ui-preview .claude/skills/ui-preview && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
ui-preview
GitHub stars
351
Token cost
~2k tokens
SKILL.md length
745 words
Files
5
Skills in repo
2
Repo updated
First seen
Licence
MPL-2.0

At a glance

Capture headless-Chrome screenshots of the tingly-box frontend (running locally in mock mode) so frontend changes can be visually verified in environments without a real browser.

  • Works in 4 steps: SendUserFile the PNGs so the user can… → For ad-hoc screenshot.mjs: delete it… → docs/ is gitignored; force-add images:… → …
  • The user asks to preview
  • SKILL.md covers Setup (run once per fresh…, Dev server, Auth seeding and First-run onboarding guides, plus 5 more sections
  • Runs JavaScript scripts from its folder; calls pnpm, git and curl; reaches storage.googleapis.com

What it does

UI Preview is an agent skill from tingly-dev/tingly-box. Capture headless-Chrome screenshots of the tingly-box frontend (running locally in mock mode) so frontend changes can be visually verified in environments without a real browser. Use when the user asks to "preview", "screenshot", "see the page", "show me the UI", "verify visually", or when frontend layout / component / styling changes need a sanity-check before review. Works in restricted/cloud sandboxes where Playwright's normal Chromium install is blocked.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files.

It sits in Testing & QA, covering Browser testing and Browser automation. It works with Playwright, npm, Go and pnpm. The repository describes itself as: Your Intelligence, Orchestrated. Every builder. Every team. Every agent. For Everyone. The licence is MPL-2.0.

When your agent uses it

  • The user asks to preview
  • Verify visually
  • Frontend layout / component / styling changes need a sanity-check before review

Example prompts

  • “preview”
  • “screenshot”
  • “see the page”
  • “/ui-preview”

Requirements

  • Node.js

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. SendUserFile the PNGs so the user can review them.
  2. For ad-hoc screenshot.mjs: delete it before committing — the stop hook will flag it.
  3. docs/ is gitignored; force-add images: git add -f docs/images/.
  4. Free the port: fuser -k 3000/tcp or pkill -f "vite --mode mock".

What it can do on your machine

Read from SKILL.md and the folder at commit b95951a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • pnpm
    • git
    • curl
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • storage.googleapis.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

UI Preview loads about 2k tokens when it runs. Until then it costs about 118 tokens; SKILL.md has 745 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~118
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:53
    nv var (read by `vite.config.ts` before `.env.mock`).

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from tingly-dev/tingly-box at commit b95951a, republished under its MPL-2.0 licence (© tingly-dev). 745 words, ~1,968 tokens.

Download SKILL.mdSave it as .claude/skills/ui-preview/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
ui-preview
description
Capture headless-Chrome screenshots of the tingly-box frontend (running locally in mock mode) so frontend changes can be visually verified in environments without a real browser. Use when the user asks to "preview", "screenshot", "see the page", "show me the UI", "verify visually", or when frontend layout / component / styling changes need a sanity-check before review. Works in restricted/cloud sandboxes where Playwright's normal Chromium install is blocked.

Headless UI preview (Playwright + Chrome for Testing)

Designed for the remote-execution container where:

  • cdn.playwright.dev / dl.google.com are blocked — use Chrome for Testing via storage.googleapis.com.
  • Ubuntu's chromium-browser is a snap stub and won't run.
  • MCP servers can't be registered mid-session — use Playwright's Node API directly.

Setup (run once per fresh container)

⚠️ This project uses pnpm (frontend/pnpm-lock.yaml is the source of truth). Do NOT run npm i here — npm ignores the pnpm lockfile and re-resolves transitive deps, which pulls broken versions (e.g. es-toolkit@1.47.0 vs the pinned 1.46.1) that crash the whole SPA at load. See Troubleshooting below.

playwright is already a committed devDependency in frontend/package.json, so a plain install provides it — no ad-hoc add/revert needed. @emotion/react / @emotion/styled are likewise already declared.

bash
# 1. Install deps from the lockfile (also fixes a node_modules previously
#    polluted by npm — wipe it first with `rm -rf node_modules` if you suspect that).
cd frontend
pnpm install --frozen-lockfile

# 2. Download Chrome for Testing (Playwright's own Chromium download is blocked)
mkdir -p /tmp/chrome && cd /tmp/chrome
curl -fsSL -o chrome.zip \
  "https://storage.googleapis.com/chrome-for-testing-public/148.0.7778.96/linux64/chrome-linux64.zip"
unzip -q chrome.zip          # → /tmp/chrome/chrome-linux64/chrome

Do NOT modify frontend/package.json / frontend/pnpm-lock.yaml for tooling anymore — everything needed is already committed. If a previous session left them dirty (or npm polluted the tree), reset with:

bash
cd <repo> && git checkout -- frontend/package.json frontend/pnpm-lock.yaml
pnpm -C frontend install --frozen-lockfile

Dev server

bash
cd frontend
USE_MOCK=true node_modules/.bin/vite --mode mock --port 3000 &
until curl -fs http://localhost:3000 >/dev/null; do sleep 1; done

USE_MOCK=true must be a shell env var (read by vite.config.ts before .env.mock).

Auth seeding

Every script must seed localStorage.user_auth_token via addInitScript or the app redirects to the login screen:

js
await page.addInitScript(() => {
    localStorage.setItem('user_auth_token', 'mock-token-for-screenshots');
});

First-run onboarding guides

Mock mode defaults these off (src/mocks/mockConfig.ts), so a fresh browser context no longer pops the "Direct Routing Guide" dialog and steals focus/clicks — no Escape-key dismissal needed before interacting with the page. If a script specifically needs to screenshot or assert the first-run guide itself, force it on per-navigation with a query param (no code change, no shared state between runs):

js
await page.goto('http://localhost:3000/agent/openai?mockOnboarding=on', { waitUntil: 'networkidle' });

?mockOnboarding=off is the (redundant) explicit default, useful when a test wants to assert the off state regardless of what a prior run left in localStorage.

Data profile: populated vs. newcomer

The onboarding flag above only controls dialogs. What data the mock backend "has" is a separate switch (src/mocks/mockConfig.ts):

js
await page.goto('http://localhost:3000/credentials?mockData=newcomer', { waitUntil: 'networkidle' });
  • ?mockData=populated (default): the full demo data set.
  • ?mockData=newcomer: a fresh install. It has no credentials, quota, usage, request logs or Claude Code profiles, and the built-in rules have no services. Use it to check that each page lands sensibly before the user has added anything. It also turns the first-run guides on, unless ?mockOnboarding=off is given.

The profile is kept in sessionStorage for the tab, so in-app navigation stays in the chosen world. Pass ?mockData=populated to switch back, or use a fresh browser context.

Scripts

All scripts live here and are run from frontend/. They use createRequire(cwd) to resolve playwright from frontend/node_modules regardless of the script's location:

js
import { createRequire } from 'module';
const { chromium } = createRequire('file://' + process.cwd() + '/')('playwright');
ScriptModePurpose
screenshot.mjsmockAd-hoc template — copy here and customise; do NOT commit
docs-screenshots.mjsmockAll docs/images/ product screenshots (<group>-<index>-<name>.png, sidebar order) + theme previews; GIF frames listed in docs/images/gif-frames.txt
regression-credentials.mjsmockAssertion-based regression for /credentials Add API Key flow
scenario-routing-graph.mjsreal backendCodex routing graph screenshots (requires running Go server)

Each script is self-documenting — see its file header for usage, outputs, and known issues.

Show full SKILL.md (286 more words)Show less

Shrinking screenshots (optional)

Screenshots are captured with Playwright's plain page.screenshot() — the skill deliberately does not compress images internally, because optimizers depend on host tooling that is not guaranteed in the run environment. If a PNG is large and you want to trim it before committing, run any optimizer you have available on the captured file afterwards. None of these are required:

  • pngquant --quality 80-95 --strip --force --out foo.png foo.png (lossy, smallest PNGs)
  • oxipng -o 4 --strip safe foo.png (lossless)
  • Node: sharp(file).png({ quality: 80, palette: true }).toFile(out)
  • Python: Pillow → img.save(out, optimize=True)

Prefer keeping the original capture when quality matters more than size.

After capturing

  1. SendUserFile the PNGs so the user can review them.
  2. For ad-hoc screenshot.mjs: delete it before committing — the stop hook will flag it.
  3. docs/ is gitignored; force-add images: git add -f docs/images/.
  4. Free the port: fuser -k 3000/tcp or pkill -f "vite --mode mock".

Troubleshooting

Blank white page / root is empty, console shows TypeError: require_isUnsafeProperty is not a function (stack points at es-toolkit/dist/compat/object/get.js ← recharts).

Cause: node_modules was installed/resolved by npm instead of pnpm, so a transitive dep (es-toolkit) drifted to a version whose CJS→ESM interop esbuild mis-bundles. It breaks the React vendor chunk, so every route renders blank — not just the page you're testing. Tweaking optimizeDeps (include/exclude/ keepNames) does not fix it.

Fix — reinstall the pinned tree with pnpm:

bash
cd frontend
rm -rf node_modules node_modules/.vite        # drop the npm-polluted tree + dep cache
pnpm install --frozen-lockfile
# verify the pinned (working) version is what's on disk:
ls node_modules/.pnpm | grep es-toolkit       # expect es-toolkit@1.46.1, NOT 1.47.0
pnpm add -D playwright                         # re-add the tool

Then restart the dev server. If you edited vite.config.ts while chasing this, revert it — the config is not the problem.

Dev-server process exits immediately (e.g. exit 144) on --force: usually a follow-on of the crash above (the unhandled client error). Once the pnpm tree is correct it starts cleanly; --force is only needed once to drop a stale node_modules/.vite optimize cache.

© tingly-dev, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in .claude/skills/ui-preview of tingly-dev/tingly-box.

  • SKILL.md
  • docs-screenshots.mjs
  • regression-credentials.mjs
  • scenario-routing-graph.mjs
  • screenshot.mjs

Open the folder on GitHubat commit b95951a

Compare with similar skills

UI Preview next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

UI Preview compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
UI Preview this skilltingly-dev/tingly-box351—~2kAutomated safety check: NotesMPL-2.0
Anti Detect Browserantibrow/anti-detect-browser-skills932—~9.8kAutomated safety check: WarnMIT
Playwright Pnpm Workspacemizchi/luna.mbt173—~1.2kAutomated safety check: PassNone
Test Electron AppPostHog/code179—~2.9kAutomated safety check: PassMIT
Test Electron AppPostHog/posthog40k—~3kAutomated safety check: PassCustom licence
Actions CI Tuningmizchi/skills356—~2.6kAutomated safety check: PassNone

Similar skills

  • Anti Detect Browser

    antibrow/anti-detect-browser-skills

    Drive Chromium from standard Playwright APIs with a real-device fingerprint applied in the kernel, one persistent isolated profile per identity, and a per-profile proxy whose exit IP sets timezone…

    932 GitHub stars~9.8k tokensUpdated 1 mo ago
    Testing & QAAuto-check: warnings
  • A skill your agent uses when running Playwright tests in this repo (luna.mbt) and either the test fails to discover specs ("did not expect test.describe()" / "two different versions of…

    173 GitHub stars~1.2k tokensUpdated 22 days ago
    Testing & QAAuto-check passed
  • Test Electron App

    PostHog/code

    Official

    Drive the real running PostHog Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser.

    179 GitHub stars~2.9k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • Test Electron App

    PostHog/posthog

    Official

    Drive the real running PostHog Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser.

    40k GitHub stars~3k tokensUpdated today
    Testing & QAAuto-check passed
  • Actions CI Tuning

    mizchi/skills

    A skill your agent uses when auditing or improving GitHub Actions workflows for a project.

    356 GitHub stars~2.6k tokensUpdated 6 days ago
    Testing & QAAuto-check passed
  • UI Visual Debugging

    NangoHQ/nango

    A skill your agent uses when modifying or visually debugging Nango frontend UI, including packages/webapp, packages/connect-ui, browser interactions, screenshots, and visual regressions.

    13k GitHub stars~1.3k tokensUpdated today
    Testing & QAAuto-check passed

More from tingly-dev/tingly-box

  • Update Libs

    tingly-dev/tingly-box

    Update the libs/ SDK submodules (openai-go, anthropic-sdk-go, go-genai) to new upstream/fork versions, adapt tingly-box to API changes, and verify with build + vet + tests.

    351 GitHub stars~830 tokensUpdated today
    Auto-check passed

Questions about UI Preview

What does UI Preview do?

Capture headless-Chrome screenshots of the tingly-box frontend (running locally in mock mode) so frontend changes can be visually verified in environments without a real browser. UI Preview is an agent skill from tingly-dev/tingly-box. Capture headless-Chrome screenshots of the tingly-box frontend (running locally in mock mode) so frontend changes can be visually verified in environments without a real browser.

When should I use UI Preview?

UI Preview fits situations like: the user asks to preview; verify visually; frontend layout / component / styling changes need a sanity-check before review.

How do I install UI Preview in Claude Code?

Run `npx skills add tingly-dev/tingly-box --skill ui-preview -a claude-code`. Or copy the skill folder (.claude/skills/ui-preview in tingly-dev/tingly-box) into .claude/skills/ui-preview in your project. Claude Code loads it when a task matches its description.

How do I install UI Preview in Codex?

Run `npx skills add tingly-dev/tingly-box --skill ui-preview -a codex`. Or copy the skill folder (.claude/skills/ui-preview in tingly-dev/tingly-box) into .agents/skills/ui-preview in your project. Codex loads it when a task matches its description.

Can I use UI Preview in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tingly-dev/tingly-box --skill ui-preview -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/ui-preview, .gemini/skills/ui-preview, .github/skills/ui-preview and .opencode/skills/ui-preview in your project.

What does UI Preview need to run?

Going by SKILL.md and its folder, UI Preview needs JavaScript for the scripts in its folder and the command-line tools its instructions call (pnpm, git, curl and npm). Our summary lists: Node.js.

Does UI Preview access the network?

SKILL.md names 1 domain. In commands or code: storage.googleapis.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is UI Preview safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does UI Preview use?

UI Preview is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does UI Preview use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to UI Preview?

Skills that share tags, products or a category with UI Preview: Anti Detect Browser (antibrow/anti-detect-browser-skills, 932 stars), Playwright Pnpm Workspace (mizchi/luna.mbt, 173 stars), Test Electron App (PostHog/code, 179 stars) and Test Electron App (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains UI Preview?

tingly-dev (a GitHub organization) maintains it in tingly-dev/tingly-box, which has 351 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.

Source: tingly-dev/tingly-box on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.