Token导航 LogoToken导航

Agent Skill · 研究检索

vscode-playwright(VS Code Playwright 搜索)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

vscode-playwright 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 69,971。

总安装 214周安装 9GitHub Stars 993下载 75核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:vscode-playwright(VS Code Playwright 搜索)
来源仓库:https://github.com/microsoft/hve-core
仓库路径:skills/vscode-playwright
安装命令:
npx skills add https://github.com/microsoft/hve-core --skill vscode-playwright
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/microsoft/hve-core --skill vscode-playwright

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助 Playwright 测试用例设计与回归验证。适合编写单元测试、端到端测试或分析失败日志。vscode-playwright 属于研究检索类 Skill,可作为该场景下的辅助能力补充。支持生成测试计划、夹具数据与浏览器交互脚本。使用时需区分模拟环境与生产环境,避免误改真实逻辑。

建议确认项目测试框架与运行命令后再实施改动。

来源仓库内路径:skills/vscode-playwright

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/microsoft/hve-core --skill vscode-playwright;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

vscode-playwright 怎么安装?

在终端执行 npx skills add https://github.com/microsoft/hve-core --skill vscode-playwright。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

vscode-playwright 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

vscode-playwright 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

vscode-playwright 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

vscode-playwright 用的人多吗?

公开数据是累计安装 214 次,近一周安装 9 次,下载 75 次,GitHub 993 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

vscode-playwright 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
vscode-playwright

VS Code Playwright 搜索 · 本页

214993接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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"

The serve-web command and mktemp must execute in the same terminal session so the $VSCODE_SERVE_DIR variable resolves. If using a background terminal (isBackground: true), inline the entire block — do not reference variables set in a different terminal.

Verify the server is ready before proceeding: curl -s -o /dev/null -w "%{http_code}" http://localhost:8765/ must return 200.

If the server log contains Ignoring option 'server-data-dir': Value must not be empty, the variable was empty — the server is using the default data directory instead of the ephemeral one. Kill the process and re-launch with the literal path.

Step 3: Navigate and Wait

  1. Navigate to the workspace: mcp_microsoft_pla_browser_navigate to http://localhost:8765/?folder=/path/to/workspace.
  2. Wait for VS Code to load: mcp_microsoft_pla_browser_wait_for with time: 5 to allow the editor UI to fully render.

Step 4: Resize Viewport

Resize the viewport to match the target placement ratio: mcp_microsoft_pla_browser_resize to a resolution whose aspect ratio matches the PPTX placeholder where the screenshot will be inserted.

Calculate dimensions using width_px = 1200 and height_px = int(1200 / (target_width_inches / target_height_inches)). For example, a 5.5" x 4.2" placeholder produces a 1200 x 916 viewport.

Do NOT use 1920x1080 unless the screenshot fills the full 16:9 slide. Resize before cleanup so UI elements render at the target resolution.

Step 5: Clean Up the UI

Prepare the editor for clean screenshots using mcp_microsoft_pla_browser_run_code with the Command Palette pattern:

  1. Dismiss workspace trust dialog if present: take a mcp_microsoft_pla_browser_snapshot, look for a trust dialog, and click "Yes, I trust the authors" via mcp_microsoft_pla_browser_click if visible.
  2. Close all editors and tabs: Command Palette -> View: Close All Editors.
  3. Clear notifications: Command Palette -> Notifications: Clear All Notifications.
  4. Enable Do Not Disturb: Command Palette -> Notifications: Toggle Do Not Disturb Mode.
  5. Close Primary Side Bar: Command Palette -> View: Close Primary Side Bar.
  6. Close bottom panel: Take a mcp_microsoft_pla_browser_snapshot first. If the panel (Terminal, Problems, Output) is visible, run Command Palette -> View: Close Panel. Do not run this command blindly — it toggles visibility and opens a hidden panel.
  7. Close Secondary Side Bar: Take a mcp_microsoft_pla_browser_snapshot first. If the secondary side bar (Chat) is visible, run Command Palette -> View: Close Secondary Side Bar.
  8. Zoom in for readability: use mcp_microsoft_pla_browser_run_code with await page.evaluate(() => {document.body.style.zoom = '1.5';}) for full-UI zoom. Use 1.5x minimum; for placeholders under 5" wide, use 1.75x. Default font sizes become illegible (~7pt) when screenshots are shrunk to fit slide placeholders.

Step 6: Open Files and Capture

Open files via mcp_microsoft_pla_browser_run_code using the Command Palette pattern: Go to File command opens Quick Open, then type the filename and press Enter:

async (page) => {
  await page.keyboard.press('F1');
  await page.waitForTimeout(400);
  await page.keyboard.type('Go to File');
  await page.waitForTimeout(300);
  await page.keyboard.press('Enter');
  await page.waitForTimeout(500);
  await page.keyboard.type('doc-ops-update.prompt.md');
  await page.waitForTimeout(500);
  await page.keyboard.press('Enter');
  await page.waitForTimeout(1000);
  return 'File opened';
}

Set up the view: selectively open only the panels needed for this screenshot (split views, Copilot Chat, Explorer) via click-based navigation using mcp_microsoft_pla_browser_snapshot to find refs followed by mcp_microsoft_pla_browser_click. Keep the view focused on the subject.

Take the screenshot: mcp_microsoft_pla_browser_take_screenshot with type: "png" and a descriptive filename.

Validate the screenshot fits the target placement. Compare the captured image's aspect ratio against the target placeholder ratio. If they diverge by more than 5%, retake with corrected viewport dimensions. If text appears too small for the placeholder width (below ~10pt effective size), retake with higher zoom. Iterate viewport and zoom adjustments until the screenshot matches the placement dimensions without distortion.

Repeat for additional screenshots. Close the current file's tab before opening the next (Command Palette -> View: Close All Editors).

Step 7: Copilot Chat Screenshots

For Copilot Chat screenshots: pre-seed "workbench.activityBar.location": "default" in settings.json (or omit it) so the Activity Bar is visible. Open the Chat panel via Activity Bar click using mcp_microsoft_pla_browser_snapshot -> mcp_microsoft_pla_browser_click, type the prompt via mcp_microsoft_pla_browser_run_code with page.keyboard.type(), then wait for the response via mcp_microsoft_pla_browser_wait_for before capturing.

Step 8: Cleanup

Stop the VS Code web server and clean up the ephemeral environment:

pkill -f "serve-web.*8765" 2>/dev/null || true
rm -rf "$VSCODE_SERVE_DIR"

Also close the Playwright browser: mcp_microsoft_pla_browser_close.

Playwright MCP Command Palette Pattern

Individual MCP tool calls execute asynchronously, so the Command Palette closes between separate press_key, type, and press_key calls. All Command Palette operations must use mcp_microsoft_pla_browser_run_code to chain actions atomically in a single Playwright execution:

async (page) => {
  const runCommand = async (command) => {
    await page.keyboard.press('F1');
    await page.waitForTimeout(400);
    await page.keyboard.type(command);
    await page.waitForTimeout(300);
    await page.keyboard.press('Enter');
    await page.waitForTimeout(500);
  };

  await runCommand('View: Close All Editors');
  await runCommand('View: Close Primary Side Bar');
  // Chain additional commands as needed
  return 'Commands executed';
}

Never use separate mcp_microsoft_pla_browser_press_key -> mcp_microsoft_pla_browser_type -> mcp_microsoft_pla_browser_press_key calls for Command Palette operations — the palette loses focus between calls.

Troubleshooting

IssueCauseSolution
Ignoring option 'server-data-dir': Value must not be emptyShell variable resolved empty in background terminalInline the full command with the literal temp directory path or run mktemp and serve-web in the same session
Color Theme navigates to Marketplace themesFresh server-data-dir has no built-in theme setPre-seed "workbench.colorTheme": "Default Dark Modern" in ephemeral settings.json
Panel toggle opens hidden panelView: Toggle Panel Visibility is a toggleUse View: Close Panel only after confirming the panel is visible via snapshot
?file= parameter does not auto-open filesVS Code web only supports ?folder=Open files through Command Palette Go to File command after navigating
Text too small in screenshotsDefault ~14px font becomes ~7pt when shrunkZoom in with page.evaluate(() => {document.body.style.zoom = '1.5';}) or higher
Screenshot aspect ratio distortionViewport ratio does not match placeholder ratioCalculate viewport from placeholder: width_px = 1200, height_px = int(1200 / (target_w / target_h))
UI clutter at slide-embedded sizesExplorer, minimap, tabs, toasts visibleClose all unnecessary UI elements before each capture
workbench.action.zoomIn does not workElectron-only commandUse editor.action.fontZoomIn or CSS zoom via page.evaluate()
Browser state restorationIndexedDB/localStorage restore previous filesPre-seed settings to disable restore; use incognito mode when available
Meta+P triggers browser actionKeyboard shortcuts intercepted by browserUse page.keyboard.press('F1') to open Command Palette
Screenshot saved to wrong directorytake_screenshot saves relative to Playwright working directoryCopy screenshots to the target directory after capture
Copilot Chat responses non-deterministicStreaming token-by-token outputUse mcp_microsoft_pla_browser_wait_for with expected text or time delay
Brought to you by microsoft/hve-core

*🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.*

平台分布

Codex

34.8%
按下载量换算26

Claude

30.24%
按下载量换算23

Cursor

19.27%
按下载量换算14

Gemini CLI

8.98%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills