agentleFS
MicrosoftKnown publishermicrosoft/vscode-copilot-chat/.agents/skills/launch/SKILL.md

launch

Skill10k starsChanged 7 months agoMITArchived repositoryView on GitHub

Launch and automate VS Code Insiders with the Copilot Chat extension using agent-browser 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'.

  • Installs packages

We split this skill into the rules it gives an agent

12 rules. 0 are common, 4 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 59 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    The extension must be compiled first: Use npm run compile for a one-shot build, or npm run watch for iterative development.

    line 16
  2. Distinctive:

    Re-snapshot: after navigation or state changes

    line 26
  3. Very specific:

    After connect, all subsequent commands target the connected app without needing --cdp.

    line 77
  4. Very specific:

    If focus is already on a Monaco editor, keyboard type and keyboard inserttext both work:

    line 200
  5. Distinctive:

    Always works when focus is on a Monaco editor.

    line 214
  6. Very specific:

    If type @ref doesn't work (e.g., ref is stale), you can focus the editor via JavaScript:

    line 252
  7. Very specific:

    After JS mouse events, document.activeElement becomes a DIV with class native-edit-context — this is VS Code's native text editing surface.

    line 272
  8. Very specific:

    Make sure VS Code Insiders was launched with --remote-debugging-port=9223

    line 301
  9. Distinctive:

    If VS Code was already running, quit and relaunch with the flag

    line 302
  10. Distinctive:

    Check that the port isn't in use by another process:

    line 303
  11. Very specific:

    Use agent-browser snapshot -i -C to include cursor-interactive elements (divs with onclick handlers)

    line 310
  12. Very specific:

    If agent-browser screenshot returns "Permission denied", your terminal needs Screen Recording permission.

    line 319

“Common” is measured: kept by at least 6 in 10 of the 59 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

VS Code Extension Automation

Automate VS Code Insiders with the Copilot Chat extension using agent-browser. VS Code is built on Electron/Chromium and exposes a Chrome DevTools Protocol (CDP) port that agent-browser can connect to, enabling the same snapshot-interact workflow used for web pages.

Prerequisites

  • agent-browser must be installed. It's available in the project's devDependencies — run npm install. Use npx agent-browser if it's not on your PATH, or install globally with npm install -g agent-browser.
  • 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.
  • The extension must be compiled first. Use npm run compile for a one-shot build, or npm run watch for iterative development.
  • 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.

Core Workflow

  1. Build the extension
  2. Launch VS Code Insiders with the extension and remote debugging enabled
  3. Connect agent-browser to the CDP port
  4. Snapshot to discover interactive elements
  5. Interact using element refs
  6. Re-snapshot after navigation or state changes

📸 Take screenshots for a paper trail. Use agent-browser screenshot <path> at key moments — after launch, before/after 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.

Save screenshots inside .vscode-ext-debug/screenshots/ (gitignored) using a timestamped subfolder so each run is isolated and nothing gets overwritten:

# Create a timestamped folder for this run's screenshots
SCREENSHOT_DIR=".vscode-ext-debug/screenshots/$(date +%Y-%m-%dT%H-%M-%S)"
mkdir -p "$SCREENSHOT_DIR"

# Windows (PowerShell):
# $screenshotDir = ".vscode-ext-debug\screenshots\$(Get-Date -Format 'yyyy-MM-ddTHH-mm-ss')"
# New-Item -ItemType Directory -Force -Path $screenshotDir

# Save a screenshot (path is a positional argument — use ./ or absolute paths)
# Bare filenames without ./ may be misinterpreted as CSS selectors
agent-browser screenshot "$SCREENSHOT_DIR/after-launch.png"
# Build and launch with the extension
npm run compile
# Use a PERSISTENT user-data-dir so auth state is preserved across sessions.
# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.
code-insiders --extensionDevelopmentPath="$PWD" --remote-debugging-port=9223 --user-data-dir="$PWD/.vscode-ext-debug"
# On Windows (PowerShell):
# code-insiders --extensionDevelopmentPath="$PWD" --remote-debugging-port=9223 --user-data-dir="$PWD\.vscode-ext-debug"

# Wait for VS Code to start, retry until connected
for i in 1 2 3 4 5; do agent-browser connect 9223 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
# If `tab` shows the wrong target, run `agent-browser close` and reconnect
agent-browser tab
agent-browser snapshot -i

Connecting

# Connect to a specific port
agent-browser connect 9223

# Or use --cdp on each command
agent-browser --cdp 9223 snapshot -i

# Auto-discover a running Chromium-based app
agent-browser --auto-connect snapshot -i

After connect, all subsequent commands target the connected app without needing --cdp.

Tab Management

VS Code uses multiple webviews internally. Use tab commands to list and switch between them:

# List all available targets (windows, webviews, etc.)
agent-browser tab

# Switch to a specific tab by index
agent-browser tab 2

# Switch by URL pattern
agent-browser tab --url "*settings*"

Launching VS Code Extensions for Debugging

To debug a VS Code extension via agent-browser, 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.

# Build the extension first (from the repo root)
npm run compile

# Launch VS Code Insiders with the extension and CDP
# IMPORTANT: Use a persistent directory (not /tmp) so auth state is preserved.
# .vscode-ext-debug is relative to the project root — works in worktrees and is gitignored.
code-insiders \
  --extensionDevelopmentPath="$PWD" \
  --remote-debugging-port=9223 \
  --user-data-dir="$PWD/.vscode-ext-debug"

# Wait for VS Code to start, retry until connected
for i in 1 2 3 4 5; do agent-browser connect 9223 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
# If `tab` shows the wrong target, run `agent-browser close` and reconnect
agent-browser tab
agent-browser snapshot -i

Key flags:

  • --extensionDevelopmentPath=<path> — loads your extension from source (must be compiled first). Use $PWD when running from the repo root.
  • --remote-debugging-port=9223 — enables CDP (use 9223 to avoid conflicts with other apps on 9222)
  • --user-data-dir=<path> — 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/.vscode-ext-debug) rather than /tmp/... so authentication, settings, and extension state survive across sessions.

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.

⚠️ Authentication is required. The Copilot Chat extension needs an authenticated GitHub session to function. Using a temp directory (e.g., /tmp/...) 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."

Always use a persistent --user-data-dir like $PWD/.vscode-ext-debug. On first use, launch once and sign in manually. Subsequent launches will reuse the auth session.

Restarting After Code Changes

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.

Restart Workflow

  1. Recompile the extension
  2. Kill the running VS Code instance (the one using your debug user-data-dir)
  3. Relaunch VS Code with the same flags
# 1. Recompile
npm run compile

# 2. Kill the VS Code instance tied to this project's debug profile, then relaunch
# macOS / Linux:
kill $(ps ax -ww -o pid,command | grep "$PWD/.vscode-ext-debug" | grep -v grep | awk '{print $1}' | head -1)

# Windows (PowerShell):
# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "*$PWD\.vscode-ext-debug*" } | ForEach-Object { Stop-Process -Id $_.ProcessId }

# 3. Relaunch
code-insiders \
  --extensionDevelopmentPath="$PWD" \
  --remote-debugging-port=9223 \
  --user-data-dir="$PWD/.vscode-ext-debug"

# 4. Reconnect agent-browser
for i in 1 2 3 4 5; do agent-browser connect 9223 2>/dev/null && break || sleep 3; done
agent-browser snapshot -i

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.

Interacting with Monaco Editor (Chat Input, Code Editors)

VS 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 agent-browser commands to interact with.

What Works

type @ref — The Best Approach

The type command with a snapshot ref handles focus and input in one step:

# Snapshot to find the chat input ref
agent-browser snapshot -i
# Look for: textbox "The editor is not accessible..." [ref=e51]

# Type directly using the ref — handles focus automatically
agent-browser type @e51 "Hello from George!"

# Send the message
agent-browser press Enter

# Wait for the response to complete before re-snapshotting.
# Poll until the "Stop generating" button disappears:
for i in $(seq 1 30); do
  agent-browser snapshot -i 2>/dev/null | grep -q "Stop generating" || break
  sleep 1
done
agent-browser snapshot -i

This is the simplest and most reliable method. It works for both the main editor chat input and the sidebar chat panel.

Tip: If type @ref 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.

keyboard type / keyboard inserttext — After Focus

If focus is already on a Monaco editor, keyboard type and keyboard inserttext both work:

⚠️ Warning: keyboard type can hang indefinitely in some focus states (e.g., after JS mouse events). If it doesn't return within a few seconds, interrupt it and fall back to press for individual keystrokes.

# Focus first (via type @ref, or JS mouse events, or a prior interaction)
agent-browser type @e51 ""
# Then keyboard type works for subsequent input
agent-browser keyboard type "More text here"
agent-browser keyboard inserttext "And this too"

press — Individual Keystrokes

Always 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:

# Type text character by character (works on all builds)
agent-browser press H
agent-browser press e
agent-browser press l
agent-browser press l
agent-browser press o
agent-browser press Space  # Use "Space" for spaces

# Select all
# macOS:
agent-browser press Meta+a
# Linux / Windows:
agent-browser press Control+a

agent-browser press Backspace    # Delete selection
agent-browser press Enter        # Send message / new line

# Send to new chat
# macOS:
agent-browser press Meta+Shift+Enter
# Linux / Windows:
agent-browser press Control+Shift+Enter

What Does NOT Work

MethodResultReason
click @ref"Element blocked by another element"Monaco overlays a transparent div over the textarea
fill @ref "text""Element not found or not visible"The textbox is not a standard fillable input
document.execCommand("insertText") via evalNo effectMonaco intercepts and discards execCommand
Setting textarea.value + dispatching input event via evalNo effectMonaco doesn't read from the textarea's value property

Fallback: Focus via JavaScript Mouse Events

If type @ref doesn't work (e.g., ref is stale), you can focus the editor via JavaScript:

agent-browser eval '
(() => {
  const inputPart = document.querySelector(".interactive-input-part");
  const editor = inputPart.querySelector(".monaco-editor");
  const rect = editor.getBoundingClientRect();
  const x = rect.x + rect.width / 2;
  const y = rect.y + rect.height / 2;
  editor.dispatchEvent(new MouseEvent("mousedown", { bubbles: true, clientX: x, clientY: y }));
  editor.dispatchEvent(new MouseEvent("mouseup", { bubbles: true, clientX: x, clientY: y }));
  editor.dispatchEvent(new MouseEvent("click", { bubbles: true, clientX: x, clientY: y }));
  return "activeElement: " + document.activeElement?.className;
})()'

# After JS focus, keyboard type and press work
agent-browser keyboard type "Text after JS focus"

After JS mouse events, document.activeElement becomes a DIV with class native-edit-context — this is VS Code's native text editing surface.

Verifying Text in Monaco

Monaco renders text in .view-line elements, not the textarea:

agent-browser eval '
(() => {
  const inputPart = document.querySelector(".interactive-input-part");
  return Array.from(inputPart.querySelectorAll(".view-line")).map(vl => vl.textContent).join("|");
})()'

Clearing Monaco Input

# macOS:
agent-browser press Meta+a
# Linux / Windows:
agent-browser press Control+a

agent-browser press Backspace

Troubleshooting

"Connection refused" or "Cannot connect"

  • Make sure VS Code Insiders was launched with --remote-debugging-port=9223
  • If VS Code was already running, quit and relaunch with the flag
  • Check that the port isn't in use by another process:
    • macOS / Linux: lsof -i :9223
    • Windows: netstat -ano | findstr 9223

Elements not appearing in snapshot

  • VS Code uses multiple webviews. Use agent-browser tab to list targets and switch to the right one
  • Use agent-browser snapshot -i -C to include cursor-interactive elements (divs with onclick handlers)

Cannot type in Monaco inputs

  • Standard click and fill don't work on Monaco editors — see the "Interacting with Monaco Editor" section above for the full compatibility matrix
  • type @ref is the best approach; individual press commands work everywhere; keyboard type and keyboard inserttext work after focus is established

Screenshots fail with "Permission denied" (macOS)

If agent-browser 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.

Cleanup

Always kill the debug VS Code instance when you're done. Leaving it running wastes resources and holds the CDP port.

# Disconnect agent-browser
agent-browser close

# Kill the debug VS Code instance
# macOS / Linux:
kill $(ps ax -ww -o pid,command | grep "$PWD/.vscode-ext-debug" | grep -v grep | awk '{print $1}' | head -1)

# Windows (PowerShell):
# Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like "*$PWD\.vscode-ext-debug*" } | ForEach-Object { Stop-Process -Id $_.ProcessId }

Download now (ZIP)

  • Other versions65 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 4

    1. microsoft/vscode★ 194k76% same
    2. OpenCortexIDE/cortexide★ 17541% same
    3. cpkt9762/opencode-vscode-ide★ 1741% same
    4. xAmirHamza77/OmniCode★ 1226% same

    Wrote their own version · 61

    1. coreyhaines31/marketingskills★ 58ksame name
    2. Yeachan-Heo/oh-my-claude-sisyphus★ 40ksame name
    3. Yeachan-Heo/oh-my-claudecode★ 40ksame name
    4. posit-dev/positron★ 4.3ksame name
    5. Nexus-JPF/note-companion★ 874same name
    6. whitecircle/halo★ 825same name
    7. menkesu/awesome-pm-skills★ 441same name
    8. NeuralInverse/neuralinverse★ 245same name
    9. Cesarjoquin/Marketing-Skills★ 190same name
    10. simota/agent-skills★ 96same name

    51 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use add-policy, tool-rename-deprecation and 10 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • OpenCortexIDESkill

      add-policy

      Use when adding, modifying, or reviewing VS Code configuration policies. Covers the full policy lifecycle from registration to export to platform-specific artifacts. Run on ANY change that adds a `policy:` field to a configuration property.

      Also in 4 projects that use this

    • gitpod-ioSkill

      tool-rename-deprecation

      Ensure renamed built-in tool references preserve backward compatibility. Use when renaming a toolReferenceName, tool set referenceName, or any tool identifier. Run on ANY change to tool registration code. Covers legacyToolReferenceFullNames for tools and legacyFullNames for tool sets.

      Also in 4 projects that use this

    • CesarjoquinSkill

      paywalls

      When the user wants to create or optimize in-app paywalls, upgrade screens, upsell modals, or feature gates. Also use when the user mentions "paywall," "upgrade screen," "upgrade modal," "upsell," "feature gate," "convert free to paid," "freemium conversion," "trial expiration screen," "limit reached screen," "plan upgrade prompt," "in-app pricing," "free users won't upgrade," "trial to paid conversion," or "how do I get users to pay." Use this for any in-product moment where you're asking users to upgrade. Distinct from public pricing pages (see cro) — this focuses on in-product upgrade moments where the user has already experienced value. For pricing decisions, see pricing.

      Also in 8 projects that use this

    • CesarjoquinSkill

      competitors

      When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' 'competitive landing pages,' 'how do we compare to X,' 'battle card,' or 'competitor teardown.' Use this for any content that positions your product against competitors. Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. For sales-specific competitor docs, see sales-enablement.

      Also in 9 projects that use this

    • pixelswithblissSkill

      co-marketing

      When the user wants to find co-marketing partners, plan joint campaigns, or brainstorm partnership opportunities. Use when the user says 'co-marketing,' 'partner marketing,' 'joint campaign,' 'who should we partner with,' 'integration marketing,' 'cross-promotion,' 'collaborate with another company,' 'partnership ideas,' or 'co-brand.' For customer referral programs, see referrals. For launch-specific partnerships, see launch.

      Also in 8 projects that use this

    • coreyhaines31Skill

      marketing-loops

      When the user wants to set up a recurring, self-running marketing workflow — a repeatable loop an AI agent runs on a cadence (weekly, daily, on a trigger) rather than a one-off task. Also use when the user mentions 'marketing loop,' 'recurring marketing workflow,' 'automate my marketing,' 'marketing on autopilot,' 'weekly marketing review,' 'ad fatigue check,' 'weekly ads check,' 'content refresh loop,' 'churn watch,' 'ranking drop alert,' 'run my SEO,' 'SEO operator,' 'daily SEO agent,' 'run my outbound,' 'AI SDR,' 'reply triage,' 'always-on marketing,' 'marketing automation workflow,' or 'run this every week.' Use this to pick, adapt, and schedule an ongoing marketing loop that orchestrates the other marketing skills. For one-off marketing ideas, see marketing-ideas. For the experimentation loop specifically, see ab-testing.

      Also in 5 projects that use this

    • +5 more from Cesarjoquin
  • In this repository11 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.