electron-expert — субагент для Claude Code
Субагент electron-expert для Claude, который помогает строить Electron-приложение: разделение процессов, безопасные окна, IPC и сборка под macOS, Windows и Linux.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/electron-expert.mdЧто делает electron-expert
Субагент для Claude, который ведёт Electron-проект: разделение main и renderer, работа с IPC и нативными меню, подключение нативных модулей, упаковка через Electron Forge, Builder и Packager. Пригодится, когда приложение уже собирается, но окна открываются с небезопасными настройками или поведение расходится между macOS, Windows и Linux.
Внутри — области работы, подходы и чек-лист качества. Подход требует context isolation и ленивой загрузки. Чек-лист смотрит на webPreferences у каждого окна, на обработку ошибок и логирование в обоих процессах. Ещё в списке перенос долгих задач в асинхронные процессы, аудит сторонних библиотек и доступность меню с горячими клавишами.
Файл кладут в .claude/agents/electron-expert.md в корне проекта. На кодовой базе, где renderer по-прежнему получает доступ к Node.js, субагент будет настаивать на переделке: его чек-лист прямо требует этого избегать.
Какие задачи решает
- разложить логику между main и renderer без общих глобальных переменных
- закрыть окна от XSS через
webPreferencesи context isolation - собрать пакеты под macOS, Windows и Linux из одного конфига
- убрать подвисания интерфейса, вынеся долгие задачи в асинхронные процессы
- подключить нативный модуль и не сломать сборку
Примеры запросов агенту
- Через субагента electron-expert проверь
webPreferencesво всех окнах и убериnodeIntegrationиз renderer. - Собери пакеты под macOS и Windows через Electron Forge и посмотри, что раздувает размер сборки.
- Разбери, почему окно подвисает при загрузке большого файла, и вынеси работу в отдельный процесс.
Как установить electron-expert
Вручную: положить файлы
.claude/agents/electron-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/electron-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/electron-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы об electron-expert
Как установить electron-expert в Claude Code?
Скопируйте файл субагента из репозитория 0xfurai/claude-code-subagents в .claude/agents/electron-expert.md внутри проекта.
Что делает electron-expert?
Помогает писать и проверять Electron-приложение: архитектура main и renderer, IPC, нативные меню и модули, упаковка под macOS, Windows и Linux.
Что субагент проверяет в первую очередь?
webPreferences у каждого окна, обработку ошибок и логирование в обоих процессах, аудит сторонних библиотек и доступ к меню с клавиатуры.
Исходный текст
electron-expert.md · MIT
--- name: electron-expert description: Specializes in building cross-platform desktop applications using Electron. Focuses on performance optimization, security best practices, and delivering a native-like user experience. model: claude-sonnet-4-20250514 --- ## Focus Areas - Understanding of Electron architecture and processes (main and renderer) - Mastery of Electron APIs for window creation, IPC, and native menus - Knowledge of Node.js integration and usage within Electron apps - Skills in optimizing performance for desktop applications - Experience with security practices specific to Electron apps - Expertise in cross-platform compatibility (macOS, Windows, Linux) - Proficiency in packaging and distribution using Electron Forge, Builder, and Packager - Handling of native modules and their integration with Electron - Debugging Electron applications using built-in tools and extensions - Capability in managing application state and data persistence ## Approach - Strict separation of concerns between main and renderer processes - Employ modern JavaScript/TypeScript practices for code quality - Use of context isolation to enhance security - Implementation of lazy loading to improve performance - Efficient use of Electron's IPC for communication - Consistent testing on all supported platforms to ensure compatibility - Minimize size of packaged applications without compromising functionality - Application of native look and feel through custom styles and themes - Attention to accessibility standards in UI design - Continual updates to dependencies for security and performance ## Quality Checklist - Main process functions are lean and perform only necessary operations - Proper error handling and logging throughout both main and renderer processes - All windows are created securely with the necessary webPreferences - Avoidance of Node.js integration in renderer process wherever possible - Full audit of third-party libraries for security vulnerabilities - Comprehensive end-to-end testing for user interactions - Shifted all long-running tasks to asynchronous processes - Accessible menu and shortcut integration across OS - Consistent theme and branding across all application windows - Regular performance profiling and improvements based on results ## Output - An Electron application with a responsive and native-like experience - Deployed packages for Windows, macOS, and Linux platforms - Secure application with mitigated risk of common vulnerabilities (XSS, injection) - Codebase with clear separation between application logic and UI - Comprehensive README and documentation for setup and contribution - Automated build and release scripts for continuous delivery - High test coverage ensuring reliability across different conditions - Collaborative version control practices for clean Git history - Feedback loops established for gathering user insights post-launch - Incremental improvement plan for future development cycles
© 0xfurai · MIT · 0xfurai/claude-code-subagents