Agent skill

Kocoro Generative UI

by Kocoro-lab in Kocoro-lab/Kocoro

Generate interactive, inline HTML/SVG widgets (charts, diagrams, forms, dashboards, illustrations) that render in sandboxed iframes inside Kocoro Desktop chat.

MITAuto-check passedFrontend & Design

Install Kocoro Generative UI

skills CLI
$ npx skills add Kocoro-lab/Kocoro --skill kocoro-generative-ui -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Kocoro-lab/Kocoro kocoro-generative-ui --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Kocoro-lab/Kocoro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/skills/bundled/skills/kocoro-generative-ui .claude/skills/kocoro-generative-ui && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kocoro-generative-ui
GitHub stars
414
Token cost
~2.5k tokens
SKILL.md length
1,159 words
Files
6 (incl. references)
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Generate interactive, inline HTML/SVG widgets (charts, diagrams, forms, dashboards, illustrations) that render in sandboxed iframes inside Kocoro Desktop chat.

  • Works in 2 steps: Use file_write to save the same HTML… → Use publish_to_web with a specific…
  • The user asks to visualize
  • SKILL.md covers Output Contract, Streaming Safety, CDN allowlist (CSP-enforced) and Design system, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Kocoro Generative UI is an agent skill from Kocoro-lab/Kocoro. Generate interactive, inline HTML/SVG widgets (charts, diagrams, forms, dashboards, illustrations) that render in sandboxed iframes inside Kocoro Desktop chat. Use when the user asks to "visualize", "chart", "diagram", "explain visually", "show me", or when data is denser than a paragraph of prose.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/charts.md`, `references/diagrams.md` and `references/maps.md`).

It sits in Frontend & Design, covering Diagrams. The repository describes itself as: A Mac-native AI agent with memory, local computer access, browser control, IM channels, and MCP-native integrations. Built on Shannon. The licence is MIT.

When your agent uses it

  • The user asks to visualize
  • Explain visually
  • Data is denser than a paragraph of prose

Example prompts

  • “visualize”
  • “diagram”
  • “explain visually”
  • “/kocoro-generative-ui”

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Use file_write to save the same HTML body to a temp path
  2. Use publish_to_web with a specific purpose describing the recipient and

What it can do on your machine

Read from SKILL.md and the folder at commit 2d5a221. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • cdnjs.cloudflare.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Kocoro Generative UI loads about 2.5k tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 80 tokens; SKILL.md has 1,159 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~80
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~17k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Kocoro-lab/Kocoro at commit 2d5a221, republished under its MIT licence (© Kocoro-lab). 1,159 words, ~2,535 tokens.

Download SKILL.mdSave it as .claude/skills/kocoro-generative-ui/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
kocoro-generative-ui
description
Generate interactive, inline HTML/SVG widgets (charts, diagrams, forms, dashboards, illustrations) that render in sandboxed iframes inside Kocoro Desktop chat. Use when the user asks to "visualize", "chart", "diagram", "explain visually", "show me", or when data is denser than a paragraph of prose.
hidden
true
metadata.version
1.0.3
metadata.user-invocable
true

Kocoro Generative UI

You produce rich visual content — SVG diagrams and HTML interactive widgets — that renders inline in the Kocoro Desktop conversation, token-by-token, in a WKWebView sandbox.

Channel availability: This skill is only exposed to the LLM on Desktop / TUI / direct API paths. The Kocoro daemon suppresses it on cloud-distributed channels (Feishu, Lark, WeCom, Slack, LINE, Telegram, webhook) because their clients render markdown but not html-artifact fences — see internal/daemon/skill_filter.go (desktopOnlySkills).

Output Contract

Wrap every widget in a markdown fenced code block with info string html-artifact:

```html-artifact title="Q1 revenue" id=art_a1 mime=text/html
<style>.bar{background:var(--color-background-info)}</style>
<h2 class="sr-only">Bar chart of Q1 revenue across three regions</h2>
<div style="position:relative;height:240px"><canvas id="c1"></canvas></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.js"></script>
<script>
  new Chart(document.getElementById('c1'), { /* ... */ });
</script>
```
  • title — required; shown to the user and used as export filename stem
  • id — optional; if absent, host generates a UUID
  • mime — text/html (default) or image/svg+xml
  • theme — auto (default), light, or dark
  • The content is a fragment. Do NOT write <!DOCTYPE>, <html>, <head>, <body> — the host wraps them.
  • Explanatory prose goes OUTSIDE the fence, in your normal reply.
  • Max 3 artifacts per reply.
  • When you need to show the user the fence syntax itself (e.g., teaching this feature), insert a zero-width space (U+200B) between the backticks in the example: <code>``​`html-artifact</code>. This prevents your example from being captured as a real artifact.

Streaming Safety

Output streams token-by-token. Structure code so useful content appears early and the script tag last:

  • HTML: <style> (short) → content HTML → <script> last. Scripts execute after the fence closes, not during streaming.
  • SVG: <defs> (markers) → visual elements.
  • Avoid gradients, shadows, blur — they flash during streaming DOM diffs. Use solid flat fills.
  • No <!-- HTML comments --> or /* CSS comments */. They waste tokens and may land mid-stream in ways that confuse rendering.

CDN allowlist (CSP-enforced)

External scripts, styles, fonts, images, and fetch / XMLHttpRequest / d3.json calls may reach ONLY these four hosts:

  • cdnjs.cloudflare.com
  • esm.sh
  • cdn.jsdelivr.net
  • unpkg.com

Any other origin is blocked by CSP and the request silently fails. You cannot call arbitrary external APIs, your own backend, raw.githubusercontent.com, or anything else — only static assets from these four CDNs. This applies to both <script src>/<link href> loads and runtime fetch() calls (e.g. D3 topology JSON from jsdelivr is fine; fetching a weather API is not).

Design system

  • Flat — no gradients, mesh backgrounds, noise textures, decorative effects. Clean flat surfaces only.
  • Dark mode is mandatory — every color must work in both light and dark. Use the CSS variables below; they auto-adapt. Never hardcode color: #333.
CSS variables provided by the host

Use these, not hardcoded hex:

  • Backgrounds: --color-background-primary (white/near-black), --color-background-secondary (surfaces), --color-background-tertiary (page bg), --color-background-info, --color-background-danger, --color-background-success, --color-background-warning
  • Text: --color-text-primary, --color-text-secondary, --color-text-tertiary, --color-text-info, --color-text-danger, --color-text-success, --color-text-warning
  • Borders: --color-border-tertiary (0.08α, default), --color-border-secondary (0.16α, hover), --color-border-primary (0.24α), semantic -info/-danger/-success/-warning
  • Typography: --font-sans (SF Pro), --font-serif (New York, rare editorial use), --font-mono (SF Mono)
  • Layout: --border-radius-md (8px), --border-radius-lg (12px, preferred), --border-radius-xl (16px)
Typography
  • Default font is var(--font-sans). Headings: h1 22px, h2 18px, h3 16px — all font-weight: 500. Body: 16px, weight 400, line-height 1.7.
  • Two weights only: 400 regular, 500 bold. Never 600 or 700.
  • Sentence case always. Never Title Case, never ALL CAPS. Applies to SVG text labels and diagram headings too.
  • No mid-sentence bolding. Bold is for headings and labels only. Entity names, class names, function names go in code style, not bold.
Borders, corners, form elements
  • Borders: 0.5px solid var(--color-border-tertiary) (upgrade to -secondary on hover).
  • Corners: var(--border-radius-md) for most elements, -lg for cards.
  • No rounded corners on single-sided borders.
  • Form elements (input, select, textarea, button, range input) are pre-styled — write bare tags, override only when necessary.
Widget container
  • The container is display: block; width: 100%. Start with your content directly; no wrapper div needed. If you want vertical breathing room, add padding: 1rem 0 on your first element.
  • Never use position: fixed — the host sizes the iframe to content height, so fixed positioning collapses it. For modal mockups, wrap everything in a normal-flow faux-viewport: <div style="min-height: 400px; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center;"> and put the modal inside.
Show full SKILL.md (511 more words)Show less

Color palette (9 ramps × 7 stops)

Classes: c-blue, c-teal, c-coral, c-pink, c-purple, c-green, c-amber, c-red, c-gray. Each provides a light-mode and dark-mode background + foreground + SVG fill/stroke. Apply to a <g> wrapping shape+text, or to <rect>/<circle>/<ellipse> directly — never to <path>.

Assignment rules:

  • Color encodes meaning, not sequence. Group nodes by category.
  • Prefer purple, teal, coral, pink for general diagram categories. Reserve blue, green, amber, red for where the node genuinely represents informational, success, warning, or error meaning.
  • Use gray for neutral/structural nodes.
  • 2–3 colors per diagram, not 6+.

Text on colored backgrounds: use the 800 or 900 stop from the same ramp for text — never plain black or generic gray. When both title and subtitle sit on a colored fill, title must be darker (800 in light mode, 100 in dark) and subtitle lighter (600 light, 200 dark).

Use case router

When the user asks for specific output types, read the relevant reference file via the file_read tool:

  • Charts (bar, line, pie, scatter, dashboards) → references/charts.md — Chart.js patterns, legends, number formatting
  • Flowcharts / structural diagrams → references/diagrams.md + references/svg-setup.md
  • Illustrative diagrams ("how does X work") → references/diagrams.md
  • UI mockups, cards, forms, comparisons → references/ui-components.md
  • Geographic maps (choropleths) → references/maps.md

Scope

This skill is visualization-only. It does not search the web, call external APIs, or retrieve live data. If the user's request requires fetching data from the internet or an external source, complete that step first (using a search or retrieval tool), then invoke this skill to visualize the results.

Forbidden

  • Fetching live data or searching the web — data must already be in context
  • Emoji (use CSS shapes or SVG paths)
  • Gradients, drop shadows, blur, glow, neon
  • position: fixed
  • <!-- HTML comments --> / /* CSS comments */
  • Font sizes below 11px
  • Title Case / ALL CAPS (sentence case only)
  • Mid-sentence bolding (use code style for identifiers)
  • Dark/colored backgrounds on the outermost container (host provides bg)
  • Nested scrolling (auto-fit height)
  • display: none sections during streaming (hidden content streams invisibly; show all stacked)

Accessibility

  • HTML widgets: begin with a visually-hidden one-sentence summary: <h2 class="sr-only">…</h2>.
  • SVG widgets: root <svg role="img"> with <title> and <desc> as the first two children.

Output discipline

  • Text goes in your response, visuals go in the artifact. Explanatory paragraphs, intros, section headings — all in normal response prose, not inside the fence.
  • Tables go in response prose as markdown, not inside widgets.
  • If you need multiple diagrams for a complex topic, stream them as separate artifacts with prose between each.

Sharing externally (optional)

The inline html-artifact block is the primary output — it renders in Kocoro Desktop with no public URL and no upload. Use it whenever the user's goal is just "show me".

If the user also wants a sharable link (to send via Slack/Feishu/email, embed in a doc, etc.), you may additionally:

  1. Use file_write to save the same HTML body to a temp path (e.g. /tmp/<short-id>.html).
  2. Use publish_to_web with a specific purpose describing the recipient and channel (e.g. "send revenue chart link to user via Slack").

Skip this entire block if the user did not ask for a shareable link — never publish a copy "just in case." Public URLs cannot be deleted.

© Kocoro-lab, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in internal/skills/bundled/skills/kocoro-generative-ui of Kocoro-lab/Kocoro.

  • SKILL.md
  • references/charts.md
  • references/diagrams.md
  • references/maps.md
  • references/svg-setup.md
  • references/ui-components.md

Open the folder on GitHubat commit 2d5a221

Compare with similar skills

Kocoro Generative UI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kocoro Generative UI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kocoro Generative UI this skillKocoro-lab/Kocoro414—~2.5kAutomated safety check: PassMIT
Architecture Mapalmendili/skills3821 repos~2.3kAutomated safety check: PassNone
Clay Sketchchadbyte/clay400—~2.5kAutomated safety check: PassAGPL-3.0
HTML Artifactsdogum/html-artifacts150—~2.1kAutomated safety check: PassApache-2.0
Visualizedisplay-dev/visualize138—~7.4kAutomated safety check: PassMIT
SVG UI Templatesxjtulyc/MedgeClaw6171 repos~522Automated safety check: PassNone

Similar skills

  • Architecture Map

    almendili/skills

    Build or update an interactive isometric map of a repository's architecture — buildings sized by real measurements, neighborhoods by subsystem, animated flows tracing actual call paths, and a drift…

    382 GitHub starsUsed in 1 repo~2.3k tokens
    Frontend & DesignAuto-check passed
  • Clay Sketch

    chadbyte/clay

    Draw and revise UI wireframes directly in Clay chat with the built-in clay-sketch renderer.

    400 GitHub stars~2.5k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • HTML Artifacts

    dogum/html-artifacts

    Produce a self-contained HTML artifact instead of a markdown document when the content benefits from spatial layout, color, real diagrams, interactivity, or a round-trip editor.

    150 GitHub stars~2.1k tokensUpdated 25 days ago
    Frontend & DesignAuto-check passed
  • Visualize

    display-dev/visualize

    Generate beautiful, on-brand HTML artifacts — reports, diagrams, diff reviews, slide decks, plans, recaps, dashboards.

    138 GitHub stars~7.4k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • SVG UI Templates

    xjtulyc/MedgeClaw

    Generate professional SVG UI panels for structured information display.

    617 GitHub starsUsed in 1 repo~522 tokens
    Frontend & DesignAuto-check passed
  • Preview

    hanamizuki/solopreneur

    Create an interactive HTML preview of any proposal, plan, idea, doc, brief, or spec and land it in the browsable local Preview Library by default (opens under file:// with a catalog sidebar and…

    152 GitHub stars~5.2k tokensUpdated 13 days ago
    Frontend & DesignAuto-check passed

More from Kocoro-lab/Kocoro

  • Claude API

    Kocoro-lab/Kocoro

    Build apps with the Claude API or Anthropic SDK. An agent skill from Kocoro-lab/Kocoro.

    414 GitHub starsUsed in 7 repos~4.5k tokens
    Auto-check passed
  • Kocoro

    Kocoro-lab/Kocoro

    Inspect AND manage Kocoro platform state — agents, skills, MCP servers, schedules, permissions, config, rules.

    414 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • PDF Reader

    Kocoro-lab/Kocoro

    Analyze PDF files attached by the user. An agent skill from Kocoro-lab/Kocoro.

    414 GitHub stars~482 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Kocoro Generative UI

What does Kocoro Generative UI do?

Generate interactive, inline HTML/SVG widgets (charts, diagrams, forms, dashboards, illustrations) that render in sandboxed iframes inside Kocoro Desktop chat. Kocoro Generative UI is an agent skill from Kocoro-lab/Kocoro. Generate interactive, inline HTML/SVG widgets (charts, diagrams, forms, dashboards, illustrations) that render in sandboxed iframes inside Kocoro Desktop chat.

When should I use Kocoro Generative UI?

Kocoro Generative UI fits situations like: the user asks to visualize; explain visually; data is denser than a paragraph of prose.

How do I install Kocoro Generative UI in Claude Code?

Run `npx skills add Kocoro-lab/Kocoro --skill kocoro-generative-ui -a claude-code`. Or copy the skill folder (internal/skills/bundled/skills/kocoro-generative-ui in Kocoro-lab/Kocoro) into .claude/skills/kocoro-generative-ui in your project. Claude Code loads it when a task matches its description.

How do I install Kocoro Generative UI in Codex?

Run `npx skills add Kocoro-lab/Kocoro --skill kocoro-generative-ui -a codex`. Or copy the skill folder (internal/skills/bundled/skills/kocoro-generative-ui in Kocoro-lab/Kocoro) into .agents/skills/kocoro-generative-ui in your project. Codex loads it when a task matches its description.

Can I use Kocoro Generative UI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Kocoro-lab/Kocoro --skill kocoro-generative-ui -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kocoro-generative-ui, .gemini/skills/kocoro-generative-ui, .github/skills/kocoro-generative-ui and .opencode/skills/kocoro-generative-ui in your project.

What does Kocoro Generative UI need to run?

SKILL.md names no scripts, command-line tools or credentials: Kocoro Generative UI is instructions for the agent only.

Does Kocoro Generative UI access the network?

SKILL.md names 1 domain. As links in the text: cdnjs.cloudflare.com. This is read from the text; nothing was executed.

Is Kocoro Generative UI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kocoro Generative UI use?

Kocoro Generative UI is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kocoro Generative UI use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.

What are the alternatives to Kocoro Generative UI?

Skills that share tags, products or a category with Kocoro Generative UI: Architecture Map (almendili/skills, 382 stars), Clay Sketch (chadbyte/clay, 400 stars), HTML Artifacts (dogum/html-artifacts, 150 stars) and Visualize (display-dev/visualize, 138 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kocoro Generative UI?

Kocoro-lab (a GitHub organization) maintains it in Kocoro-lab/Kocoro, which has 414 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 5, 2026.

Source: Kocoro-lab/Kocoro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.