Agent skill · writing content · aiskillstore
react-flow-best-practices
Best practices for writing, reviewing, and refactoring React Flow / @xyflow/react v12 canvases. Use when work touches React Flow components, custom nodes, custom edges, handles, node data typing, viewport controls, MiniMap/Background/Panel usage, NodeToolbar, NodeResizer, or workflow-builder review tasks.
Why this skill is useful
Provides domain-specific best practices for optimizing React Flow implementations that the AI wouldn't reliably generate on its own.
What it needs
About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
React Flow Best Practices Purpose Use this skill to review and improve React Flow implementations with the current @xyflow/react v12 patterns. Optimize for correctness first: stable node and handle IDs, typed node data, predictable viewport behavior, accessible controls, and performance that does not collapse as the workflow grows. First Steps 1. Inspect the React Flow package and usage: package.json for @xyflow/react. Global CSS for @xyflow/react/dist/style.css. Canvas and node widget directories. 2. If API behavior is version-sensitive or uncertain, fetch current docs with Context7 for React Flow / @xyflow/react before recommending changes. 3. Choose the smallest reference file needed: Canvas/state/viewport: read references/canvas-state-and-viewport.md. Custom nodes, handles, toolbars, resizers, edges: read references/custom-nodes-handles-and-edges.md. Review output checklist: read references/review-checklist.md. Review Workflow 1. Map the flow architecture before judging details. Identify where domain data becomes Node[] and Edge[]. Identify the ReactFlow wrapper, provider boundary, custom nodeTypes, custom edgeTypes, and global CSS import. Confirm whether the canvas is static/narrative, editable, or partially interactive. This changes which issues matter. 2. Check identity contracts. Node id, node type, handle id, sourceHandle, and targetHandle must line up exactly. Edge ids should be deterministic from source/target/semantic relationship. Changing these IDs is a migration-level change because saved flows, viewport focus, and edges can break. 3. Check state ownership. Use controlled nodes and edges when the app needs domain-driven status, selection, persistence, or custom updates. Preserve user moves/resizes unless the product intentionally rebuilds layout from domain state. Keep frequent transient canvas state out of app-global stores unless another feature truly needs it. 4. Check custom components. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/react-flow-best-practices