tanstack-agent-skills
AGENTS.md213 starsChanged 11 months agoMITView on GitHub
This document provides instructions for AI coding agents working with the TanStack Agent Skills repository. Each skill's main file uses YAML frontmatter: Followed by markdown sections: - When to Apply - Rule Categories by Priority - Quick Reference - How to Use Rules use kebab-case with category prefixes: - qk- — Query keys - cache- — Caching - mut- — Mutations - err- — Error handling - pf- — Prefetching - inf- — Infinite queries - ssr- — SSR patterns…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 145
Keep individual rule files under 200 lines
- Distinctive: line 146
Use concise code examples
- Distinctive: line 148
Only load relevant rules based on context
- Distinctive: line 152
When generating or reviewing code:
- Very specific: line 177
Consider mw-request-middleware for auth
- Distinctive: line 187
When reviewing TanStack code:
- Distinctive: line 201
Write clear explanation of the problem/solution
- Very specific: line 205
Update SKILL.md quick reference table
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Guidelines
This document provides instructions for AI coding agents working with the TanStack Agent Skills repository.
Repository Structure
tanstack-agent-skills/
├── skills/
│ ├── tanstack-query/
│ │ ├── SKILL.md
│ │ └── rules/
│ ├── tanstack-router/
│ │ ├── SKILL.md
│ │ └── rules/
│ ├── tanstack-start/
│ │ ├── SKILL.md
│ │ └── rules/
│ └── tanstack-integration/
│ ├── SKILL.md
│ └── rules/
├── README.md
├── AGENTS.md
└── CLAUDE.mdSkill Format
SKILL.md Structure
Each skill's main file uses YAML frontmatter:
---
name: skill-name
description: Brief description of what this skill covers
---Followed by markdown sections:
- When to Apply
- Rule Categories by Priority
- Quick Reference
- How to Use
Rule File Naming
Rules use kebab-case with category prefixes:
qk-— Query keyscache-— Cachingmut-— Mutationserr-— Error handlingpf-— Prefetchinginf-— Infinite queriesssr-— SSR patternsperf-— Performancets-— Type safetyorg-— Organizationload-— Data loadingsearch-— Search paramsnav-— Navigationsplit-— Code splittingpreload-— Preloadingctx-— Contextsf-— Server functionssec-— Securitymw-— Middlewareauth-— Authenticationfile-— File organizationdeploy-— Deploymentsetup-— Setupflow-— Data flow
Rule File Structure
# rule-id: Rule Title
## Priority: CRITICAL | HIGH | MEDIUM | LOW
## Explanation
Why this pattern matters and what problem it solves.
## Bad Example
\`\`\`tsx
// Code showing the anti-pattern
// With comments explaining why it's bad
\`\`\`
## Good Example
\`\`\`tsx
// Code showing the recommended pattern
// With comments explaining the approach
\`\`\`
## Context
- When to apply this rule
- When to skip this rule
- Related considerationsSkill Activation
Skills should activate when agents detect:
tanstack-query
- Data fetching code (
useQuery,useMutation) - React Query imports
- Cache management patterns
- Server state handling
tanstack-router
- Route definitions
- Navigation code
- Search params handling
- Code splitting setup
tanstack-start
- Server functions (
createServerFn) - Middleware setup
- SSR configuration
- Authentication flows
tanstack-integration
- Combined Query + Router usage
- Full-stack TanStack applications
- SSR with data prefetching
Priority Levels
| Priority | Meaning |
| CRITICAL | Must follow - violations cause bugs or security issues |
| HIGH | Strongly recommended - improves reliability and performance |
| MEDIUM | Good practice - enhances maintainability and UX |
| LOW | Nice to have - optimization and polish |
Context Efficiency
To minimize token usage:
- Keep individual rule files under 200 lines
- Use concise code examples
- Reference external docs for deep dives
- Only load relevant rules based on context
Applying Rules
When generating or reviewing code:
- Check CRITICAL rules first — These prevent bugs
- Apply HIGH priority patterns — Improve reliability
- Consider MEDIUM patterns — Better UX
- Suggest LOW patterns — When optimizing
Common Scenarios
New TanStack Query Setup
- Load tanstack-query skill
- Apply
qk-factory-patternfor query organization - Apply
cache-stale-timeandcache-gc-time - Set up error boundaries per
err-error-boundaries
New TanStack Router Setup
- Load tanstack-router skill
- Apply
ts-register-routerfor type safety - Apply
org-file-based-routingconventions - Configure preloading per
preload-intent
Adding Server Functions
- Load tanstack-start skill
- Apply
sf-create-server-fnpatterns - Always apply
sf-input-validation - Consider
mw-request-middlewarefor auth
Full-Stack Data Flow
- Load tanstack-integration skill
- Apply
setup-query-client-context - Follow
flow-loader-query-pattern - Configure
cache-single-source
Code Review Checklist
When reviewing TanStack code:
- Query keys are arrays (
qk-array-structure) - All dependencies in query keys (
qk-include-dependencies) - Router types registered (
ts-register-router) - Loaders use ensureQueryData (
load-ensure-query-data) - Search params validated (
search-validation) - Server function inputs validated (
sf-input-validation) - Mutations invalidate queries (
mut-invalidate-queries) - Error boundaries in place (
err-error-boundaries)
Adding New Rules
- Identify the category and create appropriate prefix
- Write clear explanation of the problem/solution
- Provide realistic bad and good examples
- Include context for when to apply
- Assign appropriate priority level
- Update SKILL.md quick reference table
Related Documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

