Dag visual editor design

From curiositech/windags-skills · View interactive version

Dag visual editor design is an AI agent skill from the GitHub repository curiositech/windags-skills. Design modern, intuitive DAG/workflow visual editors that feel like LEGO, not LabView

How to use this skill

Skill file

DAG Visual Editor Design

Design modern, intuitive DAG and workflow visual editors following the LEGO philosophy: snap blocks together simply rather than wire complex ports.

DECISION POINTS

Layout Algorithm Selection

Node Count < 20 AND Simple Flow?
├─ YES → Force-directed layout (React Flow default)
│         • Fast rendering
│         • Good for exploring connections
│
└─ NO → Node Count > 100?
    ├─ YES → Hierarchical (Dagre) + Virtualization
    │        • Set viewport culling
    │        • Lazy load node details
    │
    └─ NO → Branch Factor > 3 per node?
        ├─ YES → ELK Layered Algorithm
        │        • Handles complex routing
        │        • Minimizes edge crossings
        │
        └─ NO → Dagre LR (Left-Right)
                • Standard choice
                • rankdir: 'LR', ranksep: 80

Node Connection Strategy

Data Type Diversity?
├─ Single type (e.g., JSON) → Implicit connections
│   • No handles visible by default
│   • Snap zones on hover
│
├─ 2-3 types → Color-coded handles
│   • Red: Error streams
│   • Blue: Data streams  
│   • Green: Success/completion
│
└─ 4+ types → Bundled connections
    • Group related channels
    • Label bundles clearly
    • Consider type coercion nodes

Editing Mode Selection

User Skill Level?
├─ Beginner → Canvas + Sidebar
│   • Drag nodes from categorized list
│   • Template-based workflows
│
├─ Intermediate → Quick Add (Slash Commands)
│   • Type "/" for node search
│   • Context-aware suggestions
│
└─ Expert → Keyboard First
    • Hotkeys for common nodes
    • Text-based node creation
    • Batch operations

FAILURE MODES

Spaghetti Graph Syndrome

Symptoms: Edges crossing everywhere, impossible to follow data flow, users getting lost

Detection: If >30% of edges cross other edges, or users spend >20s tracing a path

Fix:

Zoom Desert Problem

Symptoms: Pan/zoom feels broken, users can't find their content, minimap unhelpful

Detection: Users hitting zoom limits frequently, >5 seconds to locate nodes after navigation

Fix:

Handle Ambiguity Confusion

Symptoms: Users connecting wrong ports, type errors, unexpected data flow

Detection: >20% connection error rate, frequent undo of connections

Fix:

Performance Cliff Rendering

Symptoms: Editor freezes with >50 nodes, stuttering during pan/zoom

Detection: Frame rate drops below 30fps, render times >100ms

Fix:

No-Feedback Execution Black Box

Symptoms: Users don't know if workflow is running, what failed, or why it stopped

Detection: Users asking "is it working?" or clicking run button multiple times

Fix:

WORKED EXAMPLES

Example: Data Processing Pipeline Editor

Scenario: Design editor for CSV → Transform → Database pipeline

Step 1: Choose Layout

Step 2: Design Node Structure

const TransformNode = ({ data }) => (
  <div className="w-64 border-2 border-gray-200 rounded-lg bg-white">
    <div className="bg-blue-50 px-3 py-2 border-b">
      <h3>🔄 Transform Data</h3>
    </div>
    <div className="p-3">
      <div className="text-sm">Filter: {data.filter}</div>
      <div className="text-sm">Sort: {data.sort}</div>
    </div>
    <Handle type="target" position={Position.Left} />
    <Handle type="source" position={Position.Right} />
  </div>
);

Step 3: Connection Logic

Novice Miss: Would add separate handles for each column

Expert Catch: Keeps single connection, shows column mapping in node detail

QUALITY GATES

NOT-FOR Boundaries

Don't use DAG editors for:

Delegate to other skills:

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.