ipc-contract-design
Skill111 starsChanged 5 months agoMITView on GitHub
Design and maintain Ordinus typed IPC contracts. Use when adding or changing window.ordinus APIs, ipcMain handlers, ipc channel names, shared request/response types, Zod schemas, preload bridge methods, or renderer calls into main process.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- lavishSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- documentation-and-adrsSkill
- electron-secure-boundarySkill
- grill-meSkill
- idea-discoverySkill
- 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
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Keep Ordinus IPC small, typed, explicit, and stable enough for the renderer to act as a safe UI over main-process capabilities.
- Very specific: line 18
Use feature-shaped methods such as workspace.selectFolder() instead of generic transport methods.
- Distinctive: line 23
Add or update shared types and Zod schemas.
- Distinctive: line 24
Add the IPC channel constant.
- Distinctive: line 26
Add the narrow preload method that invokes that channel.
- Distinctive: line 28
Run typecheck, lint, and build.
- Very specific: line 32
Keep method names domain-oriented: app.getInfo, db.getStatus, workspace.selectFolder.
- Distinctive: line 33
Prefer one explicit method over a generic catch-all channel.
- Distinctive: line 34
Keep renderer errors user-readable and main errors diagnostic enough to debug.
- Very specific: line 35
When IPC responses drive renderer status, empty states, or error copy, align user-visible naming with DESIGN.md.
- Distinctive: line 36
Do not add IPC for future features until there is an immediate caller.
- Distinctive: line 37
Do not return secrets, raw environment details, or unrestricted local paths unless the UI truly needs them.
≈ “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
IPC Contract Design
Objective
Keep Ordinus IPC small, typed, explicit, and stable enough for the renderer to act as a safe UI over main-process capabilities.
Contract Shape
- Define channel names in
src/shared/ipc.ts. - Define shared request/response schemas and types in
src/shared/contracts.ts. - Register handlers in main process modules, not renderer.
- Expose renderer-facing methods through
window.ordinusin preload. - Use feature-shaped methods such as
workspace.selectFolder()instead of generic transport methods.
Workflow
- Name the user-facing capability before creating an IPC method.
- Add or update shared types and Zod schemas.
- Add the IPC channel constant.
- Implement the main handler and validate untrusted input.
- Add the narrow preload method that invokes that channel.
- Consume the method in renderer through
window.ordinus. - Run typecheck, lint, and build.
Guidelines
- Keep method names domain-oriented:
app.getInfo,db.getStatus,workspace.selectFolder. - Prefer one explicit method over a generic catch-all channel.
- Keep renderer errors user-readable and main errors diagnostic enough to debug.
- When IPC responses drive renderer status, empty states, or error copy, align user-visible naming with
DESIGN.md. - Do not add IPC for future features until there is an immediate caller.
- Do not return secrets, raw environment details, or unrestricted local paths unless the UI truly needs them.
Anti-Patterns
window.ordinus.invoke(channel, payload).- Passing raw command strings from renderer to main.
- Duplicating response shapes separately in main and renderer.
- Letting renderer decide privileged policy such as workspace boundaries or executable paths.
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.

