matias14acevedo-svg

greensystems-interactive

Turn a GreenSystems diagram or organizational chart into one interactive HTML page: details on hover, a pinned panel on click, search, pan and zoom, slide-by-slide presentation with animations, and export to SVG, PNG, JSON or PDF. Use when the reader should explore or present a diagram instead of only looking at it.

matias14acevedo-svg 0 Updated 4h ago

Resources

2
GitHub

Install

npx skillscat add matias14acevedo-svg/greensystems/greensystems-interactive

Install via the SkillsCat registry.

SKILL.md

GreenSystems — interactive diagrams

Use this skill when a diagram or org chart must answer questions on its own: who is this, what does this box do, what does it connect to, in what order should I read it. The output is a single HTML file with no dependencies and no network requests. It opens from disk, from an email attachment or from any static host.

This skill adds behaviour, not a new look. The page uses the GreenSystems tokens, icons and components exactly as the static output does. Read the greensystems skill first for the visual system; everything there still applies.

What the reader gets

Action Result
Hover a node, connection or group (or Tab to it) A card with its name, hover text and up to three facts. Its direct connections stay lit; everything else dims.
Click (or Enter) The details panel pins open: full text, every fact, an optional link, and incoming and outgoing connections as buttons that jump to the neighbour.
Drag, wheel, pinch, + − 0 Pan and zoom. 0 fits the diagram to the screen.
/ or Ctrl K Search nodes by name, subtitle, hover text or facts.
P or the Present button Slide-by-slide presentation: the camera frames the nodes of each slide, the rest dims or stays hidden, and a bar shows the title and notes.
→ ↓ Space / ← ↑, 1–9, Home, End Next, previous, jump to a slide. F toggles full screen.
R Replays the build animation.
S or the sound button Only when the document has "sound" or "music": turns the synthesized motion sounds (the animation plays again with them) and the background music (looping across slides) on or off. Pages start silent; browsers play sound only after a click.
E or the Export button SVG with its animations, high-resolution PNG, image to the clipboard, the JSON specification, print or save as PDF, and a link to the current view.
Esc Closes the open layer, then the panel, then leaves the presentation.

Links are stable: #node=<id> opens a node, #slide=<n> opens a slide. Every animation stops under prefers-reduced-motion, and the page prints as the complete static diagram.

Source of truth

Asset Path
Page generator src/generator/interactive.js (renderInteractive, interactiveData, autoSlides)
Page runtime src/interactive/runtime.js (one self-contained function, inlined into the page)
Page styles src/interactive/styles.js
Tree layout src/generator/layout.js (layoutTree)
Validation src/generator/validate.js, schema/diagram.schema.json
CLI tools/dt-generate.js --interactive
Worked example examples/org-chart-interactive.json
Tests tests/interactive.test.js
Field reference references/interactive-spec.md
Presentation rules references/presentation.md
Template templates/interactive-org-chart.md

Workflow

  1. Build the static diagram first. Follow the greensystems skill: facts, type, layout, connectors. For a hierarchy, write nodes without coordinates and let layoutTree() place them.
  2. Write the hover text. Add info to every node a reader will point at, and details for facts worth scanning. See the writing rules below.
  3. Decide the story. Add slides when the diagram will be presented. Each slide names the nodes it is about. Skip this step and the page builds one slide per level of the graph.
  4. Generate. npm run generate -- <spec>.json --interactive writes dist/<name>.interactive.html.
  5. Check it in a browser. Hover three nodes, click one, press P and walk every slide, then export a PNG.
  6. Validate. npm run check in the repository.
npm run generate -- examples/org-chart-interactive.json --interactive
npm run generate -- my-diagram.json --interactive --out docs/my-diagram.html
import { renderInteractive } from "./src/generator/interactive.js";
import { layoutTree } from "./src/generator/layout.js";
import { validateSpec } from "./src/generator/validate.js";

const spec = layoutTree(draft, { gapX: 32, gapY: 96 }); // optional, hierarchies only
const { ok, errors } = validateSpec(spec);
if (!ok) throw new Error(errors.join("\n"));
const html = renderInteractive(spec); // one standalone document

Fields this skill adds

{
  "title": "Technology organization",
  "lang": "en",
  "motion": "build",
  "presentation": { "progressive": true },
  "nodes": [
    {
      "id": "cto", "label": "Chief Technology Officer", "subtitle": "Technology office", "icon": "crown",
      "info": "Sets the technology strategy and leads the three departments below.",
      "details": [["Reports to", "Chief Executive"], ["Direct reports", "3 departments"]],
      "href": "https://example.com/team/cto"
    }
  ],
  "edges": [{ "from": "cto", "to": "eng", "arrow": false, "info": "Reporting line." }],
  "slides": [
    { "title": "Leadership", "notes": "The CTO sets the technology strategy.", "focus": ["cto"] },
    { "title": "The whole organization", "notes": "Ten units in three levels.", "focus": [] }
  ]
}
Field On Meaning
info node, edge, group Plain text shown on hover and in the panel.
details node Facts as [key, value] pairs or { "key", "value" } objects. The hover card shows the first three; the panel shows all.
href node Link in the panel. Must start with http:, https:, mailto: or #. Anything else is dropped.
slides diagram title (required), notes, focus (node ids). An empty focus shows the whole diagram.
presentation diagram progressive (reveal nodes slide by slide), loop, autoplay (seconds per slide, 2 or more), animate (false: slides change without camera moves and nothing moves; the viewer turns animations on or off with the sparkles button or A).
theme diagram Custom palette (see the main skill); the page bars, panels and menus take the same colours.
lang diagram "en" or "es" for the page controls. Your own text is never translated.

Every field is optional and ignored by the static SVG and HTML outputs, so one specification serves all three.

A document with pages (several sheets) becomes one page that shows every sheet and presents them in order: each sheet's own slides, or one slide per sheet that frames it. slides then belong to each sheet and presentation to the document.

Writing rules

  • Hover text is evidence. Write only what the user gave you or what the source documents say. Never invent a responsibility, a head count, a reporting line or a metric to fill a card. A node without info still shows its name, type and connections.
  • One or two sentences. info answers “what is this and why does it matter here”. Keep it under about 160 characters; the hover card is small.
  • Facts are short. A details key is one or two words; a value fits on one line. Lead with the three facts that matter most, because the hover card shows three.
  • Do not repeat the label. The card already shows the label and subtitle.
  • Links must be real. Use href only for an address the user supplied.
  • Illustrative content says so. Keep an annotation such as ILLUSTRATIVE STRUCTURE on the canvas when names or numbers are placeholders.

Presentation rules

  • Five to nine slides. One idea per slide; the title is that idea in a few words.
  • focus lists the nodes the slide is about, usually one parent and its children. Two to five nodes frame well; more than eight is an overview, so leave focus empty.
  • Order slides in reading order: top-down for hierarchies, left-to-right for flows. End on a slide with empty focus so the last frame is the complete diagram.
  • progressive: true hides nodes until a slide focuses them. Use it to build a structure step by step. Leave it off when the audience should see the whole context dimmed behind the focus.
  • animate: false suits printed handouts, screen recordings and audiences sensitive to motion. Leave it on when build animations tell the story.
  • autoplay is for unattended screens. Use at least 6 seconds for a slide with notes.
  • Notes are one or two sentences the presenter could say aloud. They are not a second place for facts; facts go in details.

More in references/presentation.md.

What not to change

  • Do not hand-edit the generated HTML. Change the specification and generate again.
  • Do not restyle the page. Its colours, type, icons, radii and motion come from the design tokens; a new colour or font belongs in the design system, not in one export.
  • Do not add scripts, analytics, web fonts or external images to the page. It must stay one self-contained file.
  • Do not add a second loop animation to make the page feel alive. Hovering already animates the active connections.

Quality gate

  • Every info, fact and link is verified or the diagram is marked illustrative.
  • Hover cards fit: info is one or two sentences, facts are one line each.
  • Each slide has a title, and its focus ids exist. The last slide shows the whole diagram.
  • The static SVG of the same specification still reads well on its own.
  • Keyboard only: Tab reaches every node, Enter pins, Esc closes, P presents.
  • prefers-reduced-motion shows the complete diagram with no movement.
  • The file opens from disk with the network off.
  • npm run check passes when working in the repository.

Credits

Hover preview, pinned selection, camera framing, slide navigation and the export menu follow interaction patterns studied in Archify (Apache-2.0). No code from that project is included; the runtime here is written for the GreenSystems generator.

Agent compatibility

Agent Reads this skill from
Codex, Gemini CLI, Cursor, GitHub Copilot, Amp, goose, Windsurf, Kiro, Factory, Roo .agents/skills/greensystems-interactive/SKILL.md (canonical)
Claude Code, Cline .claude/skills/greensystems-interactive/SKILL.md
OpenCode .opencode/skills/greensystems-interactive/SKILL.md
GitHub Copilot in VS Code .github/skills/greensystems-interactive/SKILL.md
Claude.ai and the Claude apps, ChatGPT, the OpenAI API upload dist/skills/greensystems-interactive.zip, built by npm run pack:skills

The copies are mirrors. Edit the canonical .agents copy and run npm run sync:skills; never edit the mirrors by hand. Outside the repository, an uploaded skill still teaches the rules; the components and the generator need the repository.

Categories