trpc

Implement type-safe tRPC v11 APIs with routing, middleware, and error handling.

2|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/olegakbarov/ispo-code --skill trpc-olegakbarov
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trpc
Source: https://github.com/olegakbarov/ispo-code/tree/main/.claude/skills/trpc
Command: npx skills add https://github.com/olegakbarov/ispo-code --skill trpc-olegakbarov

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build and maintain type-safe server-client APIs using tRPC v11, eliminating manual API schemas and glue code.

Core Features & Use Cases

  • Initialize tRPC with a shared context and a root router, and define procedures (public, authed, admin) for robust access control.
  • Leverage middleware patterns, error handling strategies, and type inference to keep server and client contracts in sync.
  • Integrate with TanStack React Query for efficient data fetching and caching on the client.
  • Use cases include creating API routes, combining multiple routers, and providing a consistent developer experience across frameworks (Next.js, Node, etc).

Quick Start

Create a basic tRPC setup by initializing TRPC, define a root router and publicProcedure, and wire a React client to consume the API.

Frequently Asked Questions about trpc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a type-safe tRPC v11 API for a React app?

To set up a type-safe tRPC v11 API, initialize the server with a shared context, define a root router with public or authed procedures, then wire a React client using React Query to consume the API with full type inference.

How does tRPC middleware handle access control for authed and admin procedures?

tRPC middleware handles access control by attaching context to requests, allowing you to define public, authed, and admin procedures that enforce robust routing restrictions and keep server-client contracts in sync.

Can I use tRPC v11 with Next.js and Node backends?

Yes, tRPC v11 works with Next.js and Node backends, providing a consistent developer experience for creating API routes, combining multiple routers, and managing type-safe server-client interactions across frameworks.

What is the best way to integrate React Query with tRPC for data fetching?

The best way to integrate React Query is to wire the tRPC client directly into React Query, leveraging type inference to manage efficient data fetching, caching, and API interactions without manual schema glue code.

How do I handle error handling and context creation in tRPC v11?

Handle tRPC v11 errors by defining error handling strategies within your procedures and middleware, while using shared context creation during initialization to pass request data cleanly across your root router composition.

Why does tRPC eliminate the need for manual API schemas in TypeScript?

tRPC eliminates manual API schemas by using TypeScript type inference to automatically sync server and client contracts, allowing you to build robust APIs without writing boilerplate glue code or separate schema definitions.