AGENT SKILL

open-design-setup

Install Open Design and wire its MCP into coding agents.

License 许可
MIT
最近更新
2026-10-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
open-design-setup
author
hermes
license
MIT
version
1
metadata
{ "hermes": { "tags": [ "open-design", "od", "mcp", "node24", "pnpm", "daemon" ], "related_skills": [ "hermes-agent" ] } }
description
Install Open Design and wire its MCP into coding agents.

02 资源文件 4

03 SKILL.md 正文

Open Design: install + wire MCP into agents

Open Design is an agent-native design engine. Its od CLI spawns a local daemon and can register Open Design as an MCP server inside other coding agents, so they can pull files from / push artifacts to local OD projects. This skill covers the full local setup and the od mcp install wiring.

When to use

  • Installing Open Design from a release tarball (open-design-*.tar.gz) or source.
  • Building the od daemon so od / opendesign commands work.
  • Running od mcp install <agent> to connect Hermes, pi, claude, codex, cursor, etc.
  • Debugging ERR_DLOPEN_FAILED / "No such file or directory" when calling od.

Toolchain (read first — the #1 trap)

  • Node ~24 is required (README/QUICKSTART pin packageManager: pnpm@10.33.2 and engines to Node 24.x). On this box corepack is often missing, so:
    npm install -g pnpm@10.33.2      # instead of `corepack enable`
    nvm use 24.19.0                   # or fnm/whatever manages Node 24
    
  • CRITICAL — better-sqlite3 ABI: the daemon's native better-sqlite3 is compiled for Node 24 (ABI 137). Running the daemon or od under Node 25/22 fails with ERR_DLOPEN_FAILED. Always pin Node 24 on PATH before any node that touches dist/cli.js. The opendesign wrapper below does this for you.
  • Persist the pin in ~/.bashrc (prepend before the existing v25 path) so fresh shells and daemon restarts keep using Node 24:
    export PATH="/home/deeone/.nvm/versions/node/v24.19.0/bin:$PATH"
    

Install from tarball

mkdir -p ~/open-design
tar xzf /path/to/open-design-open-design-v0.19.2.tar.gz -C ~/open-design
cd ~/open-design/open-design
pnpm install
pnpm --filter @open-design/daemon build   # produces apps/daemon/dist/cli.js

The od binary is apps/daemon/bin/od.mjs; it throws if ../dist/cli.js is absent, so the build step is mandatory.

The od binary + a wrapper

od on most systems resolves to GNU coreutils od (octal dump) — that's why od mcp install pi gave od: mcp: No such file or directory. Disambiguate:

Create ~/.local/bin/opendesign (a wrapper that pins Node 24 and calls the real binary — this also sidesteps the GNU od collision):

#!/usr/bin/env bash
# pins Node 24 so better-sqlite3 (ABI 137) loads; without it node v25 breaks OD
export PATH="/home/deeone/.nvm/versions/node/v24.19.0/bin:$PATH"
exec node /home/deeone/open-design/open-design/apps/daemon/bin/od.mjs "$@"
chmod +x ~/.local/bin/opendesign
export PATH="$HOME/.local/bin:$PATH"
opendesign --help          # or: node .../bin/od.mjs <args>

(Naming it opendesign rather than od avoids shadowing GNU od.)

Run the daemon

Use the project's lifecycle entry point only — do not use pnpm dev / pnpm daemon (those aliases were removed):

pnpm tools-dev            # starts daemon + web sidecars; creates the IPC socket

Verify: ls -la /tmp/open-design/ipc/default/daemon.sock should exist.

Packaging an AppImage + desktop launch (Linux)

.dmg installers are macOS-only — they cannot be mounted or run on Linux. On EndeavourOS/KDE use the source tarball path above; the desktop app is the Electron shell that wraps the daemon + web sidecars.

Build the AppImage

pnpm --filter @open-design/desktop build
pnpm --filter @open-design/packaged build
pnpm tools-pack linux build --to appimage     # electron-builder; heavy (~min)
pnpm tools-pack linux install                  # copies artifact + writes .desktop entry

The artifact lands at .tmp/tools-pack/out/linux/namespaces/default/builder/Open Design-default.AppImage and tools-pack linux install places a copy at ~/.local/bin/ + a ~/.local/share/applications/open-design-default.desktop entry.

GOTCHA — npm allow-scripts guard: electron-builder runs npm install --omit=dev and your npm hardening blocks install scripts (npm error code EALLOWSCRIPTS). Fix by adding a project-scoped .npmrc (next to the repo root) — do NOT globally disable the guard:

allow-scripts[]=app-builder-bin
allow-scripts[]=electron-builder
allow-scripts[]=@electron/rebuild
allow-scripts[]=better-sqlite3

If the build fails again naming a different package, add just that one.

GOTCHA — missing Electron binary: after a pnpm install the apps/desktop/node_modules/electron/dist/electron binary is often absent (electron's postinstall was gated). pnpm rebuild electron may no-op; run the install script directly so it extracts the cached zip:

cd apps/desktop/node_modules/electron
node install.js          # materializes dist/electron (~200MB) from ~/.cache/electron

Run the full stack reliably (the save-bug fix)

pnpm tools-dev (no flags) probes for free ports and assigns the daemon a random port. The web app's next.config.ts rewrites /api/* → OD_PORT (default 7456). If the daemon landed on a different port, the Electron renderer's PUT /api/app-config (canvas/sheet save, settings persist) hits the default 7456 → connection refused → "Failed to fetch" → nothing saves. This is the #1 "canvas/sheets not saving" cause.

Fix: launch with explicit, aligned ports so the web's default matches:

pnpm tools-dev --daemon-port 7456 --web-port 4173

(7456 is OD's canonical default; 4173 is free here — your box has linkedin-scrape on :3000 and "RedAmon" on :3001; don't reuse those.) Verify the fix end-to-end through the web proxy (exactly what the browser does):

curl -s -X PUT http://127.0.0.1:4173/api/app-config \
  -H 'content-type: application/json' -d '{"installationId":"x","telemetry":false}'
# → HTTP 200 proves saves work

Bake the fixed ports into your launcher script (e.g. ~/open-design/launch-open-design.sh) so clicking the desktop icon never regresses to random ports.

Desktop icon on KDE Plasma

update-desktop-database is a GTK tool — KDE ignores it. For the icon to appear in the Application Launcher:

kbuildsycoca6 --noincremental          # rebuild KDE menu cache
  • .desktop Categories must have a single main category (e.g. Development;). Two mains (Development;Utility;) makes KDE flag/hide it.
  • After editing, restart plasmashell if the menu doesn't repaint: kquitapp6 plasmashell; sleep 2; plasmashell --no-desktop &.
  • Icon must exist at ~/.local/share/icons/hicolor/512x512/apps/<name>.png.

Hermes model inside Open Design

OD invokes the Hermes agent with the model set in app-config (agentModels.hermes.model). The literal hy3:free is rejected by Hermes's runtime (it runs on tencent/hy3:free via Nous). Set it to default (uses Hermes's CLI config) — otherwise Hermes "sees" the task but never responds. Patch via the daemon API:

curl -s -X PUT http://127.0.0.1:7456/api/app-config -H 'content-type: application/json' \
  --data-binary @<cfg-with-hermes-default>.json

Wire MCP into agents: od mcp install <agent>

opendesign mcp install hermes
opendesign mcp install pi
opendesign mcp install cursor

Three registration strategies (see references/agent-config-paths.md for the full table and exact paths):

  • cli (claude, codex, kimi, reasonix): od shells out to the agent's own mcp add. Needs that agent CLI installed; otherwise it errors.
  • json (cursor, copilot, cline, openclaw, antigravity, kiro, raven, trae, opencode, claude-desktop): od deep-merges the server block into the agent's JSON config itself. Safe — it won't clobber other servers.
  • manual (pi, hermes, vibe): OD refuses to guess the config path and only prints a ready-to-paste block. You apply it by hand.

The block OD emits (same shape for every agent) is in references/mcp-server-block.md.

mcp-cli is a SEPARATE MCP client with its own config (~/.mcp_servers.json or ~/.config/mcp/mcp_servers.json), independent of Hermes's ~/.hermes/config.yaml and the od mcp install wiring. To drive Open Design programmatically through mcp-cli, you must ALSO add the open-design entry to ~/.mcp_servers.json (merge under mcpServers, same command/args/env block as above). Verify with mcp-cli info open-design (not mcp-cli list — that's an unknown subcommand; use info/grep/call).

Hermes — MUST use hermes config set (do NOT edit the file directly)

Direct patch/write of ~/.hermes/config.yaml is blocked by a security guard ("Agent cannot modify security-sensitive configuration"). Use the guarded CLI instead:

hermes config set mcp_servers.open-design.command "/home/deeone/.nvm/versions/node/v24.19.0/bin/node"
hermes config set mcp_servers.open-design.args '["/home/deeone/open-design/open-design/apps/daemon/dist/cli.js", "mcp"]'
hermes config set mcp_servers.open-design.env.OD_DATA_DIR "/home/deeone/open-design/open-design/.od"
hermes config set mcp_servers.open-design.env.OD_SIDECAR_IPC_PATH "/tmp/open-design/ipc/default/daemon.sock"
hermes config get mcp_servers.open-design      # verify

Then restart/reload Hermes to load the new MCP server.

pi — write the JSON config by hand

od mcp install pi prints a block for ~/.pi/agent/mcp.json (JSON, mcpServers key). That file may not exist yet — create it:

{ "mcpServers": { "open-design": { "command": ".../node", "args": [".../dist/cli.js","mcp"],
  "env": { "OD_DATA_DIR": ".../.od", "OD_SIDECAR_IPC_PATH": "/tmp/open-design/ipc/default/daemon.sock" } } } }

Validate: node -e "require('/home/deeone/.pi/agent/mcp.json')". Restart pi.

Programmatic control via mcp-cli (plugins / designs / skills)

Once open-design is in ~/.mcp_servers.json, drive OD without the GUI:

mcp-cli info open-design                              # server + tool list
mcp-cli call open-design list_plugins '{}'            # ~460 plugins (design systems, templates)
mcp-cli call open-design list_skills  '{}'            # ~162 skills
mcp-cli call open-design start_run '{"prompt":"...","skill":"imagegen"}'   # commission a run
mcp-cli call open-design get_run '{"runId":"<id>"}'  # poll until terminal

You don't invoke skills directly — you commission a run (start_run) and OD executes the skill/plugin. Active project is optional (defaults to the OD project open in the GUI). See references/mcp-cli-control.md for the reusable od-control.sh (list/count/run/status) and the pipe-truncation gotcha: for large list_* payloads, save raw output to a file then parse the file — streaming mcp-cli call ... | node drops bytes on 60KB+ responses.

Pitfalls (don't rediscover these)

  • GNU od collision → use opendesign wrapper or call node .../bin/od.mjs.
  • Node 25/22 on PATH → ERR_DLOPEN_FAILED from better-sqlite3. Pin Node 24.
  • ~/.hermes/config.yaml direct edit blocked → use hermes config set.
  • Missing dist/cli.js → ran od.mjs before pnpm --filter @open-design/daemon build.
  • od mcp install <agent> says "unknown agent" → only the 17 AGENT_SLUGS are valid: claude, codex, reasonix, raven, cursor, copilot, openclaw, antigravity, pi, vibe, hermes, cline, kimi, kiro, trae, opencode, claude-desktop.
  • AppImage build: EALLOWSCRIPTS → add allow-scripts[]= entries to a project .npmrc (see Packaging section). Don't globally disable the guard.
  • Electron window won't open / dist/electron missing → run node install.js inside apps/desktop/node_modules/electron.
  • Canvas / sheets / settings "Failed to fetch" and nothing saves → tools-dev assigned a random daemon port, so the web's /api/* rewrite to 7456 misses it. Relaunch with --daemon-port 7456 --web-port 4173 and re-test the PUT through :4173. Bake the ports into the launcher script.
  • Desktop icon missing on KDE → update-desktop-database is GTK-only; use kbuildsycoca6. Single main Categories. Restart plasmashell to repaint.
  • Hermes task "seen but not responding" → app-config agentModels.hermes.model is hy3:free (rejected). Set it to default.

See references/packaging-and-troubleshooting.md for the exact command transcripts and the saved save-bug reproduction recipe.

Verification

  • Daemon: socket exists at /tmp/open-design/ipc/default/daemon.sock.
  • opendesign mcp --help prints usage (proves the built binary runs).
  • Hermes: after restart, the tool list shows open-design among MCP servers.
  • pi: pi mcp list (or its equivalent) shows the open-design server.

See references/ for the per-agent config table, the exact MCP block template, and the troubleshooting playbook.

04 同仓库更多 Skills