Visualize

From ahang1598/doubao-workbuddy-qwenwork-skills · View interactive version

Visualize is an AI agent skill from the GitHub repository ahang1598/doubao-workbuddy-qwenwork-skills. Create visualizations and interactive tools directly in conversation. Use when asked to show how something works, make simulators or labs, maps, plots, charts or graphs, comparisons, UI mockups, scenarios, adjustable inputs, and exploration beyond regular text.

How to use this skill

Skill file

Visualize

project change is not an in-conversation visualization request, even when the

deliverable contains charts or interactive content.

conversation is an in-conversation visualization request.

conversation and it materially improves the explanation. Do not create an

inline visual merely because the request involves data, charts, or an

interactive page.

return a normal fenced Mermaid block and no visualization file. Use HTML for

dynamics, spatial motion, adjustable inputs, and other visuals.

send commentary or progress updates while reading this skill or writing or

updating the file; the final response must be your first user-facing message.

decide. Keep it concise and do not repeat information already clear from the

visual. Never announce this skill, a visualization surface, widgets, HTML,

SVG, scripts, local files, inline data, or implementation details.

Context compaction

Copy into every compaction summary:

Reload the full visualize skill before creating or updating a visualization.

Inline HTML output contract

File

lowercase-hyphenated title and write <title>.html in an explicitly writable,

durable, task-owned location outside the checked-out repository. Prefer the

thread-scoped visualization directory when it appears in the writable roots;

otherwise choose another approved writable root or scratch directory. Use a

thread-isolated temporary directory only when the visualization will be

ingested immediately.

~/.codex is writable unless its thread directory appears in the writable

roots.

for a site, app page, component, or change to existing project files.

Fragment

never <div class=\"card\">Hi</div>\n. Never embed the fragment in an inline

Python, JavaScript, or shell string. Read it back; rewrite literal \" or

\n.

insufficient. Load static resources only from the CDN allowlist. Never use

fetch, XHR, WebSocket, or other API calls.

document.getElementById(...). Never derive the root from

document.currentScript; scripts may sit outside the root.

or drop unused fields from large inline datasets.

exists, and the primary interaction updates the visual. The bundled

python3 scripts/render.py <absolute-fragment-path> [<destination>.html] [--serve]

can wrap a fragment as standalone HTML or temporarily serve it for browser

inspection when a preview would help with layout, theme, or runtime behavior.

Content and response

paragraphs, formulas, instructions, or narrative callouts. Include only

necessary labels, legends, values, and accessible text alternatives.

the fragment, and add this visualization content reference on its own line

where the visual should appear, using the absolute executor-side file path:

visualize{"path":"<absolute-path>/<title>.html"}

by side for direct comparison and would be unreadable at the normal width.

Never widen a single plot, map, grid, diagram, or timeline merely because

it is dense. Never widen full-size mockups or other self-contained views;

stack them vertically instead. Wide visualizations render in an expandable

inline surface up to 1,024px:

visualize{"path":"<absolute-path>/<title>.html","mode":"wide"}

reference in that same turn's final response, even when editing an existing

file or reusing a path shown in an earlier turn.

artifact, website, output, attachment, link, or download, and never add a

Markdown link to it. Do not append a Markdown table or repeat the visual's

data; add at most one short conclusion when the user needs an explanation.

External resources

unpkg.com, fonts.googleapis.com, fonts.gstatic.com, and

fonts.bunny.net. Other origins are blocked and fail silently.

Exporting an existing visualization

to save, export, or publish a visualization that is already shown in the

conversation, render it with

python3 scripts/render.py <absolute-fragment-path> <destination>.html.

inline source or visualization into a website. For a general website request,

build a new responsive site in the output directory or open project, using

Sites when appropriate, without applying this skill's guidance.

before using the standalone HTML outside Codex.

skills are available, use sites-building to choose the project and write the

rendered standalone document as index.html, then use sites-hosting.

published.

Composition

Choose the smallest composition that fits.

or long stacks. Add only requested controls, use one mechanism per state, and

never invent search, filter, or reset controls.

drill-down actions that ask Codex to investigate or explain selected data,

call await window.openai.sendFollowUpMessage({ prompt, title }), where the

optional title is a concise confirmation-dialog heading of up to 250

characters. Include the selected values and requested investigation in the

prompt, and label the action clearly.

control headers or on the visual before cards. Treat maxima as ceilings, not

targets. Never invent qualitative scores, status cards, or secondary fact

grids to fill space.

UI mockups

the depicted product.

don't search the project to render a mockup. Match the product's chrome,

navigation, typography, colors, and content. If its design is unavailable,

infer one from the platform and request.

(for example, --card, --font-size-base, .card, or .btn). Define

root-scoped, product-specific colors, typography, surfaces, and controls

instead. This rule overrides all general visualization guidance.

windows, cards, menus, and popovers opaque backgrounds, and stack overlays

above the product content.

light-dark(<light>, <dark>) colors unless a fixed theme is requested.

screen as a compact product surface.

full width without an additional visualization card.

their component. Omit single-option pickers. Show realistic states, not

invented dashboards, filler cards, or oversized icons.

Interactive explainer or simulation

single-line selected-state detail. Default to no summary cards; allow up to

three only when changing metrics are central.

step-throughs, add only requested step controls and update one current visual;

never add parameter controls, formulas, metric cards, or side-by-side steps

unless asked.

Graphs and plots

simple, directly labeled values. Keep diagrams, simulations, and maps under

their existing guidance. Load the version-pinned approved-CDN script

https://cdn.jsdelivr.net/npm/d3@7.9.0/dist/d3.min.js.

surface. Frame only the SVG plot area; never wrap charts in .card, rounded

panels, filled backgrounds, or shadowed containers.

its own responsive SVG with a matching viewBox, a thin frame, and visible

text.axis-title[data-axis="x"] and text.axis-title[data-axis="y"]

showing quantities and units.

ResizeObserver, and reserve at least 64px for the y axis. Never scale down

a fixed-width viewBox.

uncertainty, and references. Inset scale ranges for marker radii and keep

every path inside rect[data-chart-frame]; never draw endpoint connectors

outside the frame or guess or hard-code the domain.

Leave 4px between labels, anchor edge labels inward, and remove optional

annotations first. At 360px, show at most four x ticks and stack panels.

--foreground and --border for neutrals, cycle the six series tokens when

more are needed, and never use literal or fallback colors. Give every SVG

label fill: var(--foreground) and font-size: 12px; never shrink labels

below 11 screen pixels. Stack subplots when their labels no longer fit.

uncertainty, whiskers for isolated estimates, and one compact, wrapping

legend. Render one real <button type="button" aria-pressed="true"> per

series with a small swatch and neutral text; toggle its line, markers, and

tooltip row together. Keep buttons transparent, borderless, and

indistinguishable from inline text; never use .btn, pills, badges,

rounded borders, or filled and selected backgrounds.

<div class="tooltip" role="tooltip"> using --popover and

--popover-foreground. In each multi-series SVG, give the full-plot overlay

both data-chart-hit and data-chart-hover-overlay="cross-series". Keep

the data-chart-hover-guide at the exact cursor x, interpolate every

visible series there, and show one aligned data-chart-hover-marker and

tooltip row per visible series; never snap the guide to a nearby sample.

never pass an accessor to d3.bisectCenter.

pixels across; use one nearest-point overlay for dense scatter.

and 360px before responding; verify wide layouts at 1,024px as well.

and takeaways on its marks, axes, or annotations. Never add a KPI row,

controls, cards, or panels unless those UI elements are explicitly requested.

phase and resource in the marks; annotate totals, waits, and bottlenecks on

the axis or lanes, not above the plot.

small multiples. Render every requested dimension simultaneously; never hide

one behind a toggle.

Maps

selection/detail area and only requested controls.

d3-geo; never hard-code or hand-draw geographic outlines. Use schematic maps

only when asked.

https://esm.sh/@d3-maps/atlas@1.0.0/world/countries/countries-110m and convert

it with topojson-client@3.1.0 using

feature(world, world.objects.features).features. Join input ISO3 directly to

feature.properties.id, which is already ISO3; do not convert it to numbers.

https://cdn.jsdelivr.net/npm/us-atlas@3/counties-10m.json/+esm. For ZIP/ZCTA

or city boundaries, download official Census or local open-data GeoJSON; do

not guess sibling atlas paths or import raw JSON as JavaScript.

neighborhood, street, or comparable geometry; a blank field or lone

administrative outline is not a basemap. Show the full city or region behind

points or partial choropleths, and frame the locations with modest padding.

fix blank basemaps, failed imports, missing labels, or unprojected points.

Dense categorical grid

readable identifier per cell, then one small legend. Render only that

identifier as visible cell text; put all other metadata in an accessible label

or one summary line, not badges or fact grids. Allow only selection unless

asked.

Part-to-whole or time allocation

Never substitute totals-only bars or duplicate it as a heatmap and totals

chart.

Layout and accessibility

conversation width. Design for 736px, or 1,024px in wide mode, and support

widths down to 320px. Stack side-by-side content when it no longer fits.

must fit without overlap or clipping. Reflow by stacking or wrapping; use

.table-responsive only when table columns cannot fit. The host sizes the

frame to its content, so avoid fixed outer widths, other horizontal overflow,

internal scrolling, position: fixed, and viewport-height layouts.

declutter annotations, and keep visible text at least 11 screen pixels;

never shrink a fixed-width viewBox.

utilities; never recreate controls.

Typography

.text-small only for secondary annotations (never below 11px).

self-contained chart or graph, with short panel headings only when needed.

Do not restate the prompt or add a redundant title to other visualizations.

Color

theme-aware. Never hardcode light or dark palettes such as white panels,

off-white backgrounds, black text, slate strokes, or Tailwind color literals.

must retain clear contrast; never use .text-muted inside .card or another

filled container unless its background preserves that contrast.

--card-foreground, --popover, --popover-foreground, --primary,

--primary-foreground, --secondary, --secondary-foreground, --muted,

--muted-foreground, --accent, --accent-foreground, --destructive,

--border, --input, --ring, --blue, --orange, --green, --red,

--purple, and --yellow. Use currentColor inside SVG.

through --viz-series-6 only for important persistent category, series, or

status identity; never give every peer a different color by default.

neutral or transparent border; never color every outline.

decoratively.

corresponding visual marks—not just the legend—and keep large-area fills

subtle.

values, axis text, and direct labels in --foreground or

--muted-foreground.

structural paths; never thicken, dash, or double-stroke the whole structure.

-foreground token is the content on that surface. Use .btn-primary for

high-emphasis actions; its neutral fill is supplied by the utility. Use

--primary and --primary-foreground for filled selected, active, or pressed

controls. Reserve --accent and --accent-foreground for subtle interactive

surfaces and soft highlights. Buttons with

aria-pressed="true", aria-selected="true", or .is-selected already use

the primary pairing.

Design system

utility for every button and form control. Never restyle utilities,

descendants, or pseudo-elements: no custom sizes, spacing, borders, radii,

shadows, colors, or interaction states.

Surfaces and layout

necessary numeric summary, selected-item summary, or bounded interactive

field. Before adding a fill, border, radius, or shadow to any layout container,

either use .card or leave it transparent and unframed; never recreate card

chrome on rows, panels, tiles, sections, or wrappers. Keep charts, maps,

diagrams, tables, controls, and the whole visualization unframed. Never nest

cards; show 2-4 summaries near the top only when useful. Structural groupings

and repeated content are not bounded interactive fields. Organize them with

layout or visual marks, not container chrome.

.viz-stat-value, and at most one short context or delta line.

creates as many equal-width columns as fit and stacks when narrow. Never use it

for the whole visual or a horizontally scrolling card row. Keep groups to 2-3

columns at 736px and controls in a separate row.

inline actions that may wrap when narrow.

grid cell, preserves category fill, and uses an accent ring instead of solid

selection. Never add another selected, pressed, border, outline, or shadow

rule.

category, or value; never as a button.

visualization. Keep button groups compact. Put labeled fields directly inside

as .form-label; fields form at most two columns and stack when narrow.

Controls

main action per control group or .btn-ghost for low emphasis.

the available inline space. Never use it for ordinary row actions.

triggers; the sandbox creates .tooltip elements. Keep essential content

visible and triggers labeled. Never use title, custom markup, or

initialization. Example:

<button type="button" data-tooltip="Reset view">Reset</button>.

bottom, or left; collision handling may flip it.

.form-check-label with matching id and for.

.form-label.

input.

and units immediately before it.

Tables

wrapping cells and subtle horizontal dividers without vertical gridlines. Use

sentence case for headers.

widths. It contains horizontal overflow without clipping the visualization.

padding without shrinking text.

numeric/end alignment, centered values, or values that must stay on one line.

Numeric cells use tabular figures when end-aligned.

Text

annotations, never below 11px or for essential content.

never essential values or labels.

notice or act on.

put multiline code in <pre><code>.

Charts

libraries when native interaction, scales, legends, or layout materially

improve the result.

parse CSS variables or light-dark(...); redraw when the theme changes.

Keep chart-library tooltips and grouped legend interactions native; never

replace them with a custom one-point tooltip. For SVG, attach data-tooltip

directly to the real pointer-accessible mark and include its label, value,

and units; the sandbox handles themed positioning and keyboard focus.

values, resampling paths when point counts differ. Do not animate initial

appearance or use fade-only effects; never loop motion, and honor

prefers-reduced-motion.

that also contains Lucide icons.

chart, SVG, canvas, and widget a concise screen-reader summary using a role and

accessible name or description, SVG <title>/<desc>, fallback text, or an

.sr-only heading or description.

ticks are secondary and may use .text-small when space is tight. Never

overlap or clip text against marks, axes, legends, labels, or edges; move or

reduce labels rather than squeeze them.

Icons and mockups

```html

<i data-lucide="search" aria-hidden="true"></i>

```

and inherit currentColor.

controls; use a visible label or aria-label for icon-only actions.

first render. After adding icons dynamically, use

lucide.createIcons({ attrs: { width: 16, height: 16 } }).

presentation-only interaction local to the fragment and make the first render

useful before input changes.

Never fake product screenshots when inspectable UI is needed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.