test-electron-app

test-electron-app is a skill for Claude Code from PostHog/posthog-foss. It costs 112 tokens per session (3,038 once invoked), scanned A, original, MIT.

A testing guide for driving a real PostHog desktop app through Chrome DevTools Protocol, including its live services and data.

In plain words
What is it for?
Use it to connect to the app, inspect its accessibility tree and network requests, interact with live data, and test changes against a local Django stack.
Why use it?
It helps verify desktop changes against the actual running application instead of relying only on mocked or isolated tests.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Good fit Use it to connect to the app, inspect its accessibility tree and…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/posthog/posthog-foss/test-electron-app
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PostHog/posthog-foss --skill test-electron-app
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-electron-app

README.md
[![agentmods](https://agentmods.dev/badge/skills/posthog/posthog-foss/test-electron-app.svg)](https://agentmods.dev/skills/posthog/posthog-foss/test-electron-app)
Your own site
<a href="https://agentmods.dev/skills/posthog/posthog-foss/test-electron-app"><img src="https://agentmods.dev/badge/skills/posthog/posthog-foss/test-electron-app.svg" alt="Measured on agentmods" height="20"></a>
Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,038 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00112 $0.03038
Opus 5 $0.00056 $0.01519
Sonnet 5 $0.00022 $0.00608
Haiku 4.5 $0.00011 $0.00304

Measured 3d ago against content hash 693ff90e49c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

test-electron-app scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

until curl -s localhost:9222/json/version >/dev/null; do sleep 1; done
products/desktop/.claude/skills/test-electron-app/SKILL.md · 239 lines

How it starts

The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test the real PostHog Electron app

Drive the actual running app over the Chrome DevTools Protocol with agent-browser. The dev app already launches with --remote-debugging-port=9222 (see apps/code/package.json), so an agent can connect, snapshot the UI, interact, and (only when asked) screenshot the live app.

This exercises real state: live tRPC, workspace-server, GitHub/Slack and whatever profile is signed into ~/.posthog-code. Pick the right surface:

Goal Tool
Verify or screenshot a change in the real app, live data this skill (agent-browser + CDP :9222)
Regression coverage in CI Playwright E2E (apps/code/tests/e2e/)

For a live backend-to-desktop test, read references/local-django-stack.md before starting services.

Prerequisites

npm i -g agent-browser && agent-browser install   # once

The app must be running with remote debugging. pnpm dev (or pnpm dev:code) already passes --remote-debugging-port=9222. Preflight + connect:

pnpm app:cdp        # checks agent-browser + that the app is up on :9222, then connects

If it reports the app is not reachable, the app isn't running. Start it, then retry pnpm app:cdp.

Launching the app yourself (background / no TTY)

Do not use pnpm dev from a non-interactive shell. It builds deps then hands off to the phrocs TUI process-multiplexer, which aborts without a controlling terminal (bubbletea: could not open TTY: /dev/tty: device not configured). An agent in a background shell has no TTY, so pnpm dev cannot launch it headlessly.

Build the workspace deps (TTY-safe, the same step pnpm dev runs first), then launch only the Electron app with its stdin held open:

pnpm build:deps                        # turbo build of @posthog/code deps
tail -f /dev/null | pnpm dev:code      # run in the background; leave it running

pnpm dev:code is pnpm --filter code start, i.e. electron-vite dev --watch — just the app, no phrocs TUI; it watches and rebuilds main/preload and hot-reloads the renderer (fine for screenshotting/interacting). The CDP port (:9222) is opened by the app itself in dev (the remote-debugging-port switch in apps/code/src/main/bootstrap.ts), not by a CLI flag.

Read the full file on GitHub · 239 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 239 lines · 112 tokens per session scan A 693ff90e49c2

Subscribe to this mod's changes

test-electron-app is a skill published in the GitHub repository PostHog/posthog-foss (714 stars, last pushed today), licensed MIT. It adds 112 tokens to every session and 3,038 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.