agentleFS
wilfreudwilfreud/skills-or-something/reactflow/SKILL.md

reactflow

Skill2 starsChanged 3 months agoMITView on GitHub

Use when working with React Flow / @xyflow/react: building, editing, reviewing, debugging, typing, performance-tuning, testing, or designing interactive node-edge canvases, custom nodes, handles, edges, labels, layouts, graph filters, save/restore behavior, or architecture diagrams. Always use for files importing @xyflow/react, ReactFlow, Background, Controls, MiniMap, Handle, useNodesState, useEdgesState, useReactFlow, Node, Edge, NodeProps, EdgeProps, or related graph/canvas code.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before implementing or reviewing React Flow behavior:

    line 10
  2. Distinctive:

    Search that file for the task area: quick start, concepts, custom nodes, handles, edges, labels, layouting, hooks, TypeScript, performance, …

    line 13
  3. Distinctive:

    Use bundled references only as a routing map.

    line 18
  4. Very specific:

    Read references/doc-map.md to pick the right official React Flow links quickly.

    line 22
  5. Very specific:

    Read references/implementation-checklist.md before editing substantial React Flow code or reviewing graph behavior.

    line 23
  6. Distinctive:

    Treat React Flow canvas state as UI state unless product requirements say otherwise.

    line 27
  7. Very specific:

    Keep business/domain relationships outside React Flow node positions.

    line 28
  8. Very specific:

    Use TypeScript generics for Node<Data> and Edge<Data> instead of any.

    line 30
  9. Very specific:

    Use stable nodeTypes and edgeTypes objects, typically memoized or module-scoped, to avoid React Flow remounts.

    line 31
  10. Distinctive:

    Keep custom node and edge components small.

    line 33
  11. Very specific:

    Avoid mutating node or edge objects in event handlers.

    line 34
  12. Distinctive:

    no invalid cross-type relationship.

    line 46
  13. Distinctive:

    no duplicate edge if domain forbids it.

    line 47
  14. Distinctive:

    no cycle if the graph must be acyclic.

    line 48
  15. Distinctive:

    Verify with TypeScript and the app's relevant test/build command.

    line 50

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

React Flow

Required doc freshness workflow

Before implementing or reviewing React Flow behavior:

  1. Fetch https://reactflow.dev/llms.txt.
  2. Search that file for the task area: quick start, concepts, custom nodes, handles, edges, labels, layouting, hooks, TypeScript, performance, SSR, testing, examples, API reference, or troubleshooting.
  3. Fetch the exact linked React Flow page(s) needed for the task.
  4. Base API names, prop names, event signatures, and type imports on fetched pages, not memory.
  5. Mention which docs were fetched when handing off non-trivial React Flow work.

Use bundled references only as a routing map. They are not a substitute for fresh docs.

Reference routing

  • Read references/doc-map.md to pick the right official React Flow links quickly.
  • Read references/implementation-checklist.md before editing substantial React Flow code or reviewing graph behavior.

Implementation stance

  • Treat React Flow canvas state as UI state unless product requirements say otherwise.
  • Keep business/domain relationships outside React Flow node positions. Persist domain graph facts in the application data model, then derive nodes[] and edges[] for rendering.
  • Store node positions, viewport, collapsed groups, and visual preferences separately from business relationships.
  • Use TypeScript generics for Node<Data> and Edge<Data> instead of any.
  • Use stable nodeTypes and edgeTypes objects, typically memoized or module-scoped, to avoid React Flow remounts.
  • Validate every connection before adding an edge when the domain has constraints.
  • Keep custom node and edge components small. Put domain editing forms/panels outside custom node renderers when possible.
  • Avoid mutating node or edge objects in event handlers. Return new arrays/objects through state setters.
  • For large graphs, minimize subscriptions to full node/edge arrays and avoid expensive work inside node renderers.

Common task workflow

  1. Identify current React Flow version from package.json and imports. In this repo expect @xyflow/react.
  2. Fetch fresh docs through the required workflow.
  3. Inspect current controlled/uncontrolled setup: nodes, edges, onNodesChange, onEdgesChange, onConnect, provider usage.
  4. Define typed data shapes for node and edge data.
  5. Encode graph invariants near the mutation boundary:
    • connection endpoints exist;
    • no forbidden self-edge;
    • no invalid cross-type relationship;
    • no duplicate edge if domain forbids it;
    • no cycle if the graph must be acyclic.
  6. Persist domain mutations first when data is business-relevant; re-render from returned server data.
  7. Verify with TypeScript and the app's relevant test/build command.

Project-specific notes for this repository

  • Existing app uses React Flow for an architecture cartography canvas.
  • Domain source of truth must be SQLite/relational data, not localStorage or React Flow objects.
  • localStorage may keep layout and appearance preferences only.
  • Graph filters should derive from typed persisted relationships: project membership, application dependency, deployment, datastore access, system-user hosting, database-instance containment, party association.

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.