[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BTH4XKN031S78G301SCQKG":3,"skill-same:01M7BTH4XKN031S78G301SCQKG":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7BTH4XKN031S78G301SCQKG","launch",null,"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'.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-IDE-编辑器内核\u002FYYC3-IDE-编辑器内核-vscode\u002Fextensions\u002Fcopilot\u002F.agents\u002Fskills\u002Flaunch\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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 `npm 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 `npm run compile` for a one-shot build, or `npm 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\nnpm 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)\nnpm 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\nnpm 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 `npm 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 `npm 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 `npm run compile` for a one-shot build, or `npm 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\nnpm 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)\nnpm 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\nnpm 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 `npm 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":24,"description":7},{"allowed-tools":25},"Bash(npx @playwright\u002Fcli:*)","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-IDE-编辑器内核\u002FYYC3-IDE-编辑器内核-vscode\u002Fextensions\u002Fcopilot\u002F.agents\u002Fskills\u002Flaunch",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill launch",{"tool":41,"command":42},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill launch",{"tool":44,"command":45},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill launch","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-IDE-编辑器内核\u002FYYC3-IDE-编辑器内核-vscode\u002Fextensions\u002Fcopilot\u002F.agents\u002Fskills\u002Flaunch\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","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.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]