jwynia avatar

Electron Best Practices

This is a comprehensive reference for building production Electron apps with React, covering the security fundamentals that keep XSS from escalating to remote code execution. It walks through context isolation, sandbox mode, and type-safe IPC patterns using the invoke/handle model, plus practical guidance on electron-vite for dev tooling and Electron Forge for packaging with code signing. The anti-patterns table alone is worth having on hand, calling out common mistakes like exposing ipcRenderer directly or skipping CSP headers. If you're generating Electron code or setting up a desktop app project, this gives you the modern security-first architecture and avoids the legacy patterns that still float around in outdated tutorials.

skills.sh installs
863
GitHub stars
182
last updated
Aug 21, 2026

Install

$ npx -y skills add jwynia/agent-skills --skill electron-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Files

Electron + React Best Practices

Guide AI agents in building secure, production-ready Electron applications with React. This skill provides security patterns, type-safe IPC communication, project setup guidance, packaging and code signing workflows, and tools for analysis, scaffolding, and type generation.

When to Use This Skill

Use this skill when:

  • Generating Electron main, preload, or renderer process code
  • Configuring electron-vite or Electron Forge
  • Setting up IPC communication between processes
  • Implementing security patterns (contextBridge, sandbox, CSP)
  • Packaging, signing, and notarizing desktop applications
  • Testing Electron apps with Playwright
  • Designing multi-window architectures

Do NOT use this skill when:

  • Building Tauri apps (different paradigm, use Tauri-specific guidance)
  • Building pure web apps with no desktop requirements
  • Targeting Electron versions below 20 (security defaults differ)
  • Using non-React renderer frameworks (use framework-specific skills)

Core Principles

1. Security First Architecture

Sponsors

Details

Repository
github.com/jwynia/agent-skills
Categories
Frontend Development, Testing & QA, Security, Documentation, AI & Agent Building
First seen
May 16, 2026

More from jwynia/agent-skills

All 118
1pulumi avatarpackage-usagepulumi/agent-skillsTrack which stacks across a Pulumi organization use a specific package and at what versions. Use for cross-stack audits, identifying outdated or unmaintained pa860skills.sh installs
2pproenca avatartanstack-querypproenca/dot-skillsTanStack Query v5 performance optimization for data fetching, caching, mutations, and query patterns. This skill should be used when using useQuery, useMutation858skills.sh installs
3astronomer avatarwarehouse-initastronomer/agentsInitialize warehouse schema discovery. Generates .astro/warehouse.md with all table metadata for instant lookups. Run once per project, refresh when schema chan841skills.sh installs
4makisuo avatareffect-best-practicesmakisuo/skillsEnforces Effect-TS patterns for services, errors, layers, and atoms. Use when writing code with Effect.Service, Schema.TaggedError, Layer composition, or effect841skills.sh installs
5netresearch avatarsecurity-auditnetresearch/security-audit-skillUse when conducting security assessments — OWASP Top 10 / API / LLM, CWE Top 25, CVSS scoring — auditing PHP/TYPO3, APIs, frontend, Terraform/K8s/Docker IaC, AW839skills.sh installs
6bitjaru avatarss-pagebitjaru/styleseedScaffold a new mobile page/screen using the StyleSeed layout patterns835skills.sh installs