vscode-playwright

A screenshot workflow for capturing VS Code editor views, code walkthroughs, and Copilot Chat examples with Playwright, a browser-automation tool.

In plain words
What is it for?
It helps create screenshots of files, editor views, and chat examples for slide decks, documentation, and other visual materials.
Why use it?
It handles starting the VS Code web environment, cleaning up the interface, setting the view size, and checking screenshots.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/microsoft/hve-core/vscode-playwright
Any agent
npx skills add microsoft/hve-core --skill vscode-playwright
Clone the repo
git clone --depth 1 https://github.com/microsoft/hve-core

Made for: Claude Code, Codex.

Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,705 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00021 $0.02705
Opus 5 $0.00010 $0.01352
Sonnet 5 $0.00004 $0.00541
Haiku 4.5 $0.00002 $0.00270

Measured 3d ago against content hash ca0f37753379, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

vscode-playwright scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$VSCODE_SERVE_DIR"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

compatibility: 'Requires VS Code CLI (code or code-insiders), Playwright MCP tools, and curl'
.github/skills/experimental/vscode-playwright/SKILL.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

VS Code Playwright Screenshot Skill

Captures VS Code editor views, code walkthroughs, and Copilot Chat examples using Playwright MCP tools with serve-web.

Overview

This skill provides a complete workflow for capturing high-quality VS Code screenshots suitable for embedding in slide decks, documentation, and other visual media. It handles server lifecycle management, viewport configuration, UI cleanup, and screenshot validation.

Prerequisites

  • VS Code or VS Code Insiders CLI (code or code-insiders)
  • Playwright MCP tools available (mcp_microsoft_pla_browser_*)
  • curl for server readiness checks

Architecture

The serve-web CLI is a Rust-based proxy ("server of servers") that downloads the VS Code Server release and proxies connections to the inner Node.js server. The outer CLI accepts a limited set of flags; --server-data-dir is the key flag that controls where all server data (settings, extensions, state) is stored.

Quick Start

  1. Detect the VS Code CLI variant and start the web server.
  2. Navigate Playwright to the VS Code web instance.
  3. Clean up the UI (close panels, tabs, notifications).
  4. Open files and capture screenshots.
  5. Stop the server and clean up.

Workflow Steps

Step 1: Detect VS Code CLI Variant

Check the VSCODE_QUALITY environment variable first; if it contains insider, use code-insiders. Otherwise, test availability with command -v code-insiders and fall back to code. Store the result for reuse:

if [[ "${VSCODE_QUALITY:-}" == *insider* ]] || command -v code-insiders &>/dev/null; then
  VSCODE_CLI="code-insiders"
else
  VSCODE_CLI="code"
fi

Step 2: Start the VS Code Web Server

Create a temporary server data directory, pre-seed settings (including the color theme) to prevent state restoration, and launch serve-web. The --server-data-dir flag must receive a literal path — shell variables from other terminal sessions are not available in background terminals:

VSCODE_SERVE_DIR=$(mktemp -d)
mkdir -p "$VSCODE_SERVE_DIR/data/User"
cat > "$VSCODE_SERVE_DIR/data/User/settings.json" <<'EOF'
{
  "window.restoreWindows": "none",
  "workbench.editor.restoreEditors": false,
  "workbench.startupEditor": "none",
  "workbench.editor.restoreViewState": false,
  "workbench.editor.sharedViewState": false,
  "files.hotExit": "off",
  "telemetry.telemetryLevel": "off",
  "workbench.colorTheme": "Default Dark Modern",
  "workbench.activityBar.location": "hidden"
}
EOF
$VSCODE_CLI serve-web --port 8765 --without-connection-token \
  --accept-server-license-terms --server-data-dir "$VSCODE_SERVE_DIR"

Read the full file on GitHub · 192 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 192 lines · 21 tokens per session scan C ca0f37753379

Subscribe to this mod's changes

vscode-playwright is a skill published in the GitHub repository microsoft/hve-core (1,411 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 2,705 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

fetching-and-converting-urls

Use when fetching a live URL and converting it to Markdown. Covers --url, custom user agents, preprocessing for noisy pages, and the --json ConversionResult shape.

xberg-io/html-to-markdown · 41 tokens

baoyu-url-to-markdown

Fetch any URL and convert to markdown using Chrome CDP. Supports two modes - auto-capture on page load, or wait for user signal (for pages requiring login). Use when user wants to save a webpage as markdown.

ufy2024/AuC · 52 tokens

sharing-results

The user wants to share or hand off what was found in a video — "send this analysis to my team", "make a page I can share", "export the findings", "give me something I can attach to the ticket". Use this to render a self-contained offline HTML viewer page with the frames, transcript, and every cached answer with its…

oxbshw/watch-skill · 75 tokens

app-docs

Generate complete user documentation for a web app with screenshots. Browses the app via browser automation, screenshots every screen, and produces a structured user guide with step-by-step instructions, annotated screenshots, workflow diagrams, and reference tables. Supports quick (key screens), standard (all pages)…

jezweb/claude-skills · 115 tokens

thumbnail-of-pptx

Capture a thumbnail image of a slide from a OneDrive/Office presentation link. Opens the PowerPoint web viewer in a headless browser and screenshots the slide canvas, producing a clean 16:9 image with no viewer chrome. Works even when the PPTX is not downloadable (e.g. personal OneDrive shares), since it screenshots…

pamelafox/presentation-skills · 111 tokens

lov-fill-web-form

Fill web forms by fetching form fields from a URL, deep-searching the user's local knowledge base for relevant info, and generating a markdown document with all answers pre-filled. Use when the user provides a URL to a web form (conference application, speaker submission, event registration, profile form) and wants…

lovstudio/skills · 146 tokens