.agents/skills/tanstack-table/SKILL.md
# TanStack Table v8 — Skill **Name:** `tanstack-table` **Purpose:** Implement type-safe, high-performance TanStack Table flows that align with TanStack Query v5, DB collections, and the shared Virtual foundation in this repo. ## Triggers Use this skill when: - Building or refactoring table UIs with `@tanstack/react-table` - Wiring server-side pagination, sorting, filtering, and URL state - Integrating table state with TanStack Query v5 - Handling large datasets that need virtualization Do
npx skillsauth add asymmetric-al/core .agents/skills/tanstack-tableInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Name: tanstack-table
Purpose: Implement type-safe, high-performance TanStack Table flows that align with TanStack Query v5, DB collections, and the shared Virtual foundation in this repo.
Use this skill when:
@tanstack/react-tableDo not use this skill when the UI is not a TanStack Table-based surface.
@tanstack/react-table@^8.21.3@tanstack/react-query@^5.90.21@tanstack/react-virtual@^3.13.19VirtualizationConfig in packages/ui/components/shadcn/data-table/types.tsuseDataTableVirtualization in packages/ui/components/shadcn/data-table/hooks/use-data-table-virtualization.tspagination, sorting, columnFilters).manual* flags).rowCount/pagination metadata.columns and expensive derived data.placeholderData: keepPreviousData for page/sort transitions.row.id, not array index).virtualization object config over legacy fields.columns and derived transforms are memoizedmanualPagination/manualSorting/manualFiltering when neededrowCount (or equivalent)virtualization or shared hook)placeholderData: keepPreviousData)import * as React from "react";
import { keepPreviousData, useQuery } from "@tanstack/react-query";
import {
getCoreRowModel,
type ColumnDef,
type PaginationState,
type SortingState,
useReactTable,
} from "@tanstack/react-table";
import { DataTableResponsive } from "@asym/ui/components/shadcn/data-table";
type Row = { id: string; name: string; amount: number };
export function DonationsTable() {
const [sorting, setSorting] = React.useState<SortingState>([]);
const [pagination, setPagination] = React.useState<PaginationState>({
pageIndex: 0,
pageSize: 25,
});
const columns = React.useMemo<ColumnDef<Row>[]>(
() => [
{ accessorKey: "name", header: "Name" },
{ accessorKey: "amount", header: "Amount" },
],
[],
);
const query = useQuery({
queryKey: ["donations", pagination, sorting],
queryFn: () => fetchDonations({ pagination, sorting }),
placeholderData: keepPreviousData,
});
const table = useReactTable({
data: query.data?.rows ?? [],
columns,
state: { sorting, pagination },
onSortingChange: setSorting,
onPaginationChange: setPagination,
manualPagination: true,
manualSorting: true,
pageCount: query.data
? Math.ceil(query.data.rowCount / pagination.pageSize)
: -1,
getCoreRowModel: getCoreRowModel(),
});
return (
<DataTableResponsive
table={table}
config={{
virtualization: {
enabled: true,
estimateSize: 56,
overscan: 10,
containerHeight: 720,
},
}}
/>
);
}
columns every renderkeepPreviousData: true) instead of v5 patterndevelopment
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.
testing
Use when CI tests fail on main branch after PR merge, or when investigating flaky test failures in CI environments
tools
Use when new translation keys are added to packages to generate new translations strings
data-ai
Pointer to the canonical agent instruction and skill system for this monorepo