Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计提醒

react-flowReact flow 前端

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

5,645

周安装

240

GitHub Stars

21

下载量

1,978
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-flow(React flow 前端)
来源仓库:https://github.com/framara/react-flow-skill
仓库路径:skills/react-flow
安装命令:
npx skills add https://github.com/framara/react-flow-skill --skill react-flow
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/framara/react-flow-skill --skill react-flow

简介

react-flow 用于辅助前端页面、组件和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限和维护状态。
  • 使用时需结合项目现有设计系统和路由方式,避免生成孤立片段。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果。

SKILL.md

React Flow

Overview

Use this skill to build, customize, debug, and optimize interactive node-based UIs with React Flow (@xyflow/react v12+). Covers everything from basic setup to advanced patterns like computed flows, sub-flows, and external layout integration.

Agent behavior contract (follow these rules)

  1. Always import from @xyflow/react — never from legacy reactflow or react-flow-renderer packages.
  2. Always import the stylesheet: import '@xyflow/react/dist/style.css' (or base.css for custom styling frameworks).
  3. The <ReactFlow> parent container must have explicit width and height — this is the #1 cause of blank canvases.
  4. Define nodeTypes and edgeTypes objects outside component bodies or wrap in useMemo to prevent re-renders.
  5. Prefer custom nodes over built-in nodes — the React Flow team explicitly recommends this.
  6. Use the nodrag class on interactive elements inside custom nodes (inputs, buttons, selects).
  7. Use nowheel class on scrollable elements inside custom nodes to prevent zoom interference.
  8. When hiding handles, use visibility: hidden or opacity: 0 — never display: none (breaks dimension calculation).
  9. When using multiple handles of the same type on a node, always assign unique id props.
  10. After programmatically adding/removing handles, call useUpdateNodeInternals to refresh the node.
  11. Always create new objects when updating node/edge state — mutations are not detected by React Flow.
  12. Prefer controlled flows (with onNodesChange/onEdgesChange/onConnect) for any non-trivial application.

First 60 seconds (triage template)

  • Clarify the goal: new flow setup, custom nodes/edges, state management, layout, performance, styling, E2E testing, advanced patterns (undo/redo, copy/paste, computed flows, collaboration), or debugging.
  • Collect minimal facts:

- React Flow version (v12+ uses @xyflow/react) - TypeScript or JavaScript - State management approach (local state, Zustand, Redux) - Number of nodes expected (affects performance strategy) - Styling approach (CSS, Tailwind, styled-components)

  • Branch quickly:

- migrating from legacy reactflow or react-flow-renderer -> package rename, import changes, API differences - blank canvas or missing nodes -> container dimensions or missing CSS import - edges not rendering -> missing handles, missing CSS, or display: none on handles - re-renders or sluggish performance -> nodeTypes defined inside component, missing memoization - connecting nodes not working -> missing onConnect handler or handle configuration - layout/positioning -> external layout library integration (dagre, elkjs) - type errors -> TypeScript generic patterns for Node/Edge types

Routing map (read the right reference fast)

  • Migrating from reactflow or react-flow-renderer to @xyflow/react v12 -> references/migration.md
  • Installation, setup, first flow, node/edge objects -> references/fundamentals.md
  • Custom node components, Handle, multiple handles, drag handles -> references/custom-nodes.md
  • Custom edge components, path utilities, edge labels, markers -> references/custom-edges.md
  • Event handlers, callbacks, connection validation, selection, keyboard -> references/interactivity.md
  • Controlled vs uncontrolled, Zustand integration, state update patterns -> references/state-management.md
  • Node/Edge types, generics, union types, type guards -> references/typescript.md
  • External layout libraries (dagre, elkjs, d3), sub-flows, parent-child -> references/layouting.md
  • Background, Controls, MiniMap, Panel, NodeToolbar, NodeResizer, hooks -> references/components-and-hooks.md
  • Memoization, render optimization, theming, CSS variables, Tailwind -> references/performance-and-styling.md
  • Common errors, debugging, edge display issues, Zustand warnings -> references/troubleshooting.md
  • Playwright E2E tests, flow selectors, drag/viewport/connection testing -> references/e2e-testing.md
  • Undo/redo, copy/paste, computed flows, dynamic handles, save/restore, collaboration -> references/advanced-patterns.md
  • Context menu add node, drag-and-drop sidebar, detail panel, export as image -> references/recipes.md

Common pitfalls -> next best move

  • Blank canvas with no errors -> parent container has no height; set explicit height: 100vh or equivalent.
  • nodeTypes / edgeTypes warning -> move object definition outside component body or wrap in useMemo.
  • Edges render but in wrong position -> handles use display: none; switch to opacity: 0.
  • Cannot interact with inputs inside nodes -> add className="nodrag" to interactive elements.
  • Nodes snap back after drag -> onNodesChange not wired up or not applying changes correctly.
  • Connection line appears but edge never creates -> onConnect handler missing or not calling addEdge.
  • Multiple handles on same side overlap -> position them with CSS (top offset) and assign unique ids.
  • State updates don't reflect in nodes -> creating mutations instead of new objects; spread operator required.
  • Zustand context warning -> two versions of @xyflow/react installed or missing <ReactFlowProvider>.
  • Sub-flow child nodes render behind parent -> ensure parent nodes appear before children in the nodes array.

Verification checklist

  • Confirm @xyflow/react/dist/style.css is imported (or base.css + custom styles).
  • Confirm parent container has explicit width and height.
  • Confirm nodeTypes / edgeTypes are stable references (defined outside component or memoized).
  • Confirm custom nodes use <Handle> components with proper type and position.
  • Confirm interactive elements inside nodes have nodrag class.
  • Confirm controlled flows wire up all three handlers: onNodesChange, onEdgesChange, onConnect.
  • Confirm state updates create new node/edge objects (no mutations).
  • Confirm TypeScript generics are applied to hooks and callbacks for type safety.
  • Confirm performance-sensitive flows memoize custom node/edge components with React.memo.

References

  • references/migration.md
  • references/fundamentals.md
  • references/custom-nodes.md
  • references/custom-edges.md
  • references/interactivity.md
  • references/state-management.md
  • references/typescript.md
  • references/layouting.md
  • references/components-and-hooks.md
  • references/performance-and-styling.md
  • references/troubleshooting.md
  • references/e2e-testing.md
  • references/advanced-patterns.md
  • references/recipes.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.95%
按下载量换算731

Claude

31.05%
按下载量换算614

Cursor

19.75%
按下载量换算391

Gemini CLI

9.81%
按下载量换算194

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills