What problem does it solve? Building tRPC APIs in a T3 Turbo monorepo involves non-obvious decisions: how to compose routers, infer types without duplication, structure queries with React Query, and avoid TypeScript serialization limits. This Skill codifies the canonical patterns so routers, procedures, and client integrations stay consistent and type-safe. ## Core Features & Use Cases - Canonical Query Patterns: Enforces queryOptions() / mutationOptions() wrappers instead of direct hooks, with staleTime guidance and batching gotchas. - Type Inference & Middleware: Covers RouterOutputs/RouterInputs inference, auth/logging/rate-limit middleware composition, and semantic TRPCError codes. - Monorepo-Specific Workarounds: Documents the blocked ctx.db pattern, the _shared.ts sub-router split, and the three-site fix for TypeScript serialization limits. - Use Case: When adding a new tenant-scoped CRUD router in packages/api, follow the worked example to import db directly, scope queries by organizationId, and throw NOT_FOUND via TRPCError. ## Quick Start Ask the agent to create a new tRPC router for an entity in packages/api following the trpc-patterns conventions with queryOptions and direct db imports.