hashgraph-online/awesome-codex-plugins / plugins/alpoxdev/hypercore/skills/hyper-diagram
hyper-diagram
VerifiedUse this skill when the user asks to draw, diagram, visualize, or map any structure - architecture, flowchart, data flow, sequence, state machine, ERD, class model, tree, mind map, timeline, schedule, or layered stack - as a polished standalone HTML plus a JPG by default, and a one-page vector PDF on request. Write a typed JSON spec, render it with automatic layout, and verify overlap, overflow, and page checks before delivery. Do not use for numeric data charts, UI mockups, illustrations, or slide decks.
rules/render-and-verify.md
View on GitHub# Render And Verify
Use this rule file before the first render and before delivery. It owns the render command, the report, the repair loop, and the closing report.
## 1. Command
```bash
bash <skill-dir>/scripts/render-diagram.sh --spec <out-dir>/<slug>.diagram.json --out-dir <out-dir> \
[--formats html,jpg[,pdf]] [--theme light|dark] [--scale 1-4] [--name <slug>] [--budget-ms <ms>]
```
- `<skill-dir>` is this skill's own folder, written as an absolute path or a path from the working directory.
- Defaults: `--formats html,jpg`, `--scale 2`, theme from the spec (`light` when absent), `--budget-ms 30000` for the baking pass.
- `--browser <path>` or `HYPER_DIAGRAM_BROWSER` picks a browser; `--list-browsers` shows what was found.
- Graph types (`architecture`, `flowchart`, `dataflow`, `state`, `class`, `erd`) need elkjs. The script downloads it once and checks its SHA-256; `HYPER_DIAGRAM_ELK` points to an already verified copy for offline machines.
## 2. Exit Codes And Report
| Exit | Meaning | Next step |
|---|---|---|
| 0 | `status: pass`; outputs written | View the JPG (§4) |
| 1 | `status: fail`; files written for inspection only | Repair (§3) |
| 2 | Usage or spec error (`SPEC_INVALID`, `BAD_FORMAT`, `SPEC_MISSING`, `BAD_SCALE`, `BAD_THEME`, `BAD_BUDGET`, `BAD_NAME`, ...) | Fix the command or the JSON |
| 3 | Blocked (`BROWSER_MISSING`, `ELK_UNAVAILABLE`, `BAKE_FAILED`, `RUNTIME_NO_RESULT`, `CANVAS_EMPTY`) | Report the blocker and the unblocking step; keep the spec |
The report on stdout carries `status`, `type`, `canvas`, `counts`, `outputs`, `pdfPages`, `errors`, and `warnings`.
## 3. Repair
| Code | Meaning | Usual fix |
|---|---|---|
| `TITLE_MISSING`, `DESCRIPTION_MISSING` | required text absent | write it |
| `BAD_ID`, `DUPLICATE_ID`, `UNKNOWN_ENDPOINT`, `UNKNOWN_GROUP`, `UNKNOWN_PARENT` | broken references | fix the ids |
| `TYPE_UNKNOWN`, `NO_NODES`, `BAD_DATE`, `TASK_LENGTH`, `NOTE_TARGET` | spec shape | follow `references/spec-format.md` |
| `TEXT_OVERFLOW`, `NODE_OVERLAP`, `LABEL_OVERLAP`, `LABEL_OVERLAPS_NODE` | crowding | shorten text, move detail into `sub`, raise `spacing` |
| `NODE_CROSSES_GROUP`, `GROUP_OVERLAP` | group membership | set `group` on the node or `parent` on the group |
| `EDGE_CROSSES_NODE` | a route runs through a box | reorder nodes, change `direction`, or regroup |
| `PDF_MULTIPAGE`, `JPG_FAILED`, `PDF_FAILED`, `SCRIPT_LEFT` | export | re-run; report if it repeats |
| warning `EDGE_CROSSINGS` | edges cross | reorder nodes in the spec; ELK keeps model order |
| warning `SMALL_TEXT` | text renders below 9.5px | shorten the label, raise `spacing`, or split the diagram |
| warning `DENSE_DIAGRAM`, `WIDE_DIAGRAM` | too big | split (`rules/diagram-selection.md` §2) or set `direction` |
- At most three repair passes after the first render. Revert a pass that adds errors.
- Fix meaning before looks: never drop an element or a relation only to pass a check without saying so.
## 4. Visual Check
The checks cannot see meaning. Open the JPG and confirm:
- the main path reads in one direction without zig-zag;
- no label sits on the wrong edge or far from its edge;
- the grouping says what the material says;
- nothing important is tiny or cut.
## 5. Closing Report
Report in Korean: the output paths (spec, HTML, JPG, PDF), the type and why, a two-line structure summary, the elements marked inferred, remaining warnings, and the verification that ran (exit code, pages, visual check).
## Sources
> Checked 2026-11-08.
| Claim | Source |
|---|---|
| Headless Chromium `--dump-dom`, `--screenshot`, `--print-to-pdf`, and the one-page condition | `.hyper/research/21.diagram-skill.md` execution checks, 2026-11-08 |
| ELK layered layout keeps model order when asked | <https://eclipse.dev/elk/reference/algorithms/org-eclipse-elk-layered.html> |
| The code set, exit codes, and the three-pass cap | this package's `scripts/render-diagram.sh` and `assets/runtime/run.js` |
### Evidence grade
`LOCAL` - the codes and the repair table describe this package's own runtime.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |