tanstack-react-router_setup-and-architecture

tanstack-react-router_setup-and-architecture is a cursor rule for Cursor from WebMCP-org/webmcp-sh. It costs 0 tokens per session (8,707 once invoked), scanned A, original, MIT.

A routing setup guide for TanStack Router, a tool that decides which React or Solid component to show for each web address.

In plain words
What is it for?
Use it when setting up TanStack Router or choosing between file-based and code-based routes in a React or Solid application.
Why use it?
It explains how to organize routes, layouts, data loading, links, and URL search values while keeping navigation checked by TypeScript.

Cursor rule for Cursor

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.

agentmods
npx agentmods add rules/webmcp-org/webmcp-sh/tanstack-react-router_setup-and-architecture
Clone the repo
git clone --depth 1 https://github.com/WebMCP-org/webmcp-sh

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 tanstack-react-router_setup-and-architecture

README.md
[![agentmods](https://agentmods.dev/badge/rules/webmcp-org/webmcp-sh/tanstack-react-router_setup-and-architecture.svg)](https://agentmods.dev/rules/webmcp-org/webmcp-sh/tanstack-react-router_setup-and-architecture)
Your own site
<a href="https://agentmods.dev/rules/webmcp-org/webmcp-sh/tanstack-react-router_setup-and-architecture"><img src="https://agentmods.dev/badge/rules/webmcp-org/webmcp-sh/tanstack-react-router_setup-and-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 8,707 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.08707
Opus 5 $0.00000 $0.04353
Sonnet 5 $0.00000 $0.01741
Haiku 4.5 $0.00000 $0.00871

Measured 4d ago against content hash 8b9d202001f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tanstack-react-router_setup-and-architecture 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 4d 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.

.cursor/rules/tanstack-react-router_setup-and-architecture.mdc · 950 lines

How it starts

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

Overview

TanStack Router is a router for building React and Solid applications. Some of its features include:

  • 100% inferred TypeScript support
  • Typesafe navigation
  • Nested Routing and layout routes (with pathless layouts)
  • Built-in Route Loaders w/ SWR Caching
  • Designed for client-side data caches (TanStack Query, SWR, etc.)
  • Automatic route prefetching
  • Asynchronous route elements and error boundaries
  • File-based Route Generation
  • Typesafe JSON-first Search Params state management APIs
  • Path and Search Parameter Schema Validation
  • Search Param Navigation APIs
  • Custom Search Param parser/serializer support
  • Search param middleware
  • Route matching/loading middleware

To get started quickly, head to the next page. For a more lengthy explanation, buckle up while I bring you up to speed!

"A Fork in the Route"

Using a router to build applications is widely regarded as a must-have and is usually one of the first choices you’ll make in your tech stack.

So, why should you choose TanStack Router over another router?

To answer this question, we need to look at the other options in the space. There are many if you look hard enough, but in my experience, only a couple are worth exploring seriously:

  • Next.js - Widely regarded as the de facto framework for starting a new React project, it’s laser focused on performance, workflow, and bleeding edge technology. Its APIs and abstractions are powerful, but can sometimes come across as non-standard. Its extremely fast growth and adoption in the industry has resulted in a featured packed experience, but at the expense of feeling overwhelming and sometimes bloated.
  • Remix / React Router - A full-stack framework based on the historically successful React Router offers a similarly powerful developer and user experience, with APIs and vision based firmly on web standards like Request/Response and a focus on running anywhere JS can run. Many of its APIs and abstractions are wonderfully designed and were inspiration for more than a few TanStack Router APIs. That said, its rigid design, bolted-on type safety and sometimes strict over-adherence to platform APIs can leave some developers wanting more.

Read the full file on GitHub · 950 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. 4d ago First seen · 950 lines · 8,707 tokens per session scan A 8b9d202001f2

Subscribe to this mod's changes

tanstack-react-router_setup-and-architecture is a cursor rule published in the GitHub repository WebMCP-org/webmcp-sh (17 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,707 tokens. 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-08-30.