agentleFS
oocxoocx/tfplan2md/.agents/skills/update-workflow-diagram/SKILL.md

update-workflow-diagram

Skill174 starsChanged 2 months agoMITView on GitHub

Convert the mermaid diagram in docs/workflow.md to a blueprint-styled SVG for the website. Use when the workflow diagram in agents.md is updated and needs to be reflected on the website.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After changes to the mermaid diagram in docs/workflow.md

    line 14
  2. Distinctive:

    When adding, removing, or renaming agents/artifacts

    line 15
  3. Distinctive:

    When modifying the workflow connections

    line 16
  4. Very specific:

    Use mermaid-cli (mmdc) to render the mermaid diagram to SVG

    line 22
  5. Distinctive:

    Keep each workflow in its own numbered sequence.

    line 25
  6. Very specific:

    Keep the SVG self-contained (all styles inline or in <style> block)

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Update Workflow Diagram from Mermaid

Purpose

Regenerate the website/ai-workflow.svg file from the canonical mermaid diagram in docs/workflow.md. The website uses a hand-crafted blueprint-styled SVG that preserves the exact layout generated by mermaid but applies a custom visual style (technical drawing aesthetic with cyan/white on dark blue).

When to Use

  • After changes to the mermaid diagram in docs/workflow.md
  • When adding, removing, or renaming agents/artifacts
  • When modifying the workflow connections

Hard Rules

Must

  • Use mermaid-cli (mmdc) to render the mermaid diagram to SVG
  • Parse the generated SVG to extract node positions and path definitions
  • Preserve exact node positions and path routing from mermaid output
  • Keep each workflow in its own numbered sequence; use plain labels rather than HTML bold or italic tags
  • Preserve subgraph headings and nested transforms, and omit invisible links used only to order the layout
  • Apply blueprint styling consistently per node type
  • Keep the SVG self-contained (all styles inline or in <style> block)

Must Not

  • Manually calculate node positions (extract from rendered mermaid SVG)
  • Manually recreate path curves (copy exact d attributes from mermaid paths)
  • Change the visual styling without updating this skill documentation

Blueprint Style Reference

Colors

ElementColorNotes
Background#0d1b2aDark navy blue
Grid linesrgba(255,255,255,0.1)Subtle white grid
Agent borders#00ffff (cyan)Solid 2px
Agent text#ffffff (white)Monospace font
Meta-agent borders#34d399 (green)Solid 2px
Meta-agent text#34d399 (green)Monospace font
Artifact borders#ffffff (white)Dashed 2px (2,2)
Artifact fillrgba(0,255,255,0.1)Subtle cyan
Artifact text#00ffff (cyan)Monospace font
Human borders#ffffff (white)Dashed 2px (4,2)
Human text#00ffff (cyan)Monospace font
Paths (solid)#00ffff (cyan)2px without filters, so straight arrows render reliably
Paths (dashed/feedback)#ff6b6b (coral red)2px, dasharray 6,3
Arrow markersSame as path color

Node Classes (from mermaid)

Mermaid ClassSVG ClassDescription
humannode-humanMaintainer (dashed white border)
agentnode-agentRegular agents (solid cyan border)
metaagentnode-metaagentWorkflow Engineer (solid green border)
artifactnode-artifactProduced documents (dashed white, cyan fill)

Glow Effects

Nodes have CSS filter glow. Edge paths have no filters: zero-width bounding boxes on perfectly vertical paths cause some SVG renderers to hide filtered arrows.

/* Nodes */
filter: drop-shadow(0 0 4px rgba(0,255,255,0.6));

Actions

One command. It extracts the mermaid block from docs/workflow.md, renders it with mmdc for layout, and restyles the result:

scripts/render-workflow-diagram.py

--check verifies the committed SVG was generated from the diagram as it stands now, by comparing a source-sha256 stamp written into the file. It does not re-render, so it needs no browser and runs in milliseconds — this is the CI check.

Mermaid lays out text by measuring it in a browser, so node coordinates depend on which fonts the machine has; a byte-for-byte comparison passes locally and fails in CI for no reason a reader could act on. The stamp catches the failure that matters — editing the diagram and forgetting to regenerate.

--check-render does the strict byte comparison against a fresh render. Use it on the machine that generated the file, not in CI.

The stamp covers the diagram source, not this script: change the styling logic without regenerating and --check still passes. If you edit the script, re-run it and commit the SVG.

The script exists because this was a ten-step manual parse, and doing it by hand loses things quietly. Two failures found the first time it ran, neither visible in the output text:

  • The Maintainer node vanished. It is a stadium, drawn as a free <path> inside an outer-path group — matching neither the <rect> nor the <polygon> pattern, so the node was skipped without an error.
  • The gate hexagons rendered ~100px from their own labels, because a mermaid <polygon> carries its own inner transform in addition to the node group's.
  • Workflow lanes lost their headings and overlapped when nested subgraph transforms were ignored. The parser composes those translations for nodes, paths and labels.
  • Invisible links used to order the workflows became visible arrows. They affect the Mermaid layout but must be omitted from the website SVG.

Always look at the rendered image before committing. A grep for the node names passes in both broken cases above.

npx --yes sharp-cli -i website/src/media-root/ai-workflow.svg -o .tmp/workflow-diagram.png resize 1400

Node styling

Mermaid classDefSVG classAppearance
rolenode-agentsolid cyan border, white text
metanode-metaagentsolid green border, green text
externalnode-externalsolid pink border — the Codex reviewer
gatenode-gateamber hexagon, amber text
artifactnode-artifactdashed white border, cyan fill
(unclassed)node-humandashed white border, cyan text

Adding a new classDef to the diagram means adding it to NODE_CLASS and STYLE in the script; an unmapped class falls back to the human style, which will look wrong.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.