apps/chat/.cursor/skills/lazy-prefetch-pattern/SKILL.md
Skill: lazy-prefetch-pattern
npx skillsauth add masonjames/sparka lazy-prefetch-patternInstall 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.
Goal: start prefetchQuery() early on the server without awaiting, so it doesn't block SSR / Suspense, while still hydrating on the client.
trpc/query-client.ts:
dehydrate.shouldDehydrateQuery includes query.state.status === "pending".dehydrate.serializeData / hydrate.deserializeData use SuperJSON.In a Server Component (e.g. app/(chat)/layout.tsx):
getQueryClient() from @/trpc/server)void (no await):
void queryClient.prefetchQuery(trpc.foo.bar.queryOptions(...))HydrateClient/HydrationBoundary dehydrate the cache.Use await only for data you must have before rendering (everything else should be lazy-prefetched).
documentation
Documentation review and fix workflow for MDX files
documentation
Documentation review and fix workflow for MDX files
testing
Skill: ultracite
development
Skill: typescript