skill · built into metaphor
/artifact-interactive
Interactive explainer artifacts — sliders, toggles, live readouts, steppers for cyclic or multi-step traces, and synchronized SVG/Chart updates
- Built in
- Slash command
you ›/artifact-interactive
metaphor ›Loaded the artifact-interactive skill. What should I work on?
What the agent is told
This is the skill's SKILL.md, exactly what Metaphor reads before the task.
If the real system has a threshold, rate, window size, or state transition, give the artifact that control so the user can feel the invariant by moving it.
1. Layout pattern: Controls → Live Readout → Visual
Do not wrap the whole interactive in a bordered card. Use a clean vertical stack (flex flex-col gap-4):
- Controls bar: 1–3 sliders (
<input type="range">) or toggle buttons (<button>), each paired with a label and a live formatted value (font-mono tabular-nums). - Metric readout row: 2–4
.metric-cardblocks showing the computed outputs, rounded cleanly (integers or at most 1–2 decimals; sign before currency-$12, never$-12). - Visual surface: An SVG diagram whose elements (
width,x,y,opacity, orc-*class) or a Chart.js canvas (chart.update()) updates immediately on theinputevent.
<div class="flex flex-col gap-4">
<div class="grid grid-cols-2 gap-4 items-center raised-card">
<label class="flex flex-col gap-1.5">
<div class="flex justify-between text-sm">
<span class="text-fg-subtle">Arrival rate (req/s)</span>
<span id="rate-val" class="font-mono font-medium tabular-nums">40</span>
</div>
<input id="rate" type="range" min="10" max="100" step="5" value="40" />
</label>
<label class="flex flex-col gap-1.5">
<div class="flex justify-between text-sm">
<span class="text-fg-subtle">Worker capacity (req/s)</span>
<span id="cap-val" class="font-mono font-medium tabular-nums">50</span>
</div>
<input id="cap" type="range" min="20" max="100" step="5" value="50" />
</label>
</div>
<div class="grid grid-cols-3 gap-3">
<div class="metric-card">
<div class="text-xs text-fg-subtle">Utilization (ρ)</div>
<div id="util-out" class="text-xl font-medium font-mono tabular-nums mt-1">80%</div>
</div>
<div class="metric-card">
<div class="text-xs text-fg-subtle">Avg queue depth</div>
<div id="depth-out" class="text-xl font-medium font-mono tabular-nums mt-1">3.2</div>
</div>
<div class="metric-card">
<div class="text-xs text-fg-subtle">P95 latency</div>
<div id="lat-out" class="text-xl font-medium font-mono tabular-nums mt-1">100 ms</div>
</div>
</div>
<div id="visual-stage">
<!-- SVG or Chart canvas updated by script -->
</div>
</div>
2. Steppers for cycles, state machines, and code traces
Never draw a circular ring of arrows for a loop or multi-stage trace. Build a stepper:
- A compact header bar with
Prev/Nextbuttons (Nextwraps around to Step 1 for cycles), a step counter (Step 2 of 4), and a 1-sentence caption for the current beat. - An SVG diagram where the active node gets a semantic highlight ramp (
c-tealorc-purple) while inactive nodes stayc-gray, and a payload token or callout moves to the active stage. - Include a drill-down button (
onclick="sendPrompt('Show me the error-handling path in step 3')") oronclick="openFile('path/to/file.ts', 42)"when walking through code.
3. Rules
- Bind slider listeners to
"input"(not"change") so the visual responds while dragging. - Round every displayed number (
Math.round,.toFixed(1)). Never let0.30000000000000004reach the DOM. - Keep scripts self-contained at the bottom of the fragment; never rely on external CDNs.
Questions
What is the artifact-interactive skill?
Interactive explainer artifacts — sliders, toggles, live readouts, steppers for cyclic or multi-step traces, and synchronized SVG/Chart updates
How do I use artifact-interactive in Metaphor?
It is built into Metaphor. Type /artifact-interactive in the composer, or describe the task and the agent loads the skill when it fits.
What is a skill?
A skill is a set of written instructions the agent reads before it starts a kind of task. It changes how the agent works, not what it is allowed to do.
More built-in skills
- /ai-ciSkillBudgeted investigation of failed GitHub Actions / PR checks — bootstrap annotations first, then failed logs, localize to code, classify flake vs real vs infraships with metaphor
- /ai-prSkillBudgeted whole-PR critique via the pr subagent — map diff, evidence findings, return a pr_review_draft for the Agent Review canvasships with metaphor
- /ai-securitySkillBudgeted security and AI-agent risk review — ai_security scan, OSV CVE/GHSA lookups, OWASP LLM/MCP/Top10 tagging, draft for Agent Review canvasships with metaphor
- /ai-sreSkillBudgeted production investigation against connected observability/logs MCP servers — scope, resolve schema, query, correlate, conclude with evidenceships with metaphor
- /artifactSkillDesign and publish self-contained HTML + Tailwind + SVG visual artifacts (diagrams, interactive explainers, charts, mockups, structured docs) that blend…ships with metaphor
- /artifact-chartSkillChart.js rules for HTML artifacts — offline lib:chart script, wrapper-div sizing, custom HTML legends with values, hex palette for canvas, and honest data rulesships with metaphor