Index of every page on this site: llms.txt
All skills
hktitan avatar

/khe-diagram

@945e23c
by Harshit Khemanihktitan/skills47 stars
2
Run it yourself

Decides whether a diagram earns its place over a sentence or a table, picks the surface by who touches the picture next, then draws a finished editorial figure or edits a live tldraw canvas, with connector, accent and budget rules that also serve as the review. Use when someone says "can you diagram this", "draw the architecture", "make a flowchart", "sketch this on a board", "my diagram looks like Mermaid", or names tldraw, a .tldraw file or diagram-design. For SVG markup and animation use `khe-svg`; for a live chart inside a product use `khe-ui`; for a leader line on a product shot use `stageshow`; for a blueprint line illustration use `plotter`.

Use this Skill: https://skilld.dev/gh/hktitan/skills/khe-diagram

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

README.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

khe-diagram

Whether to draw at all, then a finished figure or a live tldraw canvas.

npx skills add HKTITAN/skills --skill khe-diagram

What it does

  • Tests the request against a sentence and a table before any box is drawn.
  • Picks the surface by who touches the picture next: a finished figure, a tldraw canvas, a Mermaid block or FigJam.
  • Draws figures inside a budget of 9 nodes, 12 connectors, 2 callouts and one accent on 2 elements at most, with orthogonal connectors and masked labels.
  • Edits tldraw boards with bound arrows, frames and lints, and replies in the comment thread it acted on.
  • Checks a finished figure with a gate script that names every fault as a line, then walks a checklist from a render and hands over a FIGURE.md.

How it runs

khe-diagram's flow: khe-auto routes the request; the skill asks whether to draw at all, and a no ships a sentence or a table; the surface is picked by who touches it next, a tldraw canvas for a team that edits, otherwise a finished figure skinned from khe-design-tokens and passed to khe-svg after export

Used

/khe-diagram Can you diagram what changes between the old deploy pipeline and the new one?

The answer was no figure. From examples/no-diagram.md: "Verdict: table. Both pipelines run the same steps in the same order. Only four attributes of those steps change", followed by a four-row table (trigger, first exposure, rollback, who hears about a failure). It names the one part that does earn a picture, the rollback branch, and that is the gold flow beside it:

The gold deploy flow: a push passes CI, runs as a canary at 5 percent, then rolls out fully or rolls back and tells the author

When to use it

Use it when you are about to ask for an architecture, flow, sequence, state, timeline or org diagram, when a board needs building or tidying in tldraw, or when a figure you already have reads as auto-generated. It will tell you when a sentence or a table does the job better, and it will ask who edits the picture next when you have not said.

Invoke with

/khe-diagram [what]

Or describe the problem in your own words. The skill's description carries the triggers, so no special wording is needed.

Before and after

Before: 14 identical rounded boxes on a dark ground, diagonal arrows with labels sitting on the lines, five accent colors, a legend floating in the middle.

After: two figures, five zones then one path at 8 nodes, right-angle connectors with labels on masks 8px clear of the stroke, the accent on two elements, the legend in a strip underneath.

Example prompts

  • Can you diagram how our API, the queue and the worker connect?
  • I have a tldraw board for the launch plan and the arrows fall off whenever someone drags a card.
  • This architecture diagram looks like it came straight out of Mermaid. Can you make it look designed for the README?

Pairs with

  • khe-auto: it runs this skill's loop and names this skill's gate at each step.
  • khe-svg: it owns the general markup rules behind an accessible figure and the SVGO pass after an export.
  • khe-design-tokens: it reads the .design contract whose color roles and families become the figure's skin.
  • khe-ui: whether a figure animates at all is its decision; this skill keeps the figure's own clock only once it does.
  • khe-ui: its one-accent rule is the one this skill applies to nodes and to named canvas colors.

Verify

node scripts/diagram-check.mjs path/to/figure.svg --gate
node scripts/diagram-check.mjs --self-test

The gate reads an .svg, or SVG inline in .html, and prints one line per fault: diagonal:, edge-over-node:, accent-spread:, off-grid: and 26 more. It ends diagram check passed only when all 22 never-intentional lines are at 0, exits 1 when one is not, and exits 2 with inconclusive when it found no figure to read. --self-test runs it against the skill's own gold examples and teaching pairs.

What it proves: the budget of 9 nodes, 12 connectors and 2 callouts is held, connectors are orthogonal, rounded and drawn before the boxes, labels sit on masks, the accent is one hue on 2 elements at most, type holds the ramp, nodes sit on the 4px grid, the legend is present and under the figure, and the figure has an accessible title.

What it does not prove: that the figure should exist, that the accent is on the right thing, that text fits its box, or anything about a live tldraw canvas. Those are the yes/no questions in references/verify.md, answered from a render or from the board. Passing is necessary, not sufficient.

What is inside

  • SKILL.md: the one idea, the workflow with its exits, the rules and the reference map.
  • references/: 4 craft references the agent opens one at a time; verify.md (the last pass and the handover template), review.md (the brief for a fresh-eye reviewer) and teaching.md (the index of pairs); plus gotchas.md and pov.md, which are yours to edit.
  • examples/: 4 gold files, an architecture figure, a flow, a sequence and a "no diagram" answer. They are the bar and the starting point.
  • teaching/: 14 bad and good pairs, one fault each, each folder named for the gate line it raises. They are also the gate's tests.
  • scripts/diagram-check.mjs: the gate. Zero dependencies, Node 20 or later.
  • LICENSE: MIT.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning4d3 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    This skill provides a professional framework for creating and reviewing diagrams and editable canvases. It includes a specialized Node.js script for structural verification of SVG figures and integrates with well-known diagramming tools like tldraw.

  • Socket4d

    No alerts

  • Snyk8d

    Risk: MEDIUM · 1 issue

Signed by skilld at 945e23c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 days ago
metadata
{
  "author": "Harshit Khemani",
  "version": "1.0.0"
}

README badge

README badge for hktitan/skills/khe-diagram