skills/visual-mockup/SKILL.md
This skill should be used when the user asks to 'mockup the layout', 'sketch the diagram', 'show me the layout before coding', 'draft the positions', 'quick visual of the layout', 'matplotlib mockup', 'interactive mockup', 'drag and drop layout', 'draw a rough layout', 'prototype the diagram', 'let me arrange the nodes', 'mockup the chart before CeTZ', or when you're about to write a diagram with 4+ nodes or a CeTZ chart and want to confirm the visual with the user first.
npx skillsauth add edwinhu/workflows visual-mockupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Announce: "I'll create a mockup so you can see the layout before I code the real diagram."
Diagram code (CeTZ, Fletcher, TikZ) is slow to iterate on — you write coordinates, compile, discover the layout is wrong, rewrite. A 30-second sketch lets the user see and approve the spatial layout before any real code gets written. This saves 3-5 compile-fix cycles on complex diagrams.
You don't need this for simple diagrams (2-3 nodes in a line). Use your judgment — if the layout is obvious, skip the mockup and go straight to code.
| Mode | When | Output | |------|------|--------| | Interactive (default for node diagrams) | Fletcher diagrams, 4+ nodes, precise positioning | Drag-and-drop HTML → Fletcher JSON | | Matplotlib (for charts/plots) | CeTZ charts, stock prices, timelines, data series | Static PNG → iterate data → translate to CeTZ |
Default to interactive for node-edge diagrams. Use matplotlib for anything with axes, data series, or time-based plots.
From conversation context or the user's request, identify:
Write the layout as JSON and run the generator:
cat > /tmp/layout.json << 'LAYOUT'
{
"title": "Diagram Name",
"nodes": [
{"id": "n1", "label": "Issuer", "x": 200, "y": 100, "color": "#89b4fa"},
{"id": "n2", "label": "Buyer", "x": 200, "y": 300, "color": "#a6e3a1"}
],
"edges": [
{"from": "n1", "to": "n2", "label": "§11 claim"}
],
"regions": [
{"id": "r1", "label": "Primary Market", "x": 140, "y": 60, "w": 250, "h": 280, "color": "#89b4fa"}
]
}
LAYOUT
uv run python3 ${SKILL_DIR}/scripts/interactive_mockup.py /tmp/layout.json --open
${SKILL_DIR} resolves to this skill's base directory (e.g., skills/visual-mockup).
The browser opens with a Catppuccin-themed drag-and-drop canvas:
Best for Fletcher diagrams. The exported grid coords drop directly into node((x, y), ...) calls. CeTZ diagrams require manual arrow routing that the mockup can't capture — use matplotlib mode for CeTZ instead.
Tell the user: "Drag nodes where you want them, select Fletcher in the Export dropdown, then click Copy Layout JSON and paste it here."
The user pastes JSON with Fletcher grid coordinates. Use these positions directly in node((x, y), ...) calls — no coordinate transform needed.
If the user wants further changes, regenerate with updated JSON and --open again. When approved, proceed to real diagram code.
Identify the chart's data series, axes, annotations, and shaded regions. For node diagrams, identify nodes, edges, regions.
Write a Python script that uses matplotlib/seaborn to sketch the visual:
For charts/plots:
For node diagrams:
matplotlib.patches.FancyBboxPatch with rounded corners for nodesax.annotate with arrowprops for edgesOutput to /tmp/visual-mockup.png at 150 DPI, then open it:
plt.savefig('/tmp/visual-mockup.png', dpi=150, bbox_inches='tight')
open /tmp/visual-mockup.png
Show the mockup and ask if the data shape / layout is right. This is where the value lives — catching problems like "the stock price doesn't bounce back" or "the damage bracket is in the wrong place" takes seconds in matplotlib vs. minutes in CeTZ compile cycles.
When approved, translate to CeTZ. For charts, the data arrays transfer directly — matplotlib and CeTZ use the same coordinate space, just different syntax.
figsize=(12, 6) for side-by-side, (8, 6) for single diagramsboxstyle="round,pad=0.1" for nodesax.set_aspect('equal') and ax.axis('off') for node diagramsvisual-verify for that)ds workflow for charts/plots)development
Build the meeting-level proxy-voting × ownership panel on the WRDS SGE grid — ISS N-PX fund votes reduced to (item × block) direction cells, joined to institutional and mutual-fund ownership. Use when working with risk.voteanalysis_npx, N-PX fund-level votes, ISS→CRSP fund linking, index/passive/active voting blocks, or a proxy-voting panel that needs ownership attached.
development
Use when "CRSP CIZ", "CRSP v2", "CRSP flat file format 2.0", "crsp.dsf_v2 / msf_v2", "StkDlySecurityData", "StkMthSecurityData", "StkSecurityInfoHist", "stocknames_v2", "DlyRet / MthRet / DlyPrc / MthPrc", "SHRCD or EXCHCD equivalent in new CRSP", "SIZ to CIZ migration", "CRSP data after 2024", "CRSP delisting returns", "CRSP cumulative adjustment factors", "CRSP index INDNO / INDFAM", or any CRSP stock/index query where the legacy SIZ column names no longer exist.
development
Use when linking or deduping datasets by entity name rather than a shared key — 'fuzzy match', 'fuzzy name matching', 'entity resolution', 'record linkage', 'match company/person names', 'dedupe entity names', 'name-based join', 'bridge identifiers' (CIK ↔ permno ↔ gvkey ↔ wficn ↔ EIN ↔ personid), or any use of char n-gram TF-IDF, cosine similarity on names, `sparse_dot_topn`, or RapidFuzz at scale.
development
Use when building a publication-quality table in Python — 'regression table', 'results table', 'summary statistics table', 'etable', 'coefplot', 'great_tables', 'GT', 'gt table', 'format a table for the paper', 'export table to LaTeX/HTML', significance stars, spanners, or column formatting for a table headed into a paper, slide deck, or notebook.