Graph design

From rcarmo/piclaw · View interactive version

Graph design is an AI agent skill from the GitHub repository rcarmo/piclaw. Design, audit, and redraw inline SVG architecture and flow diagrams using source verification and a consistent orthogonal-routing visual language.

How to use this skill

Skill file

Graph Design

Use this skill to create, fix, or audit inline SVG diagrams in source-authored documentation.

It covers Markdown, READMEs, docs pages, workitems, and other files that embed architecture or flow diagrams.

Scope

Applies to:

Non-negotiable routing rule

Default to orthogonal arrows.

When an orthogonal arrow turns, the corner must be rounded.

Do not use hard-corner elbow polylines as the default style.

Do not use diagonals unless the diagram genuinely benefits from them.

If the flow is horizontal/vertical, draw it horizontally/vertically.

If the path bends, make it a softened right-angle turn with a consistent radius.

Canonical workflow

  1. Read the source document that owns the diagram.
  2. Read upstream docs/repo/README when the diagram represents a real system.
  3. Verify the surrounding copy matches reality before drawing.
  4. Edit the source Markdown/HTML/SVG block, not generated output.
  5. Run the project build/preview command if one exists.
  6. Verify the rendered output in its final context.
  7. If publishing is in scope, commit/push/tag only after the rendered result is checked.

Source of truth

Core principles

1. Source accuracy over aesthetics

Do not invent architecture.

When the diagram represents a real system:

Things that should be source-verified before drawing:

2. Keep diagrams simple

Prefer a small number of boxes with a clear story.

Most good diagrams show only:

Avoid turning every diagram into a subsystem map.

3. Match the surrounding story

The diagram should reinforce the nearby text:

If the diagram implies something the text does not support, either:

Visual language

Use the document or site’s established SVG theme if one already exists.

When authoring or normalizing an inline SVG diagram, prefer:

Suggested class vocabulary

If the source does not already have a house style, these classes work well:

Typical meanings:

Consistency matters more than rigid semantics.

Layout rules

Preferred shapes

Use rounded rectangles for nodes.

Preferred flow directions

Prefer one of these structures:

Avoid zig-zag storytelling unless the system really needs it.

Spacing

Box sizing

Text rules

Label hierarchy

Use:

Wrap long text manually

SVG does not wrap text well.

Instead:

Keep wording concrete

Prefer concrete nouns like:

Avoid vague labels like:

Required arrow rules

1. Arrows must exist when the story is a flow

If the diagram is about movement, requests, transforms, or state updates, arrows are not optional.

Common required flows:

2. Arrows must land on sensible box edges

Start and end arrows on node edges, not empty space.

Prefer:

3. **Arrows should be orthogonal**

Default to horizontal and vertical routing.

Use:

Avoid diagonals unless they clearly improve the story.

4. **Orthogonal turns must have rounded corners**

This is a hard rule for normal architecture and flow diagrams.

Do not use hard-corner elbow polylines as the default style.

Do not leave right-angle corners visually sharp.

Preferred approaches:

Guidelines:

5. Avoid awkward diagonals and splines

Do not default to freeform curves.

In most documentation diagrams:

6. Differentiate important flows when useful

A common convention is:

But consistency beats over-encoding.

7. Bidirectional flows should be explicit

If the system is truly request/response, draw both directions.

Examples:

Do not collapse bidirectional behavior into one ambiguous arrow.

Common diagram patterns

A. Single transform

Use for exporters, converters, wrappers, or generators.

Pattern:

B. Coordinator plus helper state

Use for apps that maintain a cache, state model, or session state.

Pattern:

C. One source, multiple outputs

Use when a tool emits multiple artifacts or execution targets.

Pattern:

D. Request/response bridge

Use for relays, gateways, resolvers, and proxies.

Pattern:

Known pitfalls

Do not bulk-rewrite blindly

Large SVG rewrites often break:

For bulk edits:

Do not trust automated layout alone

Automation can help normalize spacing, but it often:

Manual review is required.

Do not imply nonexistent components

Avoid inventing:

Do not preserve a bad old diagram just because it already exists

If the old diagram is wrong, redraw from source.

Audit checklist

When reviewing an existing diagram, check:

Verification

After editing:

  1. run the project’s build/preview command if available
  2. open the rendered output where users will actually see it
  3. inspect arrowheads, rounded turns, labels, and theme behavior
  4. confirm the source document is still the only maintained copy

Related guidance

If the workspace also includes visual-generation guidance, follow it alongside this skill:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.