Agent skill · Audited from source
Electron Api
skill · wavetermdev/wavetermApache-2.0 licenceAudited 5 Oct 2026 · source 63907843412f
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit 63907843412f and found no filesystem, network or shell access and no hard-coded secrets. What it does: Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.
Cite
Cite this page
ModelsAtlas. “Electron Api (wavetermdev/waveterm)”. Retrieved 5 Oct 2026. https://modelsatlas.com/skills/wavetermdev/electron-api
Trust audit
Audit 0.4.1 · source read 5 Oct 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha 63907843412f · 5 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherwavetermdev GitHub organizationOwner of the repository this skill is read from
- Source folderwavetermdev/waveterm/.kilocode/skills/electron-apiThe exact folder we audited
- LicenceApache-2.0As the repository states it
- Commit pinned for this verdict63907843412fA new audit runs when the source changes
- Repository statusNot archivedLast push 2 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.
---
name: electron-api
description: Guide for adding new Electron APIs to Wave Terminal. Use when implementing new frontend-to-electron communications via preload/IPC.
---
# Adding Electron APIs
Electron APIs allow the frontend to call Electron main process functionality directly via IPC.
## Four Files to Edit
1. [`frontend/types/custom.d.ts`](frontend/types/custom.d.ts) - TypeScript [`ElectronApi`](frontend/types/custom.d.ts:82) type
2. [`emain/preload.ts`](emain/preload.ts) - Expose method via `contextBridge`
3. [`emain/emain-ipc.ts`](emain/emain-ipc.ts) - Implement IPC handler
4. [`frontend/preview/preview-electron-api.ts`](frontend/preview/preview-electron-api.ts) - Add a no-op stub to keep the `previewElectronApi` object in sync with the `ElectronApi` type
## Three Communication Patterns
1. **Sync** - `ipcRenderer.sendSync()` + `ipcMain.on()` + `event.returnValue = ...`
2. **Async** - `ipcRenderer.invoke()` + `ipcMain.handle()`
3. **Fire-and-forget** - `ipcRenderer.send()` + `ipcMain.on()`
## Example: Async Method
### 1. Define TypeScript Interface
In [`frontend/types/custom.d.ts`](frontend/types/custom.d.ts):
```typescript
type ElectronApi = {
captureScreenshot: (rect: Electron.Rectangle) => Promise<string>; // capture-screenshot
};
```
### 2. Expose in Preload
In [`emain/preload.ts`](emain/preload.ts):
```typescript
contextBridge.exposeInMainWorld("api", {
captureScreenshot: (rect: Rectangle) => ipcRenderer.invoke("capture-screenshot", rect),
});
```
### 3. Implement Handler
In [`emain/emain-ipc.ts`](emain/emain-ipc.ts):
```typescript
electron.ipcMain.handle("capture-screenshot", async (event, rect) => {
const tabView = getWaveTabViewByWebContentsId(event.sender.id);
if (!tabView) throw new Error("No tab view found");
const image = await tabView.webContents.capturePage(rect);
return `data:image/png;base64,${image.toPNG().toString("base64")}`;
});
```
### 4. Add Preview Stub
In [`frontend/preview/preview-electron-api.ts`](frontend/preview/preview-electron-api.ts):
```typescript
captureScreenshot: (_rect: Electron.Rectangle) => Promise.resolve(""),
```
### 5. Call from Frontend
```typescript
import { getApi } from "@/store/global";
const dataUrl = await getApi().captureScreenshot({ x: 0, y: 0, width: 800, height: 600 });
```
## Example: Sync Method
### 1. Define
```typescript
type ElectronApi = {
getUserName: () => string; // get-user-name
};
```
### 2. Preload
```typescript
getUserName: () => ipcRenderer.sendSync("get-user-name"),
```
### 3. Handler (⚠️ MUST set event.returnValue or browser hangs)
```typescript
electron.ipcMain.on("get-user-name", (event) => {
event.returnValue = process.env.USER || "unknown";
});
```
### 4. Call
```typescript
import { getApi } from "@/store/global";
const userName = getApi().getUserName(); // blocks until returns
```
## Example: Fire-and-Forget
### 1. Define
```typescript
type ElectronApi = {
openExternal: (url: string) => void; // open-external
};
```
### 2. Preload
```typescript
openExternal: (url) => ipcRenderer.send("open-external", url),
```
### 3. Handler
```typescript
electron.ipcMain.on("open-external", (event, url) => {
electron.shell.openExternal(url);
});
```
## Example: Event Listener
### 1. Define
```typescript
type ElectronApi = {
onZoomFactorChange: (callback: (zoomFactor: number) => void) => void; // zoom-factor-change
};
```
### 2. Preload
```typescript
onZoomFactorChange: (callback) =>
ipcRenderer.on("zoom-factor-change", (_event, zoomFactor) => callback(zoomFactor)),
```
### 3. Send from Main
```typescript
webContents.send("zoom-factor-change", newZoomFactor);
```
## Quick Reference
**Use Sync when:**
- Getting config/env vars
- Quick lookups, no I/O
- ⚠️ **CRITICAL**: Always set `event.returnValue` or browser hangs
**Use Async when:**
- File operations
- Network requests
- Can fail or take time
**Use Fire-and-forget when:**
- No return value needed
- Triggering actions
**Electron API vs RPC:**
- Electron API: Native OS features, window management, Electron APIs
- RPC: Database, backend logic, remote servers
## Checklist
- [ ] Add to [`ElectronApi`](frontend/types/custom.d.ts:82) in [`custom.d.ts`](frontend/types/custom.d.ts)
- [ ] Include IPC channel name in comment
- [ ] Expose in [`preload.ts`](emain/preload.ts)
- [ ] Implement in [`emain-ipc.ts`](emain/emain-ipc.ts)
- [ ] Add no-op stub to [`preview-electron-api.ts`](frontend/preview/preview-electron-api.ts)
- [ ] IPC channel names match exactly
- [ ] **For sync**: Set `event.returnValue` (or browser hangs!)
- [ ] Test end-to-endExcerpt, first 4,628 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 6390784
git clone https://github.com/wavetermdev/waveterm git -C waveterm checkout 63907843412f
The author documents no install command, so this uses the repository directly. Our verdict covers commit 63907843412f only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
63907843412f
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/wavetermdev/electron-api/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →wavetermdev/waveterm
Guide for creating WaveEnv narrowings in Wave Terminal. Use when writing a named subset type of WaveEnv for a component tree, documenting environmental dependencies, or enabling mock environments for preview/test server…
wavetermdev/waveterm
Guide for working with Wave Terminal's WPS (Wave PubSub) event system. Use when implementing new event types, publishing events, subscribing to events, or adding asynchronous communication between components.
wavetermdev/waveterm
Guide for adding new configuration settings to Wave Terminal. Use when adding a new setting to the configuration system, implementing a new config key, or adding user-customizable settings.
wavetermdev/waveterm
Guide for adding new RPC calls to Wave Terminal. Use when implementing new RPC commands, adding server-client communication methods, or extending the RPC interface with new functionality.
wavetermdev/waveterm
Guide for adding new wsh commands to Wave Terminal. Use when implementing new CLI commands, adding command-line functionality, or extending the wsh command interface.
wavetermdev/waveterm
Guide for creating and displaying context menus in Wave Terminal. Use when implementing right-click menus, adding context menu items, creating submenus, or handling menu interactions with checkboxes and separators.
Add this badge to your README
[](https://modelsatlas.com/skills/wavetermdev/electron-api/)
<a href="https://modelsatlas.com/skills/wavetermdev/electron-api/"><img src="https://modelsatlas.com/skills/wavetermdev/electron-api/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about Electron Api
What does the Electron Api skill do?
Is Electron Api safe to install?
What can Electron Api access on my machine?
How current is this page?
Sources
- github.com/wavetermdev/waveterm/tree/main/.kilocode/skills/elect — the audited source at commit 63907843412f and every finding aboveObserved · 5 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Electron Api skill do?
- Is Electron Api safe to install?
- What can Electron Api access on my machine?