/agent-almanac:restore-diagram-legibilityfrom agent-almanac
Restores legibility to auto-generated Mermaid/Graphviz/DOT diagrams that render too small. Covers label wrapping, invisible chain links, cluster splitting, and layout direction selection.
Ships in agent-almanac. 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.
None: SKILL.md is the whole skill.
Make an auto-generated graph diagram readable again after it has outgrown its canvas. The content is usually fine — forced to 1:1 the labels are crisp — so this is a delivery failure, not an authoring one, and the fix is reducing the diagram's layout units, not styling its text.
All numbers in this skill are one measured instance (a 39-diagram corpus, 2026-07), shipped as evidence that a lever moves the needle — never as targets.
create-2d-composition for composition workCompute the render scale and effective label size; confirm the situation matches this skill.
# SVG output: viewBox width = layout units. Effective label px =
# nominal font px * (display column px / viewBox width).
grep -o 'viewBox="[^"]*"' diagram.svg
# e.g. viewBox="0 0 2685 900" in a 640px column:
# scale = 640/2685 = 23.8%; a 12px label renders at 2.9px
One measured instance: a system map rendered at 6.9% scale — nominal 12px labels at 0.83px effective. Fullscreen was a 2x improvement against a ~15x deficit.
Expected: A number pair (scale %, effective label px) and confirmation that a 1:1 render is crisp. If 1:1 is also illegible, the problem is authoring, not delivery — stop here, this skill does not apply.
On failure: If the renderer emits raster only, measure image width vs display width instead; the ratio is the same scale factor.
Do not spend time on these; both were killed by measurement.
Expected: The diagram source contains no font-size override added for legibility and no direction attribute chosen by a topology heuristic; if either is present from a prior attempt, it is reverted and the layout-unit change from the revert is recorded.
On failure: If a font increase was already applied, revert it before measuring the real levers — it inflates layout units and masks their effect.
Node width tracks the longest unbroken line in the label, and total canvas
width follows. Break labels into short lines in the diagram source (Mermaid:
<br/> inside the label text; Graphviz: \n in the label attribute).
One measured instance: 2685 -> 901 layout units from wrapping alone.
Expected: Canvas width in layout units drops substantially on re-render; labels occupy 2-3 short lines instead of one long one.
On failure: If wrapping changes nothing, the width driver is elsewhere — check for one very wide row of disconnected nodes (Step 4) or a single oversized cluster (Step 5).
Layout engines place nodes with no edges in one wide row, spreading the
canvas. Add invisible links (Mermaid: ~~~; Graphviz: style=invis edges)
between disconnected components so the engine stacks them instead.
One measured instance: 3292 -> 881 layout units. The worst single case was a cluster 3292 units wide holding 6 nodes and zero edges.
Expected: Disconnected nodes stack into rows/columns; canvas width drops.
On failure: If the renderer treats the invisible-link syntax as a real edge (arrows appear), check the tool's spelling for an invisible or unstyled link; the construct is general even where the syntax differs.
A whole system on one canvas divides one column width across every parallel cluster. Emit one diagram per cluster (or per subsystem) instead; the index page links them.
One measured instance: median effective label size went 0.8px -> 25.9px. Do NOT pick split candidates by node count — in the measured corpus the illegible clusters had a median of 6 nodes, identical to the legible ones; width, not membership, is the axis.
Expected: Each split diagram is independently legible at its display size; nothing shares a canvas with an unrelated cluster.
On failure: If clusters are interlinked so splitting breaks edges, duplicate boundary nodes into both diagrams with a visual marker rather than keeping one merged canvas.
Direction (top-down vs left-right) is shape-dependent: measure, do not predict (Step 2.2). Render the diagram in both directions, compare canvas width in layout units, keep the narrower.
One measured instance: 2682 -> 1311 units from a direction flip — on that diagram; the same flip regresses others, which is why the comparison is per-diagram.
Expected: Both renders exist; the kept direction is the measured winner for this diagram, not a global default.
On failure: If both directions are still too wide, return to Steps 3-5; direction is the last lever, not the first.
Recompute scale % and effective label px per diagram. Record before/after in the commit or PR that ships the change, as one measured instance.
Across the measured 39-diagram corpus: median effective label 13.7px -> 25.9px; 30/39 -> 37/39 diagrams at 10px or better. The legibility floor comes from Step 1's formula for your display context — not from any number in this skill.
Expected: The before/after pair is recorded next to the change; any diagram still below the display's legibility floor is listed explicitly, not averaged away.
On failure: If a diagram resists all four levers, say so in the record — an explicit residual beats a silently truncated claim of success.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
diagram-legibility, graphviz, mermaid, dot, layout-optimization
Generated from the plugin's indexed repository (pjt222/agent-almanac) — no native marketplace selected
npx claudepluginhub p/pjt222-agent-almanac377 skills in this plugin
/adapt-architectureExecute structural metamorphosis using strangler fig migration, chrysalis phases, and interface preservation. Covers transformation planning, parallel running, progressive cutover, rollback design, and post-metamorphosis stabilization for system architecture evolution. Use when assess-form has classified the system as READY for transformation, when migrating from monolith to microservices, when replacing a core subsystem while dependents continue operating, or when any architectural change must be gradual rather than big-bang.
/adapticMaster skill composing the 5-step synoptic cycle for panoramic synthesis across multiple domains. Orchestrates meditate, expand-awareness, observe, awareness, integrate-gestalt, and express-insight into a coherent process that produces unified understanding rather than sequential compromise. Use when a problem genuinely spans 3+ domains and the interactions between domains matter more than depth in any one, when sequential analysis feels like compromise rather than integration, or before major architectural decisions affecting multiple stakeholders.
/add-puzzle-typeScaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.
Other plugins' skills for the same job