mirror of
https://github.com/nexu-io/open-design.git
synced 2026-09-28 06:45:29 +08:00
* fix(plugins): enforce HTML preview contracts * fix: fail closed on preview contract I/O errors
3.5 KiB
3.5 KiB
Agent Development Handoff
Language: English | 简体中文
Give this file to a coding agent when you want it to create or improve an OpenDesign plugin.
Mission
Create a portable OpenDesign plugin that can:
- Run as a normal Agent Skill through
SKILL.md. - Install into OpenDesign through
open-design.json. - Be validated locally.
- Be published as an independent open source repo or submitted as a PR to OpenDesign.
Required Reading
Read these files before editing:
plugins/spec/SPEC.mddocs/schemas/open-design.plugin.v1.jsondocs/plugins-spec.mdwhen you need deeper product semanticsplugins/spec/PUBLISHING-REGISTRIES.mdwhen the user asks to publish outside OpenDesign- A nearby example under
plugins/spec/examples/
Build Procedure
- Choose a lowercase plugin id, for example
import-screenshot-to-prototype. - Create a folder with at least:
<plugin-id>/
SKILL.md
open-design.json
README.md
- Keep the
SKILL.mdportable. It may mention OpenDesign behavior, but the core workflow must still make sense in any Agent Skills compatible agent. - Put OD-specific display,
specVersion, pluginversion, inputs, preview, pipeline, atoms, connectors, and capabilities inopen-design.json. - Add
examples/,preview/,assets/, orreferences/only when they materially help the agent produce better results. - Add
evals/evals.jsonwhen the plugin has enough behavior to regress. - If publishing externally, prepare registry-safe README sections for skills.sh, ClawHub, and canonical GitHub source.
- For an HTML-backed visual artifact, ship the real sample as
example.htmland declareod.preview.type: "html"withentry: "./example.html". Keepod.useCase.exampleOutputsandod.context.assetsaligned with that file. A poster image may be secondary, but it must not replace the HTML preview. Whentemplate.jsoncarriesreferenceHtml, materialize the sample from that source (or the same deterministic generator) and keep them in sync.
Quality Bar
The plugin is not done until:
SKILL.mdhas a clear "Use this plugin when..." description.- The workflow states the expected output files or handoff result.
open-design.jsonvalidates against the v1 shape and carries explicitspecVersionplus pluginversion.- The declared atoms are known first-party atoms or clearly marked future work.
- The declared capabilities are the minimum needed.
- Visual plugins include a preview or concrete example output.
- HTML-backed previews load from the declared entry as
200 text/html; a preview-bakerskip (status 404)is a failure for that plugin, even when the overall bake job remains green. - Share, deploy, connector, and network plugins require explicit confirmation before externally visible actions.
Validation Commands
Run what is available in this environment:
pnpm guard
pnpm --filter @open-design/plugin-runtime typecheck
If the daemon CLI is built:
od plugin validate ./<plugin-id>
od plugin install ./<plugin-id>
od plugin apply <plugin-id> --input key=value
PR Output
When opening or preparing a PR, include:
- Plugin id, spec version, plugin version, and lane.
- What user request should trigger it.
- Files changed.
- Validation commands and results.
- Capabilities requested.
- Screenshots, preview URLs, or example artifacts for visual plugins.
- Registry links and dry-run output when publishing to skills.sh, ClawHub, or another skill registry.