Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Builds end-to-end type-safe TypeScript APIs with tRPC routers, procedures, middleware, subscriptions, and Next.js/React integration.
91% 100%+9 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 21 of 23 without it.
This test ran on v1. v2 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
tRPC lets you build fully type-safe APIs without writing a schema or code-generation step. Your TypeScript types flow from the server router directly to the client — so every API call is autocompleted, validated at compile time, and refactoring-safe. Use this skill when building TypeScript monorepos, Next.js apps, or any project where the server and client share a codebase.
Examples require matching tRPC/TanStack Query versions and application-specific auth, database models and user/session types. Cron jobs cannot assume request-bound auth() exists: build an explicitly authorized service context. The shown subscription router also needs root registration, a transport adapter and client link; its process-local emitter does not distribute across replicas. HTTP GET/POST handlers do not alone provide WebSockets. Type safety is not authorization: scope queries/output fields to permitted records, handle CSRF/origin for cookie-authenticated mutations, and enforce ownership atomically with writes.
A router groups related procedures (think: endpoints). Procedures are typed functions — query for reads, mutation for writes, subscription for real-time streams.
All procedure inputs are validated with Zod schemas. The validated, typed input is available in the procedure handler — no manual parsing.
context is shared state passed to every procedure — auth session, database client, request headers, etc. It is built once per request in a context factory. Important: Next.js App Router and Pages Router require separate context factories because App Router handlers receive a fetch Request, not a Node.js NextApiRequest.
Middleware chains run before a procedure. Use them for authentication, logging, and request enrichment. They can extend the context for downstream procedures.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.