[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BTDY5SCSBH945CMXB1DDS4":3,"skill-same:01M7BTDY5SCSBH945CMXB1DDS4":57},{"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":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7BTDY5SCSBH945CMXB1DDS4","launch",null,"Launch Code OSS (VS Code from sources) into an isolated throwaway profile with unique debug ports so you can drive it with @playwright\u002Fcli AND attach a Node debugger via dap-cli in the same session. Use when working on VS Code itself and you want to interact with the running workbench, automate chat or UI flows, test UI features, take screenshots, set breakpoints in the renderer \u002F extension host \u002F main process, or combine UI driving 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\u002F.agents\u002Fskills\u002Flaunch\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: launch\ndescription: \"Launch Code OSS (VS Code from sources) into an isolated throwaway profile with unique debug ports so you can drive it with @playwright\u002Fcli AND attach a Node debugger via dap-cli in the same session. Use when working on VS Code itself and you want to interact with the running workbench, automate chat or UI flows, test UI features, take screenshots, set breakpoints in the renderer \u002F extension host \u002F main process, or combine UI driving with debugging.\"\n---\n\n# Code OSS Dev - Launch + Debug\n\nYou're working on VS Code itself and you want to:\n\n1. Launch a Code OSS build from sources that is **already signed in** (Copilot, GitHub, etc.) so chat \u002F agent flows work end-to-end.\n2. Drive it with `@playwright\u002Fcli` over CDP (UI automation).\n3. Optionally attach a debugger via **dap-cli** to set breakpoints in the renderer, extension host, or main process.\n4. Run multiple instances at once without port conflicts.\n\nThis skill provides a launcher that clones an authenticated user-data-dir to a throwaway temp folder, picks free ports for every debug surface, and prints them as JSON so you can pick them up programmatically.\n\nThe clone is **slim**: workspace storage, browser caches, file history, cached VSIX backups, and old logs are excluded by default. Auth tokens themselves live in the OS keychain (shared automatically) plus small files inside `User\u002FglobalStorage` - both of which *are* preserved.\n\n## Prerequisites\n\n- macOS or Linux. The launcher is a bash script and depends on `rsync`, `curl`, `nohup`, and Node on `PATH`. The example caller snippets below also use `jq` (parse the JSON output) and `lsof` (kill-by-port fallback) — install those if you plan to use them, but the launcher itself does not require them.\n- A VS Code checkout with `node_modules\u002F` installed (`npm install` if missing — do **not** symlink from a sibling worktree; that breaks builds in subtle ways).\n- A VS Code checkout with sources built. Run `npm run compile` once (one-shot) or `npm run watch` for incremental rebuilds. Both build the full client **and** all built-in extensions under `extensions\u002F`. You must build the full product to run successfully, building just the client is not enough.\n- An **authenticated** Code OSS profile to seed from. By default the launcher uses `~\u002F.vscode-oss-dev`, which is the user-data-dir the repo's `launch.json` configs use - if the user has ever signed in to Copilot in a dev build, this should work. Only pass `--source-user-data-dir \u003Cpath>` (or set `$CODE_OSS_DEV_AUTHED_USER_DATA_DIR`) when you specifically want to seed from a different profile (e.g. your regular `~\u002FLibrary\u002FApplication Support\u002FCode` install).\n  - If Code OSS launches and needs a sign-in, don't give up! Use the questions tool to ask the user to sign in.\n- `@playwright\u002Fcli` available (it's a devDependency in the vscode repo - `npm install` then use `npx @playwright\u002Fcli`).\n- For debugger work: `dap-cli` on `PATH`. If debugger support would be useful but the `dap-cli` skill is not present, prompt the user to install it from https:\u002F\u002Fgithub.com\u002Froblourens\u002Fdap-cli.\n- CSS selectors are internal implementation details. If a selector-based `eval` stops working, take a fresh `snapshot`, inspect the current DOM, and update the selector rather than assuming an old one still applies.\n\n> The launcher **copies** the source profile to a temp dir and never mutates the original. Each launch gets its own isolated `--user-data-dir` and `--extensions-dir`.\n\n> The launcher always sets `files.simpleDialog.enable: true` in the launched profile's `User\u002Fsettings.json`. This is required for automation: VS Code's native OS file dialogs cannot be driven via `@playwright\u002Fcli` over CDP and are completely unreachable over SSH on headless macOS. The simple (quick-input) dialog can be navigated with `press` and clipboard paste. The override is per-launch and only affects throwaway profiles.\n\n## Launch\n\nThe launcher script lives next to this SKILL.md at `scripts\u002Flaunch.sh`. Resolve it relative to wherever this skill file is installed - do not hardcode an absolute path.\n\n```bash\n# LAUNCH=\u003Cdir-of-this-SKILL.md>\u002Fscripts\u002Flaunch.sh\n\"$LAUNCH\"                                    # default: workbench\n\"$LAUNCH\" --agents                           # Agents window\n\"$LAUNCH\" -- \u003Cworkspace-path>                # forward extra args to code.sh\n\"$LAUNCH\" --source-user-data-dir \u003Cpath>      # pick a specific authed profile\n\"$LAUNCH\" --repo \u003Cvscode-repo-root>          # if not run from the repo\n\"$LAUNCH\" --clone-extensions                 # start with a copy of the source extensions\u002F (~few seconds)\n\"$LAUNCH\" --full                             # skip slim excludes; copy everything\n```\n\n### What gets copied (slim mode, the default)\n\nThe exclude list mirrors the one used by VS Code's own perf-test skill (`.github\u002Fskills\u002Fauto-perf-optimize`), which is known to keep Copilot auth and language-model availability working. Specifically `WebStorage\u002F`, `Service Worker\u002F`, `Local Storage\u002F`, `Cookies`, `Network Persistent State`, `TransportSecurity`, `Trust Tokens`, `Preferences`, `machineid`, and the entire `User\u002FglobalStorage\u002F` (which holds `state.vscdb` - where extension `SecretStorage` blobs live, encrypted with the OS keychain key) are all preserved. Auth tokens themselves stay in the OS keychain, which is per-user, so they follow automatically.\n\nExcluded (transient, regenerable, or known-not-needed):\n- `User\u002FworkspaceStorage\u002F` - per-workspace state, **including stored chat sessions** (often multi-GB)\n- `User\u002FHistory\u002F` - local file edit history\n- `CachedExtensionVSIXs` - backup VSIXs (hundreds of MB)\n- `logs`\n- Chromium caches: `Cache`, `Code Cache`, `CachedData`, `GPUCache`, `ShaderCache`, `Dawn*Cache`, `component_crx_cache`\n- `Backups`, `blob_storage`, `BrowserMetrics`, `Crashpad`, `Session Storage`\n- `Singleton*`, `*.lock`, `*.sock` (would conflict with the source instance)\n\n`extensions\u002F` defaults to a **fresh empty directory** - fastest and conflict-free, but the launched instance starts with no third-party extensions installed. Pass `--clone-extensions` to copy the source extensions dir into the temp profile so the new instance is independent of the source. Pass `--full` to skip all excludes if you suspect the slim copy is missing something you need.\n\n> **Why never share the source `extensions\u002F` dir directly?** The extension management service writes a shared `.obsolete` file; two concurrent writers crash each other's shared background process. The launcher always uses an isolated extensions dir for the same reason it uses `--shared-data-dir` (see below).\n\n> If the launched window says \"language model unavailable\" or otherwise looks unauthed, ask the user to sign in.\n\nThe script runs pre-launch (electron download, compile-if-missing, built-in extensions) **in the foreground**, then starts Code OSS detached and **blocks until the renderer's CDP endpoint is responding** (up to ~90s) before printing the JSON line on stdout. If anything fails — preLaunch errors, code.sh exits early, CDP never opens — the script exits non-zero and dumps the relevant log tail to stderr.\n\n```json\n{\"pid\":12345,\"cdpPort\":53111,\"extHostPort\":53112,\"mainPort\":53113,\"agentHostPort\":53114,\"userDataDir\":\"...\u002Fuser-data\",\"extensionsDir\":\"...\u002Fextensions\",\"sharedDataDir\":\"...\u002Fshared-data\",\"runDir\":\"...\",\"logFile\":\"...\u002Fcode.log\",\"repo\":\"...\",\"agents\":false}\n```\n\nCapture it with `jq` — no retry loop needed, CDP is already up when the JSON is printed:\n\n```bash\nINFO=$(\"$LAUNCH\" | tail -n1)\nCDP=$(jq -r .cdpPort        \u003C\u003C\u003C\"$INFO\")\nEXT=$(jq -r .extHostPort    \u003C\u003C\u003C\"$INFO\")\nMAIN=$(jq -r .mainPort      \u003C\u003C\u003C\"$INFO\")\nAGENT=$(jq -r .agentHostPort \u003C\u003C\u003C\"$INFO\")\nLOG=$(jq -r .logFile        \u003C\u003C\u003C\"$INFO\")\nPID=$(jq -r .pid            \u003C\u003C\u003C\"$INFO\")\n```\n\n### What each port is for\n\n| Port | Process | Use with |\n|------|---------|----------|\n| `cdpPort` (`--remote-debugging-port`) | Renderer (the workbench window) | `@playwright\u002Fcli` over CDP, also Chrome DevTools |\n| `extHostPort` (`--inspect-extensions`) | Extension host (Node) | `dap-cli` (Node inspector protocol) |\n| `mainPort` (`--inspect`) | Electron main process (Node) | `dap-cli` (Node inspector protocol) |\n| `agentHostPort` (`--inspect-agenthost`) | Agent host process (Node) | `dap-cli` (Node inspector protocol) |\n\n## Drive the UI with @playwright\u002Fcli\n\nUse the dynamic `cdpPort` from the launch JSON. The normal loop is: attach, confirm the target, snapshot, interact, then re-snapshot after meaningful UI changes.\n\n> **Always pick a unique `PW_SESSION` name and pass it as `-s=$PW_SESSION`** on every `npx @playwright\u002Fcli ...` call. The CLI is backed by a persistent daemon (`cliDaemon.js`) keyed by session name; if two shells both omit `-s=`, they share the implicit `\"default\"` session and the most-recently-attached CDP \"wins\" for every subsequent command from either shell. The launch skill is built around isolation (per-instance UDD, ports, shared-data-dir), and this pattern keeps that isolation intact at the Playwright-driving layer too. **A note on the alternative `PLAYWRIGHT_CLI_SESSION` env var:** it's documented in the package README and works correctly for `open`-style workflows, but it interacts poorly with `attach --cdp=...` (the daemon ends up with both `--cdp=...` and `--endpoint=\u003Cenv-value>`, and the latter wins, causing a `connect ENOENT` failure). Confirmed against `@playwright\u002Fcli@0.1.13`. Explicit `-s=NAME` works in all modes.\n\n```bash\n# At the top of your script \u002F subagent prompt:\nPW_SESSION=\"my-uniq-$$\"        # any unique string; $$ is fine for one shell per agent\n\n# launch.sh blocks until CDP is ready, so a single attach is enough.\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-list\nnpx @playwright\u002Fcli -s=$PW_SESSION snapshot\n```\n\nAfter `attach`, later `@playwright\u002Fcli` commands keep using the connected app until you close or reattach — as long as you keep passing the same `-s=$PW_SESSION`.\n\n### Selecting the right Electron target\n\nElectron apps can expose multiple windows or webviews. If `tab-list` shows `about:blank`, a webview, or otherwise the wrong target, switch targets before interacting:\n\n```bash\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-list\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-select 2\nnpx @playwright\u002Fcli -s=$PW_SESSION snapshot\n```\n\nIf a target looks stale after relaunching, run `npx @playwright\u002Fcli -s=$PW_SESSION close`, attach again with `$CDP`, and re-check `tab-list`.\n\n### Focusing the chat input (works on Code OSS, including the Agents window)\n\n```bash\n# macOS\nnpx @playwright\u002Fcli -s=$PW_SESSION press Control+Meta+i\n# Linux \u002F Windows\nnpx @playwright\u002Fcli -s=$PW_SESSION press Control+Alt+i\n```\n\n### Typing into Monaco (chat input, editors)\n\n`fill` and `type` **silently fail** on Code OSS — Monaco's `native-edit-context` element doesn't react to Playwright's default input pipeline. Use one of these alternatives:\n\n- **`scripts\u002Fmonaco-paste.sh` helper** (recommended — fast, no system clipboard, parallel-safe). Reads text from a positional arg or stdin and dispatches a `ClipboardEvent('paste')` with a `DataTransfer` payload into the focused chat-input Monaco editor. Honors `--session NAME` or `$PW_SESSION` env so it stays inside the same `-s=` session as everything else.\n\n  ```bash\n  LAUNCH_DIR=\u003Cdir-of-this-SKILL.md>           # the same dir that holds scripts\u002Flaunch.sh\n  PASTE=\"$LAUNCH_DIR\u002Fscripts\u002Fmonaco-paste.sh\"\n  export PW_SESSION                            # helper reads this env var\n\n  # Send a prompt:\n  npx @playwright\u002Fcli -s=$PW_SESSION press Control+Meta+i  # focus chat input\n  \"$PASTE\" 'Please run `pwd && ls` using your terminal tool.'\n  npx @playwright\u002Fcli -s=$PW_SESSION press Enter\n\n  # Long \u002F arbitrary text via stdin (avoids any shell-quoting headaches):\n  printf 'multi-line prompt\\nwith backticks `x`\\nand emoji 🎉' | \"$PASTE\"\n\n  # Append without clearing:\n  \"$PASTE\" --append \" continued text\"\n\n  # Skip the read-back check (useful when intentionally pasting more than the\n  # chat input's ~600-character soft cap):\n  \"$PASTE\" --no-verify \"...long text...\"\n\n  # Or pass the session explicitly per call (if you don't want to export PW_SESSION):\n  \"$PASTE\" --session \"$PW_SESSION\" \"...\"\n  ```\n\n  The helper prints a single JSON line on stdout: `{ok, actualLength, expectedLength, viewLineCount, firstViewLine, error?}`. Exit 0 on success, 1 on verify failure, 2 on argument errors. Tested reliable across 20+ sequential pastes including unicode (中文), emoji (🎉), backticks, ampersands, embedded quotes, and newlines.\n\n  **Why a helper script and not just docs:** the inline recipe involves a multi-line `node -e` heredoc with embedded JS template literals, which is exactly the kind of code that gets miscopied. There are also three non-obvious correctness traps the helper handles internally:\n  1. Monaco's `native-edit-context` doesn't react to `fill` or `type`, only to actual paste events (or per-key `press`).\n  2. Monaco renders ASCII spaces as U+00A0 (NBSP) in the view-line DOM, so verification has to normalize before comparing.\n  3. Monaco updates its DOM **asynchronously** after a paste event — a synchronous read-back inside the same `eval` returns stale state. The helper waits two `requestAnimationFrame` ticks before reading.\n\n- **Per-key `press`** (universal but slow — each press is a separate CLI invocation with Node startup cost):\n  ```bash\n  npx @playwright\u002Fcli -s=$PW_SESSION press H\n  npx @playwright\u002Fcli -s=$PW_SESSION press i\n  npx @playwright\u002Fcli -s=$PW_SESSION press Enter\n  ```\n\n- **Clipboard paste via `pbcopy`** (fast on macOS, **but `NSPasteboard` is system-wide so any concurrent shell that touches the pasteboard will collide**). Only use when nothing else on the machine is using the clipboard for the duration of the paste.\n  ```bash\n  printf '%s' \"Your prompt here\" | pbcopy\n  npx @playwright\u002Fcli -s=$PW_SESSION press Control+Meta+i\n  npx @playwright\u002Fcli -s=$PW_SESSION press Meta+v\n  npx @playwright\u002Fcli -s=$PW_SESSION press Enter\n  ```\n\nThe focus shortcut should leave `document.activeElement` on VS Code's `native-edit-context` editing surface. That is a useful sanity check when key presses appear to do nothing.\n\n### Parallel multi-instance pattern\n\nBecause the launch skill is built around isolation, the natural workload is **many agents on one machine, each driving their own Code OSS**. The pattern boils down to giving each agent a unique `PW_SESSION` and passing it everywhere:\n\n```bash\n# In agent A's shell:\nPW_SESSION=\"agent-A-$$\"\nINFO=$(\"$LAUNCH\" --agents -- --use-mock-keychain | tail -n1)\nCDP=$(jq -r .cdpPort \u003C\u003C\u003C\"$INFO\")\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\n\"$PASTE\" \"prompt for A\"   # helper picks up $PW_SESSION\n\n# In agent B's shell (running concurrently):\nPW_SESSION=\"agent-B-$$\"\nINFO=$(\"$LAUNCH\" --agents -- --use-mock-keychain | tail -n1)\nCDP=$(jq -r .cdpPort \u003C\u003C\u003C\"$INFO\")\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\n\"$PASTE\" \"prompt for B\"\n```\n\nEach agent gets its own `cliDaemon` bound to its own CDP, so the pastes \u002F clicks \u002F snapshots don't cross-contaminate. Verified live with two concurrent instances. **macOS Mach-ports caveat:** on macOS, beyond ~2–3 concurrent Code OSS instances Crashpad's exception handler tends to die with `mach_port_request_notification: invalid capability`. That's a separate, OS-level limit; it's not affected by the session name.\n\n> **Cleanup for `cliDaemon` processes:** stop your session's daemon with `npx @playwright\u002Fcli -s=$PW_SESSION close`, or nuke all stale daemons (after killing all the Code OSS windows) with `npx @playwright\u002Fcli kill-all`. Session daemons live under `~\u002FLibrary\u002FCaches\u002Fms-playwright\u002Fdaemon\u002F\u003Chash>\u002F`.\n\n### Agents window selector differences\n\nThe Agents window does not use the regular workbench `.interactive-input-editor` wrapper. Selector checks that are scoped to that wrapper may return nothing even when the Agents chat input is focused.\n\n```js\n\u002F\u002F Regular-workbench-specific selector; do not assume this exists in Agents.\ndocument.querySelectorAll('.interactive-input-editor .view-line')\n\n\u002F\u002F More useful checks in Agents.\ndocument.querySelectorAll('.view-line')\ndocument.activeElement?.className === 'native-edit-context'\n```\n\nThe `Control+Meta+i` \u002F `Control+Alt+i` focus shortcut still works; only the DOM shape after focus differs.\n\n### Verifying and clearing chat text\n\nFor the regular workbench sidebar, this confirms that text landed in the Monaco input:\n\n```bash\nnpx @playwright\u002Fcli -s=$PW_SESSION eval '\n(() => {\n  const sidebar = document.querySelector(\".part.auxiliarybar\");\n  const viewLines = sidebar?.querySelectorAll(\".interactive-input-editor .view-line\") ?? [];\n  return Array.from(viewLines).map(viewLine => viewLine.textContent).join(\"|\");\n})()'\n```\n\nFor the Agents window, use a fresh snapshot plus the broader selector\u002Ffocus checks above instead of assuming the regular sidebar wrapper is present.\n\nTo clear the focused Monaco input:\n\n```bash\n# macOS\nnpx @playwright\u002Fcli -s=$PW_SESSION press Meta+a\n# Linux \u002F Windows\nnpx @playwright\u002Fcli -s=$PW_SESSION press Control+a\nnpx @playwright\u002Fcli -s=$PW_SESSION press Backspace\n```\n\nIf the keyboard shortcut cannot focus chat because the surface is not available yet, take a snapshot and navigate the UI into a state where chat exists before retrying. Avoid treating completed CLI commands as proof that text was entered.\n\n### Screenshots (paper trail)\n\n```bash\nSHOTS=\"$PWD\u002Fscreenshots\u002F$(date +%Y-%m-%dT%H-%M-%S)\"\nmkdir -p \"$SHOTS\"\nnpx @playwright\u002Fcli -s=$PW_SESSION screenshot --filename=\"$SHOTS\u002Fafter-launch.png\"\n```\n\n> Keep screenshots inside the workspace, not `\u002Ftmp`, so they survive for review.\n\nFor wide windows, `--full-page` can make layout easier to inspect, and element screenshots are useful when a snapshot gives a stable ref for the panel you care about:\n\n```bash\nnpx @playwright\u002Fcli -s=$PW_SESSION screenshot --full-page --filename=\"$SHOTS\u002Ffull-window.png\"\nnpx @playwright\u002Fcli -s=$PW_SESSION screenshot e42 --filename=\"$SHOTS\u002Fpanel.png\"\n```\n\nOn macOS, a screenshot \"Permission denied\" failure usually means the terminal lacks Screen Recording permission. Use text\u002Fstate verification while resolving that permission issue.\n\n## Debug with dap-cli\n\nTo set breakpoints in VS Code source while the window is running, attach `dap-cli` to one of the ports. If `dap-cli` would help but the corresponding skill is unavailable, prompt the user to install it from https:\u002F\u002Fgithub.com\u002Froblourens\u002Fdap-cli before continuing with debugger-specific steps.\n\n**Read the `dap-cli` skill for the full attach\u002Fbreakpoint\u002Finspect workflow when it is available** - this skill only tells you which port to point it at:\n\n- **Extension host** (most common - Copilot Chat extension, built-in extensions, your own extension under development) -> `extHostPort`\n- **Main process** (Electron lifecycle, window\u002Fmenu wiring, IPC) -> `mainPort`\n- **Local agent host** (`src\u002Fvs\u002Fplatform\u002FagentHost\u002Fnode\u002F...`, agent session lifecycle, AHP wiring, Claude\u002FCopilot agent providers) -> `agentHostPort`\n- **Renderer** (the workbench itself, `src\u002Fvs\u002Fworkbench\u002F...`) -> `cdpPort`\n\nYou can run `@playwright\u002Fcli` and `dap-cli` against the **same window simultaneously** - drive the UI with one terminal, hit a breakpoint and inspect state in another.\n\n## Multiple instances\n\nEvery launch picks fresh ports and a fresh temp `runDir`, so you can run as many concurrent Code OSS windows as your machine can handle. Each one's ports come back in its own JSON blob - keep them separate.\n\nThe launcher also passes `--shared-data-dir=\u003CrunDir>\u002Fshared-data`. This is **required** for multi-instance isolation: Code OSS keeps a fixed-path SQLite DB at `~\u002F.\u003CdataFolderName>-shared\u002FsharedStorage\u002Fstate.vscdb` that is *not* covered by `--user-data-dir`. Without overriding it, two concurrent instances would fight over the same file and one would die with \"shared background process terminated unexpectedly\". Each launch gets its own `shared-data` dir.\n\n## Restart after source changes\n\nWorkbench code is loaded when the Code OSS window starts; source changes are not hot-reloaded into an already-running instance. After the build output is current, kill the launched process, launch again, and reattach to the new `cdpPort` from the new JSON blob.\n\n```bash\nkill \"$PID\" 2>\u002Fdev\u002Fnull || true\nINFO=$(\"$LAUNCH\" | tail -n1)\nCDP=$(jq -r .cdpPort \u003C\u003C\u003C\"$INFO\")\nPID=$(jq -r .pid \u003C\u003C\u003C\"$INFO\")\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-list\nnpx @playwright\u002Fcli -s=$PW_SESSION snapshot\n```\n\nIf you are iterating frequently, keep the repo build\u002Fwatch task running separately so relaunches pick up already-generated output.\n\n## Cleanup\n\nThe launcher writes everything under a temp `runDir` (printed in the JSON). When you're done:\n\n```bash\n# Disconnect this session's playwright daemon (leaves other sessions' daemons alone)\nnpx @playwright\u002Fcli -s=$PW_SESSION close\n\n# Or nuke any stale daemons left behind by crashed callers across all sessions:\n# npx @playwright\u002Fcli kill-all\n\n# Kill the Code OSS instance\nkill \"$PID\" 2>\u002Fdev\u002Fnull || true\n# Or by port if you've lost the pid:\npids=$(lsof -t -i :$CDP); [ -n \"$pids\" ] && kill $pids\n\n# Remove the throwaway profile\nrm -rf \"$(dirname \"$LOG\")\"\n```\n\nCode OSS is a full Electron app and easily eats 1-4 GB. Always clean up.\n\n## Troubleshooting\n\n- **\"Sent env to running instance. Terminating...\"** - The dynamic `--user-data-dir` should prevent this. If you see it, another Code OSS is using the same profile path; pass `--source-user-data-dir` to a different source or check that the temp copy actually happened (`ls \"$(jq -r .userDataDir \u003C\u003C\u003C\"$INFO\")\"`).\n- **Renderer ESM errors \u002F `import { Menu } from 'electron'`** - `ELECTRON_RUN_AS_NODE` is set in your env. The launcher unsets it for the child, but if you spawn `code.sh` yourself, do the same.\n- **Built-in extension fails to load (`Cannot find module ...\u002Fextensions\u002F...\u002Fout\u002Fextension.js`)** - extensions weren't compiled. Run `npm run compile` (one-shot, also rebuilds all built-in extensions) or `npm run watch` (incremental). A common cause: you ran `npm run transpile-client` to satisfy unit tests, which populated `out\u002F` but not `extensions\u002F*\u002Fout\u002F`, so preLaunch's \"is `out\u002F` missing?\" check skipped the compile.\n- **`launch.sh` exits non-zero with a log tail** - either pre-launch failed, `code.sh` died before CDP came up, or CDP never opened within 90s. The tail printed to stderr is from `runDir\u002Fcode.log` - read it to diagnose.\n- **Snapshot shows the wrong page or no expected controls** - use `tab-list`, switch with `tab-select \u003Cindex>` if needed, then re-snapshot before interacting.\n- **CLI typing commands complete but the input stays empty** - focus chat with the platform shortcut, use `press` or clipboard paste rather than `fill` \u002F `type`, then verify the input state before sending.\n- **Auth missing in the launched window** - confirm the source profile is actually authed (`ls \"$SOURCE_UDD\"` should contain `User\u002F`, and `ls \"$SOURCE_UDD\u002FUser\u002FglobalStorage\"` should show persisted extension state). Some auth lives in the OS keychain - that's per-user, so it follows automatically as long as you're running as the same user.\n","# Code OSS Dev - Launch + Debug\n\nYou're working on VS Code itself and you want to:\n\n1. Launch a Code OSS build from sources that is **already signed in** (Copilot, GitHub, etc.) so chat \u002F agent flows work end-to-end.\n2. Drive it with `@playwright\u002Fcli` over CDP (UI automation).\n3. Optionally attach a debugger via **dap-cli** to set breakpoints in the renderer, extension host, or main process.\n4. Run multiple instances at once without port conflicts.\n\nThis skill provides a launcher that clones an authenticated user-data-dir to a throwaway temp folder, picks free ports for every debug surface, and prints them as JSON so you can pick them up programmatically.\n\nThe clone is **slim**: workspace storage, browser caches, file history, cached VSIX backups, and old logs are excluded by default. Auth tokens themselves live in the OS keychain (shared automatically) plus small files inside `User\u002FglobalStorage` - both of which *are* preserved.\n\n## Prerequisites\n\n- macOS or Linux. The launcher is a bash script and depends on `rsync`, `curl`, `nohup`, and Node on `PATH`. The example caller snippets below also use `jq` (parse the JSON output) and `lsof` (kill-by-port fallback) — install those if you plan to use them, but the launcher itself does not require them.\n- A VS Code checkout with `node_modules\u002F` installed (`npm install` if missing — do **not** symlink from a sibling worktree; that breaks builds in subtle ways).\n- A VS Code checkout with sources built. Run `npm run compile` once (one-shot) or `npm run watch` for incremental rebuilds. Both build the full client **and** all built-in extensions under `extensions\u002F`. You must build the full product to run successfully, building just the client is not enough.\n- An **authenticated** Code OSS profile to seed from. By default the launcher uses `~\u002F.vscode-oss-dev`, which is the user-data-dir the repo's `launch.json` configs use - if the user has ever signed in to Copilot in a dev build, this should work. Only pass `--source-user-data-dir \u003Cpath>` (or set `$CODE_OSS_DEV_AUTHED_USER_DATA_DIR`) when you specifically want to seed from a different profile (e.g. your regular `~\u002FLibrary\u002FApplication Support\u002FCode` install).\n  - If Code OSS launches and needs a sign-in, don't give up! Use the questions tool to ask the user to sign in.\n- `@playwright\u002Fcli` available (it's a devDependency in the vscode repo - `npm install` then use `npx @playwright\u002Fcli`).\n- For debugger work: `dap-cli` on `PATH`. If debugger support would be useful but the `dap-cli` skill is not present, prompt the user to install it from https:\u002F\u002Fgithub.com\u002Froblourens\u002Fdap-cli.\n- CSS selectors are internal implementation details. If a selector-based `eval` stops working, take a fresh `snapshot`, inspect the current DOM, and update the selector rather than assuming an old one still applies.\n\n> The launcher **copies** the source profile to a temp dir and never mutates the original. Each launch gets its own isolated `--user-data-dir` and `--extensions-dir`.\n\n> The launcher always sets `files.simpleDialog.enable: true` in the launched profile's `User\u002Fsettings.json`. This is required for automation: VS Code's native OS file dialogs cannot be driven via `@playwright\u002Fcli` over CDP and are completely unreachable over SSH on headless macOS. The simple (quick-input) dialog can be navigated with `press` and clipboard paste. The override is per-launch and only affects throwaway profiles.\n\n## Launch\n\nThe launcher script lives next to this SKILL.md at `scripts\u002Flaunch.sh`. Resolve it relative to wherever this skill file is installed - do not hardcode an absolute path.\n\n```bash\n# LAUNCH=\u003Cdir-of-this-SKILL.md>\u002Fscripts\u002Flaunch.sh\n\"$LAUNCH\"                                    # default: workbench\n\"$LAUNCH\" --agents                           # Agents window\n\"$LAUNCH\" -- \u003Cworkspace-path>                # forward extra args to code.sh\n\"$LAUNCH\" --source-user-data-dir \u003Cpath>      # pick a specific authed profile\n\"$LAUNCH\" --repo \u003Cvscode-repo-root>          # if not run from the repo\n\"$LAUNCH\" --clone-extensions                 # start with a copy of the source extensions\u002F (~few seconds)\n\"$LAUNCH\" --full                             # skip slim excludes; copy everything\n```\n\n### What gets copied (slim mode, the default)\n\nThe exclude list mirrors the one used by VS Code's own perf-test skill (`.github\u002Fskills\u002Fauto-perf-optimize`), which is known to keep Copilot auth and language-model availability working. Specifically `WebStorage\u002F`, `Service Worker\u002F`, `Local Storage\u002F`, `Cookies`, `Network Persistent State`, `TransportSecurity`, `Trust Tokens`, `Preferences`, `machineid`, and the entire `User\u002FglobalStorage\u002F` (which holds `state.vscdb` - where extension `SecretStorage` blobs live, encrypted with the OS keychain key) are all preserved. Auth tokens themselves stay in the OS keychain, which is per-user, so they follow automatically.\n\nExcluded (transient, regenerable, or known-not-needed):\n- `User\u002FworkspaceStorage\u002F` - per-workspace state, **including stored chat sessions** (often multi-GB)\n- `User\u002FHistory\u002F` - local file edit history\n- `CachedExtensionVSIXs` - backup VSIXs (hundreds of MB)\n- `logs`\n- Chromium caches: `Cache`, `Code Cache`, `CachedData`, `GPUCache`, `ShaderCache`, `Dawn*Cache`, `component_crx_cache`\n- `Backups`, `blob_storage`, `BrowserMetrics`, `Crashpad`, `Session Storage`\n- `Singleton*`, `*.lock`, `*.sock` (would conflict with the source instance)\n\n`extensions\u002F` defaults to a **fresh empty directory** - fastest and conflict-free, but the launched instance starts with no third-party extensions installed. Pass `--clone-extensions` to copy the source extensions dir into the temp profile so the new instance is independent of the source. Pass `--full` to skip all excludes if you suspect the slim copy is missing something you need.\n\n> **Why never share the source `extensions\u002F` dir directly?** The extension management service writes a shared `.obsolete` file; two concurrent writers crash each other's shared background process. The launcher always uses an isolated extensions dir for the same reason it uses `--shared-data-dir` (see below).\n\n> If the launched window says \"language model unavailable\" or otherwise looks unauthed, ask the user to sign in.\n\nThe script runs pre-launch (electron download, compile-if-missing, built-in extensions) **in the foreground**, then starts Code OSS detached and **blocks until the renderer's CDP endpoint is responding** (up to ~90s) before printing the JSON line on stdout. If anything fails — preLaunch errors, code.sh exits early, CDP never opens — the script exits non-zero and dumps the relevant log tail to stderr.\n\n```json\n{\"pid\":12345,\"cdpPort\":53111,\"extHostPort\":53112,\"mainPort\":53113,\"agentHostPort\":53114,\"userDataDir\":\"...\u002Fuser-data\",\"extensionsDir\":\"...\u002Fextensions\",\"sharedDataDir\":\"...\u002Fshared-data\",\"runDir\":\"...\",\"logFile\":\"...\u002Fcode.log\",\"repo\":\"...\",\"agents\":false}\n```\n\nCapture it with `jq` — no retry loop needed, CDP is already up when the JSON is printed:\n\n```bash\nINFO=$(\"$LAUNCH\" | tail -n1)\nCDP=$(jq -r .cdpPort        \u003C\u003C\u003C\"$INFO\")\nEXT=$(jq -r .extHostPort    \u003C\u003C\u003C\"$INFO\")\nMAIN=$(jq -r .mainPort      \u003C\u003C\u003C\"$INFO\")\nAGENT=$(jq -r .agentHostPort \u003C\u003C\u003C\"$INFO\")\nLOG=$(jq -r .logFile        \u003C\u003C\u003C\"$INFO\")\nPID=$(jq -r .pid            \u003C\u003C\u003C\"$INFO\")\n```\n\n### What each port is for\n\n| Port | Process | Use with |\n|------|---------|----------|\n| `cdpPort` (`--remote-debugging-port`) | Renderer (the workbench window) | `@playwright\u002Fcli` over CDP, also Chrome DevTools |\n| `extHostPort` (`--inspect-extensions`) | Extension host (Node) | `dap-cli` (Node inspector protocol) |\n| `mainPort` (`--inspect`) | Electron main process (Node) | `dap-cli` (Node inspector protocol) |\n| `agentHostPort` (`--inspect-agenthost`) | Agent host process (Node) | `dap-cli` (Node inspector protocol) |\n\n## Drive the UI with @playwright\u002Fcli\n\nUse the dynamic `cdpPort` from the launch JSON. The normal loop is: attach, confirm the target, snapshot, interact, then re-snapshot after meaningful UI changes.\n\n> **Always pick a unique `PW_SESSION` name and pass it as `-s=$PW_SESSION`** on every `npx @playwright\u002Fcli ...` call. The CLI is backed by a persistent daemon (`cliDaemon.js`) keyed by session name; if two shells both omit `-s=`, they share the implicit `\"default\"` session and the most-recently-attached CDP \"wins\" for every subsequent command from either shell. The launch skill is built around isolation (per-instance UDD, ports, shared-data-dir), and this pattern keeps that isolation intact at the Playwright-driving layer too. **A note on the alternative `PLAYWRIGHT_CLI_SESSION` env var:** it's documented in the package README and works correctly for `open`-style workflows, but it interacts poorly with `attach --cdp=...` (the daemon ends up with both `--cdp=...` and `--endpoint=\u003Cenv-value>`, and the latter wins, causing a `connect ENOENT` failure). Confirmed against `@playwright\u002Fcli@0.1.13`. Explicit `-s=NAME` works in all modes.\n\n```bash\n# At the top of your script \u002F subagent prompt:\nPW_SESSION=\"my-uniq-$$\"        # any unique string; $$ is fine for one shell per agent\n\n# launch.sh blocks until CDP is ready, so a single attach is enough.\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-list\nnpx @playwright\u002Fcli -s=$PW_SESSION snapshot\n```\n\nAfter `attach`, later `@playwright\u002Fcli` commands keep using the connected app until you close or reattach — as long as you keep passing the same `-s=$PW_SESSION`.\n\n### Selecting the right Electron target\n\nElectron apps can expose multiple windows or webviews. If `tab-list` shows `about:blank`, a webview, or otherwise the wrong target, switch targets before interacting:\n\n```bash\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-list\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-select 2\nnpx @playwright\u002Fcli -s=$PW_SESSION snapshot\n```\n\nIf a target looks stale after relaunching, run `npx @playwright\u002Fcli -s=$PW_SESSION close`, attach again with `$CDP`, and re-check `tab-list`.\n\n### Focusing the chat input (works on Code OSS, including the Agents window)\n\n```bash\n# macOS\nnpx @playwright\u002Fcli -s=$PW_SESSION press Control+Meta+i\n# Linux \u002F Windows\nnpx @playwright\u002Fcli -s=$PW_SESSION press Control+Alt+i\n```\n\n### Typing into Monaco (chat input, editors)\n\n`fill` and `type` **silently fail** on Code OSS — Monaco's `native-edit-context` element doesn't react to Playwright's default input pipeline. Use one of these alternatives:\n\n- **`scripts\u002Fmonaco-paste.sh` helper** (recommended — fast, no system clipboard, parallel-safe). Reads text from a positional arg or stdin and dispatches a `ClipboardEvent('paste')` with a `DataTransfer` payload into the focused chat-input Monaco editor. Honors `--session NAME` or `$PW_SESSION` env so it stays inside the same `-s=` session as everything else.\n\n  ```bash\n  LAUNCH_DIR=\u003Cdir-of-this-SKILL.md>           # the same dir that holds scripts\u002Flaunch.sh\n  PASTE=\"$LAUNCH_DIR\u002Fscripts\u002Fmonaco-paste.sh\"\n  export PW_SESSION                            # helper reads this env var\n\n  # Send a prompt:\n  npx @playwright\u002Fcli -s=$PW_SESSION press Control+Meta+i  # focus chat input\n  \"$PASTE\" 'Please run `pwd && ls` using your terminal tool.'\n  npx @playwright\u002Fcli -s=$PW_SESSION press Enter\n\n  # Long \u002F arbitrary text via stdin (avoids any shell-quoting headaches):\n  printf 'multi-line prompt\\nwith backticks `x`\\nand emoji 🎉' | \"$PASTE\"\n\n  # Append without clearing:\n  \"$PASTE\" --append \" continued text\"\n\n  # Skip the read-back check (useful when intentionally pasting more than the\n  # chat input's ~600-character soft cap):\n  \"$PASTE\" --no-verify \"...long text...\"\n\n  # Or pass the session explicitly per call (if you don't want to export PW_SESSION):\n  \"$PASTE\" --session \"$PW_SESSION\" \"...\"\n  ```\n\n  The helper prints a single JSON line on stdout: `{ok, actualLength, expectedLength, viewLineCount, firstViewLine, error?}`. Exit 0 on success, 1 on verify failure, 2 on argument errors. Tested reliable across 20+ sequential pastes including unicode (中文), emoji (🎉), backticks, ampersands, embedded quotes, and newlines.\n\n  **Why a helper script and not just docs:** the inline recipe involves a multi-line `node -e` heredoc with embedded JS template literals, which is exactly the kind of code that gets miscopied. There are also three non-obvious correctness traps the helper handles internally:\n  1. Monaco's `native-edit-context` doesn't react to `fill` or `type`, only to actual paste events (or per-key `press`).\n  2. Monaco renders ASCII spaces as U+00A0 (NBSP) in the view-line DOM, so verification has to normalize before comparing.\n  3. Monaco updates its DOM **asynchronously** after a paste event — a synchronous read-back inside the same `eval` returns stale state. The helper waits two `requestAnimationFrame` ticks before reading.\n\n- **Per-key `press`** (universal but slow — each press is a separate CLI invocation with Node startup cost):\n  ```bash\n  npx @playwright\u002Fcli -s=$PW_SESSION press H\n  npx @playwright\u002Fcli -s=$PW_SESSION press i\n  npx @playwright\u002Fcli -s=$PW_SESSION press Enter\n  ```\n\n- **Clipboard paste via `pbcopy`** (fast on macOS, **but `NSPasteboard` is system-wide so any concurrent shell that touches the pasteboard will collide**). Only use when nothing else on the machine is using the clipboard for the duration of the paste.\n  ```bash\n  printf '%s' \"Your prompt here\" | pbcopy\n  npx @playwright\u002Fcli -s=$PW_SESSION press Control+Meta+i\n  npx @playwright\u002Fcli -s=$PW_SESSION press Meta+v\n  npx @playwright\u002Fcli -s=$PW_SESSION press Enter\n  ```\n\nThe focus shortcut should leave `document.activeElement` on VS Code's `native-edit-context` editing surface. That is a useful sanity check when key presses appear to do nothing.\n\n### Parallel multi-instance pattern\n\nBecause the launch skill is built around isolation, the natural workload is **many agents on one machine, each driving their own Code OSS**. The pattern boils down to giving each agent a unique `PW_SESSION` and passing it everywhere:\n\n```bash\n# In agent A's shell:\nPW_SESSION=\"agent-A-$$\"\nINFO=$(\"$LAUNCH\" --agents -- --use-mock-keychain | tail -n1)\nCDP=$(jq -r .cdpPort \u003C\u003C\u003C\"$INFO\")\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\n\"$PASTE\" \"prompt for A\"   # helper picks up $PW_SESSION\n\n# In agent B's shell (running concurrently):\nPW_SESSION=\"agent-B-$$\"\nINFO=$(\"$LAUNCH\" --agents -- --use-mock-keychain | tail -n1)\nCDP=$(jq -r .cdpPort \u003C\u003C\u003C\"$INFO\")\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\n\"$PASTE\" \"prompt for B\"\n```\n\nEach agent gets its own `cliDaemon` bound to its own CDP, so the pastes \u002F clicks \u002F snapshots don't cross-contaminate. Verified live with two concurrent instances. **macOS Mach-ports caveat:** on macOS, beyond ~2–3 concurrent Code OSS instances Crashpad's exception handler tends to die with `mach_port_request_notification: invalid capability`. That's a separate, OS-level limit; it's not affected by the session name.\n\n> **Cleanup for `cliDaemon` processes:** stop your session's daemon with `npx @playwright\u002Fcli -s=$PW_SESSION close`, or nuke all stale daemons (after killing all the Code OSS windows) with `npx @playwright\u002Fcli kill-all`. Session daemons live under `~\u002FLibrary\u002FCaches\u002Fms-playwright\u002Fdaemon\u002F\u003Chash>\u002F`.\n\n### Agents window selector differences\n\nThe Agents window does not use the regular workbench `.interactive-input-editor` wrapper. Selector checks that are scoped to that wrapper may return nothing even when the Agents chat input is focused.\n\n```js\n\u002F\u002F Regular-workbench-specific selector; do not assume this exists in Agents.\ndocument.querySelectorAll('.interactive-input-editor .view-line')\n\n\u002F\u002F More useful checks in Agents.\ndocument.querySelectorAll('.view-line')\ndocument.activeElement?.className === 'native-edit-context'\n```\n\nThe `Control+Meta+i` \u002F `Control+Alt+i` focus shortcut still works; only the DOM shape after focus differs.\n\n### Verifying and clearing chat text\n\nFor the regular workbench sidebar, this confirms that text landed in the Monaco input:\n\n```bash\nnpx @playwright\u002Fcli -s=$PW_SESSION eval '\n(() => {\n  const sidebar = document.querySelector(\".part.auxiliarybar\");\n  const viewLines = sidebar?.querySelectorAll(\".interactive-input-editor .view-line\") ?? [];\n  return Array.from(viewLines).map(viewLine => viewLine.textContent).join(\"|\");\n})()'\n```\n\nFor the Agents window, use a fresh snapshot plus the broader selector\u002Ffocus checks above instead of assuming the regular sidebar wrapper is present.\n\nTo clear the focused Monaco input:\n\n```bash\n# macOS\nnpx @playwright\u002Fcli -s=$PW_SESSION press Meta+a\n# Linux \u002F Windows\nnpx @playwright\u002Fcli -s=$PW_SESSION press Control+a\nnpx @playwright\u002Fcli -s=$PW_SESSION press Backspace\n```\n\nIf the keyboard shortcut cannot focus chat because the surface is not available yet, take a snapshot and navigate the UI into a state where chat exists before retrying. Avoid treating completed CLI commands as proof that text was entered.\n\n### Screenshots (paper trail)\n\n```bash\nSHOTS=\"$PWD\u002Fscreenshots\u002F$(date +%Y-%m-%dT%H-%M-%S)\"\nmkdir -p \"$SHOTS\"\nnpx @playwright\u002Fcli -s=$PW_SESSION screenshot --filename=\"$SHOTS\u002Fafter-launch.png\"\n```\n\n> Keep screenshots inside the workspace, not `\u002Ftmp`, so they survive for review.\n\nFor wide windows, `--full-page` can make layout easier to inspect, and element screenshots are useful when a snapshot gives a stable ref for the panel you care about:\n\n```bash\nnpx @playwright\u002Fcli -s=$PW_SESSION screenshot --full-page --filename=\"$SHOTS\u002Ffull-window.png\"\nnpx @playwright\u002Fcli -s=$PW_SESSION screenshot e42 --filename=\"$SHOTS\u002Fpanel.png\"\n```\n\nOn macOS, a screenshot \"Permission denied\" failure usually means the terminal lacks Screen Recording permission. Use text\u002Fstate verification while resolving that permission issue.\n\n## Debug with dap-cli\n\nTo set breakpoints in VS Code source while the window is running, attach `dap-cli` to one of the ports. If `dap-cli` would help but the corresponding skill is unavailable, prompt the user to install it from https:\u002F\u002Fgithub.com\u002Froblourens\u002Fdap-cli before continuing with debugger-specific steps.\n\n**Read the `dap-cli` skill for the full attach\u002Fbreakpoint\u002Finspect workflow when it is available** - this skill only tells you which port to point it at:\n\n- **Extension host** (most common - Copilot Chat extension, built-in extensions, your own extension under development) -> `extHostPort`\n- **Main process** (Electron lifecycle, window\u002Fmenu wiring, IPC) -> `mainPort`\n- **Local agent host** (`src\u002Fvs\u002Fplatform\u002FagentHost\u002Fnode\u002F...`, agent session lifecycle, AHP wiring, Claude\u002FCopilot agent providers) -> `agentHostPort`\n- **Renderer** (the workbench itself, `src\u002Fvs\u002Fworkbench\u002F...`) -> `cdpPort`\n\nYou can run `@playwright\u002Fcli` and `dap-cli` against the **same window simultaneously** - drive the UI with one terminal, hit a breakpoint and inspect state in another.\n\n## Multiple instances\n\nEvery launch picks fresh ports and a fresh temp `runDir`, so you can run as many concurrent Code OSS windows as your machine can handle. Each one's ports come back in its own JSON blob - keep them separate.\n\nThe launcher also passes `--shared-data-dir=\u003CrunDir>\u002Fshared-data`. This is **required** for multi-instance isolation: Code OSS keeps a fixed-path SQLite DB at `~\u002F.\u003CdataFolderName>-shared\u002FsharedStorage\u002Fstate.vscdb` that is *not* covered by `--user-data-dir`. Without overriding it, two concurrent instances would fight over the same file and one would die with \"shared background process terminated unexpectedly\". Each launch gets its own `shared-data` dir.\n\n## Restart after source changes\n\nWorkbench code is loaded when the Code OSS window starts; source changes are not hot-reloaded into an already-running instance. After the build output is current, kill the launched process, launch again, and reattach to the new `cdpPort` from the new JSON blob.\n\n```bash\nkill \"$PID\" 2>\u002Fdev\u002Fnull || true\nINFO=$(\"$LAUNCH\" | tail -n1)\nCDP=$(jq -r .cdpPort \u003C\u003C\u003C\"$INFO\")\nPID=$(jq -r .pid \u003C\u003C\u003C\"$INFO\")\nnpx @playwright\u002Fcli -s=$PW_SESSION attach --cdp=http:\u002F\u002F127.0.0.1:$CDP\nnpx @playwright\u002Fcli -s=$PW_SESSION tab-list\nnpx @playwright\u002Fcli -s=$PW_SESSION snapshot\n```\n\nIf you are iterating frequently, keep the repo build\u002Fwatch task running separately so relaunches pick up already-generated output.\n\n## Cleanup\n\nThe launcher writes everything under a temp `runDir` (printed in the JSON). When you're done:\n\n```bash\n# Disconnect this session's playwright daemon (leaves other sessions' daemons alone)\nnpx @playwright\u002Fcli -s=$PW_SESSION close\n\n# Or nuke any stale daemons left behind by crashed callers across all sessions:\n# npx @playwright\u002Fcli kill-all\n\n# Kill the Code OSS instance\nkill \"$PID\" 2>\u002Fdev\u002Fnull || true\n# Or by port if you've lost the pid:\npids=$(lsof -t -i :$CDP); [ -n \"$pids\" ] && kill $pids\n\n# Remove the throwaway profile\nrm -rf \"$(dirname \"$LOG\")\"\n```\n\nCode OSS is a full Electron app and easily eats 1-4 GB. Always clean up.\n\n## Troubleshooting\n\n- **\"Sent env to running instance. Terminating...\"** - The dynamic `--user-data-dir` should prevent this. If you see it, another Code OSS is using the same profile path; pass `--source-user-data-dir` to a different source or check that the temp copy actually happened (`ls \"$(jq -r .userDataDir \u003C\u003C\u003C\"$INFO\")\"`).\n- **Renderer ESM errors \u002F `import { Menu } from 'electron'`** - `ELECTRON_RUN_AS_NODE` is set in your env. The launcher unsets it for the child, but if you spawn `code.sh` yourself, do the same.\n- **Built-in extension fails to load (`Cannot find module ...\u002Fextensions\u002F...\u002Fout\u002Fextension.js`)** - extensions weren't compiled. Run `npm run compile` (one-shot, also rebuilds all built-in extensions) or `npm run watch` (incremental). A common cause: you ran `npm run transpile-client` to satisfy unit tests, which populated `out\u002F` but not `extensions\u002F*\u002Fout\u002F`, so preLaunch's \"is `out\u002F` missing?\" check skipped the compile.\n- **`launch.sh` exits non-zero with a log tail** - either pre-launch failed, `code.sh` died before CDP came up, or CDP never opened within 90s. The tail printed to stderr is from `runDir\u002Fcode.log` - read it to diagnose.\n- **Snapshot shows the wrong page or no expected controls** - use `tab-list`, switch with `tab-select \u003Cindex>` if needed, then re-snapshot before interacting.\n- **CLI typing commands complete but the input stays empty** - focus chat with the platform shortcut, use `press` or clipboard paste rather than `fill` \u002F `type`, then verify the input state before sending.\n- **Auth missing in the launched window** - confirm the source profile is actually authed (`ls \"$SOURCE_UDD\"` should contain `User\u002F`, and `ls \"$SOURCE_UDD\u002FUser\u002FglobalStorage\"` should show persisted extension state). Some auth lives in the OS keychain - that's per-user, so it follows automatically as long as you're running as the same user.\n",{"name":5,"description":7},"main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-IDE-编辑器内核\u002FYYC3-IDE-编辑器内核-vscode\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":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill launch",{"tool":39,"command":40},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill launch",{"tool":42,"command":43},"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\u002F.agents\u002Fskills\u002Flaunch\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"scripts\u002Flaunch.sh","SCRIPT","脚本",10348,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-IDE-编辑器内核\u002FYYC3-IDE-编辑器内核-vscode\u002F.agents\u002Fskills\u002Flaunch\u002Fscripts\u002Flaunch.sh",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fmonaco-paste.sh",7508,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-IDE-编辑器内核\u002FYYC3-IDE-编辑器内核-vscode\u002F.agents\u002Fskills\u002Flaunch\u002Fscripts\u002Fmonaco-paste.sh",[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"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":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"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":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"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":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"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":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"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":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"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",[],[]]