Find opportunities to improve web application code using TanStack libraries (Query, Table, Form, Router, etc.). Avoid man-with-hammer syndrome by applying TanStack after vanilla implementation works.
Philosophy: Avoid "man with a hammer syndrome" (to whom everything appears as a nail). Start vanilla, then strategically adopt TanStack where it provides clear benefits.
Timing: Use this AFTER your app is already working pretty well in vanilla Next.js/React/Tailwind.
TanStack is a set of high-quality libraries for web applications:
| Library | Purpose |
|---|---|
| TanStack Query | Server state management, caching, synchronization |
| TanStack Table | Headless table/grid logic |
| TanStack Form | Form state management and validation |
| Type-safe routing |
| TanStack Virtual | Virtualization for large lists |
| TanStack Ranger | Range/slider components |
Don't do this:
Why it's bad:
Do this instead:
Ok, I want you to look through the ENTIRE project and look for areas where, if we leveraged one of the many TanStack libraries (e.g., query, table, forms, etc), we could make part of the code much better, simpler, more performant, more maintainable, elegant, shorter, more reliable, etc. Use ultrathink
Good candidates:
Skip if:
Good candidates:
Skip if:
Good candidates:
Skip if:
Good candidates:
Skip if:
Good candidates:
Skip if:
Build your app with vanilla patterns first:
fetch or axios for API callsUse the TanStack analysis prompt with Claude Code + Opus 4.5 or Codex + GPT 5.2 (High reasoning effort).
The model will identify opportunities. For each:
Only adopt where there's clear benefit. It's fine to:
Run the analysis again after changes. New opportunities may emerge.
| Model | Configuration |
|---|---|
| Claude Code + Opus 4.5 | Use ultrathink |
| Codex + GPT 5.2 | High or Extra-High reasoning effort |
// Vanilla approach
const [data, setData] = useState(null);
const [loading, setLoading] = useState(true);
const [error, setError] = useState(null);
useEffect(() => {
fetch('/api/users')
.then(res => res.json())
.then(setData)
.catch(setError)
.finally(() => setLoading(false));
}, []);
// TanStack Query approach
const { data, isLoading, error } = useQuery({
queryKey: ['users'],
queryFn: () => fetch('/api/users').then(res => res.json()),
});
Benefits:
// Vanilla approach with manual sorting, filtering, pagination
// ... 200+ lines of state management
// TanStack Table handles sorting, filtering, pagination
const table = useReactTable({
data,
columns,
getCoreRowModel: getCoreRowModel(),
getSortedRowModel: getSortedRowModel(),
getFilteredRowModel: getFilteredRowModel(),
getPaginationRowModel: getPaginationRowModel(),
});
Benefits:
bd create "Evaluate TanStack Query opportunities" -t enhancement -p 3
bd create "Migrate user data fetching to TanStack Query" -t enhancement -p 2
bd create "Implement data table with TanStack Table" -t feature -p 2
bd create "Add TanStack Virtual to chat message list" -t performance -p 2
Ok, I want you to look through the ENTIRE project and look for areas where, if we leveraged one of the many TanStack libraries (e.g., query, table, forms, etc), we could make part of the code much better, simpler, more performant, more maintainable, elegant, shorter, more reliable, etc. Use ultrathink
Look through the project for data fetching patterns that would benefit from TanStack Query. Consider caching needs, refetching patterns, and optimistic updates. Identify the top 3 opportunities. Use ultrathink.
Look through the project for table/grid components that would benefit from TanStack Table. Consider sorting, filtering, pagination, and column management needs. Identify candidates. Use ultrathink.