Skip to content
Back to skills

Desktop Check

ASecurity

Look at a RustCode desktop UI change in the headless mock window (bun run mock-window), drive it with real input, stage states, screenshot it in the user's theme, test an engine change in the app, install a local build, or share a mock build over a Cloudflare quick tunnel.

  • 18 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentspythonrustgo

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add LHagfoss/rustcode --skill desktop-check --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Desktop Check?

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

Security grade badge for Desktop Check
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lhagfoss-desktop-check/badge)](https://www.skillsdirectory.com/skills/lhagfoss-desktop-check)

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-check
description: Look at a RustCode desktop UI change in the headless mock window (bun run mock-window), drive it with real input, stage states, screenshot it in the user's theme, test an engine change in the app, install a local build, or share a mock build over a Cloudflare quick tunnel.
---

# Checking desktop app behavior

## The mock window

Look at UI changes in the mock: no engine and no model turns. In
`apps/desktop`, `bun run mock-window open` opens a tab and starts a mock dev
server (`VITE_TRANSPORT=mock`) for the current checkout.

- Checkouts share one headless Chrome at 1512×945 and native scale (2x).
  Reopening from the same checkout reuses its tab and server, so threads in
  one checkout share a tab and concurrent threads should check from separate
  checkouts.
- It is headless on purpose: a visible window steals the user's focus, so
  agents never pass `open --show` (that is for a person who wants to watch).
  An open window is reused in whichever mode it started.
- Keep it open for the whole check and `bun run mock-window close` (closes
  that checkout's tab and server) only when finished. Do not open browser
  panes in the user's terminal.

## Driving it

Use real input, so the check exercises what the user does:

- `click "<css>"` (`--at <x>,<y>` for a partly covered element),
  `type "<text>"`, `press <key>`, `hover "<css>" [--wait <ms>]` (prints what
  opened), `drag "<from css>" "<to css>" [--steps <n>]`,
  `scroll "<css>" <dy>`, `dblclick "<css>"` and `move <x>,<y>` (off an
  element, to dismiss it).
- `eval "<js>"` evaluates in the page (top-level `await` works).
- `screenshot <file.png>` saves a PNG; `--selector "<css>"` crops it to that
  element and `--clip <x>,<y>,<w>,<h>` to a viewport rectangle, so no image
  tool is needed. A bare file name saves under `$TMPDIR/rustcode-screenshots`
  and the command prints the full path to embed. Keep screenshots there or in
  the worktree: the app shows a reply's picture inline only from the thread's
  checkouts and the temporary folders, so `~/code/<anything>-preview/` shows
  as a "Show image" button, and the command warns when you pick such a path.

## Theme and state

- Show a UI change in the theme the user runs: read `theme` from
  `~/.config/rustcode/config.toml`, then `mode` under `[desktop]` in
  `~/.config/rustcode/themes/<theme>.toml`; with no file or no mode, use
  dark. Set it before the screenshot
  (`(await import("/src/state/viewActions.ts")).setTheme("dark")`, or
  `"light"`) and wait about 3 seconds for the theme's fade.
- To stage a state the mock does not reach (a finished thread, an update in
  progress, a Settings page), evaluate `await import("/src/state/store.ts")`
  (or `updates.ts`) and set state on it. `?updatePreview` stages the update
  row.
- The window is long-lived: restart the server (`close`, then `open`) for a
  fresh check. After an edit, HMR serves the module under a `?t=` URL and the
  import returns a second, empty copy.

## Engine changes in the app

- Rebuild the `rc` binary with `cargo build -p rustcode-cli --bin rc`, then
  run `bun tauri dev` (it uses `target/debug/rc`). A plain `cargo build` does
  not rebuild that binary, and the app then talks to the old engine.
- To install a local build over the user's app, replace
  `/Applications/RustCode.app` in place and keep no copy of the old one in
  `/Applications`: three `RustCode-<version>-backup.app` copies once made the
  app take four times its space. A rollback is a release download away.
- Never copy `credentials.json` or `provider-accounts.json` into a scratch
  `RUSTCODE_CONFIG_DIR`. A token refresh there rotates the OpenAI refresh
  token, and the user's real sign-in then fails with "OpenAI token request
  failed (HTTP 400)" (#2765). For live model turns, ask the user first.

## A public link to a mock build

Only when the user asks for a live or public link. Put a static mock build
behind a Cloudflare quick tunnel. Do not tunnel the dev server: it serves the
source tree and refuses unknown hosts. Do not tunnel the engine, the gateway
or anything with the user's data. In `apps/desktop`, with `DIR` a scratch
directory outside the worktree:

```sh
VITE_TRANSPORT=mock bunx vite build --emptyOutDir --outDir "$DIR/site"
python3 -I -m http.server 8787 --bind 127.0.0.1 --directory "$DIR/site"  # background
cloudflared tunnel --no-autoupdate --url http://127.0.0.1:8787           # background; prints https://<words>.trycloudflare.com
```

Check the URL with `curl` before handing it over, and say it shows mock
data. To update it, run the build again into the same directory: the URL
stays the same. Stop both processes when the user is done or the thread is
settled. If `cloudflared` is missing, ask before installing it.

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.