Agent skill

Electron

by ericrisco in ericrisco/rsc-harness

A skill your agent uses when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down…

MITAuto-check passedFrontend & Design

Install Electron

skills CLI
$ npx skills add ericrisco/rsc-harness --skill electron -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ericrisco/rsc-harness electron --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ericrisco/rsc-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/electron .claude/skills/electron && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
electron
GitHub stars
156
Token cost
~2.9k tokens
SKILL.md length
1,022 words
Files
6 (incl. scripts, references)
Skills in repo
229
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down…

  • Shipping a cross-platform Electron desktop app — main/renderer/preload process model
  • SKILL.md covers The mental model — three…, Start right, The security baseline and Typed IPC the right way, plus 4 more sections
  • Runs Shell scripts from its folder; calls npm
  • Typed contextBridge IPC

What it does

Electron is an agent skill from ericrisco/rsc-harness. Use when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down nodeIntegration/contextIsolation/sandbox/CSP, or packaging with signing and auto-update. NOT a Rust-backed shell on the native webview (that is tauri), nor the web UI inside it (that is react).

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `evals/README.md`, `evals/cases.yaml` and `references/packaging-and-updates.md`).

It sits in Frontend & Design, covering Frontend development. It works with React, Tauri and Rust. The repository describes itself as: Your agent invents things because it has no memory, and can't touch your database because it has no arms. rsc is the meta-harness that gives it both, plus the trade to know the… The licence is MIT.

When your agent uses it

  • Shipping a cross-platform Electron desktop app — main/renderer/preload process model
  • Typed contextBridge IPC
  • Locking down nodeIntegration/contextIsolation/sandbox/CSP
  • Packaging with signing and auto-update

Example prompts

  • “/electron”

Requirements

  • Node.js
  • A Bash shell

What it can do on your machine

Read from SKILL.md and the folder at commit 92fde8f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Electron loads about 2.9k tokens when it runs, and up to ~5.5k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 1,022 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ericrisco/rsc-harness at commit 92fde8f, republished under its MIT licence (© ericrisco). 1,022 words, ~2,917 tokens.

Download SKILL.mdSave it as .claude/skills/electron/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
electron
description
Use when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down nodeIntegration/contextIsolation/sandbox/CSP, or packaging with signing and auto-update. NOT a Rust-backed shell on the native webview (that is tauri), nor the web UI inside it (that is react).
tags
electron, desktop, ipc, security, packaging, auto-update, code-signing
recommends
tauri, react, nodejs, github-actions, secure-coding
origin
risco

Electron — desktop shell, typed IPC, hardening, signing

This skill owns the desktop shell: process model, IPC, security, packaging, signing, auto-update. It does not own the web UI inside the window (../react/SKILL.md), the Node backend logic, or the CI runner matrix.

The mental model — three processes, one rule

An Electron app is three kinds of process. Code lives in exactly one; putting it in the wrong one is the root cause of most security holes.

ProcessRuntimeTrustOne perDoes
mainNode.js, full OS APItrustedappwindows, menus, tray, dialogs, fs, child procs
rendererChromium, no Nodeuntrustedwindowyour web UI; can run attacker JS if you load remote content
preloadisolated world, runs before page JSsemi-trustedwindowthe only bridge: contextBridge exposes a tiny API

The governing rule: the renderer is untrusted, the main process holds all privilege, and the preload is the only sanctioned bridge between them. Renderer-to-OS escalation is the dominant failure mode in real Electron apps, so everything below is a corollary.

Start right

Scaffold with Electron Forge (@electron/forge) — first-party, all-in-one (scaffold → package → make → publish), and it gets new Electron features first.

bash
npm init electron-app@latest my-app -- --template=vite-typescript
cd my-app && npm start

Pin to a supported major. Electron ships a new major every 8 weeks (tracking Chromium) and supports only the latest 3 majors. As of June 2026 the stable line is Electron 42 (Chromium M148, Node 24); 43 lands 2026-06-30. Shipping on an EOL major means unpatched Chromium CVEs — check package.json and bump if behind.

Project layout keeps the boundary visible:

text
src/
  main.ts       # main process — owns everything privileged
  preload.ts    # the bridge — contextBridge only
  renderer/     # your web UI (untrusted)
  ipc/types.ts  # IPC contract shared by main + preload

The security baseline

Modern Electron defaults are already secure (nodeIntegration:false, contextIsolation:true, sandbox:true since Electron 20). Assert them explicitly anyway so a careless edit can't silently weaken the window:

ts
const win = new BrowserWindow({
  webPreferences: {
    preload: path.join(__dirname, 'preload.js'),
    nodeIntegration: false,        // renderer gets NO require/process — never flip true
    contextIsolation: true,        // preload + page run in separate JS worlds
    sandbox: true,                 // renderer in an OS sandbox; preload uses a limited API
    webSecurity: true,             // keep same-origin policy; never disable to "fix CORS"
    allowRunningInsecureContent: false, // no mixed http content on https pages
  },
});

One why per flag: each removes a documented way for renderer-side script to reach Node or the OS. Flipping any of them to the insecure value is what verify.sh fails on.

CSP via response headers, not a <meta> tag — meta CSP can't restrict the initial document and is trivially bypassed for some directives. Set it in the main process:

ts
session.defaultSession.webRequest.onHeadersReceived((details, cb) => {
  cb({ responseHeaders: { ...details.responseHeaders,
    'Content-Security-Policy': ["default-src 'self'; script-src 'self'"] } });
});

Lock navigation. A renderer that can navigate to attacker content gets the renderer's privileges. Deny unexpected navigation and block new windows:

ts
app.on('web-contents-created', (_e, contents) => {
  contents.on('will-navigate', (e, url) => {
    if (new URL(url).origin !== 'https://app.local') e.preventDefault();
  });
  contents.setWindowOpenHandler(() => ({ action: 'deny' })); // no tab-jacking
});

Open real external links deliberately, after allow-listing the protocol:

ts
function openExternal(url: string) {
  const { protocol } = new URL(url);
  if (protocol === 'https:' || protocol === 'mailto:') shell.openExternal(url);
}

Which branch are you on?

  • Local-only UI (you bundle the HTML/JS): CSP + sandbox:true + nav lockdown is enough.
  • Loads any remote/third-party content: also add Electron Fuses (disable run-as-node, encrypt cookies, ASAR integrity) and treat every embedded origin as hostile.

Fuses and the full hardened example live in references/security-and-ipc.md.

Typed IPC the right way

IPC is the seam between untrusted renderer and privileged main. Get it wrong and you've handed the OS to whatever script runs in the page.

Never expose ipcRenderer (or any of its methods) across the bridge. Sending the whole module now yields an empty object on the other side — a deliberate footgun removal — and exposing its methods lets the page call any channel with any payload.

ts
// Bad — preload.ts: hands the renderer a universal IPC weapon (also: empty object now)
contextBridge.exposeInMainWorld('api', ipcRenderer);
ts
// Good — preload.ts: ONE function per channel, each wrapping a specific call
import { contextBridge, ipcRenderer } from 'electron';
contextBridge.exposeInMainWorld('api', {
  readConfig: () => ipcRenderer.invoke('config:read'),
  saveNote: (text: string) => ipcRenderer.invoke('note:save', text),
  onSync: (cb: () => void) => ipcRenderer.on('sync:done', cb), // events: send/on
});

Prefer ipcMain.handle + ipcRenderer.invoke (request/response, returns a Promise) for anything that returns data. Reserve send/on for fire-and-forget events (progress, push notifications). Validate every argument in main — a renderer message is an HTTP request from an untrusted client:

ts
ipcMain.handle('note:save', (_e, text: unknown) => {
  if (typeof text !== 'string' || text.length > 10_000) throw new Error('bad input');
  return saveNote(text); // never path.join(userInput) or eval it
});

Share the contract as TypeScript types across both sides (ipc/types.ts) so a channel rename breaks the build, not production. Full main + preload + window.api d.ts example: references/security-and-ipc.md.

Native capabilities — renderer asks, main acts

The renderer can't (and must not) touch the OS directly. When the UI needs a native menu, tray icon, file dialog, system notification, custom protocol:// handler, or a child_process, the renderer invokes an IPC channel and the main process performs the action and returns a result. Same one-function-per-channel discipline as above.

For embedding web content in a region of a window, use WebContentsView — BrowserView is deprecated since Electron 30. They share shape (both take webPreferences; setBounds/getBounds/webContents carry over), so migration is mechanical.

Show full SKILL.md (388 more words)Show less

Packaging, signing, auto-update

Two real toolchains:

NeedUse
New app, first-party alignment, features firstElectron Forge (ASAR integrity, universal macOS, scaffold→make→publish)
Differential/staged updates, multi-provider (GitHub/S3), richer configelectron-builder + electron-updater

Code signing is a prerequisite for auto-update, not optional polish. macOS auto-update (Squirrel.Mac) refuses to update an app that isn't signed and notarized; Windows updates need an Authenticode-signed installer. So the order is always: sign → notarize → publish → auto-update. Full Forge and builder configs, notarytool steps, Windows Authenticode, and electron-updater + GitHub Releases wiring: references/packaging-and-updates.md.

The CI matrix that runs these builds across three OSes is github-actions' job; this skill defines what to build and sign.

Anti-patterns and migration smells

Anti-patternWhy it's wrongDo instead
nodeIntegration: truePage JS gets require('fs'); any XSS becomes OS-level RCEfalse; move the capability behind IPC
contextIsolation: falsePage can rewrite the preload's globalstrue (the default)
sandbox: false without a reasonDrops the OS sandbox around the renderertrue; only relax for a measured, isolated need
exposeInMainWorld('api', ipcRenderer) or its methodsUniversal IPC weapon — any channel, any payload (and an empty object now)One typed function per channel
No arg validation in ipcMain.handleRenderer is an untrusted client; you trust its inputType-check + bound every arg before acting
webSecurity: false to "fix CORS"Disables same-origin policy app-wideKeep true; proxy/handle CORS in main
CSP only in a <meta> tagDoesn't cover the initial document; bypassableSet CSP in onHeadersReceived
Loading a remote URL into a Node-enabled windowRemote site runs with your app's privilegeBundle UI locally; sandbox + nav lockdown for remote
@electron/remote importSync main-object access = renderer→main RCEReplace with explicit ipcMain.handle channels
new BrowserView(...)Deprecated since Electron 30, will be removednew WebContentsView(...)
Auto-update with an unsigned/un-notarized buildSquirrel.Mac silently refuses; no updates shipSign + notarize (mac), Authenticode (win) first
Shipping on an EOL Electron majorUnpatched Chromium CVEs in your users' handsStay within the latest 3 majors
Heavy CPU work in the main processBlocks the event loop → the whole UI freezesutilityProcess/worker, or do it in the renderer

Verify

Run scripts/verify.sh /path/to/your-electron-project to grep a target for insecure patterns (nodeIntegration: true, contextIsolation: false, sandbox: false, @electron/remote, new BrowserView, exposeInMainWorld(..., ipcRenderer)). It's read-only and exits non-zero on any finding. With no argument it self-checks this skill's own example snippets for the secure baseline. See references/security-and-ipc.md for the full checklist.

© ericrisco, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in skills/electron of ericrisco/rsc-harness.

  • SKILL.md
  • evals/README.md
  • evals/cases.yaml
  • references/packaging-and-updates.md
  • references/security-and-ipc.md
  • scripts/verify.sh

Open the folder on GitHubat commit 92fde8f

Compare with similar skills

Electron next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Electron compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Electron this skillericrisco/rsc-harness156—~2.9kAutomated safety check: PassMIT
Cursor BYOK Frontend Guideleookun/cursor-byok3.2k—~1.9kAutomated safety check: PassMIT
Reactflow Workflowveloxbase/veloxdb646—~897Automated safety check: PassMIT
I18nhuoshen80/ReinaManager693—~177Automated safety check: PassAGPL-3.0
Frontend Testhuoshen80/ReinaManager693—~180Automated safety check: PassAGPL-3.0
NEAR dApp Builderinternet-court/internet-court-skill6.4k1 repos~684Automated safety check: PassCustom licence

Similar skills

  • Cursor BYOK Frontend Guide

    leookun/cursor-byok

    Sets the rules for building the Cursor BYOK desktop app's React and Tauri frontend, especially its HTTP boundary and component state architecture.

    3.2k GitHub stars~1.9k tokensUpdated 9 days ago
    Frontend & DesignAuto-check passed
  • Reactflow Workflow

    veloxbase/veloxdb

    Build and harden React Flow diagram surfaces in VeloxDB using @xyflow/react patterns (nodes, edges, viewport, controls, interactions, performance).

    646 GitHub stars~897 tokensUpdated 7 days ago
    Frontend & DesignAuto-check passed
  • I18n

    huoshen80/ReinaManager

    使用 i18next-cli 检查、同步和整理本项目的国际化资源。涉及新增、修改、删除翻译键或国际化字符串,以及修复缺失翻译时使用。

    693 GitHub stars~177 tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • Frontend Test

    huoshen80/ReinaManager

    在 ReinaManager 项目内进行隔离前端验证,复用测试目录并回收测试资源。需要模拟批量数据、延迟、失败或交互回归时使用。

    693 GitHub stars~180 tokensUpdated 4 days ago
    Frontend & DesignAuto-check passed
  • NEAR dApp Builder

    internet-court/internet-court-skill

    Scaffolds new NEAR dApps with create-near-app or adds NEAR wallet sign-in, contract calls and transaction signing to an existing React or plain JavaScript app.

    6.4k GitHub starsUsed in 1 repo~684 tokens
    Frontend & DesignAuto-check passed
  • Breeze Helper

    LanternOps/breeze

    Quick reference for the Breeze Helper Tauri desktop app — architecture, Rust backend commands, React frontend, config files, IPC with the Go agent, helper chat API routes, tool approval flow, and…

    130 GitHub stars~3.2k tokensUpdated today
    Frontend & DesignAuto-check passed

More from ericrisco/rsc-harness

All 229 skills in this repo
  • Ab Testing

    ericrisco/rsc-harness

    A skill your agent uses when designing or analyzing a controlled experiment — falsifiable hypothesis, sample size from an MDE, reading significance/CI/power, CUPED, or rescuing tests that won't go…

    156 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Accessibility

    ericrisco/rsc-harness

    A skill your agent uses when making a web UI conform to WCAG 2.2 Level AA — axe-core or Lighthouse a11y violations, keyboard operability, focus management, ARIA roles/names/live regions, contrast…

    156 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Ads

    ericrisco/rsc-harness

    A skill your agent uses when running or fixing paid acquisition on Google or Meta — campaign structure (Performance Max, Demand Gen, Search, Advantage+), platform-fit creative, budget/scaling rules…

    156 GitHub stars~2.2k tokensUpdated yesterday
    Auto-check passed
  • Agent Eval

    ericrisco/rsc-harness

    A skill your agent uses when measuring whether an LLM or agent system actually got better and gating merges on it: golden sets, fixing an inflated LLM-as-judge, scoring RAG (faithfulness, contextual…

    156 GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • AI Media

    ericrisco/rsc-harness

    A skill your agent uses when a creative goal must become a finished media file: pick and order generative-media models per modality — AI voiceover, image-to-video clips, score — then glue them with…

    156 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Analytics

    ericrisco/rsc-harness

    A skill your agent uses when instrumenting product or web analytics — GA4/PostHog SDK wiring, event taxonomy, funnels, double-counted events, consent gating, PII scrubbing.

    156 GitHub stars~2.8k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Electron

What does Electron do?

A skill your agent uses when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down…. Electron is an agent skill from ericrisco/rsc-harness. Use when building, hardening, or shipping a cross-platform Electron desktop app — main/renderer/preload process model, typed contextBridge IPC, locking down nodeIntegration/contextIsolation/sandbox/CSP, or packaging with signing and auto-update.

When should I use Electron?

Electron fits situations like: shipping a cross-platform Electron desktop app — main/renderer/preload process model; typed contextBridge IPC; locking down nodeIntegration/contextIsolation/sandbox/CSP; packaging with signing and auto-update.

How do I install Electron in Claude Code?

Run `npx skills add ericrisco/rsc-harness --skill electron -a claude-code`. Or copy the skill folder (skills/electron in ericrisco/rsc-harness) into .claude/skills/electron in your project. Claude Code loads it when a task matches its description.

How do I install Electron in Codex?

Run `npx skills add ericrisco/rsc-harness --skill electron -a codex`. Or copy the skill folder (skills/electron in ericrisco/rsc-harness) into .agents/skills/electron in your project. Codex loads it when a task matches its description.

Can I use Electron in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ericrisco/rsc-harness --skill electron -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/electron, .gemini/skills/electron, .github/skills/electron and .opencode/skills/electron in your project.

What does Electron need to run?

Going by SKILL.md and its folder, Electron needs a shell for the scripts in its folder and the command-line tools its instructions call (npm). Our summary lists: Node.js; A Bash shell.

Does Electron access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Electron safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Electron use?

Electron is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Electron use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.6k tokens, read only when the agent opens those files.

What are the alternatives to Electron?

Skills that share tags, products or a category with Electron: Cursor BYOK Frontend Guide (leookun/cursor-byok, 3.2k stars), Reactflow Workflow (veloxbase/veloxdb, 646 stars), I18n (huoshen80/ReinaManager, 693 stars) and Frontend Test (huoshen80/ReinaManager, 693 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Electron?

ericrisco (a GitHub user) maintains it in ericrisco/rsc-harness, which has 156 GitHub stars. The repository holds 229 skills in this directory. The repository was last updated on October 6, 2026.

Source: ericrisco/rsc-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.