agentleFS
DeckardGerDeckardGer/tanstack-agent-skills/AGENTS.md

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.

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
  1. Distinctive:

    Keep individual rule files under 200 lines

    line 145
  2. Distinctive:

    Use concise code examples

    line 146
  3. Distinctive:

    Only load relevant rules based on context

    line 148
  4. Distinctive:

    When generating or reviewing code:

    line 152
  5. Very specific:

    Consider mw-request-middleware for auth

    line 177
  6. Distinctive:

    When reviewing TanStack code:

    line 187
  7. Distinctive:

    Write clear explanation of the problem/solution

    line 201
  8. Very specific:

    Update SKILL.md quick reference table

    line 205

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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.md

Skill 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 keys
  • cache- — Caching
  • mut- — Mutations
  • err- — Error handling
  • pf- — Prefetching
  • inf- — Infinite queries
  • ssr- — SSR patterns
  • perf- — Performance
  • ts- — Type safety
  • org- — Organization
  • load- — Data loading
  • search- — Search params
  • nav- — Navigation
  • split- — Code splitting
  • preload- — Preloading
  • ctx- — Context
  • sf- — Server functions
  • sec- — Security
  • mw- — Middleware
  • auth- — Authentication
  • file- — File organization
  • deploy- — Deployment
  • setup- — Setup
  • flow- — 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 considerations

Skill 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

PriorityMeaning
CRITICALMust follow - violations cause bugs or security issues
HIGHStrongly recommended - improves reliability and performance
MEDIUMGood practice - enhances maintainability and UX
LOWNice 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:

  1. Check CRITICAL rules first — These prevent bugs
  2. Apply HIGH priority patterns — Improve reliability
  3. Consider MEDIUM patterns — Better UX
  4. Suggest LOW patterns — When optimizing

Common Scenarios

New TanStack Query Setup

  1. Load tanstack-query skill
  2. Apply qk-factory-pattern for query organization
  3. Apply cache-stale-time and cache-gc-time
  4. Set up error boundaries per err-error-boundaries

New TanStack Router Setup

  1. Load tanstack-router skill
  2. Apply ts-register-router for type safety
  3. Apply org-file-based-routing conventions
  4. Configure preloading per preload-intent

Adding Server Functions

  1. Load tanstack-start skill
  2. Apply sf-create-server-fn patterns
  3. Always apply sf-input-validation
  4. Consider mw-request-middleware for auth

Full-Stack Data Flow

  1. Load tanstack-integration skill
  2. Apply setup-query-client-context
  3. Follow flow-loader-query-pattern
  4. 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

  1. Identify the category and create appropriate prefix
  2. Write clear explanation of the problem/solution
  3. Provide realistic bad and good examples
  4. Include context for when to apply
  5. Assign appropriate priority level
  6. Update SKILL.md quick reference table

Related Documentation

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.