Skip to content
ExamsLibraryFor agentsConnect your agent

Drawing the real mechanism

intermediate·8 min·Markdown for agents

What this lesson teaches

Draw a figure that shows how the thing actually works, with one accent, right-angle connectors, readable labels and an SVG a screen reader can describe.

  1. 1Delete first
  2. 2One accent, and hierarchy by treatment
  3. 3The six connector rules
  4. 4Grid, type and legend
  5. 5An SVG a screen reader can describe
  6. 6When your project has a brand

Ask an agent to "diagram how password reset works" and you will often get the vague version. Here is the real one; flip to Vague to compare.

How a password reset worksThe browser asks the API, which saves a short-lived token and queues a job; a worker emails the reset link, and the user clicks it to return to the browser.requestsave tokenenqueueasyncreset linkuser clicksBrowseruser’s tabAPIPOST /api/resetQueuejobsEmail workersends mailTokenstoken · 15 minInboxuser’s emailmain pathasync or returnstoredHow a password reset worksThe browser asks the API, which saves a short-lived token and queues a job; a worker emails the reset link, and the user clicks it to return to the browser.requesttokenenqueueasynclinkuser clicksBrowseruser’s tabAPIPOST /api/resetTokens15 minQueuejobsEmail workersends mailInboxemailmain pathstoredasync or return
  • The real parts: queue, worker, tokens
  • Order, and the async hop, dashed
  • One accent, on the path that matters
  • Right angles, masked labels, legend at the foot
Same system. The vague version could describe any app. The real one shows the token, the queue, the async hop and the email that matters.

The vague one is not wrong, exactly. It is just empty. "Backend" and "Cloud" could be any system on earth, the arrows go every direction, and nothing tells you what happens first.

The real one names the actual parts and shows the order they act in. That is the whole job of a figure: show the mechanism, so a reader could rebuild it.

Delete first

A designed diagram is mostly deletion. Before you draw, run four tests on your list of parts.

  1. Can a node go?

    Every should be a distinct idea. A "Load balancer" nobody asked about can usually go.

  2. Can two nodes merge?

    If two boxes always travel together, they are one box.

  3. Can an arrow go?

    If the layout already implies it (left to right, top to bottom), the arrow repeats it.

  4. Can a label go?

    If the shape or color already says it, the word is noise.

Then hold the budget from the last lesson: about 9 nodes, 12 connectors, 2 accents and 2 callouts. The figure is done when nothing else can be removed.

One accent, and hierarchy by treatment

A is one bright color on one or two elements: the thing the reader must see first. In the password reset figure that is the email worker and the link it sends. An accent on five boxes is no accent at all.

Everything else gets a treatment instead of a size or a color. Identical boxes erase the hierarchy, so each kind of node looks slightly different:

KindTreatment
Focalaccent tint fill, accent stroke
Servicewhite fill, ink stroke
Store (a database, a cache)ink at 5%
External (the user, a third party)ink at 3%, stroke at 30%
Optionaldashed 4,3

Use borders, not shadows. Nodes get a corner radius of 6, never a pill and never a soft floating card. A figure is print, so the rules for shadows in a live interface don't apply here.

Purple glow and rounded-everything is the generated-diagram look.

The six connector rules

are where most figures fail. These six rules come from Cathryn Lavery's diagram-design, and they are what make the right-hand picture look calm.

  1. only. Right-angle elbows rounded at 8px. A straight line only when both ends share an x or a y.
  2. Labels on a . Each arrow label sits on a patch of paper color, 6 to 10px clear of its line, never on it. 14 characters at most.
  3. No stacked lines. Parallel routes sit at least 12px apart. Hop at a single crossing.
  4. Own attach points. Several arrows on one edge spread out evenly, at least 12px apart, instead of meeting at the middle.
  5. Never behind a box. A line that passes behind a box it doesn't end at gets rerouted.
  6. Arrows before boxes. Draw lines first, so they sit behind the nodes and no label covers a box.

✕ Before

Diagonal lines from center to center. "request" written across the stroke. Three arrows meeting at one point on the API box. A legend floating between nodes.

✓ After

Right angles. "request" on a paper mask above the line. Three arrows spread along the edge. The legend in a strip under the figure.

Strokes are muted gray by default. The headline path gets the accent, and async or return paths are dashed (5,4), like the "user clicks" line looping back to the browser.

Grid, type and legend

Put every position, size, gap and padding on a 4px grid: if it doesn't divide by 4, nudge it. Node names go in a sans font at weight 600. Technical sublabels (ports, URLs, commands) go in mono. Never use mono as a blanket "developer" font for everything.

The legend is a horizontal strip under the figure, never floating among the nodes. Widen the drawing by about 60px to make room for it.

On a phone, try the demo above at a narrow width: it switches to a vertical layout, a redesign rather than a squeeze. If you can't redesign it, keep the SVG at its full width inside a small scrolling wrapper, so the figure scrolls sideways and the page doesn't.

An SVG a screen reader can describe

A figure is an image, so it needs a name. Put role="img" on the SVG and point aria-labelledby at a .

<svg viewBox="0 0 710 320" role="img"
     aria-labelledby="reset-flow-title reset-flow-desc">
  <title id="reset-flow-title">How a password reset works</title>
  <desc id="reset-flow-desc">The API saves a short-lived token and queues a job;
    a worker emails the link, and the user clicks it.</desc>
  <!-- arrows first, then boxes; labels as real <text> -->
</svg>

Three details people miss. <title> is the first child, before <defs>. Both ids carry the figure's name as a prefix (reset-flow-title, never a bare title), because two figures on one page would otherwise clash. And <desc> describes the content in one sentence, not the geometry ("boxes and arrows" tells nobody anything).

When your project has a brand

If the project ships a .design file (a written design contract), it supplies the of the figure: the paper color, the ink, the one accent and the font families. diagram-design keeps everything else: the geometry, the connector rules, the type sizes and its motion timing, because its scripts check them.

TopicWho wins inside a diagram-design file
Paper, accent, font familiesyour .design contract
Box radius, no shadows, connector rulesdiagram-design
Small type (12px names, 9px sublabels)diagram-design, as long as the figure isn't shown smaller than its width
Step-by-step reveal at 480msdiagram-design: that is reading pace, not a slow button
Whether it moves at allthis skill decides; static by default

The gotcha goes both ways. Skip diagram-design's first-run question about colors and you ship its default palette (an orange accent on warm gray) as if it were your brand. Re-skin the connector rules "to match the brand" and you break the checks it runs.

Draw the mechanism· for your agent
Draw a figure of how [system] actually works, as one HTML file with inline SVG.
Name the real parts (not "Backend" or "Cloud") and show the order they act in.
Delete first: cut any node, arrow or label the layout already implies. Max 9 nodes, 12 connectors.
One accent on the headline path only. Treatment by kind: focal tint, service white, store 5% ink, external 3%.
Orthogonal connectors (r=8), labels on paper masks 6–10px off the line, own attach points, arrows drawn before boxes.
4px grid, sans 600 names, mono only for technical sublabels, legend as a strip under the figure.
role="img" with aria-labelledby to a prefixed <title> and a one-sentence <desc>.

Quick check

Your figure has three arrows leaving the bottom of the API box, all starting from its exact center. Which rule fixes it?

What this lesson builds on and leads to, across every course.

  • Should you draw it?
  • What is a skill?
  • Routing the job