trpc

Set up tRPC routers, procedures, and React Query clients for type-safe APIs.

4|Updated Jan 15, 2026
One-click install
npx skills add https://github.com/mgd34msu/goodvibes-gemini --skill trpc-mgd34msu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: trpc
Source: https://github.com/mgd34msu/goodvibes-gemini/tree/main/skills/trpc
Command: npx skills add https://github.com/mgd34msu/goodvibes-gemini --skill trpc-mgd34msu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @trpc/server, @trpc/client, @trpc/react-query, @tanstack/react-query, zod, superjson, @upstash/ratelimit, @upstash/redis, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the creation of end-to-end type-safe APIs, eliminating the need for code generation or runtime overhead, and streamlining full-stack TypeScript development.

Core Features & Use Cases

  • Type Safety: Ensures type consistency between frontend and backend.
  • Router & Procedure Definition: Provides clear patterns for defining API endpoints.
  • Context & Middleware: Enables custom logic for authentication, logging, and rate limiting.
  • Use Case: When building a new full-stack application with Next.js and TypeScript, use this Skill to set up a robust, type-safe API layer that integrates seamlessly with React Query.

Quick Start

Install the necessary tRPC packages and set up your server and client configurations following the provided examples.

Frequently Asked Questions about trpc

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

FAQPage Schema
How do I build type-safe APIs in a full-stack TypeScript application?▼

Build type-safe APIs by defining server-side routers and procedures and connecting them directly to your client, ensuring end-to-end type consistency without code generation or runtime overhead.

Can I integrate tRPC with React Query for data fetching and mutations?▼

Yes, tRPC integrates seamlessly with React Query, providing typed wrappers for queries and mutations that maintain full-stack type safety and automatic data synchronization across your application.

What is the best way to set up tRPC context and middleware for authentication and rate limiting?▼

Set up tRPC context and middleware to inject custom logic like authentication, logging, and rate limiting into your procedures, using dependencies like @upstash/ratelimit and @upstash/redis to manage request flows.

Does tRPC work with Next.js to handle API routes and client-side data fetching?▼

Yes, tRPC works with Next.js to handle API server-side setup and client-side integration, providing a robust type-safe API layer that connects your Next.js backend directly to your frontend.

How do I validate inputs and handle errors in tRPC procedures?▼

Validate inputs in tRPC procedures using Zod schemas to ensure runtime type safety, and handle errors by structuring your API handlers to catch and return typed error responses to the client.

Why should I use tRPC instead of generating API types for my full-stack TypeScript application?▼

Use tRPC to eliminate the need for code generation by directly sharing TypeScript types between your server and client, providing real-time type safety and eliminating runtime overhead during development.