tanstack-start-best-practices▌
deckardger/tanstack-agent-skills · updated Apr 8, 2026
Best practices for full-stack React development with TanStack Start, covering server functions, middleware, SSR, and authentication.
- ›Organizes 31 rules across 10 categories (server functions, security, middleware, authentication, SSR, error handling, and more) with priority levels to guide implementation order
- ›Covers critical patterns for server-side logic, input validation, secure session management, and client-server boundary handling
- ›Includes middleware composition, selective SSR
TanStack Start Best Practices
Comprehensive guidelines for implementing TanStack Start patterns in full-stack React applications. These rules cover server functions, middleware, SSR, authentication, and deployment.
When to Apply
- Creating server functions for data mutations
- Setting up middleware for auth/logging
- Configuring SSR and hydration
- Implementing authentication flows
- Handling errors across client/server boundary
- Organizing full-stack code
- Deploying to various platforms
Rule Categories by Priority
| Priority | Category | Rules | Impact |
|---|---|---|---|
| CRITICAL | Server Functions | 5 rules | Core data mutation patterns |
| CRITICAL | Security | 4 rules | Prevents vulnerabilities |
| HIGH | Middleware | 4 rules | Request/response handling |
| HIGH | Authentication | 4 rules | Secure user sessions |
| MEDIUM | API Routes | 1 rule | External endpoint patterns |
| MEDIUM | SSR | 6 rules | Server rendering patterns |
| MEDIUM | Error Handling | 3 rules | Graceful failure handling |
| MEDIUM | Environment | 1 rule | Configuration management |
| LOW | File Organization | 3 rules | Maintainable code structure |
| LOW | Deployment | 2 rules | Production readiness |
Quick Reference
Server Functions (Prefix: sf-)
sf-create-server-fn— Use createServerFn for server-side logicsf-input-validation— Always validate server function inputssf-method-selection— Choose appropriate HTTP methodsf-error-handling— Handle errors in server functionssf-response-headers— Customize response headers when needed
Security (Prefix: sec-)
sec-validate-inputs— Validate all user inputs with schemassec-auth-middleware— Protect routes with auth middlewaresec-sensitive-data— Keep secrets server-side onlysec-csrf-protection— Implement CSRF protection for mutations
Middleware (Prefix: mw-)
mw-request-middleware— Use request middleware for cross-cutting concernsmw-function-middleware— Use function middleware for server functionsmw-context-flow— Properly pass context through middlewaremw-composability— Compose middleware effectively
Authentication (Prefix: auth-)
auth-session-management— Implement secure session handlingauth-route-protection— Protect routes with beforeLoadauth-server-functions— Verify auth in server functionsauth-cookie-security— Configure secure cookie settings
API Routes (Prefix: api-)
api-routes— Create API routes for external consumers
SSR (Prefix: ssr-)
ssr-data-loading— Load data appropriately for SSRssr-hydration-safety— Prevent hydration mismatchesssr-streaming— Implement streaming SSR for faster TTFBssr-selective— Apply selective SSR when beneficialssr-prerender— Configure static prerendering and ISR
Environment (Prefix: env-)
env-functions— Use environment functions for configuration
Error Handling (Prefix: err-)
err-server-errors— Handle server function errorserr-redirects— Use redirects appropriatelyerr-not-found— Handle not-found scenarios
File Organization (Prefix: file-)
file-separation— Separate server and client codefile-functions-file— Use .functions.ts patternfile-shared-validation— Share validation schemas
Deployment (Prefix: deploy-)
deploy-env-config— Configure environment variablesdeploy-adapters— Choose appropriate deployment adapter
How to Use
Each rule file in the rules/ directory contains:
- Explanation — Why this pattern matters
- Bad Example — Anti-pattern to avoid
- Good Example — Recommended implementation
- Context — When to apply or skip this rule
Full Reference
See individual rule files in rules/ directory for detailed guidance and code examples.
Ratings
4.6★★★★★28 reviews- ★★★★★Luis Kim· Dec 20, 2024
tanstack-start-best-practices reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Camila Garcia· Nov 11, 2024
I recommend tanstack-start-best-practices for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Yash Thakker· Nov 3, 2024
tanstack-start-best-practices is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Dhruvi Jain· Oct 22, 2024
Keeps context tight: tanstack-start-best-practices is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Liam Mehta· Oct 2, 2024
Useful defaults in tanstack-start-best-practices — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Arya Ndlovu· Sep 21, 2024
tanstack-start-best-practices has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Sofia Ramirez· Sep 13, 2024
Solid pick for teams standardizing on skills: tanstack-start-best-practices is focused, and the summary matches what you get after install.
- ★★★★★Piyush G· Sep 9, 2024
Registry listing for tanstack-start-best-practices matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Shikha Mishra· Aug 28, 2024
tanstack-start-best-practices reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Carlos Abebe· Aug 12, 2024
Solid pick for teams standardizing on skills: tanstack-start-best-practices is focused, and the summary matches what you get after install.
showing 1-10 of 28