Official agent skill

Preview Screens

by microsoft in microsoft/power-platform-skills

A skill your agent uses when the user wants to preview generated screens in a browser without starting Metro / a simulator — for example after /create-mobile-app finishes or after /edit-app…

OfficialMITAuto-check: notesMobile

Install Preview Screens

skills CLI
$ npx skills add microsoft/power-platform-skills --skill preview-screens -a claude-code

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

GitHub CLI
$ gh skill install microsoft/power-platform-skills preview-screens --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/microsoft/power-platform-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/mobile-apps/skills/preview-screens .claude/skills/preview-screens && 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
preview-screens
GitHub stars
972
Token cost
~2.7k tokens
SKILL.md length
1,232 words
Files
1
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user wants to preview generated screens in a browser without starting Metro / a simulator — for example after /create-mobile-app finishes or after /edit-app…

  • Works in 7 steps: Locate project → Discover screens → Read reference mapping → …
  • After /edit-app regenerates a screen
  • SKILL.md covers When to use, When NOT to use, Workflow and Notes, plus 1 more section
  • Calls node and npm

What it does

Preview Screens is an agent skill from microsoft/power-platform-skills, published by the product's own GitHub organization. Use when the user wants to preview generated screens in a browser without starting Metro / a simulator — for example after /create-mobile-app finishes or after /edit-app regenerates a screen.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with npm. The repository describes itself as: A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and… The licence is MIT.

When your agent uses it

  • After /edit-app regenerates a screen

Example prompts

  • “/preview-screens”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Glob, Grep, Bash

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Locate project
  2. Discover screens
  3. Read reference mapping
  4. Read and convert each screen
  5. Assemble preview.html
  6. Write the file
  7. Open in browser

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Glob
    • Grep
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node
    • npm

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

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    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

Preview Screens loads about 2.7k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 1,232 words of instructions outside code blocks.

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

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.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Glob, Grep, Bash

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 microsoft/power-platform-skills at commit 0d044b8, republished under its MIT licence (© microsoft). 1,232 words, ~2,681 tokens.

Download SKILL.mdSave it as .claude/skills/preview-screens/SKILL.md (or your agent's skills folder).
name
preview-screens
description
Use when the user wants to preview generated screens in a browser without starting Metro / a simulator — for example after /create-mobile-app finishes or after /edit-app regenerates a screen.
allowed-tools
Read, Write, Glob, Grep, Bash
user-invocable
true
model
sonnet

Plugin check: Run node "${PLUGIN_ROOT}/scripts/check-version.js" - if it outputs a message, show it to the user before proceeding.

Shared instructions: shared-instructions.md — read first.

Preview Screens

Generates a self-contained HTML file that renders every screen in the app as a phone-frame mockup (375 × 812) with tab navigation and a dark/light toggle. The agent reads TSX files, understands the Tamagui component tree, and produces equivalent HTML/CSS — no programmatic TSX parsing.

When to use

  • After generating screens, to see a quick visual preview without running Metro/Expo
  • To share a screenshot-ready mockup with stakeholders
  • To verify layout before deploying

When NOT to use

  • To run the actual app → use npm run dev
  • To modify screens → use /edit-app; screen-builder is an internal agent invoked by orchestrator skills

Workflow

  1. Locate project → 2. Discover screens → 3. Read reference mapping → 4. Read & convert each screen → 5. Assemble preview.html → 6. Write file → 7. Open in browser

Step 1 — Locate project

Determine the working directory:

  • If $ARGUMENTS contains --working-dir <path>, use that.
  • Otherwise use the current working directory.

Validate the project:

text
Glob pattern="power.config.json" path="<working_dir>"

If missing, check for package.json. If neither exists, report the error and stop.

Read memory-bank.md if present to get the project name for the page title:

text
Grep pattern="^# " path="<working_dir>/memory-bank.md"

Fallback: read name from package.json.

Step 2 — Discover screens

Telemetry checkpoint: discover_app_screens

Find all TSX files under the app directory:

text
Glob pattern="app/**/*.tsx" path="<working_dir>"

Exclude these patterns — they are not screens:

  • _layout.tsx (navigation layouts)
  • +not-found.tsx (Expo Router error boundary)
  • Files in directories starting with .
  • index.tsx at the app root if it only contains an auth redirect (read it to check)

Derive screen names from file paths:

  • app/(app)/home.tsx → "Home"
  • app/(app)/recipes/index.tsx → "Recipes"
  • app/(app)/recipes/[id].tsx → "Recipe Detail"
  • app/login.tsx → "Login"
  • app/oauth-callback.tsx → skip (not a visible screen)

If native-app-plan.md exists in the working directory, read its ## Screens section for human-friendly labels.

Build an ordered list: [ { path, screenName, screenId } ].

Default tab ordering — Home first, then two details, then the rest. Step 5 marks the first entry as active, so the order below directly controls which screen the user lands on when preview.html opens.

Sort the list with this priority:

  1. Home / dashboard first. The first screen matching any of these paths (in this priority): app/(app)/home.tsx, app/(app)/index.tsx, app/(app)/dashboard.tsx, app/index.tsx (only if it's a real home screen — not the auth redirect you already filtered out in Step 2). If native-app-plan.md flags one screen as the home/landing screen, prefer that.
  2. Then up to two detail screens. A "detail" screen is any TSX whose route segment uses a dynamic param — file path contains [ and ] (e.g. app/(app)/recipes/[id].tsx, app/(app)/orders/[orderId]/edit.tsx). Take the first two in the order they were discovered (alphabetical by path is fine).
  3. Then everything else in discovery order.

If there are fewer than two detail screens, just include whatever exists and continue with the rest — do not pad with non-detail screens to force a count of 3.

Do not drop any screens — this rule only reorders. Every discovered screen still gets a tab.

Step 3 — Read reference mapping

Load the Tamagui-to-HTML mapping reference:

text
Read file_path="${PLUGIN_ROOT}/shared/references/tamagui-html-mapping.md"

Internalize:

  • Component → HTML element + CSS mappings (Section 1)
  • Token → pixel values for spacing, font-size, color (Section 2)
  • Conversion guidelines — placeholder rules, icon substitutions, what to skip (Section 3)
  • Phone frame HTML template (Section 4) — this is the outer shell

Also check if the project has custom brand tokens:

text
Glob pattern="tamagui.config.ts" path="<working_dir>"

If found, read it and extract any custom color tokens (look for tokens: { color: { ... } }). Add them as additional CSS custom properties in the generated HTML.

Step 4 — Read and convert each screen

Telemetry checkpoint: render_screen_preview_frames

Print before starting:

"→ Reading + converting <N> screens to HTML/CSS (one print per screen as I go)."

For each screen in the ordered list from Step 2:

  1. Read the full TSX file.

  2. Identify the component tree. Walk the JSX return statement and note every Tamagui component, its props, and its children.

  3. Generate equivalent HTML/CSS using the mapping from Step 3:

    • YStack → <div style="display:flex; flex-direction:column; ...">
    • Map every shorthand prop to its CSS equivalent (flex={1} → flex:1, bg="$color2" → background:var(--color2), etc.)
    • Map token values to pixels (p="$4" → padding:16px)
    • Replace <Ionicons name="..." /> icons with Unicode equivalents (see mapping reference Section 3, Guideline 4 — the icon substitution table uses Ionicons names)
  4. Handle dynamic content:

    • .map() over arrays → generate 3–4 representative placeholder items
    • useQuery / useMutation → show the populated state only (skip loading/error branches)
    • Form defaultValues → pre-fill inputs with those values

    Native PDF/pen controls need honest static approximations:

    • PDF viewer actions → render a compact report/PDF block with a filename, generated timestamp, storage label (for example Stored in Evidence PDF File or On-device share only), and a disabled View PDF button. If the source URL is not visibly HTTPS, label it Preview unavailable in browser rather than showing a fake viewer.
    • Generated PDF reports → render the generated/ready state and any persistence label from the plan or code, such as Uploads to Evidence PDF File. Do not embed a browser PDF iframe or imply the native viewer runs in preview.
    • Pen/signature input → render a signature pad placeholder with an ink stroke sample and a captured-preview state. Include the persistence label when known, such as Stored in Signature Image or Uploads to Signature File.
    • Do not wire browser click handlers that pretend to capture pen input, open native PDF viewer, share, print, or upload. This preview is visual only.
  5. Produce a <div class="screen" id="screen-{screenId}"> wrapping the converted HTML.

Use inline styles on elements. Keep each screen's HTML self-contained (no shared CSS classes between screens, except the theme variables).

Show full SKILL.md (341 more words)Show less
Step 5 — Assemble preview.html

Use the phone frame template from the mapping reference (Section 4) as the outer shell.

Replace the placeholders:

  • {{APP_NAME}} — project name from Step 1
  • {{TABS}} — one <button class="tab" ...> per screen, first tab gets class active
  • {{SCREENS}} — all screen <div> blocks from Step 4, first screen gets class active

If the project has custom brand tokens (from Step 3), add them to the :root CSS block.

Step 6 — Write the file

Telemetry checkpoint: write_screen_preview_document

text
Write file_path="<working_dir>/preview.html"

Print confirmation:

✅ Preview generated: <working_dir>/preview.html
   Screens: <N> (<comma-separated list of screen names>)
   Toggle: dark/light mode button in top-right
Step 7 — Open in browser

Telemetry checkpoint: open_screen_preview

Do NOT prompt. The visual_companion flag in <working_dir>/memory-bank.md already encodes the answer; asking again is redundant. The flag is set by /design-system (Step 6.75) during project creation, or defaults to yes if /design-system was not run.

Read the flag and act:

bash
grep -E "^visual_companion:[[:space:]]*(yes|no)" "<working_dir>/memory-bank.md" 2>/dev/null
FlagAction
visual_companion: noPrint the link and stop. Do not auto-open.
visual_companion: yes (or missing memory-bank, or standalone invocation)Print the link, then auto-open.

visual_companion: no — print:

"Preview is at: file://<working_dir>/preview.html (Visual Companion off — open manually.)"

Otherwise — print the link AND auto-open in one breath, no prompt:

"Preview is at: file://<working_dir>/preview.html — opening now."

Then try OS-appropriate openers in sequence and fall back to printing the link if none work:

bash
open "<working_dir>/preview.html" 2>/dev/null \
  || xdg-open "<working_dir>/preview.html" 2>/dev/null \
  || powershell.exe -NoProfile -Command "Start-Process '<working_dir>\preview.html'" 2>/dev/null \
  || echo "Could not auto-open. Open this URL in your browser: file://<working_dir>/preview.html"

open is macOS-only; the chain covers Linux (xdg-open) and Windows / WSL (powershell.exe Start-Process). On headless / SSH sessions all three fail silently and the user just opens the link they were already given.


Notes

  • Read-only with respect to source code. This skill only creates/overwrites preview.html — it never modifies TSX files, layouts, configs, or the memory bank.
  • Static approximation. The preview does not execute React, handle state, or fetch data. Dynamic lists show placeholder items. Interactions (button taps, navigation) are not functional.
  • Native capabilities are placeholders. PDF viewer, PDF report, sharing, printing, and pen/signature capture are shown as static states only. Browser preview must not imply native capture/viewer APIs work there.
  • Re-running /preview-screens overwrites the previous preview.html.
  • No memory-bank update needed — previews are ephemeral artifacts.

References

© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/mobile-apps/skills/preview-screens of microsoft/power-platform-skills.

Open the folder on GitHubat commit 0d044b8

Compare with similar skills

Preview Screens 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.

Preview Screens compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Preview Screens this skillmicrosoft/power-platform-skills972—~2.7kAutomated safety check: NotesMIT
Cometchat Angular V5 Migrationcometchat/cometchat-skills130—~1.9kAutomated safety check: PassMIT
Android API Diffgkd-kit/gkd43k—~796Automated safety check: PassGPL-3.0
Mobileclimobile-next/mobilecli295—~2.5kAutomated safety check: NotesCustom licence
Mobilevc InstallerJayCRL/MobileVC209—~1.2kAutomated safety check: PassMIT
Electron Wrapperbrianlovin/agent-config376—~2.3kAutomated safety check: PassNone

Similar skills

  • Cometchat Angular V5 Migration

    cometchat/cometchat-skills

    Upgrade an Angular app from CometChat UI Kit v4 → v5 (@cometchat/chat-uikit-angular ^4 → ^5).

    130 GitHub stars~1.9k tokensUpdated 3 days ago
    MobileAuto-check passed
  • Android API Diff

    gkd-kit/gkd

    Looks up Android framework Java and AIDL APIs across versions with the android-api-diff CLI: signatures, availability, source files and hidden-API access code.

    43k GitHub stars~796 tokensUpdated yesterday
    MobileAuto-check passed
  • Mobilecli

    mobile-next/mobilecli

    Run mobile automation, app testing, and interact with iOS and Android devices, simulators, emulators, and apps using the mobilecli CLI tool or JSON-RPC API.

    295 GitHub stars~2.5k tokensUpdated 3 days ago
    MobileAuto-check: notes
  • Mobilevc Installer

    JayCRL/MobileVC

    Install and start MobileVC — a Claude Code mobile workspace launcher that lets the user run Claude Code on a phone (iOS / Android) with their dev machine as the backend.

    209 GitHub stars~1.2k tokensUpdated 3 mo ago
    MobileAuto-check passed
  • Electron Wrapper

    brianlovin/agent-config

    Wrap a Bun web app into an Electron desktop app with native window management, auto-updates, code signing, and CI/CD distribution.

    376 GitHub stars~2.3k tokensUpdated 6 mo ago
    MobileAuto-check passed
  • Upgrading React Native

    callstackincubator/agent-skills

    Official

    Upgrades React Native apps to newer versions by applying rn-diff-purge template diffs, updating package.json dependencies, migrating native iOS and Android configuration, resolving CocoaPods and…

    1.7k GitHub starsUsed in 1 repo~1.1k tokens
    MobileAuto-check passed

More from microsoft/power-platform-skills

All 87 skills in this repo
  • Manage Firewall

    microsoft/power-platform-skills

    Official

    Inspects and configures the web application firewall (WAF) in front of a Power Pages production site.

    972 GitHub stars~4.5k tokensUpdated today
    Auto-check: notes
  • Manage Headers

    microsoft/power-platform-skills

    Official

    Inspects and configures the security headers a Power Pages site sends to browsers — Content Security Policy, frame and clickjacking protection, cross-origin sharing, cookie behavior, and related…

    972 GitHub stars~3k tokensUpdated today
    Auto-check: notes
  • Scan Code

    microsoft/power-platform-skills

    Official

    Scans a Power Pages site project for security issues in source code and dependencies.

    972 GitHub stars~3.4k tokensUpdated today
    Auto-check: notes
  • Scan Site

    microsoft/power-platform-skills

    Official

    Runs a security scan on a deployed Power Pages site, fetches the latest scan report, and produces a plain-language summary.

    972 GitHub stars~3.2k tokensUpdated today
    Auto-check: notes
  • Setup Datamodel

    microsoft/power-platform-skills

    Official

    Creates Dataverse tables, columns, and relationships for a Power Pages site based on a data model proposal.

    972 GitHub stars~4k tokensUpdated today
    Auto-check: notes
  • Add Server Logic

    microsoft/power-platform-skills

    Official

    Creates, edits, and manages Power Pages Server Logic files — server-side JavaScript that runs securely on the Power Pages runtime.

    972 GitHub stars~18k tokensUpdated today
    Auto-check: notes

Works with

Categories

Questions about Preview Screens

What does Preview Screens do?

A skill your agent uses when the user wants to preview generated screens in a browser without starting Metro / a simulator — for example after /create-mobile-app finishes or after /edit-app…. Preview Screens is an agent skill from microsoft/power-platform-skills, published by the product's own GitHub organization. Use when the user wants to preview generated screens in a browser without starting Metro / a simulator — for example after /create-mobile-app finishes or after /edit-app regenerates a screen.

When should I use Preview Screens?

Preview Screens fits situations like: after /edit-app regenerates a screen.

How do I install Preview Screens in Claude Code?

Run `npx skills add microsoft/power-platform-skills --skill preview-screens -a claude-code`. Or copy the skill folder (plugins/mobile-apps/skills/preview-screens in microsoft/power-platform-skills) into .claude/skills/preview-screens in your project. Claude Code loads it when a task matches its description.

How do I install Preview Screens in Codex?

Run `npx skills add microsoft/power-platform-skills --skill preview-screens -a codex`. Or copy the skill folder (plugins/mobile-apps/skills/preview-screens in microsoft/power-platform-skills) into .agents/skills/preview-screens in your project. Codex loads it when a task matches its description.

Can I use Preview Screens 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 microsoft/power-platform-skills --skill preview-screens -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/preview-screens, .gemini/skills/preview-screens, .github/skills/preview-screens and .opencode/skills/preview-screens in your project.

What does Preview Screens need to run?

Going by SKILL.md and its folder, Preview Screens needs the command-line tools its instructions call (node and npm). Its frontmatter pre-approves these tools: Read, Write, Glob, Grep, Bash.

Does Preview Screens access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Preview Screens safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Preview Screens use?

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

How many tokens does Preview Screens use?

About 2.7k tokens (SKILL.md is roughly 11k 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 Preview Screens?

Skills that share tags, products or a category with Preview Screens: Cometchat Angular V5 Migration (cometchat/cometchat-skills, 130 stars), Android API Diff (gkd-kit/gkd, 43k stars), Mobilecli (mobile-next/mobilecli, 295 stars) and Mobilevc Installer (JayCRL/MobileVC, 209 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Preview Screens?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/power-platform-skills, which has 972 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on October 7, 2026.

Source: microsoft/power-platform-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.