[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699C5XZ5A64QSB4PEXS1EA6":3,"skill-same:01M699C5XZ5A64QSB4PEXS1EA6":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":53,"linkOnly":54,"markdownContent":55,"markdownBody":56,"frontMatter":57,"refName":60,"commitSha":61,"skillDirectory":62,"forksCount":63,"repositoryHtmlUrl":64,"repositoryHomepageUrl":65,"ownerHtmlUrl":66,"ownerBlogUrl":67,"ownerDescription":68,"updatedAt":69,"install":70,"resources":82},"01M699C5XZ5A64QSB4PEXS1EA6","launch","VS Code 界面自动化操作","Launch and automate VS Code Insiders with the Copilot Chat extension using @playwright\u002Fcli via Chrome DevTools Protocol. Use when you need to interact with the VS Code UI, automate the chat panel, test the extension UI, or take screenshots. Triggers include 'automate VS Code', 'interact with chat', 'test the UI', 'take a screenshot', 'launch with debugging'.","使用 @playwright\u002Fcli 通过 Chrome DevTools Protocol 启动并自动化带有 Copilot Chat 扩展的 VS Code Insiders。当需要与 VS Code 界面交互、自动化聊天面板、测试扩展界面或截图时使用。触发条件包括『自动化 VS Code』『与聊天交互』『测试界面』『截图』『带调试启动』。","microsoft\u002Fvscode","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M6998NK2WED5M549DX06VBCH",195369,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fextensions\u002Fcopilot\u002F.agents\u002Fskills\u002Flaunch\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH2SFTXSGVVGVBMDTMWK","桌面自动化与界面操作","SCENARIO","使用场景",[5,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"screenshot","you","when","take a screenshot","with","chat","use","npx","triggers","panel","automate","ui","take","code","Bash","debugging","devtools","copilot","chrome devtools","screenshots","chrome","cli","2026-11-10 10:12:30",false,"---\nname: launch\ndescription: \"Launch and automate VS Code Insiders with the Copilot Chat extension using @playwright\u002Fcli via Chrome DevTools Protocol. Use when you need to interact with the VS Code UI, automate the chat panel, test the extension UI, or take screenshots. Triggers include 'automate VS Code', 'interact with chat', 'test the UI', 'take a screenshot', 'launch with debugging'.\"\nmetadata:\n  allowed-tools: Bash(npx @playwright\u002Fcli:*)\n---\n\n# VS Code Extension Automation\n\nAutomate VS Code Insiders with the Copilot Chat extension using `@playwright\u002Fcli`. VS Code is built on Electron\u002FChromium and exposes a Chrome DevTools Protocol (CDP) port that `@playwright\u002Fcli` can attach to, enabling the same snapshot-interact workflow used for web pages.\n\n## Prerequisites\n\n- **`@playwright\u002Fcli` is available via devDependencies.** Run `pnpm install` at the repo root, then use `npx @playwright\u002Fcli` to invoke commands. Alternatively, install globally with `npm install -g @playwright\u002Fcli`.\n- **`code-insiders` is required.** This extension uses 58 proposed VS Code APIs and targets `vscode ^1.110.0-20260223`. VS Code Stable will **not** activate it — you must use VS Code Insiders.\n- **The extension must be compiled first.** Use `pnpm run compile` for a one-shot build, or `pnpm run watch` for iterative development.\n- **CSS selectors are internal implementation details.** Selectors like `.interactive-input-part`, `.monaco-editor`, and `.view-line` are VS Code internals that may change across versions. If automation breaks after a VS Code update, re-snapshot and check for selector changes.\n\n## Core Workflow\n\n1. **Build** the extension\n2. **Launch** VS Code Insiders with the extension and remote debugging enabled\n3. **Attach** npx @playwright\u002Fcli to the CDP port\n4. **Snapshot** to discover interactive elements\n5. **Interact** using element refs\n6. **Re-snapshot** after navigation or state changes\n\n> **? Take screenshots for a paper trail.** Use `npx @playwright\u002Fcli screenshot --filename=\u003Cpath>` at key moments — after launch, before\u002Fafter interactions, and when something goes wrong. Screenshots provide visual proof of what the UI looked like and are invaluable for debugging failures or documenting what was accomplished.\n>\n> Save screenshots inside `.vscode-ext-debug\u002Fscreenshots\u002F` (gitignored) using a timestamped subfolder so each run is isolated and nothing gets overwritten:\n>\n> ```bash\n> # Create a timestamped folder for this run's screenshots\n> SCREENSHOT_DIR=\".vscode-ext-debug\u002Fscreenshots\u002F$(date +%Y-%m-%dT%H-%M-%S)\"\n> mkdir -p \"$SCREENSHOT_DIR\"\n>\n> # Windows (PowerShell):\n> # $screenshotDir = \".vscode-ext-debug\\screenshots\\$(Get-Date -Format 'yyyy-MM-ddTHH-mm-ss')\"\n> # New-Item -ItemType Directory -Force -Path $screenshotDir\n>\n> # Save a screenshot\n> npx @playwright\u002Fcli screenshot --filename=\"$SCREENSHOT_DIR\u002Fafter-launch.png\"\n> ```\n\n```bash\n# Build and launch with the extension\npnpm run compile\n# Use a PERSISTENT user-data-dir so auth state is preserved across sessions.\n# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.\ncode-insiders --extensionDevelopmentPath=\"$PWD\" --remote-debugging-port=9223 --user-data-dir=\"$PWD\u002F.vscode-ext-debug\"\n# On Windows (PowerShell):\n# code-insiders --extensionDevelopmentPath=\"$PWD\" --remote-debugging-port=9223 --user-data-dir=\"$PWD\\.vscode-ext-debug\"\n\n# Wait for VS Code to start, retry until attached\nfor i in 1 2 3 4 5; do npx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223 2>\u002Fdev\u002Fnull && break || sleep 3; done\n\n# Verify you're connected to the right target (not about:blank)\n# If `tab-list` shows the wrong target, run `npx @playwright\u002Fcli close` and reattach\nnpx @playwright\u002Fcli tab-list\nnpx @playwright\u002Fcli snapshot\n```\n\n## Attaching\n\n```bash\n# Attach to a specific CDP port\nnpx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223\n```\n\nAfter `attach`, all subsequent commands target the connected app without needing to reattach.\n\n## Tab Management\n\nVS Code uses multiple webviews internally. Use tab commands to list and switch between them:\n\n```bash\n# List all available targets (windows, webviews, etc.)\nnpx @playwright\u002Fcli tab-list\n\n# Switch to a specific tab by index\nnpx @playwright\u002Fcli tab-select 2\n```\n\n## Launching VS Code Extensions for Debugging\n\nTo debug a VS Code extension via npx @playwright\u002Fcli, launch VS Code Insiders with `--extensionDevelopmentPath` pointing to your extension source and `--remote-debugging-port` for CDP. Use `--user-data-dir` to avoid conflicting with an already-running VS Code instance.\n\n```bash\n# Build the extension first (from the repo root)\npnpm run compile\n\n# Launch VS Code Insiders with the extension and CDP\n# IMPORTANT: Use a persistent directory (not \u002Ftmp) so auth state is preserved.\n# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.\ncode-insiders \\\n  --extensionDevelopmentPath=\"$PWD\" \\\n  --remote-debugging-port=9223 \\\n  --user-data-dir=\"$PWD\u002F.vscode-ext-debug\"\n\n# Wait for VS Code to start, retry until attached\nfor i in 1 2 3 4 5; do npx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223 2>\u002Fdev\u002Fnull && break || sleep 3; done\n\n# Verify you're connected to the right target (not about:blank)\n# If `tab-list` shows the wrong target, run `npx @playwright\u002Fcli close` and reattach\nnpx @playwright\u002Fcli tab-list\nnpx @playwright\u002Fcli snapshot\n```\n\n**Key flags:**\n- `--extensionDevelopmentPath=\u003Cpath>` — loads your extension from source (must be compiled first). Use `$PWD` when running from the repo root.\n- `--remote-debugging-port=9223` — enables CDP (use 9223 to avoid conflicts with other apps on 9222)\n- `--user-data-dir=\u003Cpath>` — uses a separate profile so it starts a new process instead of sending to an existing VS Code instance. **Always use a persistent path** (e.g., `$PWD\u002F.vscode-ext-debug`) rather than `\u002Ftmp\u002F...` so authentication, settings, and extension state survive across sessions.\n\n**Without `--user-data-dir`**, VS Code detects the running instance, forwards the args to it, and exits immediately — you'll see \"Sent env to running instance. Terminating...\" and CDP never starts.\n\n> **⚠️ Authentication is required.** The Copilot Chat extension needs an authenticated GitHub session to function. Using a temp directory (e.g., `\u002Ftmp\u002F...`) creates a fresh profile with no auth — the agent will hit a \"Sign in to use Copilot\" wall and model resolution will fail with \"Language model unavailable.\"\n>\n> **Always use a persistent `--user-data-dir`** like `$PWD\u002F.vscode-ext-debug`. On first use, launch once and sign in manually. Subsequent launches will reuse the auth session.\n\n## Restarting After Code Changes\n\n**After making changes to the extension source code, you must restart VS Code to pick up the new build.** The extension host loads the compiled bundle at startup — changes are not hot-reloaded.\n\n### Restart Workflow\n\n1. **Recompile** the extension\n2. **Kill** the running VS Code instance (the one using your debug user-data-dir)\n3. **Relaunch** VS Code with the same flags\n\n```bash\n# 1. Recompile\npnpm run compile\n\n# 2. Kill the VS Code instance tied to this project's debug profile, then relaunch\n# macOS \u002F Linux:\nkill $(ps ax -ww -o pid,command | grep \"$PWD\u002F.vscode-ext-debug\" | grep -v grep | awk '{print $1}' | head -1)\n\n# Windows (PowerShell):\n# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like \"*$PWD\\.vscode-ext-debug*\" } | ForEach-Object { Stop-Process -Id $_.ProcessId }\n\n# 3. Relaunch\ncode-insiders \\\n  --extensionDevelopmentPath=\"$PWD\" \\\n  --remote-debugging-port=9223 \\\n  --user-data-dir=\"$PWD\u002F.vscode-ext-debug\"\n\n# 4. Reattach npx @playwright\u002Fcli\nfor i in 1 2 3 4 5; do npx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223 2>\u002Fdev\u002Fnull && break || sleep 3; done\nnpx @playwright\u002Fcli snapshot\n```\n\n> **Tip:** If you're iterating frequently, run `pnpm run watch` in a separate terminal so compilation happens automatically. You still need to kill and relaunch VS Code to load the new bundle.\n\n## Interacting with Monaco Editor (Chat Input, Code Editors)\n\nVS Code uses Monaco Editor for all text inputs including the Copilot Chat input. Monaco editors appear as textboxes in the accessibility snapshot but require specific npx @playwright\u002Fcli commands to interact with.\n\n### What Works\n\n#### `fill \u003Cref>` — The Best Approach\n\nThe `fill` command with a snapshot ref handles focus and input in one step:\n\n```bash\n# Snapshot to find the chat input ref\nnpx @playwright\u002Fcli snapshot\n# Look for: textbox \"The editor is not accessible...\" [ref=e51]\n\n# Fill directly using the ref — handles focus automatically\nnpx @playwright\u002Fcli fill e51 \"Hello from George!\"\n\n# Send the message\nnpx @playwright\u002Fcli press Enter\n\n# Wait for the response to complete before re-snapshotting.\n# Poll until the \"Stop generating\" button disappears:\nfor i in $(seq 1 30); do\n  npx @playwright\u002Fcli snapshot 2>\u002Fdev\u002Fnull | grep -q \"Stop generating\" || break\n  sleep 1\ndone\nnpx @playwright\u002Fcli snapshot\n```\n\nThis is the simplest and most reliable method. It works for both the main editor chat input and the sidebar chat panel.\n\n> **Tip:** If `fill` silently drops text (the editor stays empty), the ref may be stale or the editor not yet ready. Re-snapshot to get a fresh ref and try again. You can verify text was entered using the snippet in \"Verifying Text in Monaco\" below.\n\n#### `type` — After Focus\n\nIf focus is already on a Monaco editor, `type` works:\n\n```bash\n# Focus first (via fill with empty string, or JS mouse events)\nnpx @playwright\u002Fcli fill e51 \"\"\n# Then type works for subsequent input\nnpx @playwright\u002Fcli type \"More text here\"\n```\n\n#### `press` — Individual Keystrokes\n\nAlways works when focus is on a Monaco editor. Useful for special keys, keyboard shortcuts, and as a universal fallback for typing text character by character:\n\n```bash\n# Type text character by character (works on all builds)\nnpx @playwright\u002Fcli press H\nnpx @playwright\u002Fcli press e\nnpx @playwright\u002Fcli press l\nnpx @playwright\u002Fcli press l\nnpx @playwright\u002Fcli press o\nnpx @playwright\u002Fcli press Space  # Use \"Space\" for spaces\n\n# Select all\n# macOS:\nnpx @playwright\u002Fcli press Meta+a\n# Linux \u002F Windows:\nnpx @playwright\u002Fcli press Control+a\n\nnpx @playwright\u002Fcli press Backspace    # Delete selection\nnpx @playwright\u002Fcli press Enter        # Send message \u002F new line\n\n# Send to new chat\n# macOS:\nnpx @playwright\u002Fcli press Meta+Shift+Enter\n# Linux \u002F Windows:\nnpx @playwright\u002Fcli press Control+Shift+Enter\n```\n\n### What Does NOT Work\n\n| Method | Result | Reason |\n|--------|--------|--------|\n| `click \u003Cref>` on editor | \"Element blocked by another element\" | Monaco overlays a transparent div over the textarea |\n| Setting `textarea.value` + dispatching `input` event via `eval` | No effect | Monaco doesn't read from the textarea's value property |\n\n### Fallback: Focus via JavaScript Mouse Events\n\nIf `fill` doesn't work (e.g., ref is stale), you can focus the editor via JavaScript:\n\n```bash\nnpx @playwright\u002Fcli eval '\n(() => {\n  const inputPart = document.querySelector(\".interactive-input-part\");\n  const editor = inputPart.querySelector(\".monaco-editor\");\n  const rect = editor.getBoundingClientRect();\n  const x = rect.x + rect.width \u002F 2;\n  const y = rect.y + rect.height \u002F 2;\n  editor.dispatchEvent(new MouseEvent(\"mousedown\", { bubbles: true, clientX: x, clientY: y }));\n  editor.dispatchEvent(new MouseEvent(\"mouseup\", { bubbles: true, clientX: x, clientY: y }));\n  editor.dispatchEvent(new MouseEvent(\"click\", { bubbles: true, clientX: x, clientY: y }));\n  return \"activeElement: \" + document.activeElement?.className;\n})()'\n\n# After JS focus, type and press work\nnpx @playwright\u002Fcli type \"Text after JS focus\"\n```\n\nAfter JS mouse events, `document.activeElement` becomes a `DIV` with class `native-edit-context` — this is VS Code's native text editing surface.\n\n### Verifying Text in Monaco\n\nMonaco renders text in `.view-line` elements, not the textarea:\n\n```bash\nnpx @playwright\u002Fcli eval '\n(() => {\n  const inputPart = document.querySelector(\".interactive-input-part\");\n  return Array.from(inputPart.querySelectorAll(\".view-line\")).map(vl => vl.textContent).join(\"|\");\n})()'\n```\n\n### Clearing Monaco Input\n\n```bash\n# macOS:\nnpx @playwright\u002Fcli press Meta+a\n# Linux \u002F Windows:\nnpx @playwright\u002Fcli press Control+a\n\nnpx @playwright\u002Fcli press Backspace\n```\n\n## Troubleshooting\n\n### \"Connection refused\" or \"Cannot connect\"\n\n- Make sure VS Code Insiders was launched with `--remote-debugging-port=9223`\n- If VS Code was already running, quit and relaunch with the flag\n- Check that the port isn't in use by another process:\n  - macOS \u002F Linux: `lsof -i :9223`\n  - Windows: `netstat -ano | findstr 9223`\n\n### Elements not appearing in snapshot\n\n- VS Code uses multiple webviews. Use `npx @playwright\u002Fcli tab-list` to list targets and switch to the right one with `npx @playwright\u002Fcli tab-select \u003Cindex>`\n\n### Cannot type in Monaco inputs\n\n- Standard `click` doesn't work on Monaco editors — see the \"Interacting with Monaco Editor\" section above for the full compatibility matrix\n- `fill \u003Cref>` is the best approach; individual `press` commands work everywhere; `type` works after focus is established\n\n### Screenshots fail with \"Permission denied\" (macOS)\n\nIf `npx @playwright\u002Fcli screenshot` returns \"Permission denied\", your terminal needs Screen Recording permission. Grant it in **System Settings → Privacy & Security → Screen Recording**. As a fallback, use the `eval` verification snippet to confirm text was entered — this doesn't require screen permissions.\n\n## Cleanup\n\n**Always kill the debug VS Code instance when you're done.** Leaving it running wastes resources and holds the CDP port.\n\n```bash\n# Disconnect npx @playwright\u002Fcli\nnpx @playwright\u002Fcli close\n\n# Kill the debug VS Code instance\n# macOS \u002F Linux:\nkill $(ps ax -ww -o pid,command | grep \"$PWD\u002F.vscode-ext-debug\" | grep -v grep | awk '{print $1}' | head -1)\n\n# Windows (PowerShell):\n# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like \"*$PWD\\.vscode-ext-debug*\" } | ForEach-Object { Stop-Process -Id $_.ProcessId }\n```\n","# VS Code Extension Automation\n\nAutomate VS Code Insiders with the Copilot Chat extension using `@playwright\u002Fcli`. VS Code is built on Electron\u002FChromium and exposes a Chrome DevTools Protocol (CDP) port that `@playwright\u002Fcli` can attach to, enabling the same snapshot-interact workflow used for web pages.\n\n## Prerequisites\n\n- **`@playwright\u002Fcli` is available via devDependencies.** Run `pnpm install` at the repo root, then use `npx @playwright\u002Fcli` to invoke commands. Alternatively, install globally with `npm install -g @playwright\u002Fcli`.\n- **`code-insiders` is required.** This extension uses 58 proposed VS Code APIs and targets `vscode ^1.110.0-20260223`. VS Code Stable will **not** activate it — you must use VS Code Insiders.\n- **The extension must be compiled first.** Use `pnpm run compile` for a one-shot build, or `pnpm run watch` for iterative development.\n- **CSS selectors are internal implementation details.** Selectors like `.interactive-input-part`, `.monaco-editor`, and `.view-line` are VS Code internals that may change across versions. If automation breaks after a VS Code update, re-snapshot and check for selector changes.\n\n## Core Workflow\n\n1. **Build** the extension\n2. **Launch** VS Code Insiders with the extension and remote debugging enabled\n3. **Attach** npx @playwright\u002Fcli to the CDP port\n4. **Snapshot** to discover interactive elements\n5. **Interact** using element refs\n6. **Re-snapshot** after navigation or state changes\n\n> **? Take screenshots for a paper trail.** Use `npx @playwright\u002Fcli screenshot --filename=\u003Cpath>` at key moments — after launch, before\u002Fafter interactions, and when something goes wrong. Screenshots provide visual proof of what the UI looked like and are invaluable for debugging failures or documenting what was accomplished.\n>\n> Save screenshots inside `.vscode-ext-debug\u002Fscreenshots\u002F` (gitignored) using a timestamped subfolder so each run is isolated and nothing gets overwritten:\n>\n> ```bash\n> # Create a timestamped folder for this run's screenshots\n> SCREENSHOT_DIR=\".vscode-ext-debug\u002Fscreenshots\u002F$(date +%Y-%m-%dT%H-%M-%S)\"\n> mkdir -p \"$SCREENSHOT_DIR\"\n>\n> # Windows (PowerShell):\n> # $screenshotDir = \".vscode-ext-debug\\screenshots\\$(Get-Date -Format 'yyyy-MM-ddTHH-mm-ss')\"\n> # New-Item -ItemType Directory -Force -Path $screenshotDir\n>\n> # Save a screenshot\n> npx @playwright\u002Fcli screenshot --filename=\"$SCREENSHOT_DIR\u002Fafter-launch.png\"\n> ```\n\n```bash\n# Build and launch with the extension\npnpm run compile\n# Use a PERSISTENT user-data-dir so auth state is preserved across sessions.\n# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.\ncode-insiders --extensionDevelopmentPath=\"$PWD\" --remote-debugging-port=9223 --user-data-dir=\"$PWD\u002F.vscode-ext-debug\"\n# On Windows (PowerShell):\n# code-insiders --extensionDevelopmentPath=\"$PWD\" --remote-debugging-port=9223 --user-data-dir=\"$PWD\\.vscode-ext-debug\"\n\n# Wait for VS Code to start, retry until attached\nfor i in 1 2 3 4 5; do npx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223 2>\u002Fdev\u002Fnull && break || sleep 3; done\n\n# Verify you're connected to the right target (not about:blank)\n# If `tab-list` shows the wrong target, run `npx @playwright\u002Fcli close` and reattach\nnpx @playwright\u002Fcli tab-list\nnpx @playwright\u002Fcli snapshot\n```\n\n## Attaching\n\n```bash\n# Attach to a specific CDP port\nnpx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223\n```\n\nAfter `attach`, all subsequent commands target the connected app without needing to reattach.\n\n## Tab Management\n\nVS Code uses multiple webviews internally. Use tab commands to list and switch between them:\n\n```bash\n# List all available targets (windows, webviews, etc.)\nnpx @playwright\u002Fcli tab-list\n\n# Switch to a specific tab by index\nnpx @playwright\u002Fcli tab-select 2\n```\n\n## Launching VS Code Extensions for Debugging\n\nTo debug a VS Code extension via npx @playwright\u002Fcli, launch VS Code Insiders with `--extensionDevelopmentPath` pointing to your extension source and `--remote-debugging-port` for CDP. Use `--user-data-dir` to avoid conflicting with an already-running VS Code instance.\n\n```bash\n# Build the extension first (from the repo root)\npnpm run compile\n\n# Launch VS Code Insiders with the extension and CDP\n# IMPORTANT: Use a persistent directory (not \u002Ftmp) so auth state is preserved.\n# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.\ncode-insiders \\\n  --extensionDevelopmentPath=\"$PWD\" \\\n  --remote-debugging-port=9223 \\\n  --user-data-dir=\"$PWD\u002F.vscode-ext-debug\"\n\n# Wait for VS Code to start, retry until attached\nfor i in 1 2 3 4 5; do npx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223 2>\u002Fdev\u002Fnull && break || sleep 3; done\n\n# Verify you're connected to the right target (not about:blank)\n# If `tab-list` shows the wrong target, run `npx @playwright\u002Fcli close` and reattach\nnpx @playwright\u002Fcli tab-list\nnpx @playwright\u002Fcli snapshot\n```\n\n**Key flags:**\n- `--extensionDevelopmentPath=\u003Cpath>` — loads your extension from source (must be compiled first). Use `$PWD` when running from the repo root.\n- `--remote-debugging-port=9223` — enables CDP (use 9223 to avoid conflicts with other apps on 9222)\n- `--user-data-dir=\u003Cpath>` — uses a separate profile so it starts a new process instead of sending to an existing VS Code instance. **Always use a persistent path** (e.g., `$PWD\u002F.vscode-ext-debug`) rather than `\u002Ftmp\u002F...` so authentication, settings, and extension state survive across sessions.\n\n**Without `--user-data-dir`**, VS Code detects the running instance, forwards the args to it, and exits immediately — you'll see \"Sent env to running instance. Terminating...\" and CDP never starts.\n\n> **⚠️ Authentication is required.** The Copilot Chat extension needs an authenticated GitHub session to function. Using a temp directory (e.g., `\u002Ftmp\u002F...`) creates a fresh profile with no auth — the agent will hit a \"Sign in to use Copilot\" wall and model resolution will fail with \"Language model unavailable.\"\n>\n> **Always use a persistent `--user-data-dir`** like `$PWD\u002F.vscode-ext-debug`. On first use, launch once and sign in manually. Subsequent launches will reuse the auth session.\n\n## Restarting After Code Changes\n\n**After making changes to the extension source code, you must restart VS Code to pick up the new build.** The extension host loads the compiled bundle at startup — changes are not hot-reloaded.\n\n### Restart Workflow\n\n1. **Recompile** the extension\n2. **Kill** the running VS Code instance (the one using your debug user-data-dir)\n3. **Relaunch** VS Code with the same flags\n\n```bash\n# 1. Recompile\npnpm run compile\n\n# 2. Kill the VS Code instance tied to this project's debug profile, then relaunch\n# macOS \u002F Linux:\nkill $(ps ax -ww -o pid,command | grep \"$PWD\u002F.vscode-ext-debug\" | grep -v grep | awk '{print $1}' | head -1)\n\n# Windows (PowerShell):\n# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like \"*$PWD\\.vscode-ext-debug*\" } | ForEach-Object { Stop-Process -Id $_.ProcessId }\n\n# 3. Relaunch\ncode-insiders \\\n  --extensionDevelopmentPath=\"$PWD\" \\\n  --remote-debugging-port=9223 \\\n  --user-data-dir=\"$PWD\u002F.vscode-ext-debug\"\n\n# 4. Reattach npx @playwright\u002Fcli\nfor i in 1 2 3 4 5; do npx @playwright\u002Fcli attach --cdp=http:\u002F\u002F127.0.0.1:9223 2>\u002Fdev\u002Fnull && break || sleep 3; done\nnpx @playwright\u002Fcli snapshot\n```\n\n> **Tip:** If you're iterating frequently, run `pnpm run watch` in a separate terminal so compilation happens automatically. You still need to kill and relaunch VS Code to load the new bundle.\n\n## Interacting with Monaco Editor (Chat Input, Code Editors)\n\nVS Code uses Monaco Editor for all text inputs including the Copilot Chat input. Monaco editors appear as textboxes in the accessibility snapshot but require specific npx @playwright\u002Fcli commands to interact with.\n\n### What Works\n\n#### `fill \u003Cref>` — The Best Approach\n\nThe `fill` command with a snapshot ref handles focus and input in one step:\n\n```bash\n# Snapshot to find the chat input ref\nnpx @playwright\u002Fcli snapshot\n# Look for: textbox \"The editor is not accessible...\" [ref=e51]\n\n# Fill directly using the ref — handles focus automatically\nnpx @playwright\u002Fcli fill e51 \"Hello from George!\"\n\n# Send the message\nnpx @playwright\u002Fcli press Enter\n\n# Wait for the response to complete before re-snapshotting.\n# Poll until the \"Stop generating\" button disappears:\nfor i in $(seq 1 30); do\n  npx @playwright\u002Fcli snapshot 2>\u002Fdev\u002Fnull | grep -q \"Stop generating\" || break\n  sleep 1\ndone\nnpx @playwright\u002Fcli snapshot\n```\n\nThis is the simplest and most reliable method. It works for both the main editor chat input and the sidebar chat panel.\n\n> **Tip:** If `fill` silently drops text (the editor stays empty), the ref may be stale or the editor not yet ready. Re-snapshot to get a fresh ref and try again. You can verify text was entered using the snippet in \"Verifying Text in Monaco\" below.\n\n#### `type` — After Focus\n\nIf focus is already on a Monaco editor, `type` works:\n\n```bash\n# Focus first (via fill with empty string, or JS mouse events)\nnpx @playwright\u002Fcli fill e51 \"\"\n# Then type works for subsequent input\nnpx @playwright\u002Fcli type \"More text here\"\n```\n\n#### `press` — Individual Keystrokes\n\nAlways works when focus is on a Monaco editor. Useful for special keys, keyboard shortcuts, and as a universal fallback for typing text character by character:\n\n```bash\n# Type text character by character (works on all builds)\nnpx @playwright\u002Fcli press H\nnpx @playwright\u002Fcli press e\nnpx @playwright\u002Fcli press l\nnpx @playwright\u002Fcli press l\nnpx @playwright\u002Fcli press o\nnpx @playwright\u002Fcli press Space  # Use \"Space\" for spaces\n\n# Select all\n# macOS:\nnpx @playwright\u002Fcli press Meta+a\n# Linux \u002F Windows:\nnpx @playwright\u002Fcli press Control+a\n\nnpx @playwright\u002Fcli press Backspace    # Delete selection\nnpx @playwright\u002Fcli press Enter        # Send message \u002F new line\n\n# Send to new chat\n# macOS:\nnpx @playwright\u002Fcli press Meta+Shift+Enter\n# Linux \u002F Windows:\nnpx @playwright\u002Fcli press Control+Shift+Enter\n```\n\n### What Does NOT Work\n\n| Method | Result | Reason |\n|--------|--------|--------|\n| `click \u003Cref>` on editor | \"Element blocked by another element\" | Monaco overlays a transparent div over the textarea |\n| Setting `textarea.value` + dispatching `input` event via `eval` | No effect | Monaco doesn't read from the textarea's value property |\n\n### Fallback: Focus via JavaScript Mouse Events\n\nIf `fill` doesn't work (e.g., ref is stale), you can focus the editor via JavaScript:\n\n```bash\nnpx @playwright\u002Fcli eval '\n(() => {\n  const inputPart = document.querySelector(\".interactive-input-part\");\n  const editor = inputPart.querySelector(\".monaco-editor\");\n  const rect = editor.getBoundingClientRect();\n  const x = rect.x + rect.width \u002F 2;\n  const y = rect.y + rect.height \u002F 2;\n  editor.dispatchEvent(new MouseEvent(\"mousedown\", { bubbles: true, clientX: x, clientY: y }));\n  editor.dispatchEvent(new MouseEvent(\"mouseup\", { bubbles: true, clientX: x, clientY: y }));\n  editor.dispatchEvent(new MouseEvent(\"click\", { bubbles: true, clientX: x, clientY: y }));\n  return \"activeElement: \" + document.activeElement?.className;\n})()'\n\n# After JS focus, type and press work\nnpx @playwright\u002Fcli type \"Text after JS focus\"\n```\n\nAfter JS mouse events, `document.activeElement` becomes a `DIV` with class `native-edit-context` — this is VS Code's native text editing surface.\n\n### Verifying Text in Monaco\n\nMonaco renders text in `.view-line` elements, not the textarea:\n\n```bash\nnpx @playwright\u002Fcli eval '\n(() => {\n  const inputPart = document.querySelector(\".interactive-input-part\");\n  return Array.from(inputPart.querySelectorAll(\".view-line\")).map(vl => vl.textContent).join(\"|\");\n})()'\n```\n\n### Clearing Monaco Input\n\n```bash\n# macOS:\nnpx @playwright\u002Fcli press Meta+a\n# Linux \u002F Windows:\nnpx @playwright\u002Fcli press Control+a\n\nnpx @playwright\u002Fcli press Backspace\n```\n\n## Troubleshooting\n\n### \"Connection refused\" or \"Cannot connect\"\n\n- Make sure VS Code Insiders was launched with `--remote-debugging-port=9223`\n- If VS Code was already running, quit and relaunch with the flag\n- Check that the port isn't in use by another process:\n  - macOS \u002F Linux: `lsof -i :9223`\n  - Windows: `netstat -ano | findstr 9223`\n\n### Elements not appearing in snapshot\n\n- VS Code uses multiple webviews. Use `npx @playwright\u002Fcli tab-list` to list targets and switch to the right one with `npx @playwright\u002Fcli tab-select \u003Cindex>`\n\n### Cannot type in Monaco inputs\n\n- Standard `click` doesn't work on Monaco editors — see the \"Interacting with Monaco Editor\" section above for the full compatibility matrix\n- `fill \u003Cref>` is the best approach; individual `press` commands work everywhere; `type` works after focus is established\n\n### Screenshots fail with \"Permission denied\" (macOS)\n\nIf `npx @playwright\u002Fcli screenshot` returns \"Permission denied\", your terminal needs Screen Recording permission. Grant it in **System Settings → Privacy & Security → Screen Recording**. As a fallback, use the `eval` verification snippet to confirm text was entered — this doesn't require screen permissions.\n\n## Cleanup\n\n**Always kill the debug VS Code instance when you're done.** Leaving it running wastes resources and holds the CDP port.\n\n```bash\n# Disconnect npx @playwright\u002Fcli\nnpx @playwright\u002Fcli close\n\n# Kill the debug VS Code instance\n# macOS \u002F Linux:\nkill $(ps ax -ww -o pid,command | grep \"$PWD\u002F.vscode-ext-debug\" | grep -v grep | awk '{print $1}' | head -1)\n\n# Windows (PowerShell):\n# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like \"*$PWD\\.vscode-ext-debug*\" } | ForEach-Object { Stop-Process -Id $_.ProcessId }\n```\n",{"name":5,"metadata":58,"description":7},{"allowed-tools":59},"Bash(npx @playwright\u002Fcli:*)","main","d2b1bf2230b505648e972e81d854743de79b65af","extensions\u002Fcopilot\u002F.agents\u002Fskills\u002Flaunch",43835,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode","https:\u002F\u002Fcode.visualstudio.com","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 03:00:24",{"source":9,"skillName":5,"commands":71,"prompt":80,"zipAvailable":81},[72,74,77],{"tool":38,"command":73},"npx skills add microsoft\u002Fvscode --skill launch",{"tool":75,"command":76},"bunx","bunx skills add microsoft\u002Fvscode --skill launch",{"tool":78,"command":79},"pnpm","pnpm dlx skills add microsoft\u002Fvscode --skill launch","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fextensions\u002Fcopilot\u002F.agents\u002Fskills\u002Flaunch\u002FSKILL.md",true,[],[84,92,99,106,131,159],{"skillNo":85,"name":86,"nameZh":17,"description":87,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":91},"01M7B4XRMJX3WB67XWMX3GVHNN","vscode-ui","Present metrics, comparisons, tables, bar charts, and expandable details as native visuals inside an Agents window response. Use when numbers or a comparison are clearer shown than described. Not for diagrams, mockups, or standalone documents.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fvscode-ui\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":93,"name":94,"nameZh":17,"description":95,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":91},"01M78JJQ6C7V7NR93D5D9N2VCA","html-preview","Create visual reports, implementation plans, code-review explainers, comparisons, diagrams, and static UI mockups as inline HTML previews in the Agents window. Use when the user asks for visual or rendered output, not ordinary HTML code examples.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fhtml-preview\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":17,"description":102,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":91},"01M78JJDRGWKHBBZY6W3GY2CQ9","endgame-status","Report VS Code endgame status, focusing on test-plan progress, tester activity, release-branch PRs, and release-build availability.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fendgame-status\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":17,"description":109,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":53},"01M70H0ANBKZAVEP1NVV4K28M3","sweeper-query","Answer natural-language questions about the VS Code Sweeper's published issue index (index-\u003Cname>.json for microsoft\u002Fvscode and the enrolled family repos) — which issues are agent-ready to implement or plan, what the sweeper proposed for an assignee or area, whether the sweeper knows a report as a duplicate, the highest-value open bugs in a lane — and, for one issue, the review's full record (evidence with file citations, fix brief, proposed comment). Use ONLY when the request explicitly names the sweeper — \"sweeper\", \"vscodesweeper\", \"sweeper-query\", a sweeper verdict, record, brief or index, an agent-ready issue — or asks what \"the sweeper\" found, proposed or knows. Do NOT use for general questions about issues, duplicates, priorities or ranking that do not mention the sweeper. Read-only; discovery only.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fsweeper-query\u002FSKILL.md",[],[113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,33,44,130],"sweeper query","query","sweeper","duplicates","read","Citations","brief","ready","which","review","request","fix","plan","issues","ranking","open","only","natural-language",{"skillNo":132,"name":133,"nameZh":134,"description":135,"descriptionZh":136,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":137,"categories":138,"keywords":143,"publishedAt":53},"01M699DRJS4YJCV600Q72SVVWE","update-skills","仓库技能与指令更新","Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says \"learn!\", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.","当在会话中发现重要经验教训时，创建或更新仓库技能与指令。当用户说\"learn!\"、识别出重要模式或陷阱，或需要为未来会话捕获可复用的领域知识时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-skills\u002FSKILL.md",[139,140],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":141,"categoryName":142,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRN0CV1NMDZ5TEJX1GVM29","插件与技能管理",[144,145,146,147,148,149,150,151,152,153,154,37,33,155,156,157,158],"update","update skills","repository","pattern","user","sessions","instructions","domain","for","session","knowledge","reusable","learn","learnings","create",{"skillNo":160,"name":161,"nameZh":162,"description":163,"descriptionZh":164,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":165,"categories":166,"keywords":171,"publishedAt":53},"01M699DPWHZ72B66P82EW31RNE","update-pr","Pull Request 更新与推送","Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.","更新当前会话的拉取请求（Pull Request）。当用户希望把新变更推送到已有 PR 时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fvscode\u002Fblob\u002Fmain\u002Fsrc\u002Fvs\u002Fsessions\u002Fskills\u002Fupdate-pr\u002FSKILL.md",[167,168],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":169,"categoryName":170,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[172,144,173,174,175,176,177,152,123,153,37,178,33,148],"pr","update pr","pull","push","changes","pull request","Existing"]