Comprehensive React Flow (@xyflow/react) patterns and best practices for building node-based UIs, workflow editors, and interactive diagrams. Use when working with React Flow for (1) building flow editors or node-based interfaces, (2) creating custom nodes and edges, (3) implementing drag-and-drop workflows, (4) optimizing performance for large graphs, (5) managing flow state and interactions, (6) implementing auto-layout or positioning, or (7) TypeScript integration with React Flow.
95
95%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Version 1.0.0 xyflow Team January 2026
Comprehensive React Flow patterns and best practices for building node-based UIs and interactive flow diagrams. Designed for AI agents and LLMs to guide the development of production-ready React Flow applications.
This skill provides comprehensive guidance for building node-based interfaces with React Flow (@xyflow/react). It covers:
react-flow/
├── SKILL.md - Quick reference with YAML frontmatter (loaded on skill trigger)
├── AGENTS.md - Full compiled guide (comprehensive documentation)
├── README.md - This file (overview and navigation)
├── metadata.json - Skill metadata and references
├── all_links.md - Complete list of scraped documentation URLs
├── rules/ - Individual rule files organized by category
│ ├── _sections.md - Category metadata and structure
│ ├── _template.md - Template for creating new rules
│ ├── setup-*.md - Setup and configuration rules
│ ├── perf-*.md - Performance optimization rules
│ ├── node-*.md - Node patterns and customization
│ ├── edge-*.md - Edge handling and customization
│ ├── state-*.md - State management patterns
│ ├── hook-*.md - React Flow hooks usage
│ ├── layout-*.md - Layout and positioning patterns
│ ├── interaction-*.md - User interaction patterns
│ └── typescript-*.md - TypeScript integration patterns
└── scraped/ - Original documentation from reactflow.dev
├── learn-concepts/
├── learn-customization/
├── learn-advanced/
├── learn-tutorials/
├── learn-layouting/
├── learn-troubleshooting/
├── api-hooks/
├── api-types/
├── api-utils/
├── api-components/
├── examples-nodes/
├── examples-edges/
├── examples-interaction/
├── examples-layout/
├── examples-misc/
└── ui-components/Rules are organized into 9 categories by priority and focus:
Essential patterns for initializing React Flow correctly.
Patterns to maintain performance with large graphs.
Best practices for node creation and customization.
Edge creation, customization, and connection handling.
Managing flow state, persistence, and history.
Proper usage of React Flow hooks.
Auto-layout and viewport management.
User interaction handling.
Type-safe React Flow applications.
import { useCallback } from 'react';
import {
ReactFlow,
Background,
Controls,
useNodesState,
useEdgesState,
addEdge
} from '@xyflow/react';
import '@xyflow/react/dist/style.css';
const initialNodes = [
{ id: '1', position: { x: 0, y: 0 }, data: { label: 'Hello' } },
{ id: '2', position: { x: 100, y: 100 }, data: { label: 'World' } },
];
const initialEdges = [
{ id: 'e1-2', source: '1', target: '2' },
];
function Flow() {
const [nodes, setNodes, onNodesChange] = useNodesState(initialNodes);
const [edges, setEdges, onEdgesChange] = useEdgesState(initialEdges);
const onConnect = useCallback(
(params) => setEdges((eds) => addEdge(params, eds)),
[setEdges]
);
return (
<div style={{ width: '100%', height: '100vh' }}>
<ReactFlow
nodes={nodes}
edges={edges}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
onConnect={onConnect}
fitView
>
<Background />
<Controls />
</ReactFlow>
</div>
);
}When this skill is triggered, agents should:
All documentation scraped from official React Flow sources:
@xyflow/reactnpm install @xyflow/reactThis skill is designed to be maintained and updated as React Flow evolves. To add new rules:
rules/_template.md as a starting point{category}-{description}.md