tanstack-agent-skills
π‘ Summary
This skill provides best practices for building applications using the TanStack ecosystem.
π― Target Audience
π€ AI Roast: βPowerful, but the setup might scare off the impatient.β
Risk: Medium. Review: shell/CLI command execution; outbound network access (SSRF, data egress); filesystem read/write scope and path traversal. Run with least privilege and audit before enabling in production.
TanStack Agent Skills
Comprehensive best practices for building applications with the TanStack ecosystem. These skills provide AI coding agents with structured guidelines for TanStack Query, TanStack Router, and TanStack Start.
Available Skills
tanstack-query
Best practices for data fetching, caching, mutations, and server state management with TanStack Query (React Query).
32+ rules across 8 categories:
- Query Keys (CRITICAL) β Proper key structure and organization
- Caching (CRITICAL) β staleTime, gcTime, and invalidation patterns
- Mutations (HIGH) β Optimistic updates, error handling
- Error Handling (HIGH) β Error boundaries, retry logic
- Prefetching (MEDIUM) β Intent-based and route prefetching
- Infinite Queries (MEDIUM) β Pagination patterns
- SSR Integration (MEDIUM) β Hydration and dehydration
- Performance (LOW) β Select transforms, memoization
tanstack-router
Best practices for type-safe routing, data loading, search params, and navigation with TanStack Router.
30+ rules across 8 categories:
- Type Safety (CRITICAL) β Router registration, type narrowing
- Route Organization (CRITICAL) β File-based routing, route trees
- Data Loading (HIGH) β Loaders, Query integration
- Search Params (HIGH) β Validation, type inheritance
- Navigation (MEDIUM) β Link component, active states
- Code Splitting (MEDIUM) β Lazy routes, critical path
- Preloading (MEDIUM) β Intent-based preloading
- Route Context (LOW) β Dependency injection
tanstack-start
Best practices for full-stack React applications with TanStack Start, including server functions, middleware, SSR, and authentication.
29+ rules across 8 categories:
- Server Functions (CRITICAL) β createServerFn patterns
- Security (CRITICAL) β Input validation, CSRF protection
- Middleware (HIGH) β Request/function middleware
- Authentication (HIGH) β Sessions, route protection
- SSR (MEDIUM) β Hydration safety, streaming
- Error Handling (MEDIUM) β Server errors, redirects
- File Organization (LOW) β Code separation patterns
- Deployment (LOW) β Environment config
tanstack-integration
Best practices for integrating TanStack Query with TanStack Router and TanStack Start together.
13 rules across 4 categories:
- Setup (CRITICAL) β QueryClient context, provider wrapping
- Data Flow (HIGH) β Loader + Query patterns
- Caching (MEDIUM) β Single source of truth
- SSR (LOW) β Dehydration/hydration
Installation
npx add-skill tanstack-agent-skills
Or manually add to your project's .cursor/ or Claude Code configuration.
Usage
Skills activate automatically when AI agents detect relevant contexts:
- Building data-driven React applications
- Setting up routing for React apps
- Creating full-stack applications with SSR
- Implementing authentication flows
- Optimizing data fetching patterns
Skill Format
Each skill follows the Agent Skills standard:
skills/
βββ tanstack-query/
β βββ SKILL.md # Main skill instructions
β βββ rules/ # Individual rule files
β βββ qk-array-structure.md
β βββ cache-stale-time.md
β βββ ...
βββ tanstack-router/
β βββ SKILL.md
β βββ rules/
βββ tanstack-start/
β βββ SKILL.md
β βββ rules/
βββ tanstack-integration/
βββ SKILL.md
βββ rules/
Rule File Structure
Each rule file contains:
- Priority β CRITICAL, HIGH, MEDIUM, or LOW
- Explanation β Why this pattern matters
- Bad Example β Anti-pattern to avoid with explanation
- Good Example β Recommended implementation
- Context β When to apply or skip the rule
Contributing
Contributions welcome! Please ensure:
- Rules are practical and battle-tested
- Examples are clear and runnable
- Priority levels are appropriate
- Context helps agents decide applicability
Resources
License
MIT
Pros
- Comprehensive best practices
- Structured guidelines for multiple TanStack tools
- Supports various application types
Cons
- May require familiarity with TanStack tools
- Complexity could overwhelm beginners
- Limited to TanStack ecosystem
Related Skills
react-best-practices
AβPowerful, but the setup might scare off the impatient.β
remotion
AβCreating videos with code? Hope your code is as smooth as your transitions.β
newbie-next
AβPowerful, but the setup might scare off the impatient.β
Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.
Copyright belongs to the original author DeckardGer.
