Command Palette

Search for a command to run...

Назад к скиллам
скилл № 60465

diagramer

Draw block diagrams in code: measured pieces composed like UI (row, col, box, tree), placed on an 8 px grid with a few hints, joined by routed arrows, checked…

БесплатноЗапускает вложенные скрипты
hyper-code-harnessот hyper-code-harness★ 22 звезды на GitHub

Установить diagramer в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Diagramer: diagrams in code

The engine is diagramer.draw. A diagram is a tree of pieces — plain data that knows its size when built (text is measured with the SVG font). You compose pieces like UI, lay them out, route arrows between the same variables, ask the engine what is wrong, and render SVG. No coordinates by hand, no guessing widths.

Rendering is independent of any board: the result of render is an HTML fragment with one <svg> — put it on the canvas (canvas.show({ args: { html } })), into a document, or onto a Wireframer board (below), where every piece becomes clickable.

The pipeline

const g = ctx.fns.diagramer.draw;
// 1. pieces
const app = g.chip({ label: "app", note: "libpq", tone: "blue", id: "app" });
const db  = g.drum({ label: "Postgres", tone: "green", id: "db" });
const box = g.box({ title: "Backend", body: g.row({ items: [app, g.chip({ label: "cache" })], gap: 3 }), tone: "blue", dashed: true });
// 2. composition
const root = g.col({ items: [box, db], gap: g.gap({ label: "SQL" }) });
// 3. layout (+ hints)
const L = g.layout({ root, hints: [g.under({ piece: db, anchor: app })] });
// 4. arrows, by the same variables
const wires = [g.link({ layout: L, from: app, to: db, label: "SQL" })];
// 5. self-check, then render
const problems = g.check({ layout: L, wires, maxWidth: 145 });   // [] when clean
const html = g.render({ sheet: "backend", layout: L, wires });
  • Pieces: chip (filled block, label + note), drum (storage cylinder), text (caption), box (titled frame that fits around its body; w/h to force a size), space.
  • Composition: row, col (gap, align), wrap (flow to a width), tree (parent centred over children), free (your own offsets when the picture is not a tree). gap({ label }) gives exactly the space a labelled arrow needs.
  • Layout: layout({ root, hints }) — everything on a grid of 8 px steps. Hints move single pieces: under (centre under/over another), align (one line on an axis). A hint that drags a piece into another is reported by check.
  • Arrows: link (one arrow, label on its longest segment), fan (one to many: trunk, bus, drops). Point arrows at the piece you mean; to enter a framed group, target the inner group rather than a chip behind its title.
  • Self-check: check → sentences ("arrow connect crosses the title of Backends"); report → the same as data (rectangles, overlap, shift that clears it, advice). Always fix until check is empty — the examples test fails on any problem.
  • Ids: give id to every piece someone may point at — it becomes data-widget-id="<sheet>.<id>"; ids are unique per sheet (render throws on duplicates). Every piece, group and arrow also takes widgetId: a full Wireframer widget id written verbatim (no sheet prefix), the same as widgetId of the w.* kit. selectable keeps any data-widget-id already present in the SVG, so kit markup and hand-tagged SVG mix with diagram parts.

On a Wireframer board

A set of diagrams is a design folder of the Wireframer kind: studio.json + one boards/<sheet>.ts per sheet. Wireframer gives the canvas (pan, zoom, select, Ask agent, redraw on save); a sheet returns d.board({ title, body: g.render({ sheet: d.id, … }) }).

  1. await ctx.fns.diagramer.create({ file: "diagrams/<topic>", title, lang: "ru", sheets: [{ id: "flow", kind: "flow" }] }) — or copy a sheet from examples/demo/boards/ into boards/ and list it in studio.json.
  2. Edit boards/<sheet>.ts with the write/edit tool.
  3. await ctx.fns.wireframer.open({ file: "diagrams/<topic>" }) once; every save redraws the tab by itself.
  4. Check: wireframer.refresh({}) → problems must be empty; to look yourself wireframer.snapshot({ file, board }) → PNG, read it.
  5. Point at a place: wireframer.focus({ widget: "<sheet>.<id>" }).
export default async function (ctx: Context, d: types.wireframer.Scope): Promise<string> {
    const g = ctx.fns.diagramer.draw;
    // … pieces, layout, wires as above …
    const problems = g.check({ layout: L, wires });
    const note = problems.length ? `<pre style="color:#da1e28">${problems.join("\n")}</pre>` : "";
    return d.board({ title: "Backend", body: g.render({ sheet: d.id, layout: L, wires }) + note });
}

Ask agent. Every piece with an id and every labelled arrow is a widget <sheet>.<id>. The person clicks it and presses Ask agent; you receive <design-target … id="backend.db" file="…/boards/backend.ts" line="5"/>. Edit that line and keep the ids — generated ids shift when calls are reordered.

Sandbox. Sheets run in Wireframer's worker: ctx.fns gives drawing functions only (diagramer.*, diagrams.*, svg.*, w.*, markdown.*), no database, state or network. Data is literal in the file. 10 s per sheet, 2 MB HTML.

Other sheet kinds

  • Flowchart (auto layout, DAG only): svg.flowHelpers + diagramer.flow({ sheet, nodes, edges, direction?, mainPath? }). Example: `e
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • examples/demo/boards/drawengine.ts
  • examples/demo/boards/failover.ts
  • examples/demo/boards/iostack.ts
  • examples/demo/boards/k8s.ts
  • examples/demo/boards/linux.ts
  • examples/demo/boards/oidc.ts
  • examples/demo/boards/pgdraw.ts
  • examples/demo/boards/postgres.ts
  • examples/demo/studio.json
  • package.json
  • src/diagramer/KitTools.ts
  • src/diagramer/Shape.ts
  • src/diagramer/create.ts
  • src/diagramer/diagramer.test.ts
  • src/diagramer/draw/End.ts
  • src/diagramer/draw/Hint.ts
  • src/diagramer/draw/Issue.ts
  • src/diagramer/draw/Piece.ts
  • src/diagramer/draw/Placed.ts
  • src/diagramer/draw/Rect.ts
  • src/diagramer/draw/Wire.ts
  • src/diagramer/draw/align.ts
  • src/diagramer/draw/box.ts
  • src/diagramer/draw/check.ts
  • src/diagramer/draw/chip.ts
  • src/diagramer/draw/col.ts
  • src/diagramer/draw/draw.test.ts
  • src/diagramer/draw/drum.ts
  • src/diagramer/draw/fan.ts
  • src/diagramer/draw/free.ts
  • src/diagramer/draw/gap.ts
  • src/diagramer/draw/layout.ts
  • src/diagramer/draw/link.ts
  • src/diagramer/draw/measure.ts
  • src/diagramer/draw/render.ts
  • src/diagramer/draw/report.ts
  • src/diagramer/draw/row.ts
  • src/diagramer/draw/space.ts
  • src/diagramer/draw/text.ts
  • src/diagramer/draw/tree.ts

FAQ

Что делает скилл diagramer?

Draw block diagrams in code: measured pieces composed like UI (row, col, box, tree), placed on an 8 px grid with a few hints, joined by routed arrows, checked for collisions in plain words and rendered as one SVG — inline anywhere, or as selectable sheets on a Wireframer board with Ask agent.

Как установить скилл diagramer?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл diagramer запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить diagramer с