tanstack-start

TanStack Start Routing, Loaders, and Server Functions Standards.

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/omergulcicek/omergulcicek.com/tanstack-start
Clone the repo
git clone --depth 1 https://github.com/omergulcicek/omergulcicek.com

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 935 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 95% copy Near-identical to another mod 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.00935
Opus 5 $0.00000 $0.00467
Sonnet 5 $0.00000 $0.00187
Haiku 4.5 $0.00000 $0.00093

Measured yesterday against content hash 022602a6ac3a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

tanstack-start 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 yesterday.

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.

Origin

This is a copy

95% identical to tanstack-start — 18 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/tanstack-start.mdc · 87 lines

How it starts

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

TanStack Start Constitution

Constraints

  • Route Definition: Always use createFileRoute. Path MUST strictly match the file system location.
  • Component Scope: Keep route files thin. Only orchestrate routing and data. Move UI and business logic to src/features.
  • Nested Layouts: Use the <Outlet /> component in parent routes to render child routes. If a route has children, the parent component MUST render <Outlet />.
  • Data Loading: Fetch all route-level data in loader. Consume via Route.useLoaderData or useSuspenseQuery.
  • Guards: Put auth, redirects, and preconditions in beforeLoad.
  • Hydration: Rely on loader prefetching for data hydration. Do not use Next.js-specific patterns like manual dehydration.
  • Server Functions: Wrap all backend-only logic in standalone serverFn. Functions MUST act as a bridge to the API layer; keep database orchestration and business logic inside src/features/api or helpers.
  • Search Params: Validate all search params with validateSearch using a Zod schema. Never trust raw search values.
  • i18n Implementation: Use paraglide-js for translations. Follow the patterns defined in i18n.mdc.
  • Error Handling: Provide errorComponent for failure states. Handle expected errors in the loader.
  • Loading UI: Provide pendingComponent for async states when needed.
  • Not Found: Provide notFoundComponent for missing resources.
  • Head/SEO: Define metadata with the head property. Keep it deterministic and typed.
  • Sync: Ensure route paths are kept in sync via tsr watch command.
  • Guard Security: Enforce session and permission checks within beforeLoad or dedicated middleware before serverFn execution.

Bans

  • Client-Side Fetching: Fetching data inside the component body via useEffect or useQuery (without loader prefetch) is FORBIDDEN.
  • Inline serverFn: Defining serverFn inside a component or route definition is FORBIDDEN. They MUST be exported as standalone constants.
  • Next.js Conventions: Using "use server" directives, page.tsx naming, or Next.js-specific hooks (useRouter from next/navigation) is STRICTLY FORBIDDEN.
  • Untyped Routes: Navigating via string paths without type-safety (using Link or Maps without the to property pointing to a valid route) is FORBIDDEN.
  • Insecure Env Vars: Forbidden to store secrets or private keys in environment variables with VITE_ prefixes.

Read the full file on GitHub · 87 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. yesterday First seen · 87 lines · 0 tokens per session scan A 022602a6ac3a

Subscribe to this mod's changes

tanstack-start is a cursor rule published in the GitHub repository omergulcicek/omergulcicek.com (15 stars, last pushed 7d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 935 tokens. A static security scan graded it A with 0 findings. It is 95% identical to tanstack-start, differing in 18 lines, and is treated as a copy.

Related

Other cursor rules, from other repositories

jsx-and-tsx

When writing React code, use this guide for React best practices and guidance.

janhesters/react-router-saas-template · 0 tokens

facades

When writing facade functions, use this guide for facade functions best practices and guidance.

janhesters/react-router-saas-template · 0 tokens

storybook-stories

Guides the creation and modification of Storybook files specifically within the 'packages/docs' package. It covers conventions, best practices, and helps answer questions about existing story implementations within 'packages/core'.

mondaycom/vibe · 0 tokens

new-component-implementation

Provides a systematic, research-driven workflow for implementing new Vibe components - for the @vibe/core library (located in "packages/core") - from initial research through final validation. Emphasizes studying existing patterns, following established conventions, and systematic progression through types, component…

mondaycom/vibe · 2,471 tokens

base-components

Comprehensive guide for base components in @vibe/core library (BaseInput, BaseList, BaseListItem, InfoText, FieldLabel). Documents their usage patterns, accessibility requirements, form integration patterns, and what consumers need to provide for optimal accessibility and UX. These components serve as foundational…

mondaycom/vibe · 107 tokens

layout-components

Guidelines for using Box and Flex layout components in the @vibe/core library instead of custom CSS for spacing, borders, and flexbox layouts.

mondaycom/vibe · 2,182 tokens