electron-secure-boundary
Skill111 starsChanged 5 months agoMITView on GitHub
Maintain Ordinus Electron security boundaries. Use when changing BrowserWindow options, main/preload/renderer responsibilities, privileged OS access, filesystem/database/process usage, or anything that could expose Electron or Node capabilities to renderer code.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- lavishSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- documentation-and-adrsSkill
- grill-meSkill
- idea-discoverySkill
- ipc-contract-designSkill
- ordinus-ui-systemSkill
- provider-runtime-adapterSkill
- shadcn-project-workflowSkill
- sqlite-minimal-persistenceSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Keep Ordinus secure by preserving the separation between privileged desktop code and UI code.
- Distinctive: line 14
Keep privileged work in Electron main process: filesystem, SQLite, child processes, provider runtimes, secrets, native dialogs, and OS …
- Distinctive: line 15
Keep renderer as UI-only React code.
- Very specific: line 16
Keep preload small and typed.
- Very specific: line 17
Never expose raw ipcRenderer, electron, filesystem, process, database, or generic command execution APIs to renderer.
- Very specific: line 19
Avoid third-party runtime imports in preload.
- Distinctive: line 25
Add the narrowest preload method needed for renderer.
- Distinctive: line 26
Keep validation and trust decisions in main/shared, not renderer.
- Very specific: line 27
Run npm run typecheck, npm run lint, and npm run build.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Electron Secure Boundary
Objective
Keep Ordinus secure by preserving the separation between privileged desktop code and UI code.
Rules
- Keep privileged work in Electron main process: filesystem, SQLite, child processes, provider runtimes, secrets, native dialogs, and OS integration.
- Keep renderer as UI-only React code. Do not import or use Node APIs, Electron APIs, SQLite clients, filesystem modules, or child process modules in renderer.
- Keep preload small and typed. Expose only purpose-built
window.ordinus.*methods. - Never expose raw
ipcRenderer,electron, filesystem, process, database, or generic command execution APIs to renderer. - Preserve
nodeIntegration: false,contextIsolation: true, andsandbox: trueunless the user explicitly asks for a security model redesign. - Avoid third-party runtime imports in preload. In sandboxed preload, prefer type-only imports plus
ipcRenderer.invoke.
Workflow
- Identify which side of the boundary the change touches: main, preload, renderer, or shared contracts.
- Move privileged behavior to main process services or IPC handlers.
- Add the narrowest preload method needed for renderer.
- Keep validation and trust decisions in main/shared, not renderer.
- Run
npm run typecheck,npm run lint, andnpm run build. - For boundary changes, smoke test
npm run devor the packaged app.
Red Flags
- Renderer imports from
electron,node:*,fs,path,child_process,better-sqlite3, or main-process modules. - Preload exposes general-purpose methods such as
invoke(channel, payload)orrunCommand(command). - IPC handlers trust renderer payloads without validation.
- A UI feature requires relaxing sandbox settings before simpler IPC design has been tried.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

