Agent Skillsmuratgur/ordinus › electron-secure-boundary

electron-secure-boundary

GitHub

维护 Ordinus Electron 应用的安全边界,确保主进程处理特权操作,渲染器仅负责 UI。通过严格隔离、最小化 preload 暴露及禁用 Node 集成,防止敏感能力泄露至渲染层,保障应用安全架构。

.claude/skills/electron-secure-boundary/SKILL.md muratgur/ordinus

触发场景

修改 BrowserWindow 选项 调整主进程/预加载/渲染器的职责划分 涉及操作系统访问或文件系统操作 任何可能将 Electron 或 Node 能力暴露给渲染代码的变更

安装

npx skills add muratgur/ordinus --skill electron-secure-boundary -g -y
更多选项

非标准路径

npx skills add https://github.com/muratgur/ordinus/tree/master/.claude/skills/electron-secure-boundary -g -y

不安装直接使用

npx skills use muratgur/ordinus@electron-secure-boundary

指定 Agent (Claude Code)

npx skills add muratgur/ordinus --skill electron-secure-boundary -a claude-code -g -y

安装 repo 全部 skill

npx skills add muratgur/ordinus --all -g -y

预览 repo 内 skill

npx skills add muratgur/ordinus --list

SKILL.md

Frontmatter
{
    "name": "electron-secure-boundary",
    "description": "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."
}

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, and sandbox: true unless 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

  1. Identify which side of the boundary the change touches: main, preload, renderer, or shared contracts.
  2. Move privileged behavior to main process services or IPC handlers.
  3. Add the narrowest preload method needed for renderer.
  4. Keep validation and trust decisions in main/shared, not renderer.
  5. Run npm run typecheck, npm run lint, and npm run build.
  6. For boundary changes, smoke test npm run dev or 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) or runCommand(command).
  • IPC handlers trust renderer payloads without validation.
  • A UI feature requires relaxing sandbox settings before simpler IPC design has been tried.

版本历史

  • f507122 当前 2026-07-05 18:18

同 Skill 集合

.agents/skills/lavish/SKILL.md
.claude/skills/code-review-and-quality/SKILL.md
.claude/skills/code-simplification/SKILL.md
.claude/skills/documentation-and-adrs/SKILL.md
.claude/skills/grill-me/SKILL.md
.claude/skills/idea-discovery/SKILL.md
.claude/skills/ipc-contract-design/SKILL.md
.claude/skills/ordinus-ui-system/SKILL.md
.claude/skills/provider-runtime-adapter/SKILL.md
.claude/skills/shadcn-project-workflow/SKILL.md
.claude/skills/sqlite-minimal-persistence/SKILL.md
.codex/skills/code-review-and-quality/SKILL.md
.codex/skills/code-simplification/SKILL.md
.codex/skills/documentation-and-adrs/SKILL.md
.codex/skills/electron-secure-boundary/SKILL.md
.codex/skills/grill-me/SKILL.md
.codex/skills/idea-discovery/SKILL.md
.codex/skills/ipc-contract-design/SKILL.md
.codex/skills/ordinus-ui-system/SKILL.md
.codex/skills/provider-runtime-adapter/SKILL.md
.codex/skills/shadcn-project-workflow/SKILL.md
.codex/skills/sqlite-minimal-persistence/SKILL.md

元信息

文件数
0
版本
f507122
Hash
d06bde43
收录时间
2026-07-05 18:18

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-14 13:32
浙ICP备14020137号-1 $访客地图$