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 a new <title>.html in the thread-scoped

visualization directory listed in the writable roots

(.codex/visualizations/YYYY/MM/DD/<thread-id>).

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 exact directive on its own line where the visual

should appear:

::codex-inline-vis{file="<title>.html"}

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

Markdown link to it.

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

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 and support widths down to 320px.

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.

utilities; never recreate controls.

Typography

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

restate the prompt inside the fragment; put titles and explanation in Markdown

above the directive.

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, and --ring. 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.

them for text; use --foreground or --muted-foreground for labels and

values.

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

only when it materially reduces complexity.

Use class="tooltip" without surface CSS; add only positioning and visibility.

Choose the best position: relative parent; convert the hovered mark into that

parent's CSS pixel space before setting absolute left/top. Measure and

clamp the box to the plot—never pointer coordinates. Show label, value, and

units; mirror them in a visible keyboard fallback.

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.