CommunityImagengithub.com

vispage

/vispage — páginas HTML de informes basados en evidencia, construidas a partir de figuras SVG impulsadas por datos: Manrope sobre fondo gris frío, tarjetas de figuras blancas, grandes paneles KPI, barras clasificadas, divisiones apiladas, diagramas de flujo, carriles de natación, hojas de ruta por fases, tableros de veredicto y matrices de estado. Cada sección está encabezada por una figura con un pie de foto que indica qué concluir. Es una biblioteca de componentes de Python (15 tipos de figuras), un envoltorio de página y un verificador de renderizado que FALLA si las etiquetas se desbordan o chocan. El verificador se prueba meta. ÚSALO AL: redactar una página de hallazgos / revisión / auditoría / programa / recomendación que contenga números o un proceso, o cuando te pidan "muchas imágenes" o /vispage. NO USAR PARA: una infografía de una página con insignias de iconos y líneas de metro (/infog), un solo gráfico, pantallas de interfaz de usuario tipo aplicación o presentaciones de diapositivas.

¿Qué es vispage?

/vispage es una biblioteca de componentes Python diseñada para crear páginas HTML de informes con evidencia visual. Proporciona 15 tipos de figuras SVG (como paneles KPI, barras horizontales clasificadas, divisiones apiladas, diagramas de flujo, carriles de natación, hojas de ruta por fases, tableros de veredicto y matrices de estado) que se integran en una estructura de página predefinida. La biblioteca incluye un verificador de renderizado headless que detecta automáticamente etiquetas superpuestas o desbordadas, garantizando que los informes sean legibles y profesionales. Es especialmente útil para informes de hallazgos, revisiones, auditorías, programas o recomendaciones que involucren datos numéricos o procesos. Cada figura debe llevar un pie de foto que explique claramente qué conclusión extraer, y toda la página sigue una estructura narrativa: línea de navegación, título, veredicto en una línea, secciones numeradas con figuras, tarjeta de decisiones pendientes y detalles colapsables. La herramienta se usa desde la línea de comandos con Playwright para renderizar y verificar, y se integra con asistentes de IA como Claude Code para generar informes completos a partir de datos de evidencia.

Compatible con✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alphafarmer/diagram-skills/tree/HEAD/vispage

Installed? Explore more Imagen skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

/vispage — visual evidence pages

The files

FileWhat it is
vispage.pyThe palette tokens, 15 figure functions, and page() / fig() / details() / chip()
example.pyEvery component with demo data. Copy it as your starting point.
render_check.pyHeadless-Chromium check plus screenshots. --selftest proves it catches seeded faults.

The method: how the page reads

  1. Nav line. Backlinks (← related pages) followed by Last updated: from date -u, never estimated. page() does this for you.
  2. H1 and subtitle. The subtitle names the sources and the review status, plus a chip (draft, settled, …).
  3. "In one line" box. The verdict, in a sentence the reader could repeat.
  4. Numbered sections (1 · What happened, 2 · Why, 3 · The fix …). Lead each section with a figure. Prose is optional; the figure carries the point.
  5. Every figure = SVG + caption. The caption says what to conclude, then the source, window and caveat. Put a note_bar inside the figure only for the one takeaway.
  6. A "Decisions needed" card near the end: a numbered list, one decision per line.
  7. Details, collapsed. Specs, method, caveats and the evidence path go in details() blocks.

Aim for one figure per claim. Write for the reader first: plain sentences, a unit and window on every number, and no internal jargon at the top.

The components (all take plain data and return an SVG string, 920 wide)

FunctionUse it for
kpi_tiles(title, [(value,label,tone)], notes)The headline: 3–5 big numbers plus takeaway strips
hbars(title, rows, inner=…, legend_items, note)A ranked quantity. The optional dark inner overlay shows "the part that was X".
split_bars(title, [(label,pct,note)])Per-actor split, e.g. fix vs forward time
stacked(title, rows, segments, note)100% shares compared across two bases
before_after(title, [(label,before,after/None,note)])Would the fix have helped? None shows a "needs other fix" chip.
pipeline(title, stages, below, badges, above_link, note)Flow with entry points (below) and a late-discovery arc (above)
swimlanes(title, columns, lanes, note)A process by size or role × step. None = step skipped.
phases(title, items, notes)Roadmap with gate states; dashed = gated / not started
cycle(title, boxes, loop_label, chips, notes)A lifecycle with a feedback loop, plus owner chips
two_columns(title, left, right)Keep vs delete, added vs removed
board(title, columns, note)Verdict board: KILL / SLIM / KEEP
ranked_rows(title, rows, …)Keyed list with a bar and a status chip (rules, risks, steers)
ladder(title, steps, note)Escalation tiers
status_matrix(title, rows)Capability / status table drawn as a figure
targets(title, rows, note)Metric / now / target, with mini bars and a falsifier

Tones: green (good/done/keep), amber (partial/in flight/warning), red (bad/missing/gated-hard), indigo (neutral emphasis/planned), blue (info), ink (structure), grey (skipped/trivial). Never invent new colours.

Hard rules

  • Every number comes from an evidence file. Keep the evidence next to the build script and name its path in the Method details. Estimates are labelled as estimates in the caption.
  • Build pages from a script (build_page.py), never by hand-editing the HTML, so the next edit is a data change.
  • render_check.py page.html shots/ must PASS, and you must look at the screenshots before publishing. The checker catches geometry, not taste. When a label overflows, shorten the words; don't shrink the font below 10.
  • Labels are short. A note bar holds about 130 characters, and a swimlane cell about 18.
  • No coloured left-edge stripes on cards. Use a full 1 px border and a tint. The CSS here already complies.
  • Exactly one Last updated: stamp, and backlinks to the related pages.

Workflow

pip install playwright && playwright install chromium     # once, for render_check.py
cp ~/.claude/skills/vispage/example.py ./build_page.py      # swap in your data
python3 build_page.py page.html
python3 ~/.claude/skills/vispage/render_check.py page.html shots
# Read shots/figNN.png, fix, repeat until PASS and it looks right

example.py adds its own directory to sys.path; in a copied build_page.py use sys.path.insert(0, os.path.expanduser("~/.claude/skills/vispage")) before from vispage import *. The page is a single self-contained HTML file (fonts load from Google Fonts); publish it however you publish static pages.

Self-check before calling it done

  • The selftest passes: render_check.py --selftest.
  • render_check.py PASSES on the page.
  • You looked at the screenshots.
  • Every figure has a caption with a source.
  • The Decisions card exists if the page asks the reader for anything.

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

Skills relacionados