815-reactflow-diagrams

815-reactflow-diagrams is a cursor rule for Cursor from d-padmanabhan/agent-engineering-handbook. It costs 38 tokens per session (1,113 once invoked), scanned A, original, MIT.

A set of conventions for building interactive architecture diagrams with React Flow, a React library for node-and-connection canvases.

In plain words
What is it for?
Creating custom diagram nodes and edges, organizing diagram pages, adding routes, and explaining system boundaries in React applications.
Why use it?
It helps keep complex diagrams readable, consistent, discoverable, and checked before they are merged.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Creating custom diagram nodes and edges, organizing diagram pages, adding routes, and explaining system boundaries in React applications.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/d-padmanabhan/agent-engineering-handbook/815-reactflow-diagrams
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 815-reactflow-diagrams

README.md
[![agentmods](https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/815-reactflow-diagrams.svg)](https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/815-reactflow-diagrams)
Your own site
<a href="https://agentmods.dev/rules/d-padmanabhan/agent-engineering-handbook/815-reactflow-diagrams"><img src="https://agentmods.dev/badge/rules/d-padmanabhan/agent-engineering-handbook/815-reactflow-diagrams.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.01113
Opus 5 $0.00019 $0.00557
Sonnet 5 $0.00008 $0.00223
Haiku 4.5 $0.00004 $0.00111

Measured 3d ago against content hash a665a644c064, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

815-reactflow-diagrams scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/815-reactflow-diagrams.mdc · 79 lines

How it starts

The opening of the file, as written. The whole thing — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Interactive architecture diagrams (React Flow)

Goal: Ship readable, consistent narrative diagrams in a React SPA using @xyflow/react (React Flow): fixed layout, animated edges where they help, and prose on a sibling page that explains scope (what is in-band vs out-of-band).

This rule complements 800-markdown.mdc (Mermaid in Markdown). Use 800 for static docs diagrams; use 815 when the diagram is TypeScript + React Flow.

When this rule applies

Use for interactive canvases (not image-only figures). Typical stack: React, TypeScript, Vite, Tailwind, optional React Router. Package manager may be Bun or npm per project.

File and route layout (SPA)

Adapt paths to your repo, but keep separation of concerns:

  • Diagram: **/components/diagrams/<Name>Diagram.tsx (or your agreed folder) exporting <Name>Diagram.
  • Page: route-level view that wraps copy + <Name /> (figure, legend, diagram).
  • Router and index: register the path and add a card or link from the app home so deep links are discoverable.
  • README: document new routes and any public/ reference assets.

React Flow defaults (narrative mode)

  • Outer container: bordered, dark background, bounded height (for example min(88dvh, …)).
  • fitView with tuned fitViewOptions (padding, maxZoom) and sensible minZoom / maxZoom for the graph size.
  • proOptions={{ hideAttribution: true }} where license allows.
  • Read-only story: nodesDraggable={false}, nodesConnectable={false} unless the product is an editor.
  • Canvas chrome: react-flow dark base, !bg-slate-950, [&_.react-flow__node]:overflow-visible when handles or labels extend past node boxes.
  • Dots Background and Controls styled to match the app (slate theme is common).
  • Wrap custom node and edge components in memo(); pass stable nodeTypes / edgeTypes objects (module scope), not new literals each render.
  • Prefer buildNodesAndEdges() returning { nodes, edges } at module scope for static graphs so types and data stay stable.

Read the full file on GitHub · 79 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 79 lines · 38 tokens per session scan A a665a644c064

Subscribe to this mod's changes

815-reactflow-diagrams is a cursor rule published in the GitHub repository d-padmanabhan/agent-engineering-handbook (16 stars, last pushed 7d ago), licensed MIT. It adds 38 tokens to every session and 1,113 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.