agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
Expert guide for Electron development with Electron Vite and Electron Builder. Use when developing Electron applications, working with main/renderer processes, IPC communication, preload scripts, security configuration, native module handling, or build/distribution setup.
Claude Code
$ npx -y skills add pedronauck/skills --skill electron-dev --agent claude-code
Codex
$ npx skills add pedronauck/skills --skill electron-dev -a codex -y
Cursor
$ npx skills add pedronauck/skills --skill electron-dev -a cursor -y
Gemini CLI
$ npx skills add pedronauck/skills --skill electron-dev -a gemini-cli -y
GitHub Copilot
$ npx skills add pedronauck/skills --skill electron-dev -a github-copilot -y
OpenCode
$ npx skills add pedronauck/skills --skill electron-dev -a opencode -y
Windsurf
$ npx skills add pedronauck/skills --skill electron-dev -a windsurf -y
name: electron-dev description: Expert guide for Electron development with Electron Vite and Electron Builder. Use when developing Electron applications, working with main/renderer processes, IPC communication, preload scripts, security configuration, native module handling, or build/distribution setup. allowed-tools: Read, Grep, Glob
This skill provides guidelines, patterns, and best practices for building production-grade Electron applications using Electron Vite and Electron Builder.
1. **Core Rules**: For detailed Electron development patterns and guidelines, refer to `references/patterns.md` within this skill. 2. **Security**: Always enable `contextIsolation`, `sandbox`, and disable `nodeIntegration`. 3. **Architecture**: Main process handles Node.js operations; renderer focuses on UI; preload bridges them securely.
The main process handles:
Key guidelines:
The renderer process:
The preload script is the **only bridge** between renderer and main:
import { contextBridge, ipcRenderer } from "electron";
contextBridge.exposeInMainWorld("electronAPI", {
invoke: (channel: string, args?: unknown) => {
const validChannels = ["db:query", "file:save", "app:close"];
if (validChannels.includes(channel)) {
return ipcRenderer.invoke(channel, args);
}
throw new Error(`Invalid IPC channel: ${channel}`);
},
});Always configure `webPreferences` with these settings:
webPreferences: {
preload: path.join(__dirname, 'preload.js'),
contextIsolation: true, // REQUIRED
enableRemoteModule: false, // REQUIRED
sandbox: true, // REQUIRED
nodeIntegration: false, // REQUIRED
webSecurity: true,
}ipcMain.handle("db:insert", async (event, data: unknown) => {
if (!isValidInsertData(data)) {
throw new Error("Invalid data");
}
return db.insert(data);
});import { defineConfig } from "electron-vite";
export default defineConfig({
main: {
build: {
outDir: "dist/main",
rollupOptions: {
external: ["better-sqlite3", "native-module-name"],
},
},
},
preload: {
build: { outDir: "dist/preload" },
},
renderer: {
build: {
outDir: "dist/renderer",
rollupOptions: {
output: {
manualChunks: {
vendor: ["react", "react-dom"],
},
},
},
},
},
});For native modules like `better-sqlite3`: 1. Exclude from rollup in electron-vite config 2. Include in `extraResources` in Electron Builder config 3. Use dynamic imports in main process 4. Rebuild for Electron using `@electron/rebuild`
// Exposing entire Node.js API
contextBridge.exposeInMainWorld("require", require);
// Not validating IPC messages
ipcMain.handle("dangerous", (event, data) => {
fs.writeFileSync(data.path, data.content);
});
// Using __dirname in renderer
const imagePath = `${__dirname}/images/logo.png`;// Whitelist specific channels
contextBridge.exposeInMainWorld("electronAPI", {
invoke: (channel: string, args: unknown) => {
if (!["safe:channel"].includes(channel)) throw new Error("Invalid");
return ipcRenderer.invoke(channel, args);
},
});
// Validate all arguments
ipcMain.handle("file:write", async (event, { path, content }) => {
if (typeof path !== "string" || typeof content !== "string") {
throw new TypeError("Invalid arguments");
}
// Safe to use
});Before finishing a task involving Electron:
| Issue | Solution | |-------|----------| | White screen in production | Check asset paths use `base: './'`, verify build output | | Native module fails | Exclude from rollup, include in extraResources | | IPC not working | Verify preload path, contextIsolation enabled, channel whitelisted | | HMR not working | Run with `-w` flag, check VITE_DEV_SERVER_URL |
For detailed configuration examples and additional patterns, consult `references/patterns.md`.
A curated collection of 89 agent skills for Claude Code and compatible AI coding assistants — 43 original (⭐️), 33 hand-picked (💎), and 13 marketing & business (📣).
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like…
Autonomously optimize any Claude Code skill by running it repeatedly, scoring outputs against binary evals, mutating the prompt,…
Centrifugo real-time messaging server expert for WebSocket PUB/SUB, channel management, JWT authentication, event proxying, and…
Retrieves up-to-date documentation, API references, and code examples for any developer technology. Use this skill whenever the…
Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by…
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…