agentleFS
muratgurmuratgur/ordinus/.claude/skills/ipc-contract-design/SKILL.md

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.

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
  1. Very specific:

    Keep Ordinus IPC small, typed, explicit, and stable enough for the renderer to act as a safe UI over main-process capabilities.

    line 10
  2. Very specific:

    Use feature-shaped methods such as workspace.selectFolder() instead of generic transport methods.

    line 18
  3. Distinctive:

    Add or update shared types and Zod schemas.

    line 23
  4. Distinctive:

    Add the IPC channel constant.

    line 24
  5. Distinctive:

    Add the narrow preload method that invokes that channel.

    line 26
  6. Distinctive:

    Run typecheck, lint, and build.

    line 28
  7. Very specific:

    Keep method names domain-oriented: app.getInfo, db.getStatus, workspace.selectFolder.

    line 32
  8. Distinctive:

    Prefer one explicit method over a generic catch-all channel.

    line 33
  9. Distinctive:

    Keep renderer errors user-readable and main errors diagnostic enough to debug.

    line 34
  10. Very specific:

    When IPC responses drive renderer status, empty states, or error copy, align user-visible naming with DESIGN.md.

    line 35
  11. Distinctive:

    Do not add IPC for future features until there is an immediate caller.

    line 36
  12. Distinctive:

    Do not return secrets, raw environment details, or unrestricted local paths unless the UI truly needs them.

    line 37

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.ordinus in preload.
  • Use feature-shaped methods such as workspace.selectFolder() instead of generic transport methods.

Workflow

  1. Name the user-facing capability before creating an IPC method.
  2. Add or update shared types and Zod schemas.
  3. Add the IPC channel constant.
  4. Implement the main handler and validate untrusted input.
  5. Add the narrow preload method that invokes that channel.
  6. Consume the method in renderer through window.ordinus.
  7. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.