Co-Pilot
Updated a month ago

tanstack-agent-skills

DDeckardGer
0.0k
deckardger/tanstack-agent-skills
82
Agent Score

πŸ’‘ Summary

This skill provides best practices for building applications using the TanStack ecosystem.

🎯 Target Audience

React developersFull-stack developersSoftware architectsTechnical leadsAI developers

πŸ€– AI Roast: β€œPowerful, but the setup might scare off the impatient.”

Security AnalysisMedium Risk

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:

  1. Priority β€” CRITICAL, HIGH, MEDIUM, or LOW
  2. Explanation β€” Why this pattern matters
  3. Bad Example β€” Anti-pattern to avoid with explanation
  4. Good Example β€” Recommended implementation
  5. 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

5-Dim Analysis
Clarity9/10
Novelty7/10
Utility9/10
Completeness8/10
Maintainability8/10
Pros & Cons

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
toolCo-Pilot
86/ 100

β€œPowerful, but the setup might scare off the impatient.”

remotion

A
toolCo-Pilot
84/ 100

β€œCreating videos with code? Hope your code is as smooth as your transitions.”

newbie-next

A
toolCo-Pilot
82/ 100

β€œ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.