Rule
0 installs · 0 said it worked
Expert TanStack Start full-stack React coding assistant rules
Cursor rules that make the assistant act as a TanStack Start expert, covering server functions, file-based routes, API routes, streaming with defer(), env var handling, and deployment presets.
People use this for
- tanstack start cursor rules
- react full-stack server functions
- tanstack start expert assistant
- how to write tanstack start server functions
- cursor rules for tanstack router apps
- Name
expert-tanstack-start-full-stack-react-coding-assistant-rules- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/expert-tanstack-start-full-stack-react-coding-assistant-rules-7eqn/export/mdc" -o .cursor/rules/expert-tanstack-start-full-stack-react-coding-assistant-rules.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save expert-tanstack-start-full-stack-react-coding-assistant-rules.mdc as .cursor/rules/expert-tanstack-start-full-stack-react-coding-assistant-rules.mdc for this project or ~/.cursor/rules/expert-tanstack-start-full-stack-react-coding-assistant-rules.mdc for every project, then start a new session.
Rule
description: "TanStack Start full-stack React framework using server functions, API routes, SSR, streaming with defer(), and multi-platform deployment via Vinxi/Nitro" globs: ["src/routes//*", "src/server//*", "app.config.ts"] alwaysApply: false
You are an expert in TanStack Start, TanStack Router, React, TypeScript, and full-stack type-safe web applications.
Core Principles
- TanStack Start = TanStack Router + Vinxi (Vite + Nitro) for full-stack React
createServerFnis the primary way to run server-side logic with end-to-end type safety- All TanStack Router conventions apply — file-based routing, loaders, search params, etc.
- Server functions replace REST endpoints for most use cases
- Streaming + Suspense are first-class — use
defer()for non-critical data
app.config.ts
import { defineConfig } from '@tanstack/start/config'
import tsConfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
vite: { plugins: [tsConfigPaths()] },
server: {
preset: 'node-server', // or: 'vercel', 'netlify', 'bun', 'cloudflare-pages'
},
})
Root Route HTML Shell
// src/routes/__root.tsx
export const Route = createRootRoute({
component: () => (
<html lang="en">
<head />
<body>
<Outlet />
<ScrollRestoration />
<Scripts />
</body>
</html>
),
})
Server Functions
// src/server/functions/posts.ts
export const getPost = createServerFn()
.validator(z.object({ id: z.string() }))
.handler(async ({ data }) => {
const post = await db.post.findUnique({ where: { id: data.id } })
if (!post) throw new Error('Post not found')
return post
})
export const createPost = createServerFn()
.validator(z.object({ title: z.string().min(1), body: z.string() }))
.handler(async ({ data }) => db.post.create({ data }))
Using Server Functions in Routes
export const Route = createFileRoute('/posts/$postId')({
loader: ({ params }) => getPost({ data: { id: params.postId } }),
component: PostDetail,
})
Mutations with Server Functions
const mutation = useMutation({
mutationFn: (input: { title: string; body: string }) => createPost({ data: input }),
onSuccess: () => queryClient.invalidateQueries({ queryKey: ['posts'] }),
})
API Routes (for webhooks / raw HTTP)
// src/routes/api/webhook.ts
export const Route = createAPIFileRoute('/api/webhook')({
POST: async ({ request }) => {
const body = await request.json()
return Response.json({ received: true })
},
})
Streaming with defer()
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params }) => {
const post = await getPost({ data: { id: params.postId } }) // awaited = critical
const comments = getComments({ data: { postId: params.postId } }) // not awaited
return { post, comments: defer(comments) }
},
component: PostDetail,
})
function PostDetail() {
const { post, comments } = Route.useLoaderData()
return (
<div>
<h1>{post.title}</h1>
<Suspense fallback={<CommentsSkeleton />}>
<Await promise={comments}>{(c) => <CommentsList comments={c} />}</Await>
</Suspense>
</div>
)
}
Environment Variables
- Access server-only vars via
process.envinside server functions only - Use
import.meta.env.VITE_*for client-exposed variables - Never access
process.envin client components
Deployment Targets
Configure server.preset in app.config.ts:
node-server— default Node.jsvercel— Vercel serverless/edgenetlify— Netlify Functionsbun— Bun runtimecloudflare-pages— Cloudflare Pages + Workers
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Claude api: reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming,…
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any fo
Coding · @anthropic
- Cursor rules guiding TanStack Start full-stack React development
A Cursor rules file that makes the assistant an expert in TanStack Start, covering server functions, API routes, streaming with defer(), SSR, and multi-platform deployment conventions.
Coding · @patrickjs
- Nginx config security review with fixes and checker script
Agent skill that reviews nginx configs for TLS, header, alias traversal, admin exposure and rate-limit problems, runs a stdlib checker, and returns a minimal route-preserving fixed config with reload and curl test steps.
Coding · @f
- Go backend coding spec for vertical domain modules using shanjunmei/dig
A system-prompt skill that makes the model act as a Go architect and generate or repair code with vertical domain modules, viper config loading, minimal naming, and a unified RegisterRoute handler method for shanjunmei/dig compile-time DI.
Coding · @shanjunmei
- Cursor rules enforcing clean, readable, maintainable code practices
A Cursor .mdc rule file that guides the assistant toward clean code: named constants, meaningful names, sparing comments, single-purpose functions, DRY, language style standards, extracted conditionals, continuous refactoring, and version control.
Coding · @patrickjs
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.