Nexus Generative UI
SkillFiles & storageGenerate interactive charts, flowcharts, simulators, explorable explanations, data dashboards, visual comparisons, SVG/Canvas art, and UI prototypes in Nexus conversations. Use only when visualization is clearer than text or tables; not for HTML or diagram files that need to be saved persistently or
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Nexus Generative UI skill
What this skill tells your AI
The instructions your AI receives, as published by nexus-research-lab/nexus in skills/visualize/SKILL.md and read by ahel’s review.
Create a custom interactive visual only when it communicates the answer better than ordinary prose or a table.
Workflow
- Call
show_widgetwith a concise title and one self-contained HTML fragment inwidget_code. - Put explanation and conclusions in the normal response around the widget. Do not repeat the visual as Markdown.
- The tool result only confirms delivery to the client. Do not claim that rendering succeeded.
Widget contract
- Return a fragment only. Do not include
html,head, orbodytags. - Inline the widget's CSS and JavaScript. SVG, Canvas, DOM, Web Components, and external CDN libraries are supported.
- Network access and external resources are allowed without a domain allowlist. Prefer established HTTPS CDNs.
- The fragment runs in an isolated iframe and cannot access the Nexus page, cookies, storage, or parent DOM.
- Streaming order is short style, visible content, then scripts last. Scripts run only after the complete tool input arrives. Keep native controls and static content useful before initialization.
- Before calling
show_widget, check every inline script for unmatched quotes, backticks, brackets, and incomplete blocks. Prefer short functions over one monolithic script. - Before calling
show_widget, verify that every id, class, or data attribute referenced by JavaScript exists in the submitted markup and is spelled identically. - Separate source data, derived calculations, rendering, and event binding. Avoid constructing large interfaces through nested template literals or long HTML string concatenation; update existing DOM nodes when practical.
- Use the smallest implementation that fully answers the request. Split independent visuals into separate
show_widgetcalls with short prose between them, but keep one cohesive widget when its views share state. - Make the layout responsive at 320px width and avoid fixed viewport dimensions.
- Use accessible labels, keyboard-operable controls, visible focus, and reduced-motion fallbacks.
- Keep interaction local to the widget. Do not assume a host API or
postMessagebridge.
Nexus visual language
- Make the visual feel native to the surrounding answer: flat, quiet, compact, and content-first.
- Keep the outermost background transparent. Use neutral surfaces, one-pixel borders, and 8px or 12px radii; avoid gradients, glass, glow, heavy shadows, and decorative hero layouts.
- Use only 400 and 500 font weights. Body text is 14px to 16px, labels are at least 12px, and controls are compact rather than oversized.
- Use the accent color only for selection, focus, or the primary data series. Prefer one neutral ramp and at most two categorical color ramps.
- Do not recreate Nexus chrome or add a second page title inside the widget.
widget_codecontains the visual and its local controls, not duplicate prose. - Let content determine height. Do not create nested scrolling, fixed-position overlays, or viewport-sized shells.
Theme variables
--nexus-background--nexus-surface--nexus-surface-hover--nexus-text--nexus-muted--nexus-border--nexus-accent--nexus-accent-contrast--nexus-chart-1through--nexus-chart-5--nexus-font-sans--nexus-font-mono--nexus-radius-md--nexus-radius-lg
Use these variables for CSS and SVG. Canvas APIs cannot resolve CSS var(...) strings; read their computed values first.
Interactive widgets
- Begin with visible, meaningful markup. JavaScript enhances it after streaming; it must not be required to reveal the entire widget.
- Use native
button,input,select, andrangecontrols with explicit labels. Every visible control must change the visual immediately and support keyboard input. - Keep one plain state object. Derive displayed values from it, then render through short idempotent functions.
- Resolve elements before binding events. Never call
.addEventListenerdirectly ongetElementById(...)orquerySelector(...): fail with a clearMissing widget element: <selector>error for required elements, and use optional chaining only for genuinely optional controls. - Bind events once with
addEventListener. Do not wait forDOMContentLoaded; final widget scripts already run after the submitted markup is inserted. Do not mix inline handlers, duplicated listeners, and global mutable callbacks. - Prefer changing
textContent, attributes, classes, SVG paths, or chart data over replacing a large subtree withinnerHTML. - Animate the visualization, not the surrounding UI. Use 150-400ms transitions and honor
prefers-reduced-motion.
Charts
- Use SVG or native DOM for small charts. Use Chart.js only when axes, tooltips, or multiple dynamic series justify it.
- Wrap each canvas in a
position:relativecontainer with an explicit height. Do not set CSS height on canvas. Useresponsive:trueandmaintainAspectRatio:false. - Canvas cannot resolve CSS variables. Read
--nexus-chart-1through--nexus-chart-5withgetComputedStyle(document.documentElement).getPropertyValue(name).trim(). - Assigning
canvas.widthorcanvas.heightclears the bitmap and resets the context. Set the backing size only during initialization or a real resize, never inside draw or coordinate helpers. - Give every canvas a unique id. Keep the chart instance and guard initialization so CDN
onloadplus an immediate fallback cannot create it twice. - Load established UMD builds over HTTPS. Put the library script before the initializer, use
onloadto call a named init function, and also call it when the global already exists. - Controls must update chart data and call
chart.update(). Disable library legends when a compact HTML legend communicates values more clearly. - Round displayed values consistently, label axes and units, and pad plot ranges so points and labels are not clipped.
Diagrams
- Prefer one responsive SVG with
width="100%"and a completeviewBox. Putdefsand arrow markers before visible nodes so streaming connectors are valid. - Choose the structure that matches the idea: flow for sequence, hierarchy for ownership, cycle for feedback, matrix for two dimensions, timeline for change, or side-by-side for comparison.
- Keep node titles to five words when possible and at most four full-size nodes per row. Put detail in surrounding prose or an interactive inspector.
- Calculate the
viewBoxfrom the lowest element plus padding. Keep labels inside bounds and account fortext-anchordirection. - Connect edges from node boundaries, use a shared marker, and verify no edge crosses unrelated nodes or text.
- Use neutral structure plus no more than two categorical chart colors. Encode status with text or shape as well as color.
- For interactive diagrams, mutate classes and SVG attributes on existing elements instead of rebuilding the SVG.
When diagram-design is installed, use it for a persistent, downloadable single-file HTML diagram rather than an inline conversational widget.
UI mockups
- Reproduce the requested product surface, not an entire decorative landing page. Omit browser chrome, fake sidebars, duplicate titles, and ornamental hero areas unless they are the subject.
- Use a clear reading order: compact controls, primary content, then secondary detail. Prefer dividers and whitespace over nested cards.
- Use CSS Grid for comparable metrics and Flexbox for compact controls. Keep labels and values aligned to common axes.
- Use one-pixel
--nexus-borderboundaries,--nexus-surfacefor restrained grouping, and 8px or 12px radii. Avoid gradients, glass, glow, and heavy shadows. - Empty, loading, selected, warning, and error states must remain distinguishable in both light and dark themes.
- On narrow widths, reflow columns and allow tables or timelines to scroll only when their data cannot remain legible otherwise.
SVG and Canvas art
- Prefer SVG for illustrations and finite diagrams; use Canvas for continuous animation, dense particles, or pixel-level drawing.
- For Canvas, initialize the backing store once per actual size change, scale for
devicePixelRatioonce, and keep coordinate conversion separate from drawing. - Resolve Nexus color variables to concrete values before assigning
fillStyle,strokeStyle, shadows, or gradients. - Run animation through
requestAnimationFrame, cap particle or object counts, and pause or simplify whenprefers-reduced-motionis enabled. - Keep controls and captions as accessible HTML outside Canvas. Do not make essential meaning depend on pixels alone.
- Keep the outer surface transparent and let the artwork, not decorative containers, carry the composition.
Signals
- GitHub stars
- 145
- Forks
- 15
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
visualize-nexus-research-lab- Source
- github.com/nexus-research-lab/nexus