artifacts
Persist, version, and iterate on LLM-generated UI (widgets, HTML, markdown). Load when the user wants to save, find, update, or iterate on a previously-rendered widget — anything that should outlive the chat scrollback.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-05
- Stars
- ★ 212
- Forks
- 33
01 前言 Front Matter
- name
- artifacts
- triggers
- artifact, save widget, save this, iterate, iterate on, update the widget, change the widget, version, library, find widget, what have we built, iterate again, redo the
- description
- Persist, version, and iterate on LLM-generated UI (widgets, HTML, markdown). Load when the user wants to save, find, update, or iterate on a previously-rendered widget — anything that should outlive the chat scrollback.
03 SKILL.md 正文
Artifacts (@gideon-core/artifact_*)
An Artifact is a named, versioned piece of generated content — a widget,
HTML tool, dashboard, markdown doc, SVG, or JSON — that persists beyond the chat
scrollback and can be reopened and iterated on by name in a later session. The
Artifacts library lists them; each lives at /artifacts/<slug> in the dashboard.
Without artifacts, a widget you render scrolls away and is gone. With them, the user can say "iterate on that dashboard" three days later and you can fetch the current version, change it, and save a new checkpoint.
Mental model
- slug — the stable handle (e.g.
sales-dashboard). Derived from the name, or you pass an explicit one. Everything references an artifact by slug. - version — every
artifact_updatesnapshots a new numbered version (like a commit). The live version is what/artifacts/<slug>shows; old snapshots are kept up toMAX_VERSIONS = 50(FIFO-pruned beyond that). - kind —
widget(default),html,markdown,svg,json,text,infographic(AntV declarative DSL → SVG — see theinfographic-syntaxskill),document(editorial long-form HTML — see theeditorial-documentskill).
Tools
| Tool | Use |
|---|---|
artifact_list |
List saved artifacts (name/slug/kind/version/tags). Filter by tag, kind, or text q. |
artifact_save |
Save new content. Returns the slug — the handle for later. |
artifact_get |
Fetch content by slug (pass version=N for a historical snapshot; omit for live). |
artifact_update |
Update by slug → new version snapshot. New content, or metadata only. |
artifact_versions |
List the numbered snapshots of a slug. |
artifact_delete |
Delete an artifact + its history by slug (does not touch any source file). |
artifact_save/artifact_update take content inline via content= or from a
file via content_file= (absolute path — a Workspace/cwd file).
Rules (follow these)
-
Always
artifact_listbeforeartifact_save(kind="widget"). Check whether a matching widget already exists. If it does,artifact_updateit instead of creating a near-duplicate. -
Re-emitting a saved widget requires its slug. When you render the HTML of a saved artifact again in chat, put its slug on the tag so the dashboard links the rendered widget back to the library entry:
<widget title="…" slug="sales-dashboard">…</widget>. -
Iterate-without-a-slug decision tree. The user says "iterate on that" but you don't have a slug:
- It was saved earlier this session → you have the slug;
artifact_get→ change →artifact_update. - It was rendered but never saved → save it yourself now (
artifact_save), then iterate. Never tell the user "it wasn't saved, so I can't iterate" — saving is your job, do it silently. - You're unsure which artifact →
artifact_list(filter byq/kind) and pick by name, or ask only if genuinely ambiguous.
- It was saved earlier this session → you have the slug;
-
Metadata-only updates don't bump content. Changing just
description/tagsviaartifact_updateis fine and still snapshots — but don't re-send identical content just to touch metadata.
Don't
- Don't save throwaway one-off widgets the user didn't ask to keep. Cost discipline: a quick chart inline is fine unsaved.
- Don't create a second artifact when one already covers it — update instead.
- Don't delete an artifact to "replace" it —
artifact_updateis the replace. - Don't reference a slug you haven't confirmed exists (
artifact_get/listfirst).
Worked example
User: "Save this as the team dashboard." (after you rendered a widget)
artifact_list(kind="widget", q="team dashboard")→ none.artifact_save(name="Team Dashboard", kind="widget", content="<the HTML>")→ returnsslug="team-dashboard".- Tell the user: saved →
/artifacts/team-dashboard.
User (next day): "Add a burndown chart to the team dashboard."
artifact_get(slug="team-dashboard")→ current HTML.- Add the chart (Chart.js from jsDelivr — see the
widgetsskill for CSP/theme). artifact_update(slug="team-dashboard", content="<new HTML>")→ new version.- Re-render in chat with
<widget title="Team Dashboard" slug="team-dashboard">….
04 同仓库更多 Skills
web-verify
Verify a built web page or app actually renders and works — drive it in a real browser, check the console and network, confirm the thing you changed is the thing being served, and capture evidence. Use before claiming a frontend change works.
visual-output
Emit rich visual output in chat via <widget> tags — styled HTML cards, charts, tables, interactive tools, and drawn SVG/canvas diagrams, illustrations, and animations — theme-aware, centered, and responsive instead of clashing or cramped.
task-and-project
Track work as Tasks (the /api/tasks CRUD + native task provider), and decompose larger projects into independent, verifiable units — fanning parallel investigation out to subagents while keeping one coherent plan; hand open-ended goal-driven work to a goal loop.
research-campaign
Run a multi-cycle research campaign — grill the question, decompose it into answerable sub-questions, investigate each against sources, then synthesize with confidence and gaps stated. Use for open questions that need real investigation rather than one lookup.
memory-discipline
When and how to persist durable memory — save genuine user preferences, facts, and corrections; NEVER persist transient environment failures (a failed command, a flaky network call, a one-off tool error) as lessons; recall before re-asking.
loop-worker
Per-cycle protocol for an autonomous goal loop worker — the unified autonomous goal engine that runs one self-directed cycle per turn until its goal is met, then self-retires. Drives one cycle against a loop's file interface (status.json gate, brief.md goal, guidance.txt nudges, findings/cycle_NNN.json, FINDINGS.md, the type-appropriate deliverable, STOP sentinel). The worker produces work and reports evidence; a deterministic check or a separate judge — never the worker — decides done-ness.