agentleFS
xAmirHamza77xAmirHamza77/OmniCode/.agents/skills/launch/SKILL.md

launch

Skill12 starsChanged 6 months agoMITView on GitHub

Launch and automate VS Code (OmniCode) using @playwright/cli via Chrome DevTools Protocol. Use when you need to interact with the VS Code UI, automate the chat panel, test UI features, or take screenshots of VS Code. Triggers include 'automate VS Code', 'interact with chat', 'test the UI', 'take a screenshot', 'launch OmniCode with debugging'.

  • Installs packages

66 other projects use a version of this, 3 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use competitors, paywalls and 8 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.
  • 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 12 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 9 projects that use this

  • riggyzSkill

    attribution

    Attribution rules for issues, pull requests, work items, reviews, and comments created or edited by the agent in GitHub, Linear, Azure DevOps, or similar collaboration systems. Use when creating, commenting on, reviewing, or modifying external tracker content.

    Also in 6 projects that use this

  • coreyhaines31Skill

    conversion-tracking

    Set up, audit, verify, or fix website conversion tracking. Use when the conversion is a form submission, booked meeting, chat, phone call, signup, or purchase; when conversions must reach Google Ads, Meta, GA4, LinkedIn, TikTok, or Microsoft Ads; when the work involves GTM tags and dataLayer events, pixels, the Conversions API (CAPI), Enhanced Conversions, server-side tagging, or gclid and fbclid capture; or when the user reports conversion problems like "conversions stopped", "double counting", "spend but no conversions", "GA4 and Google Ads don't match", or an Unverified or Inactive status. Covers lead gen and ecommerce. Always fire on confirmed success, never the submit click; verify a test conversion arrives; diagnose before changing anything; offer free and native paths alongside paid ones and disclose partner tools. For tracking plans and UTMs, see analytics. For attribution models, see attribution. For campaigns and bidding, see ads. For CRM lead-stage design, see revops.

    Also in 3 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 6 projects that use this

  • timruebenachSkill

    directory-submissions

    When the user wants to submit their product to startup, SaaS, AI, agent, MCP, no-code, or review directories for backlinks, domain rating, and discovery. Also use when the user mentions "directory submissions," "submit to directories," "backlinks from directories," "list my product," "submit to Product Hunt," "BetaList," "TAAFT," "Futurepedia," "G2 listing," "Capterra listing," "AlternativeTo," "SaaSHub," "AI directories," "MCP registry," "agent directory," "dofollow backlinks," "launch directories," or "directory tracker." Use this whenever someone is planning the directory layer of a product launch or an ongoing backlink campaign. For the broader launch moment, see launch-strategy. For programmatic SEO pages that should live behind these backlinks, see programmatic-seo. For AI citation optimization, see ai-seo.

    Also in 9 projects that use this

  • +4 more from Cesarjoquin

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 5 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 60 edited versions we read keep these.

  • 5

    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:

    @playwright/cli is available via devDependencies: Run npm install at the repo root, then use npx @playwright/cli to invoke commands.

    line 14
  2. Distinctive:

    Re-snapshot: after navigation or state changes

    line 24
  3. Very specific:

    After attach, all subsequent commands target the connected app without needing to reattach.

    line 66
  4. Distinctive:

    Wait for the window to fully initialize, then attach:

    line 89
  5. Very specific:

    If you see "Sent env to running instance.

    line 105
  6. Distinctive:

    If the keyboard shortcut doesn't work (e.g., chat panel isn't configured), you can focus the editor via JavaScript:

    line 296
  7. Very specific:

    Use npx @playwright/cli screenshot --full-page to capture the entire window

    line 341
  8. Very specific:

    Use element screenshots: npx @playwright/cli screenshot <ref> --filename=sidebar.png (get the ref from a snapshot)

    line 342
  9. Very specific:

    Make sure OmniCode was launched with --remote-debugging-port=NNNN

    line 351
  10. Very specific:

    If OmniCode was already running, quit and relaunch with the flag

    line 352
  11. Distinctive:

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

    line 353
  12. Very specific:

    Use npx @playwright/cli press for individual keystrokes after focusing the input.

    line 363
  13. Distinctive:

    Verify it's gone:

    line 387

“Common” is measured: kept by at least 6 in 10 of the 60 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 Automation

Automate VS Code (OmniCode) using @playwright/cli. VS Code is built on Electron/Chromium and exposes a Chrome DevTools Protocol (CDP) port that @playwright/cli can attach to, enabling the same snapshot-interact workflow used for web pages.

Prerequisites

  • @playwright/cli is available via devDependencies. Run npm install at the repo root, then use npx @playwright/cli to invoke commands. Alternatively, install globally with npm install -g @playwright/cli.
  • For OmniCode (VS Code dev build): The repo must be built before launching. ./scripts/code.sh runs the build automatically if needed, or set VSCODE_SKIP_PRELAUNCH=1 to skip the compile step if you've already built.
  • CSS selectors are internal implementation details. Selectors like .interactive-input-part, .interactive-input-editor, and .part.auxiliarybar used in eval commands are VS Code internals that may change across versions. If they stop working, use npx @playwright/cli snapshot to re-discover the current DOM structure.

Core Workflow

  1. Launch OmniCode with remote debugging enabled
  2. Attach npx @playwright/cli to the CDP port
  3. Snapshot to discover interactive elements
  4. Interact using element refs
  5. Re-snapshot after navigation or state changes

📸 Take screenshots for a paper trail. Use npx @playwright/cli screenshot --filename=<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 a timestamped subfolder so each run is isolated and nothing gets overwritten:

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

# Save a screenshot
npx @playwright/cli screenshot --filename="$SCREENSHOT_DIR/after-launch.png"
# Launch OmniCode with remote debugging
# NOTE: unset ELECTRON_RUN_AS_NODE if running from a Claude Code terminal
unset ELECTRON_RUN_AS_NODE
./scripts/code.sh --remote-debugging-port=9224

# Wait for OmniCode to start, retry until attached
for i in 1 2 3 4 5; do npx @playwright/cli attach --cdp=http://127.0.0.1:9224 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
# If `tab-list` shows the wrong target, run `npx @playwright/cli close` and reattach
npx @playwright/cli tab-list

# Discover UI elements
npx @playwright/cli snapshot

# Focus the chat input (macOS)
npx @playwright/cli press Control+Meta+i

Attaching

# Attach to a specific CDP port
npx @playwright/cli attach --cdp=http://127.0.0.1:9222

After attach, all subsequent commands target the connected app without needing to reattach.

Tab Management

Electron apps often have multiple windows or webviews. Use tab commands to list and switch between them:

# List all available targets (windows, webviews, etc.)
npx @playwright/cli tab-list

# Switch to a specific tab by index
npx @playwright/cli tab-select 2

Launching OmniCode (VS Code Dev Build)

The VS Code repository includes scripts/code.sh which launches OmniCode from source. It passes all arguments through to the Electron binary, so --remote-debugging-port works directly:

cd <repo-root>  # the root of your VS Code checkout
./scripts/code.sh --remote-debugging-port=9224

Wait for the window to fully initialize, then attach:

# Wait for OmniCode to start, retry until attached
for i in 1 2 3 4 5; do npx @playwright/cli attach --cdp=http://127.0.0.1:9224 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
# If `tab-list` shows the wrong target, run `npx @playwright/cli close` and reattach
npx @playwright/cli tab-list
npx @playwright/cli snapshot

Tips:

  • Unset ELECTRON_RUN_AS_NODE before launching if it's set in your shell (e.g., in Claude Code terminals): unset ELECTRON_RUN_AS_NODE && ./scripts/code.sh --remote-debugging-port=9224
  • Set VSCODE_SKIP_PRELAUNCH=1 to skip the compile step if you've already built: VSCODE_SKIP_PRELAUNCH=1 ./scripts/code.sh --remote-debugging-port=9224 (from the repo root)
  • OmniCode uses the default user data directory. Unlike VS Code Insiders, you don't typically need --user-data-dir since there's usually only one OmniCode instance running.
  • If you see "Sent env to running instance. Terminating..." it means OmniCode is already running and forwarded your args to the existing instance. Quit OmniCode and relaunch with the flag, or use --user-data-dir=/tmp/omnicode-debug to force a new instance.

Launching the Agents App (Agents Window)

The Agents app is a separate workbench mode launched with the --agents flag. It uses a dedicated user data directory to avoid conflicts with the main OmniCode instance.

cd <repo-root>  # the root of your VS Code checkout
./scripts/code.sh --agents --remote-debugging-port=9224

Wait for the window to fully initialize, then attach:

# Wait for Agents app to start, retry until attached
for i in 1 2 3 4 5; do npx @playwright/cli attach --cdp=http://127.0.0.1:9224 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
npx @playwright/cli tab-list
npx @playwright/cli snapshot

Tips:

  • The --agents flag launches the Agents workbench instead of the standard VS Code workbench.
  • Set VSCODE_SKIP_PRELAUNCH=1 to skip the compile step if you've already built.

Launching VS Code Extensions for Debugging

To debug a VS Code extension via npx @playwright/cli, launch VS Code Insiders with --extensionDevelopmentPath and --remote-debugging-port. Use --user-data-dir to avoid conflicting with an already-running instance.

# Build the extension first
cd <extension-repo-root>  # e.g., the root of your extension checkout
npm run compile

# Launch VS Code Insiders with the extension and CDP
code-insiders \
  --extensionDevelopmentPath="<extension-repo-root>" \
  --remote-debugging-port=9223 \
  --user-data-dir=/tmp/vscode-ext-debug

# Wait for VS Code to start, retry until attached
for i in 1 2 3 4 5; do npx @playwright/cli attach --cdp=http://127.0.0.1:9223 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
# If `tab-list` shows the wrong target, run `npx @playwright/cli close` and reattach
npx @playwright/cli tab-list
npx @playwright/cli snapshot

Key flags:

  • --extensionDevelopmentPath=<path> — loads your extension from source (must be compiled first)
  • --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

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.

Restarting After Code Changes

After making changes to OmniCode source code, you must restart to pick up the new build. The workbench loads the compiled JavaScript at startup — changes are not hot-reloaded.

Restart Workflow

  1. Rebuild the changed code
  2. Kill the running OmniCode instance
  3. Relaunch with the same flags
# 1. Ensure your build is up to date.
#    Normally you can skip a manual step here and let ./scripts/code.sh in step 3
#    trigger the build when needed (or run `npm run watch` in another terminal).

# 2. Kill the OmniCode instance listening on the debug port (if running)
pids=$(lsof -t -i :9224)
if [ -n "$pids" ]; then
	kill $pids
fi

# 3. Relaunch
./scripts/code.sh --remote-debugging-port=9224

# 4. Reattach npx @playwright/cli
for i in 1 2 3 4 5; do npx @playwright/cli attach --cdp=http://127.0.0.1:9224 2>/dev/null && break || sleep 3; done
npx @playwright/cli tab-list
npx @playwright/cli snapshot

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 OmniCode to load the new build.

Interacting with Monaco Editor (Chat Input, Code Editors)

VS Code uses Monaco Editor for all text inputs including the Copilot Chat input. Monaco editors require specific npx @playwright/cli techniques — standard click, fill, and type commands may not work depending on the VS Code build.

The Universal Pattern: Focus via Keyboard Shortcut + press

This works on all VS Code builds (OmniCode, Insiders, stable):

# 1. Open and focus the chat input with the keyboard shortcut
# macOS:
npx @playwright/cli press Control+Meta+i
# Linux / Windows:
npx @playwright/cli press Control+Alt+i

# 2. Type using individual press commands
npx @playwright/cli press H
npx @playwright/cli press e
npx @playwright/cli press l
npx @playwright/cli press l
npx @playwright/cli press o
npx @playwright/cli press Space  # Use "Space" for spaces
npx @playwright/cli press w
npx @playwright/cli press o
npx @playwright/cli press r
npx @playwright/cli press l
npx @playwright/cli press d

# Verify text appeared (optional)
npx @playwright/cli eval '
(() => {
  const sidebar = document.querySelector(".part.auxiliarybar");
  const viewLines = sidebar.querySelectorAll(".interactive-input-editor .view-line");
  return Array.from(viewLines).map(vl => vl.textContent).join("|");
})()'

# 3. Send the message (same on all platforms)
npx @playwright/cli press Enter

Chat focus shortcut by platform:

  • macOS: Ctrl+Cmd+I → npx @playwright/cli press Control+Meta+i
  • Linux: Ctrl+Alt+I → npx @playwright/cli press Control+Alt+i
  • Windows: Ctrl+Alt+I → npx @playwright/cli press Control+Alt+i

This shortcut focuses the chat input and sets document.activeElement to a DIV with class native-edit-context — VS Code's native text editing surface that correctly processes key events from npx @playwright/cli press.

fill <ref> — Works on Some Builds

On VS Code Insiders (extension debug mode), fill handles focus and input in one step:

npx @playwright/cli snapshot
# Look for: textbox "The editor is not accessible..." [ref=e62]
npx @playwright/cli fill e62 "Hello from George!"

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 and Clearing" below.

However, fill silently fails on OmniCode — the command completes without error but no text appears. Always verify text appeared after typing, and fall back to the keyboard shortcut + press pattern if it didn't. The press-per-key approach works universally across all builds.

Fastest Method on OmniCode / Agents Window: Clipboard Paste (macOS only)

For prompts longer than ~20 characters, press-per-key is tediously slow. On macOS, paste via the system clipboard:

PROMPT="Edit sample.txt and replace \"hello world\" with \"hello phase 8\". Use the Edit tool."
printf '%s' "$PROMPT" | pbcopy
npx @playwright/cli press Control+Meta+i   # focus chat input
npx @playwright/cli press Meta+v           # paste
npx @playwright/cli press Enter            # submit

This is reliable on both the regular workbench and the Agents window (where the chat input editor doesn't have an .interactive-input-editor wrapper — see Selector Notes below). Linux / Windows equivalents use xclip / clip.exe and Control+v; not validated here.

Selector Notes — Agents Window

The Agents window (./scripts/code.sh --agents) does NOT use the .interactive-input-editor wrapper that the regular workbench uses. Selectors that work in the workbench but FAIL in the Agents window:

// ❌ Returns 0 elements in the Agents window
document.querySelectorAll(".interactive-input-editor .view-line")

// ✅ Use one of these instead
document.querySelectorAll(".view-line")                              // unscoped
document.activeElement?.className === "native-edit-context"          // focus check

The Control+Meta+i focus shortcut still works; only the post-focus DOM selectors differ.

Compatibility Matrix

MethodVS Code InsidersOmniCode
press per key (after focus shortcut)✅ Works✅ Works
pbcopy + Meta+v paste (macOS)✅ Works✅ Works (incl. Agents window)
fill <ref> "text"✅ Works❌ Silent fail
type "text" (after focus)✅ Works❌ Silent fail
click <ref> on editor❌ Blocked by overlay❌ Blocked by overlay

Fallback: Focus via JavaScript Mouse Events

If the keyboard shortcut doesn't work (e.g., chat panel isn't configured), you can focus the editor via JavaScript:

npx @playwright/cli 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;
})()'

# Then use press for each character
npx @playwright/cli press H
npx @playwright/cli press e
# ...

Verifying Text and Clearing

# Verify text in the chat input
npx @playwright/cli eval '
(() => {
  const sidebar = document.querySelector(".part.auxiliarybar");
  const viewLines = sidebar.querySelectorAll(".interactive-input-editor .view-line");
  return Array.from(viewLines).map(vl => vl.textContent).join("|");
})()'

# Clear the input (Select All + Backspace)
# macOS:
npx @playwright/cli press Meta+a
# Linux / Windows:
npx @playwright/cli press Control+a
# Then delete:
npx @playwright/cli press Backspace

Screenshot Tips for VS Code

On ultrawide monitors, the chat sidebar may be in the far-right corner of the CDP screenshot. Options:

  • Use npx @playwright/cli screenshot --full-page to capture the entire window
  • Use element screenshots: npx @playwright/cli screenshot <ref> --filename=sidebar.png (get the ref from a snapshot)
  • Maximize the sidebar first: click the "Maximize Secondary Side Bar" button

macOS: If npx @playwright/cli 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.

Troubleshooting

"Connection refused" or "Cannot connect"

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

Elements not appearing in snapshot

  • VS Code uses multiple webviews. Use npx @playwright/cli tab-list to list targets and switch to the right one with npx @playwright/cli tab-select <index>

Cannot type in Monaco Editor inputs

  • Use npx @playwright/cli press for individual keystrokes after focusing the input. Focus the chat input with the keyboard shortcut (macOS: Ctrl+Cmd+I, Linux/Windows: Ctrl+Alt+I).
  • fill and type work on VS Code Insiders but silently fail on OmniCode — they complete without error but no text appears. The press-per-key approach works universally.
  • See the "Interacting with Monaco Editor" section above for the full compatibility matrix.

Cleanup

Always kill the OmniCode instance when you're done. OmniCode is a full Electron app that consumes significant memory (often 1–4 GB+). Leaving it running wastes resources and holds the CDP port.

# Disconnect npx @playwright/cli
npx @playwright/cli close

# Kill the OmniCode instance listening on the debug port (if running)
# macOS / Linux:
pids=$(lsof -t -i :9224)
if [ -n "$pids" ]; then
	kill $pids
fi

# Windows:
# taskkill /F /PID <PID>
# Or use Task Manager to end "OmniCode"

Verify it's gone:

# Confirm no process is listening on the debug port
lsof -i :9224  # should return nothing

Download now (ZIP)

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.