electron-dev
Development workflow, build commands, and IPC patterns for the Electron+React+Vite image gallery application.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Development workflow, build commands, and IPC patterns for the Electron+React+Vite image gallery application.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Update CHANGELOG.md and package.json via compiled release_bump harness, then commit/push only when the user asks. Use for /release, changelog updates, or shipping gallery versions.
Works in image-scoring-gallery on electron/db.ts contract, IPC, apiService, React/Vite, and alignment with sibling image-scoring-backend schema. Use for desktop app bugs, database.engine modes, API URL/port from webui.lock, or TypeScript changes under electron/ or src/. Triggers include Electron gallery, db.ts, IPC, apiService, config.api, PostgreSQL vs api engine, and Vite renderer.
React component patterns, CSS Modules styling, design tokens, virtualization, and UX constitution for the Driftara Gallery renderer. Use for src/ UI work, styling, FilterPanel/GalleryGrid/ImageViewer, or design:check—not electron/db unless coordinated with gallery-electron-ts.
Verify implementation against spec AC-n criteria via compiled harness. Use after /implement or /test-and-fix, before /pr-ready. Parses ACs and emits the report; LLM assigns Verified/Failed/Unknown when evidence is not a clean command exit.
Use before claiming work is complete, fixed, passing, ready to commit, or ready for PR. Runs scripts/agent_skills/verification_before_completion.py for the claim→proof catalog; LLM interprets output. Never upgrade incomplete verification.
Driftara Gallery MCP — is-ui-* router-first; backend triage via sibling is-be-mcp search+dispatch.
| name | electron-dev |
| description | Development workflow, build commands, and IPC patterns for the Electron+React+Vite image gallery application. |
| Command | Purpose |
|---|---|
npm run dev | Start dev mode (Vite HMR + Electron) |
npm run build | Production build + electron-builder |
npm run lint | ESLint checks |
./run.bat | Shortcut launcher for dev mode |
Main Process (Node.js) Renderer Process (Chromium)
┌─────────────────────┐ ┌──────────────────────────┐
│ electron/main.ts │◄─IPC──►│ src/main.tsx │
│ electron/db.ts │ │ src/App.tsx │
│ electron/preload.ts │ │ src/components/... │
│ electron/nefExtractor.ts│ │ src/hooks/... │
└─────────────────────┘ └──────────────────────────┘
electron/): DB operations, file system, OS integrationsrc/): React UI, hooks, statecontextBridge in preload.ts exposes window.electron APIThis is the most common task. Follow these 4 files in order:
electron/db.tsexport async function getMyData(options: MyOptions = {}): Promise<MyResult[]> {
return query<MyResult>('SELECT ... FROM ... WHERE ...', []);
}
electron/main.tsAdd inside app.whenReady().then(() => { ... }):
ipcMain.handle('db:my-channel', async (_, options) => {
try {
return await db.getMyData(options);
} catch (e: any) {
console.error('DB Error:', e);
return [];
}
});
electron/preload.tsgetMyData: (options?: any) => ipcRenderer.invoke('db:my-channel', options),
src/electron.d.tsAdd to the Window.electron interface:
getMyData: (options?: { limit?: number; offset?: number }) => Promise<any[]>;
const data = await window.electron.getMyData({ limit: 50 });
Images are served via a custom media:// protocol registered in main.ts. To display an image:
const src = `media://${image.thumbnail_path || image.file_path}`;
The DB stores WSL-style paths (/mnt/d/...). The convertPathToLocal() function in main.ts converts them to Windows paths (D:/...). Any new path handling must account for this.
config.json at project root provides DB credentials and dev server URL. Both main.ts and db.ts load it independently via loadConfig().
| Package | Version | Purpose |
|---|---|---|
electron | 40.x | Desktop runtime |
react | 19.x | UI framework |
vite | 7.x | Build tool + HMR |
typescript | 5.9 | Type safety |
pg | 8.x | PostgreSQL DB client |
zustand | 5.x | State management |
react-virtuoso | 4.x | Virtualized grid |
exiftool-vendored | 35.x | EXIF/RAW metadata |
libraw-wasm | 1.x | Client-side RAW decode |
lucide-react | 0.5x | Icons |
localhost:5432)media:// protocol and WSL path conversionnpm run lint — check electron.d.ts matches preload.ts