Scroll AI Now

Agent skill

Drive desktop app

Drive and verify an Electron or Tauri desktop app from the inside, including the main‑process and Rust IPC calls a browser tool cannot see. Use when a...

By reticlehq · reticlehq/reticle · Apache License 2.0 · ★ 1,336 · 86 lines

New to this? An agent skill is a file of instructions your AI assistant follows for one job. The text above is written for the assistant. How to use a skill

What it does

Drive desktop app is an agent skill from reticlehq/reticle, a GitHub repo with 1,340 stars.
In short, it gives your assistant a fixed routine for one kind of job.
The file is 86 lines long and is set out in parts such as “Electron: two lines, none in your app code”, “Tauri: the CSP step is required and its failure is silent”, “Verify” and “What a missing observer looks like”.
It has 4 code examples your assistant can follow.

When to use it

Reach for it when you do this job often and want the same good result each time.
Everything it needs is in this one file.
It does not ask for special tools.

Safety check

Our checker read all 86 lines before we listed it.
It found no attack techniques, no hidden text and no steps that switch off your assistant's safety or send your data away.
It flagged nothing else to watch for.
The text links to 7 outside sites.
It is shared under the Apache‑2.0 license.
Still read it before you use it, like any instructions you give your AI.

Open in the appOriginal on GitHub

What is inside

How to use it

Read the full guide to using an agent skill

Want your own? How to write an agent skill that works

The full skill

---
name: drive-desktop-app
description: Drive and verify an Electron or Tauri desktop app from the inside, including the main-process and Rust IPC calls a browser tool cannot see. Use when a desktop app needs testing, when a feature works in the browser but not in the packaged app, when an IPC or invoke call needs proving, when a desktop screenshot or visual diff is wanted, or when you need a headless run of a desktop UI in CI.
license: Apache-2.0
metadata:
  version: 3.11.1
  homepage: https://www.reticle.sh
  repository: https://github.com/reticlehq/reticle
---

# Drive a desktop app and prove what happened

A desktop app reaches its backend over **IPC, not HTTP**. Patching `fetch`/`XHR` cannot see that, so a browser-shaped tool is blind to every backend call the app makes: the network log reads empty, an action has no in-flight request to settle on, and asserting on the network is vacuously true. That is a false green by construction.

**Reticle** observes the renderer _and_ the IPC boundary, so a desktop verdict means what a web one does. Not set up? Follow the [`reticle`](https://github.com/reticlehq/reticle/blob/main/skills/reticle/SKILL.md) skill: it installs Reticle, asks the user before `init` changes the app's files, and proves one flow.

## Electron: two lines, none in your app code

```ts
// vite.config.ts — desktop:true lets connect() start in a packaged renderer (NODE_ENV=production).
// A default (production-mode) `vite build` ships no Reticle code; to drive a packaged
// renderer with no dev server, build it with `vite build --mode development`
export default defineConfig({
  base: './', // file:// needs relative asset paths
  plugins: [react(), reticle({ desktop: true })],
});
```

```js
// electron/preload.cjs — FIRST line. This is what makes main-process IPC visible.
require('@reticlehq/electron/preload');
```

It **must** be in the preload and it must be first. `contextBridge.exposeInMainWorld` hands the renderer a deeply frozen object, so nothing in the page can instrument it afterwards. The preload is the last point where `ipcRenderer.invoke` is still writable, and the shim has to run before your preload captures its own reference.

A sandboxed preload cannot resolve `node_modules`, so the bare `require` fails. Either bundle the preload (electron-vite and Forge do by default) or set `sandbox: false`.

## Tauri: the CSP step is required and its failure is silent

The frontend is the same as any web app. The part people miss is that Tauri's default CSP blocks the bridge WebSocket before it opens, so **the app runs perfectly and simply never connects**:

```json
{
  "app": {
    "security": {
      "csp": "default-src 'self' ipc: http://ipc.localhost; connect-src 'self' ipc: http://ipc.localhost ws://localhost:4400 ws://127.0.0.1:4400"
    }
  }
}
```

Keep `ipc: http://ipc.localhost`: Tauri v2 needs it for `invoke` itself. Dev-only; drop the `ws://` entries from your release config.

IPC observation needs **nothing** on the Rust side: an `invoke('load_todos')` already reaches Reticle as `ipc://load_todos`. The [`reticle-tauri`](https://crates.io/crates/reticle-tauri) crate is only for screenshots and headless, and it is versioned independently of the npm packages.

Also: **use a hash router.** A packaged renderer is served from `file://`, where history-based routing does not resolve.

## Verify

Same loop as the web, with IPC in the predicates:

```
reticle_act_and_wait({ sessionId, ref, action: "click", until: { kind: "allOf", predicates: [
  { kind: "net",     urlContains: "ipc://todos:archive", status: 200 },
  { kind: "element", query: { testid: "..." } },
  { kind: "console", level: "error", absent: true },
]}})
```

**IPC has no status code.** `200`/`500` are synthetic, mapped from whether the command succeeded, precisely so the same predicates keep working. On Tauri you will see `status: 500` next to `statusText: "OK"`. That is not a bug: the transport answered fine and the `500` is the command's own verdict. `ok` is authoritative.

`reticle_look { action: "state" }` reads the live store exactly as on the web. `reticle_screenshot` and `reticle_visual_diff` work once the platform's capture step is wired. Electron needs nothing extra; Tauri needs the crate. Headless on Tauri is `RETICLE_HEADLESS=1`, and screenshots keep working because the capture renders the webview rather than the screen.

## What a missing observer looks like

A missing Electron preload is **declared, not silent**: verdicts come back with `coverage: partial` naming the line you did not add, instead of reading clean over a blind spot. If you see that, add the preload line before trusting anything.

If IPC calls never appear while the app works fine: on Electron, the shim's `require` is not first. On Tauri, `invoke` from `@tauri-apps/api/core` is observed, but a hand-rolled `postMessage` protocol is not.

## Honesty

`unknown` is not a pass on the desktop either. And do not weaken an IPC assertion to make a red verdict green: a desktop false green is the exact failure this wiring exists to remove.

---

Full desktop reference: `curl https://docs.reticle.sh/desktop.md`. Everything else: `curl https://docs.reticle.sh/llms.txt`.

Copyright 2026 Reticle Labs.
Published under the Apache License 2.0, which you can read in full there.
Shown as published on GitHub, with credit and a link to the original.
Read it before you use it.

Are you the author?

This skill passed our automated safety check.
Show it in your README with the badge below.
It links readers back to this page. How the badge works

Featured on Scroll AI Now, passed its automated safety check

Markdown
[![Featured on Scroll AI Now, passed its automated safety check](https://scrollainow.com/badge/safety-checked.svg)](https://scrollainow.com/skills/drive-desktop-app/)
HTML
<a href="https://scrollainow.com/skills/drive-desktop-app/"><img src="https://scrollainow.com/badge/safety-checked.svg" alt="Featured on Scroll AI Now, passed its automated safety check" height="28"></a>

More skills

All agent skills

Try it in your browser

Today's AI news, one card per swipe.
Free to start.

Open the web app