Visually verify a component by launching its Storybook story and taking a screenshot with playwright-cli. Use after making visual changes to a component.
npx skills add https://github.com/microsoft/fluentui --skill visual-test
Visually verify $ARGUMENTS by launching Storybook and capturing a screenshot with playwright-cli.
Run playwright-cli via npx so nothing is installed globally on the user's box. The first invocation downloads @playwright/[email protected] into the npx cache; subsequent calls are cached. Every command below uses this form:
npx -y @playwright/[email protected] <command>
Always boot the per-component stories package (react-<component>-stories) via nx storybook target, which only imports its own component's stories and dependencies.
react-<component>-stories: yarn nx show project react-<lowercase-component-name>-stories --json
If nx returns nothing with output of Could not find project react-<component>-stories, the component doesn't have its own stories package — check for a preview package (react-<component>-preview-stories) or ask before proceeding.
storybook target on the stories project directly — it's the most portable, since library aliases like react-<component>:start were only added in April 2026 and may not exist in older workspace snapshots: yarn nx run react-<component>-stories:storybook &
49360), not the Storybook default 6006. Don't assume.Content-Type.Reliable detection — target the storybook node child (not the yarn wrapper), then probe each listening socket until one returns text/html:
# Wait up to 180s for the storybook child to bind an HTTP port.
# Pattern matches the node child specifically, not `yarn storybook dev` (the wrapper has no sockets).
for i in $(seq 1 180); do
SB_CHILD=$(pgrep -f "node.*\.bin/storybook dev" | head -1)
if [ -n "$SB_CHILD" ]; then
for port in $(lsof -a -p "$SB_CHILD" -i -P -sTCP:LISTEN 2>/dev/null | awk 'NR>1 {print $9}' | sed 's/.*://'); do
CT=$(curl -sI --max-time 2 "http://localhost:$port/" 2>/dev/null | grep -i '^content-type:' | grep -i 'text/html')
if [ -n "$CT" ]; then SB_PORT=$port; break; fi
done
if [ -n "$SB_PORT" ]; then break; fi
fi
sleep 1
done
echo "Storybook child PID=$SB_CHILD on port $SB_PORT"
Then wait for Storybook to finish compiling stories — the HTTP port answers before index.json is populated:
for i in $(seq 1 60); do
N=$(curl -s --max-time 2 "http://localhost:$SB_PORT/index.json" 2>/dev/null \
| python3 -c "import json,sys; print(len(json.load(sys.stdin).get('entries', {})))" 2>/dev/null || echo 0)
if [ "$N" -gt 0 ]; then break; fi
sleep 2
done
If no port turns up, or index.json never populates — do not fall back to the workspace-wide Storybook; read the nx output log and debug the per-component boot. The most common real failure is missing build artifacts for unstable re-export deps (see troubleshooting below).
npx -y @playwright/[email protected] open "http://localhost:$SB_PORT"
Use the iframe URL for a clean render without Storybook chrome:
npx -y @playwright/[email protected] goto "http://localhost:$SB_PORT/iframe.html?id=components-<component>--default&viewMode=story"
npx -y @playwright/[email protected] screenshot --filename=/tmp/visual-test-$ARGUMENTS.png
snapshot to get the accessibility tree and find interactive element refs: npx -y @playwright/[email protected] snapshot
Then interact with elements by ref (e.g., click, hover) before taking more screenshots.
npx -y @playwright/[email protected] close
# Kill storybook — the nx wrapper may already be gone, so target the child
[ -n "$SB_CHILD" ] && kill "$SB_CHILD" 2>/dev/null
lsof -i :$SB_PORT -t 2>/dev/null | xargs kill 2>/dev/null
yarn nx run react-<component>-stories:storybook says the target doesn't exist.
The workspace graph may be stale (recent reparent). Run yarn nx reset then retry. If stroybook aliases still don't exist, use the direct yarn invocation:
cd packages/react-components/react-<component>/stories && yarn storybook dev --port 0 &
# --port 0 asks Storybook to pick a free port; detect it via the pgrep/lsof pattern above
Story IDs follow the pattern <category>-<component>--<story>:
# Default story for Button
components-button--default
# Appearance variant
components-button--appearance
# Default story for Menu
components-menu--default
To discover exact story IDs, open the Storybook sidebar and use snapshot to find navigation links,
or check the story file's export default { title: '...' } metadata.
# Local storybook (replace $SB_PORT with the actual port)
http://localhost:$SB_PORT/iframe.html?id=components-button--default&viewMode=story
# Dark theme
http://localhost:$SB_PORT/iframe.html?id=components-button--default&viewMode=story&globals=theme:webDarkTheme
The /iframe.html URL gives a clean render without Storybook chrome — always prefer this for screenshots.
npx -y @playwright/[email protected] snapshot to get an accessibility tree — useful for verifying ARIA attributes and finding interactive elements.npx -y @playwright/[email protected] click <ref> to interact with the component (test hover states, open menus, etc.) before taking a screenshot.npx -y @playwright/[email protected] resize <width> <height> to test responsive behavior.Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.
Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.
Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.
Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.
Use when the user explicitly asks for a desktop or system screenshot (full screen, specific app or window, or a pixel region), or when tool-specific capture capabilities are unavailable and an OS-level capture is needed.
A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.
| 所有联网操作必须通过此 skill 处理,包括:搜索、网页抓取、登录后操作、动态页面交互等。 触发场景:用户要求搜索信息、查看网页内容、访问需要登录的网站、操作网页界面、抓取社交媒体内容(小红书、微博、推特等)、读取动态渲染页面、以及任何需要真实浏览器环境的网络任务。
Take microsoft/visual-test from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.