Visual Explainer
Generate self-contained HTML pages that explain systems, code changes, plans, data, and technical concepts visually. Use this skill for diagram requests, architecture overviews, diff/plan reviews, project recaps, comparison tables, slide decks, and any visual explanation.
Trigger and delivery rules
- Prefer an HTML page over terminal ASCII when the output is inherently visual
- If a table would have 4+ rows or 3+ columns, render it as HTML and give only a short chat summary
- Write files to
~/.local/share/agents/visual-explainer/diagrams/ or the explicit eval output path. Use descriptive filenames
- Open generated pages in the browser when running normally. In Pi package installs, use
visual_explainer with prepare for planning/context and render only after the complete HTML document exists
- The final page must be a complete self-contained HTML document, including embedded CSS and any needed JS
Required follow-up reads
Read only the references needed for the current output:
| Need |
Read |
When |
| Text-heavy architecture/cards |
templates/architecture.html |
Building that page shape |
| Mermaid diagrams |
templates/mermaid-flowchart.html, Mermaid sections in references/libraries.md |
A graph is the chosen representation |
| Data tables, comparisons, audits |
templates/data-table.html |
Tabular HTML is chosen |
| Slide decks |
templates/slide-deck.html, references/slide-patterns.md |
Slides are explicitly requested |
| Layout, overflow, depth, connectors, images |
references/css-patterns.md |
The selected layout needs those patterns |
| 4+ major page sections |
references/responsive-nav.md |
Adding responsive section navigation |
| Prose-heavy pages |
Prose sections in references/css-patterns.md and references/libraries.md |
Prose dominates the page |
| Command workflows |
Matching file under commands/ |
Running that named command |
Choose the representation
| Content |
Default representation |
| Flowchart, pipeline, state machine, decision tree |
Mermaid |
| Sequence, ER/schema, class, C4, topology-focused architecture |
Mermaid |
| Text-heavy architecture, module internals, implementation plans |
CSS grid cards, optionally with a Mermaid overview |
| 15+ element architecture |
Hybrid: small Mermaid overview + CSS detail cards |
| Comparison/audit/status matrix |
Semantic HTML <table> |
| Timeline/roadmap |
CSS timeline |
| Dashboard/metrics |
CSS grid + charts/KPIs |
| Slide deck |
100dvh slides using slide template patterns |
Mermaid invariants
- Use
theme: 'base' with custom themeVariables matching the page palette
- For complex diagrams use ELK layout when available
- Never use bare
<pre class="mermaid">
- Use the canonical
diagram-shell pattern from templates/mermaid-flowchart.html: .diagram-shell > .mermaid-wrap > .zoom-controls + .mermaid-viewport > .mermaid-canvas
- Every Mermaid diagram needs zoom in/out/reset/expand controls, Ctrl/Cmd+scroll zoom, drag panning, and click-to-expand
- Prefer
flowchart TD for complex diagrams. Use LR only for simple 3-4 node linear flows
- Use
<br/> in quoted flowchart labels. Do not use escaped \n labels
- Never define page-level
.node; Mermaid uses it internally. Use namespaced page classes such as .ve-card
- For 15+ elements, do not cram everything into one Mermaid diagram. Use the hybrid overview + cards pattern
Layout and style invariants
- Use semantic HTML where it helps accessibility and copy/paste:
<table>, headings, lists, <details>, captions
- Use CSS custom properties for palette:
--bg, --surface, --border, --text, --text-dim, and 3-5 accents
- Pick a clear aesthetic direction before writing: blueprint, editorial, paper/ink, terminal, IDE-inspired, or data-dense
- Avoid generic defaults: no body font that is only Inter, Roboto, Arial, Helvetica, or system-ui; no violet/fuchsia Tailwind-default accents as the main palette (
#8b5cf6, #7c3aed, #a78bfa, #d946ef); no cyan+magenta+purple neon dashboard; no gradient-mesh blobs
- Good font pair families: DM Sans + Fira Code; Instrument Serif + JetBrains Mono; IBM Plex Sans + IBM Plex Mono; Bricolage Grotesque + Fragment Mono; Plus Jakarta Sans + Azeret Mono
- Good accent directions: terracotta+sage, teal+slate, rose+cranberry, amber+emerald, deep blue+gold
- Prevent overflow:
min-width: 0 on grid/flex children, overflow-wrap: break-word for long text, and scroll containers for wide tables/code
- Do not set
display: flex directly on <li> when list markers matter
- Use depth sparingly: hero/elevated only for primary sections; flat/recessed for reference material
- Use entrance/hover animation only when it clarifies hierarchy. Respect
prefers-reduced-motion. Do not use continuous glow, pulse, or breathing effects on static content
Slide deck mode
Use slides only when explicitly requested or when a command asks for slides. Slides are a different medium, not a paginated article:
- Each slide is one viewport (
100dvh) with no page-level scrolling
- Use larger type, fewer objects per slide, varied compositions, and visible navigation
- Include slide nav chrome from
slide-deck.html: prev/next controls, slide count, keyboard navigation, and carousel dots/indicators
- Before writing HTML, inventory the source and map every source item to slides
- Do not drop content to fit a fixed slide count. Add slides instead
- Use the 10 slide types from
slide-patterns.md: Title, Section Divider, Content, Split, Diagram, Dashboard, Table, Code, Quote, Full-Bleed
Optional generated images
If surf is available, generated images may be embedded as base64 for hero banners, conceptual illustrations, or educational visuals. Skip images for data-heavy, structural, or Mermaid/CSS-suitable content. Pages must stand on CSS, typography, and diagrams without images.
Final checklist
Before delivery, verify:
- complete HTML document;
- output written to the requested path;
- no console errors when opened;
- no horizontal overflow at normal desktop width;
- fonts load with fallbacks;
- tables preserve rows/columns and wrap long text;
- Mermaid diagrams use
diagram-shell with zoom/pan/expand;
- slides fit one viewport, include carousel dots, and preserve source coverage;
- visual hierarchy makes the main idea obvious in the first viewport;
- styling would still be recognizable if compared against a generic dark/violet template
1---2name: visual-explainer3description: Use when the user asks for a self-contained HTML visual explanation, diagram, plan review, diff review, or recap.4license: AGPL-3.0-or-later5---67# Visual Explainer89Generate self-contained HTML pages that explain systems, code changes, plans, data, and technical concepts visually. Use this skill for diagram requests, architecture overviews, diff/plan reviews, project recaps, comparison tables, slide decks, and any visual explanation.1011## Trigger and delivery rules1213- Prefer an HTML page over terminal ASCII when the output is inherently visual14- If a table would have 4+ rows or 3+ columns, render it as HTML and give only a short chat summary15- Write files to `~/.local/share/agents/visual-explainer/diagrams/` or the explicit eval output path. Use descriptive filenames16- Open generated pages in the browser when running normally. In Pi package installs, use `visual_explainer` with `prepare` for planning/context and `render` only after the complete HTML document exists17- The final page must be a complete self-contained HTML document, including embedded CSS and any needed JS1819## Required follow-up reads2021Read only the references needed for the current output:2223|Need|Read|When|24|---|---|---|25|Text-heavy architecture/cards|`templates/architecture.html`|Building that page shape|26|Mermaid diagrams|`templates/mermaid-flowchart.html`, Mermaid sections in `references/libraries.md`|A graph is the chosen representation|27|Data tables, comparisons, audits|`templates/data-table.html`|Tabular HTML is chosen|28|Slide decks|`templates/slide-deck.html`, `references/slide-patterns.md`|Slides are explicitly requested|29|Layout, overflow, depth, connectors, images|`references/css-patterns.md`|The selected layout needs those patterns|30|4+ major page sections|`references/responsive-nav.md`|Adding responsive section navigation|31|Prose-heavy pages|Prose sections in `references/css-patterns.md` and `references/libraries.md`|Prose dominates the page|32|Command workflows|Matching file under `commands/`|Running that named command|3334## Choose the representation3536|Content|Default representation|37|---|---|38|Flowchart, pipeline, state machine, decision tree|Mermaid|39|Sequence, ER/schema, class, C4, topology-focused architecture|Mermaid|40|Text-heavy architecture, module internals, implementation plans|CSS grid cards, optionally with a Mermaid overview|41|15+ element architecture|Hybrid: small Mermaid overview + CSS detail cards|42|Comparison/audit/status matrix|Semantic HTML `<table>`|43|Timeline/roadmap|CSS timeline|44|Dashboard/metrics|CSS grid + charts/KPIs|45|Slide deck|`100dvh` slides using slide template patterns|4647## Mermaid invariants4849- Use `theme: 'base'` with custom `themeVariables` matching the page palette50- For complex diagrams use ELK layout when available51- Never use bare `<pre class="mermaid">`52- Use the canonical `diagram-shell` pattern from `templates/mermaid-flowchart.html`: `.diagram-shell` > `.mermaid-wrap` > `.zoom-controls` + `.mermaid-viewport` > `.mermaid-canvas`53- Every Mermaid diagram needs zoom in/out/reset/expand controls, Ctrl/Cmd+scroll zoom, drag panning, and click-to-expand54- Prefer `flowchart TD` for complex diagrams. Use `LR` only for simple 3-4 node linear flows55- Use `<br/>` in quoted flowchart labels. Do not use escaped `\n` labels56- Never define page-level `.node`; Mermaid uses it internally. Use namespaced page classes such as `.ve-card`57- For 15+ elements, do not cram everything into one Mermaid diagram. Use the hybrid overview + cards pattern5859## Layout and style invariants6061- Use semantic HTML where it helps accessibility and copy/paste: `<table>`, headings, lists, `<details>`, captions62- Use CSS custom properties for palette: `--bg`, `--surface`, `--border`, `--text`, `--text-dim`, and 3-5 accents63- Pick a clear aesthetic direction before writing: blueprint, editorial, paper/ink, terminal, IDE-inspired, or data-dense64- Avoid generic defaults: no body font that is only Inter, Roboto, Arial, Helvetica, or system-ui; no violet/fuchsia Tailwind-default accents as the main palette (`#8b5cf6`, `#7c3aed`, `#a78bfa`, `#d946ef`); no cyan+magenta+purple neon dashboard; no gradient-mesh blobs65- Good font pair families: DM Sans + Fira Code; Instrument Serif + JetBrains Mono; IBM Plex Sans + IBM Plex Mono; Bricolage Grotesque + Fragment Mono; Plus Jakarta Sans + Azeret Mono66- Good accent directions: terracotta+sage, teal+slate, rose+cranberry, amber+emerald, deep blue+gold67- Prevent overflow: `min-width: 0` on grid/flex children, `overflow-wrap: break-word` for long text, and scroll containers for wide tables/code68- Do not set `display: flex` directly on `<li>` when list markers matter69- Use depth sparingly: hero/elevated only for primary sections; flat/recessed for reference material70- Use entrance/hover animation only when it clarifies hierarchy. Respect `prefers-reduced-motion`. Do not use continuous glow, pulse, or breathing effects on static content7172## Slide deck mode7374Use slides only when explicitly requested or when a command asks for slides. Slides are a different medium, not a paginated article:7576- Each slide is one viewport (`100dvh`) with no page-level scrolling77- Use larger type, fewer objects per slide, varied compositions, and visible navigation78- Include slide nav chrome from `slide-deck.html`: prev/next controls, slide count, keyboard navigation, and carousel dots/indicators79- Before writing HTML, inventory the source and map every source item to slides80- Do not drop content to fit a fixed slide count. Add slides instead81- Use the 10 slide types from `slide-patterns.md`: Title, Section Divider, Content, Split, Diagram, Dashboard, Table, Code, Quote, Full-Bleed8283## Optional generated images8485If `surf` is available, generated images may be embedded as base64 for hero banners, conceptual illustrations, or educational visuals. Skip images for data-heavy, structural, or Mermaid/CSS-suitable content. Pages must stand on CSS, typography, and diagrams without images.8687## Final checklist8889Before delivery, verify:9091- complete HTML document;92- output written to the requested path;93- no console errors when opened;94- no horizontal overflow at normal desktop width;95- fonts load with fallbacks;96- tables preserve rows/columns and wrap long text;97- Mermaid diagrams use `diagram-shell` with zoom/pan/expand;98- slides fit one viewport, include carousel dots, and preserve source coverage;99- visual hierarchy makes the main idea obvious in the first viewport;100- styling would still be recognizable if compared against a generic dark/violet template101