Create refreshable, auditable OpenDesign artifacts backed by connector or local data. Trigger when the user asks for live dashboards, refreshable reports, synce
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-live-artifact-46c2278353ee ,按照其中的说明把「live-artifact」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Create an OpenDesign live artifact: a project-scoped, previewable HTML artifact whose data can later be refreshed without redesigning the presentation.
live-artifact/
├── SKILL.md
└── references/
├── artifact-schema.md ← `references/artifact-schema.md`: artifact files, DTO shape, template binding rules
├── connector-policy.md ← `references/connector-policy.md`: connector safety, redaction, credential boundaries
└── refresh-contract.md ← `references/refresh-contract.md`: source metadata, refresh execution, snapshots
Use the references in this directory as the source of truth for the live artifact file contract. Prefer daemon wrapper commands over raw HTTP when registering or updating live artifacts.
Use this skill when the user asks for a data-backed view that should remain useful after the first render, for example a live dashboard, refreshable report, synced status page, auditable data view, or artifact that can later be refreshed from local/project data or connectors.
Before creating files, decide whether the user actually wants a live artifact or a normal static artifact:
Resolve scope and data source without blocking on connected connectors
"$OD_NODE_BIN" "$OD_BIN" tools connectors list --format compact. If the named connector is present with status: "connected", choose an appropriate read-only auto tool from its catalog and execute it through the connector wrapper.notion connector plus a user brief that names Notion is enough to start with notion.notion_search using a query derived from the requested artifact/topic. Use notion.notion_fetch_database only when the user supplied a database id or the search result clearly identifies one.Author the source files
template.html as the human-designed HTML template. The daemon hydrates it with data.json using the html_template_v1 binding contract — stay inside it or hydration fails and the raw template ships with visible {{…}} tokens:
{{data.path.to.value}}. Paths start with data, dot-separated; numeric array indexes are allowed ({{data.kpis.0.value}}). Every binding must resolve to a single string/number, not an object or array.data-od-repeat="item in data.items", then bind loop-scoped fields inside it as {{item.label}} (or {{item}} for a scalar array). One level only; data.* still works inside the repeat for globals.<script> (scripts are stripped from previews), and do NOT reference a bare loop variable like {{metric.value}} without a matching data-od-repeat scope — that binding is unresolvable. Nested repeats, conditionals, filters, helpers, and raw/triple-brace interpolation are unsupported.data.json as the canonical preview data used by those bindings — real values, not placeholders.artifact.json with the live artifact metadata, preview declaration, document declaration, and safe source descriptors.provenance.json with concise source notes, timestamps, non-sensitive connector references, and transformation notes.index.html as source. The daemon derives index.html from template.html and data.json.Keep data compact and preview-oriented
data.json.references/artifact-schema.md.Apply safety rules before registration
artifact.json, data.json, provenance.json, or source metadata.raw, rawResponse, payload, body, headers, cookie, authorization, token, secret, credential, and password anywhere in persisted JSON.html_template_v1 interpolation only. Raw/unescaped HTML interpolation is not allowed.Register or update through daemon wrappers
Use the OpenDesign daemon wrapper commands via "$OD_NODE_BIN" "$OD_BIN" instead of raw curl, bare node, or bare od:
"$OD_NODE_BIN" "$OD_BIN" tools live-artifacts create --input artifact.json
"$OD_NODE_BIN" "$OD_BIN" tools live-artifacts list --format compact
"$OD_NODE_BIN" "$OD_BIN" tools live-artifacts update --artifact-id "$ARTIFACT_ID" --input artifact.json
The wrapper reads injected OD_NODE_BIN, OD_BIN, OD_DAEMON_URL, and OD_TOOL_TOKEN; do not print, persist, or override token values.
Do not include or invent projectId; the daemon derives project/run scope from the token.
Use raw HTTP only for daemon development/debugging when explicitly requested.
Use connector wrappers for connector data
Discover available connectors and tools:
"$OD_NODE_BIN" "$OD_BIN" tools connectors list --format compact
Execute a read-only connector tool with a JSON object input file:
"$OD_NODE_BIN" "$OD_BIN" tools connectors execute --connector "$CONNECTOR_ID" --tool "$TOOL_NAME" --input input.json
Persist only the compact normalized fields needed by the preview plus non-sensitive connector references (connectorId, toolName, accountLabel). Never persist connector credentials, transport metadata, or raw provider output.
Do not ask for connector secrets or duplicate setup. If status is connected, use the listed tools; if it is not connected, tell the user to connect it in the UI.
See references/connector-policy.md for listing/execution and credential boundaries, and references/refresh-contract.md for read-only refresh source metadata.
Report concise results
index.html is daemon-derived.Every live artifact creation flow must produce these source files before registration:
template.html — declared skill output and source template for the preview.data.json — compact, canonical preview data.artifact.json — create/update input for daemon validation.provenance.json — safe source and transformation summary.index.html is the primary preview entry declared in frontmatter, but it is derived daemon output rather than agent-authored source.