/diagram-studio:diagram-compositionfrom diagram-studio
Decomposes a complex idea into related subdiagrams, chooses suitable visual forms, and composes a compact page with explicit grid spans, consistent semantic colors, readable text, shared SVG icons, and meaningful cross-panel connections. Use for dense explanatory figures, architecture plates, visual comparisons, and multi-panel diagrams that need semantic planning before layout; coordinate available diagram and icon skills without requiring them.
Ships in diagram-studio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Read palette-policy.md before authoring or composing visuals. Apply one exact colorset to authored content and report preserved source media separately. Read solid-surfaces.md for solid-first category fills, black/white text on the actual fill, and palette exhaustion before border variants.
Design the explanation before packing the page. Deliver one coherent figure whose subdiagrams answer different questions and whose relationships explain the whole. Default to the smallest readable diagram footprint: compact nodes, panels and connector routes while preserving visible arrowheads, unambiguous endpoints, separated lines and every required label. Use the bounded compaction pass in layout-and-density.md; chart bodies retain their quantitative reading space. Keep generated files outside this read-only bundle.
Read arrow-visibility.md when producing, importing or reviewing directional arrows. Audit actual shafts/heads at delivery scale.
Keep every source, draft, report, and screenshot inside the user's workspace; use its output folder for scratch files too. Do not use a system temp directory. Choose the shortest reliable production path:
build_panels.py. Prefer its measured geometry unless a supplied asset,
specialized notation, or unsupported shape requires a custom renderer.
Hubs support rectangular/elliptical nodes and an optional named enclosure.
Use the one-command render_diagram.py workflow in that reference for standard
plan/SVG/report/audit/preview outputs; it rebuilds and verifies the entire figure.For owned generated outputs, use --overwrite from the first command below so
the same command is safe to repeat during revision. Preserve supplied originals.
Read each report's ok before continuing; a failed draft may leave an older
figure on disk. Use distinct layout, composition, and audit report paths.
State the audience, one-sentence thesis, intended display/print size, and facts to preserve. Infer sensible dimensions if unspecified. Separate entities, relations, quantities, chronology, and uncertainty. Give recurring concepts stable IDs.
For each necessary subdiagram, write its viewer question, claim, inputs, and connection to the thesis. Merge panels that answer the same question. Keep a cross-panel relationship only when it carries a named dependency, contrast, shared identity, containment, or synthesis; proximity alone is not a relation. Use the requested panel count, otherwise let the explanation determine it.
Read visual-selection.md to select each form. Compare the preferred form with a plausible alternative, including a non-flow form when considering a flowchart. Use flowcharts for real ordered actions or decisions, not as a default for all nouns. Do not force variety when the same form is the clearest choice. Preserve explicit user choices when truthful.
Read layout-and-density.md. Sketch at least two plausible arrangements for a complex brief; choose by semantic reading order, aspect-ratio fit, crossings, and readable density. This can be a small planning note, not an extra user approval step.
Set grid row/column weights and rectangular spans before rendering. Allocate wide regions to sequences and comparisons, tall regions to deep hierarchies or stacks, and near-square regions to radial or adjacency views. Respect the actual labels and node counts; these are tendencies, not fixed family restrictions. Reserve title, legend, and connector space. White space is useful separation, not a failure to fill every pixel. Do not solve overcrowding by shrinking text.
Before building panels, read shared-colors.md and freeze one semantic palette for the whole composition. Bind recurring colored concepts to registry IDs and exact colors; carry those bindings into every panel and specialist handoff. Do not assign fresh colors by panel, renderer, row order, or orientation. Keep neutral surfaces/text and relationship styling aligned too.
Record the chosen plan using composition-contract.md and the compact template. Run:
uv run --script <skill-root>/scripts/compose_diagram.py layout --spec composition.json --output layout.json --overwrite
The layout report supplies each panel's exact body rectangle. Author to those dimensions; use it to set companion renderer dimensions before generating assets. It may report deferred port coordinates before source panels exist. The final compose step requires every endpoint to resolve.
Read specialist-handoffs.md when coordinating other skills or importing their SVG. Select only available specialists relevant to the chosen forms. Give each the exact question, facts, source/output paths, body size, typography, shared identities, and connection ports. Invoke skills sequentially unless the task separately authorizes parallel agents.
Use technical-logo-assets for exact brands/products and iconify-icon-search for
generic pictograms when available. Export chosen SVGs into the deliverable with
their provenance/license files. Distinguish GitHub Copilot from Microsoft Copilot,
and a generic cloud from a product name. Never guess a brand from a similar word.
If a diagram companion is absent, read native-panels.md
and use scripts/build_panels.py for supported hubs, matrices, taxonomies, cycles,
and boundary maps. Describe their data instead of manually placing every label,
icon, and arrow. The builder creates exact-size sources and semantic ports;
compose its generated plan. Use custom native SVG only for unsupported forms.
For missing brand artwork, use a short honest label. No sibling
bundle, repository file, network, or renderer is required for this fallback.
Replace repeated names with recognizable icons where the audience can identify
them. Explain unfamiliar symbols once in a shared legend; keep visible qualifiers
for ambiguous products, units, state, negation, and relationship verbs. Give every
icon-only entity an accessible name. Preserve brand geometry and aspect ratio.
Use one visual grammar across panels: label scale, stroke weight, arrow meanings,
and icon optical size. Native objects use concept bindings; imported SVGs tag
their semantic accent marks as described in the shared-color contract. Keep
brand artwork intact and put semantic colors on an adjacent swatch or enclosure.
Use one shared key when colors need explanation. Harmonize source settings
without changing quantitative encodings, units, or data.
Use a static vector SVG per panel with a tight, honest viewBox; exclude HTML
labels, external resources, scripts, and animation. Inline icons in that SVG.
For renderer CSS, first use the bundled prepare command documented in the
handoff reference; it materializes styles before importing.
uv run --script <skill-root>/scripts/compose_diagram.py compose --spec composition.json --output diagram.svg --report composition-report.json --inspect --overwrite
The composer preserves aspect ratio, namespaces IDs and local references, inserts
panels in reading order, and connects ports bound to actual object boundaries.
Read connectors-and-surfaces.md for
object annotations, measured imports, outward ports, and routing. Native panels
export these bindings automatically. Use automatic routing first; reserve via
for a specific route that still respects object interiors and terminal direction.
Wires stop at node surfaces, while enclosing regions may admit a wire to a child.
An edge must identify the intended object. Use the shared concept key when a
long cross-panel identity edge adds clutter; preserve explicitly requested edges.
Never add an arrow that invents order, causality, magnitude, or equivalence.
For a draft, append --inspect to composition and inspect its report's ok.
On a route finding, choose an outward side or widen the corridor, then regenerate.
Keep automatic routing unless a reviewed geometry needs explicit waypoints.
Failed drafts save diagnostics without publishing a new SVG; do not audit a stale
figure. Finish with a clean compose command without --inspect.
For native panel revisions, change the authored brief and rebuild the generated plan before composing again. For custom SVG revisions, regenerate source and measure changed geometry before updating the composition plan.
uv run --script <skill-root>/scripts/audit_diagram.py audit --input diagram.svg --report visual-audit.json --screenshot preview.png --inspect --overwrite
Draft --inspect reports expected authoring findings with ok: false without
failing the command. Repair them and rerun with --inspect --overwrite. Once
clean, run the same audit with --overwrite and without --inspect as the
final failing-on-findings gate. Never treat inspection mode as a passing audit.
The audit checks label size/contrast, containment, text collisions, annotated
connector intrusions/crossings/contacts, object geometry, resource requests,
vector portability, and declared semantic color bindings across panels.
It also detects obscured accents and contradictory fills on semantic objects.
Require semanticColors.status: checked
when using semantic accents; not-declared is not evidence of color consistency.
Repair mismatched, missing, or hidden bindings at source. Inspect its screenshot yourself for claim/form
fit, reading order, icon recognition, crossing ambiguity, contrast, and wasted
space. Inspect every connector at both ends and every colored object's complete
surface, not just its legend swatch. A mechanical pass does not prove semantic
or visual quality. Review any
clippedMarks to distinguish intentional renderer clipping (such as
sequence lifelines) from cropped information. For print,
convert physical width to the agreed viewing scale before review. A narrow
screen may need a separate reflowed composition, not a microscopic whole page.
If crowded, shorten redundant prose, share the legend, change orientation/form, rebalance spans, or move secondary detail into an explicitly identified companion view. Preserve the requested facts and size; report an unresolved conflict instead of silently dropping facts. Revise source assets/plan and rerun affected checks. Keep the specified canvas and displayWidth fixed; increasing the display width to make text pass is not a repair. Check the subject and actor in every headline, and inspect icon/label separation and source-internal arrowheads in the screenshot. If Chromium is unavailable, deliver static checks with that validation gap stated.
Deliver the figure and editable plan/source assets, plus a concise explanation of the visual choices and actual checks. Respect exact requested paths. This skill handles compact editorial composition; use an available synchronized-canvas skill when shared live values, semantic zoom, or a navigable world are the main task.
agents/openai.yaml (opens in a new tab)assets/palettes/colorsets.json (opens in a new tab)assets/templates/composition.json (opens in a new tab)references/arrow-visibility.md (opens in a new tab)references/composition-contract.md (opens in a new tab)references/connectors-and-surfaces.md (opens in a new tab)references/layout-and-density.md (opens in a new tab)references/native-panels.md (opens in a new tab)references/palette-policy.md (opens in a new tab)references/shared-colors.md (opens in a new tab)references/solid-surfaces.md (opens in a new tab)references/specialist-handoffs.md (opens in a new tab)references/visual-selection.md (opens in a new tab)scripts/arrow_quality.py (opens in a new tab)scripts/audit_diagram.py (opens in a new tab)scripts/build_panels.py (opens in a new tab)scripts/compose_diagram.py (opens in a new tab)scripts/palette_contract.py (opens in a new tab)scripts/render_diagram.py (opens in a new tab)scripts/route_connectors.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gvillarroel/plugins --plugin diagram-studio11 skills in this plugin
/compose-synchronized-svgDesigns, builds, synchronizes, and validates giant standalone SVG compositions made from many related diagrams, charts, maps, schematics, illustrations, and explanatory assets. Use when Codex must turn one idea into a coherent 6–16-module megacanvas or a 12–48-module navigable world such as a Path of Exile-style skill tree, giant genealogy, causal atlas, or linked-diagram map; keep recurring concepts visually consistent; propagate canonical values through every relevant view; coordinate focus, time, world-to-district-to-module semantic zoom, or a deterministic camera route for video; and deliver one self-contained interactive SVG with meaningful static and reduced-motion fallbacks./d3Creates, animates, inspects, recomposes, and validates D3-powered HTML and SVG visuals. Use for custom charts, simulations, linked views, visual audits, parametric logos, textures, and portable SVG that need data-driven geometry, joins, layouts, or transitions./echarts-animated-svgAnimates already-rendered Apache ECharts SVG output and builds replayable SVG galleries. Use when Codex needs to render ECharts charts with SVGRenderer or SSR, post-process the resulting SVG instead of rebuilding chart geometry, choose chart-type-specific SVG animation profiles for ECharts chart types, or create an HTML index with controls to replay or restore chart animations./hierarchy-lensBuilds offline interactive hierarchies with decision-driven pixel composition, compact organic cells, radial heatmaps, or labeled charts. Use for organizational maps, portfolios, or taxonomies needing explicit placement priorities, proximity rules, step-by-step growth, switchable color lenses, and exact record lookup./lucidchart-svgExports Lucidchart diagrams to SVG, inserts SVG artwork into Lucidchart, and reconstructs SVG diagrams as editable Lucid shapes and connectors. Use for Lucidchart SVG downloads, uploads, conversions, and fidelity checks./mermaidCreates, selects, styles, renders, validates, and animates Mermaid diagrams from prose or structured data, including verified accessible title and description metadata for newly authored work. Use when Codex must honor or infer an appropriate Mermaid family; preserve workflows, schedules, schemas, hierarchies, interactions, behavioral contracts, tabular data, or quantitative facts; simplify or audience-adapt an existing diagram with an explicit fidelity ledger; apply colorset1 as the standard palette or colorset2 only when extended/full-color styling is explicitly requested; restyle Mermaid files or Markdown fences; render static SVG; or produce faithful animated SVG.