tanstack-react-router_setup-and-architecture

tanstack-react-router_setup-and-architecture is a cursor rule for Cursor from openstory-so/openstory. It costs 7,995 tokens per session, scanned A, original, MIT.

A set of setup and architecture rules for TanStack Router, a library that manages pages and navigation in React or Solid applications. It covers nested pages, type-safe navigation, data loading, and URL search parameters.

In plain words
What is it for?
Planning file-based routes, nested layouts, route data loading, prefetching, error boundaries, search-parameter validation, and middleware.
Why use it?
It helps developers choose and structure routes consistently while reducing navigation and URL-state errors in TypeScript applications.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is Before you continue, it's important you have a good understanding of [code-based routing](./routing/code-based-routing.md) and [file-based routing](./routing/fi.

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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/openstory-so/openstory/tanstack-react-router_setup-and-architecture.svg)](https://agentmods.dev/rules/openstory-so/openstory/tanstack-react-router_setup-and-architecture)
Your own site
<a href="https://agentmods.dev/rules/openstory-so/openstory/tanstack-react-router_setup-and-architecture"><img src="https://agentmods.dev/badge/rules/openstory-so/openstory/tanstack-react-router_setup-and-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 7,995 This file is loaded in full into every session.
When invoked 7,995 The same file — it is already loaded in full.
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.1 $0.07995 $0.07995
Opus 5 $0.03998 $0.03998
Sonnet 5 $0.01599 $0.01599
Haiku 4.5 $0.00800 $0.00800

Measured 6d ago against content hash 1a24051fd2f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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 · 775 lines

How it starts

The opening of the file, as written. The whole thing — 775 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.

Why TanStack Router?

TanStack Router delivers on the same fundamental expectations as other routers that you’ve come to expect:

  • Nested routes, layout routes, grouped routes
  • File-based Routing
  • Parallel data loading
  • Prefetching
  • URL Path Params
  • Error Boundaries and Handling
  • SSR
  • Route Masking

And it also delivers some new features that raise the bar:

  • 100% inferred TypeScript support
  • Typesafe navigation
  • Built-in SWR Caching for loaders
  • Designed for client-side data caches (TanStack Query, SWR, etc.)
  • Typesafe JSON-first Search Params state management APIs
  • Path and Search Parameter Schema Validation
  • Search Parameter Navigation APIs
  • Custom Search Param parser/serializer support
  • Search param middleware
  • Inherited Route Context
  • Mixed file-based and code-based routing

Let’s dive into some of the more important ones in more detail!

100% Inferred TypeScript Support

Everything these days is written “in Typescript” or at the very least offers type definitions that are veneered over runtime functionality, but too few packages in the ecosystem actually design their APIs with TypeScript in mind. So while I’m pleased that your router is auto-completing your option fields and catching a few property/method typos here and there, there is much more to be had.

Read the full file on GitHub · 775 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. 6d ago First seen · 775 lines · 7,995 tokens per session scan A 1a24051fd2f3

Subscribe to this mod's changes

tanstack-react-router_setup-and-architecture is a cursor rule published in the GitHub repository openstory-so/openstory (574 stars, last pushed yesterday), licensed MIT. It adds 7,995 tokens to every session, about $0.0400 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-08-30.