Skip to content
Back to skills

Desktop Screenshots

ASecurity

Capture screenshots and video of Robin's real desktop shell (Electron) in the sandbox, against the local mock backend, for PR evidence. Use for any UI change that shows in the desktop app, instead of a browser with a stubbed `window.openSweDesktop`.

  • 11,287 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentsgoshellbashsqlnodedockergitapibackend

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add langchain-ai/open-swe --skill desktop-screenshots --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Desktop Screenshots?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Desktop Screenshots
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/langchain-ai-desktop-screenshots/badge)](https://www.skillsdirectory.com/skills/langchain-ai-desktop-screenshots)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: desktop-screenshots
description: Capture screenshots and video of Robin's real desktop shell (Electron) in the sandbox, against the local mock backend, for PR evidence. Use for any UI change that shows in the desktop app, instead of a browser with a stubbed `window.openSweDesktop`.
---

# Desktop screenshots

A browser page with `window.openSweDesktop` stubbed is a mock: it has no native tab strip, title bar, window size or pointer.
Capture desktop-facing changes in the real shell (`desktop/`) under Xvfb, signed in to the mock backend, with [`scripts/desktop.cjs`](scripts/desktop.cjs).
Paths below are relative to `open-swe/`.

## Set up once per sandbox

The global image preinstalls the desktop's dependencies, its Electron binary, `xdotool` and Inter; on an older image, install what is missing:

```bash
pnpm install --frozen-lockfile --filter 'open-swe-desktop...'
(cd desktop/node_modules/electron && node install.js)
apt-get install -y --no-install-recommends xdotool fonts-inter
```

Build the shell: `pnpm --dir desktop run build`.

Start the backend with `background_execute`, never in the foreground:

```bash
docker run -d -p 55432:5432 -e POSTGRES_PASSWORD=pw postgres:16
POSTGRES_URI=postgresql://postgres:pw@localhost:55432/postgres bash tests/e2e/dev-mock.sh
```

The UI comes up on `http://127.0.0.1:3000`; the first page load compiles slowly.
Restarting `dev-mock.sh` loses the mock threads' message content, so seed again after a restart.

## Build the base and PR archives

The shell loads the dashboard from a `ui.json.gz` archive, so build one per side and copy each out before the next build overwrites it:

```bash
pnpm --filter open-swe-dashboard run build && cp ui/.output/desktop/ui.json.gz /tmp/cap/base.ui.json.gz
git apply /tmp/pr.diff   # only the PR's diff, onto current main
pnpm --filter open-swe-dashboard run build && cp ui/.output/desktop/ui.json.gz /tmp/cap/pr.ui.json.gz
```

## Capture

```bash
node .agents/skills/desktop-screenshots/scripts/desktop.cjs seed "Write a haiku about sidebars"
node .agents/skills/desktop-screenshots/scripts/desktop.cjs still /tmp/cap/pr.ui.json.gz /tmp/cap/pr.png /agents 1280x800
```

`seed` types a prompt into the composer once it is a live editor (`[data-testid=composer-editor][data-lexical-editor="true"]`) and prints the new thread's id; `getByPlaceholder().fill()` does not reach the Lexical editor.
`still` takes an optional fifth argument, a selector to wait for before the shot, such as `'[data-testid="user-message"]'` on a thread.
`still` prints the platform fonts of the first text on the page; expect `Inter`, not `Liberation Sans`.

For hover states and video, require the module from a script:

```js
const { Desktop } = require("/workspace/langchainplus/open-swe/.agents/skills/desktop-screenshots/scripts/desktop.cjs");
const desktop = await Desktop.launch("/tmp/cap/pr.ui.json.gz", { width: 720, height: 820 });
await desktop.goto(`/agents/${threadId}`, '[data-testid="user-message"]'); // wait for an element the shot needs
await desktop.newTab();                 // the tab strip shows only with more than one tab
const clip = await desktop.record("/tmp/cap/pr.mp4");
await desktop.move(2, 300);             // the real X pointer, in content coordinates
await desktop.page.waitForTimeout(800);
await clip.stop();
await desktop.grab("/tmp/cap/pr.png");
await desktop.close();
```

`Desktop.launch` starts Xvfb on `:99` if needed, sets the `osw_session` cookie from `/control/login?login=alice` in `session.defaultSession`, and sets dark theme through `localStorage['open-swe-theme']`.
`goto` waits for a selector (by default a `main` that is not the loading skeleton), because the dashboard keeps an invalidation stream open and `networkidle` may never arrive.
The window is a `BaseWindow`, so size it with `setSize` (`setContentSize`), not `BrowserWindow` APIs.
`desktop.page` stays the first app tab after `newTab`; Playwright locators on it still work for clicks, but use `move` for anything that depends on the pointer, such as hover and edge peeks.

Use the same size, route, data and pointer path for base and PR, and convert each clip to a GIF for the PR description as the screenshot guidance describes.

## What the captures show

They render on Linux: Inter stands in for the macOS system font (SF Pro cannot be redistributed), and there are no traffic lights, only the 90px gap left for them at the top left.
Say so in the caption.

## Gotchas

- Do not `pkill -f <pattern>` inside a `background_execute` command whose own command line contains that pattern: it kills itself.
  Stop the earlier task with `background_task` instead.
- One capture launches one shell; close it before the next launch, since each launch gets fresh state.

Files in this skill

  • SKILL.md4.6 KB
  • scripts/desktop.cjs8.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.