agentleFS
renfei-designrenfei-design/Figma-AI-Bridge/.github/skills/workflow-diagram/SKILL.md

workflow-diagram

Skill16 starsChanged 9 months agoMITView on GitHub

Create workflow diagrams, flowcharts, and process maps in Figma with shapes, arrows, and text. Use when asked to create a workflow, flowchart, process diagram, decision tree, or any node-and-edge diagram in Figma. Supports process boxes, decision diamonds, start/end pills, subprocess shapes, notes, swimlanes, and automatic graph layout.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Direction: default TB; use LR for timelines or horizontal processes

    line 103
  2. Distinctive:

    Write concise labels (1–4 words ideal)

    line 108
  3. Distinctive:

    Every node should be reachable from a start node

    line 110
  4. Distinctive:

    Every path should lead to an end node (unless it's a loop)

    line 111
  5. Very specific:

    Use get_canvas_bounds first to avoid overlap with existing content.

    line 119
  6. Very specific:

    Manual overrides: If a node has explicit x/y, those are used

    line 194
  7. Very specific:

    Default spacing: nodeWidth=240, nodeHeight=72, horizontalGap=120, verticalGap=80

    line 196
  8. Very specific:

    Direction: Use TB for most workflows, LR for pipelines/timelines

    line 224
  9. Very specific:

    Use get_canvas_bounds to avoid overlap with existing content

    line 226
  10. Distinctive:

    Keep labels concise (1–4 words).

    line 228

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Workflow Diagram

Build workflow diagrams in Figma using the create_workflow_diagram command. One command builds the entire diagram — shapes, arrows, labels, and layout are handled automatically.

Prerequisites

  • figma-ai-bridge plugin running in Figma and connected
  • The create_workflow_diagram command registered in code.js
  • Helper: scripts/figma_cmd.mjs <channel> create_workflow_diagram '<paramsJSON>'

Shape Types

TypeShapeUse for
startGreen pillEntry point of a workflow
endRed pillTermination / completion points
processWhite rectangleActions, tasks, operations
decisionYellow diamondYes/no branches, conditions. Always has 2+ labeled outgoing edges
subprocessPurple double-border rectangleReferenced sub-processes, external calls
noteDashed yellow boxComments, annotations, side notes

Command Schema

{
  "title": "My Workflow",
  "direction": "TB",
  "nodes": [
    { "id": "start", "type": "start", "label": "Begin" },
    { "id": "step1", "type": "process", "label": "Do something" },
    { "id": "check", "type": "decision", "label": "OK?" },
    { "id": "done", "type": "end", "label": "Done" }
  ],
  "edges": [
    { "from": "start", "to": "step1" },
    { "from": "step1", "to": "check" },
    { "from": "check", "to": "done", "label": "Yes" },
    { "from": "check", "to": "step1", "label": "No" }
  ],
  "x": 0,
  "y": 0
}

Parameters

ParameterTypeRequiredDefaultDescription
titlestringNo"Workflow Diagram"Diagram title
nodesarrayYes—Node definitions
edgesarrayYes—Edge definitions
direction"TB" | "LR"No"TB"Top-to-bottom or left-to-right
swimlanesarrayNo—Optional lane groupings
x, ynumberNo0Canvas placement offset
spacingobjectNo—Override nodeWidth, nodeHeight, horizontalGap, verticalGap

Node Object

FieldTypeRequiredDescription
idstringYesUnique identifier
typestringYesstart, end, process, decision, subprocess, note
labelstringYesDisplay text inside the shape
sublabelstringNoSmaller text below the shape
x, ynumberNoManual position override

Edge Object

FieldTypeRequiredDescription
fromstringYesSource node id
tostringYesTarget node id
labelstringNoText label on the arrow ("Yes", "No", "Error")

Swimlane Object

FieldTypeRequiredDescription
idstringYesLane identifier
labelstringYesHeader text
nodeIdsstring[]YesNode IDs belonging to this lane

Workflow

1. Analyze the User's Description

Parse the description and identify:

  • Steps → process nodes
  • Decision points → decision nodes
  • Start/End → start / end nodes
  • Sub-processes → subprocess nodes
  • Annotations → note nodes
  • Roles/departments → swimlanes
  • Direction: default TB; use LR for timelines or horizontal processes

2. Plan Nodes and Edges

  • Assign unique short id strings (e.g., validate_email, send_welcome)
  • Write concise labels (1–4 words ideal)
  • Every decision node must have labeled outgoing edges
  • Every node should be reachable from a start node
  • Every path should lead to an end node (unless it's a loop)

3. Build the Diagram

FIGMA_TIMEOUT_MS=60000 node scripts/figma_cmd.mjs <channel> create_workflow_diagram '<JSON>'

Use get_canvas_bounds first to avoid overlap with existing content.

4. Refine (Optional)

  • set_fill_color — change a node's color
  • set_text_content — update a label
  • move_node — reposition a node
  • set_focus — zoom to the diagram

Common Patterns

Linear Flow

{
  "title": "Order Processing",
  "nodes": [
    { "id": "start", "type": "start", "label": "Order Received" },
    { "id": "validate", "type": "process", "label": "Validate Order" },
    { "id": "charge", "type": "process", "label": "Charge Payment" },
    { "id": "ship", "type": "process", "label": "Ship Item" },
    { "id": "done", "type": "end", "label": "Complete" }
  ],
  "edges": [
    { "from": "start", "to": "validate" },
    { "from": "validate", "to": "charge" },
    { "from": "charge", "to": "ship" },
    { "from": "ship", "to": "done" }
  ]
}

Branching Decision

{
  "title": "Login Flow",
  "nodes": [
    { "id": "start", "type": "start", "label": "User Login" },
    { "id": "auth", "type": "process", "label": "Authenticate" },
    { "id": "valid", "type": "decision", "label": "Valid?" },
    { "id": "dashboard", "type": "process", "label": "Show Dashboard" },
    { "id": "error", "type": "process", "label": "Show Error" },
    { "id": "retry", "type": "decision", "label": "Retry?" },
    { "id": "done", "type": "end", "label": "Done" }
  ],
  "edges": [
    { "from": "start", "to": "auth" },
    { "from": "auth", "to": "valid" },
    { "from": "valid", "to": "dashboard", "label": "Yes" },
    { "from": "valid", "to": "error", "label": "No" },
    { "from": "error", "to": "retry" },
    { "from": "retry", "to": "auth", "label": "Yes" },
    { "from": "retry", "to": "done", "label": "No" },
    { "from": "dashboard", "to": "done" }
  ]
}

Swimlane Layout

{
  "title": "Support Ticket Flow",
  "swimlanes": [
    { "id": "customer", "label": "Customer", "nodeIds": ["submit"] },
    { "id": "support", "label": "Support Team", "nodeIds": ["triage", "assign"] },
    { "id": "engineering", "label": "Engineering", "nodeIds": ["investigate", "resolve", "close"] }
  ]
}

Layout Algorithm

Built-in layered graph layout (Sugiyama-style):

  1. Rank assignment: BFS from start nodes assigns each node to a layer
  2. Crossing minimization: Barycenter heuristic (4 passes)
  3. Coordinate assignment: Nodes evenly spaced, centered
  4. Manual overrides: If a node has explicit x/y, those are used

Default spacing: nodeWidth=240, nodeHeight=72, horizontalGap=120, verticalGap=80

Design Tokens

Shape Colors

ShapeFillStroke
Process#FFFFFF#D1D6DC
Decision#FFF9EB#E3C78A
Start#ECF9EC#8CC78C
End#FAECEC#D18C8C
Subprocess#EFEFFA#A6A6D6
Note#FDFCF3#D1CCB3 (dashed)

Typography

ElementFontWeightSizeColor
Diagram titleInterBold24px#212631
Node labelInterSemibold14px#212631
Node sublabelInterRegular11px#737A85
Edge labelInterRegular11px#666E78
Swimlane headerInterSemibold13px#59616B

Notes

  • Auto-layout is built-in — no coordinate math required
  • Direction: Use TB for most workflows, LR for pipelines/timelines
  • Swimlanes are optional — only use when roles/departments are mentioned
  • Use get_canvas_bounds to avoid overlap with existing content
  • Node id values should be short, snake_case identifiers
  • Keep labels concise (1–4 words). Use sublabels for additional context.

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.