trpc-router

Develop TRPC routers with structure, procedure patterns, and conventions.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/alceupassos/hub --skill trpc-router-alceupassos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trpc-router
Source: https://github.com/alceupassos/hub/tree/main/.agents/skills/trpc-router
Command: npx skills add https://github.com/alceupassos/hub --skill trpc-router-alceupassos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill Unit simplifies the development of TRPC routers, streamlining the process of creating or modifying apps and server-side API endpoints.

Core Features & Use Cases

  • TRPC Router Development Guide: Provides comprehensive instructions for setting up and managing TRPC routers.
  • Router Structure: Offers a detailed explanation of router structure, including imports, middleware, and procedure patterns.
  • Procedure Pattern: Walks through the creation of query and mutation procedures with examples.
  • Aggregated Detail Endpoint: Shows how to create a single endpoint that fetches multiple related data points.
  • Conventions: Lists conventions for return shapes, error handling, input validation, router naming, procedure naming, and logging.

Quick Start

Use the trpc-router skill to generate a new router for your application by following the guidelines provided in the SKILL.md file.

Frequently Asked Questions about trpc-router

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

FAQPage Schema
How do I structure a tRPC router for server-side API endpoints?

To structure a tRPC router, you define imports, apply middleware, and configure procedure patterns for queries and mutations. This approach streamlines the creation of server-side API endpoints within your application.

What is the pattern for creating tRPC query and mutation procedures?

Creating tRPC query and mutation procedures involves defining specific input validation and return shapes within your router. The guide walks you through the procedure pattern with examples for fetching and modifying data.

How do I build an aggregated tRPC endpoint to fetch multiple related data points?

You can build an aggregated tRPC endpoint to fetch multiple related data points by combining procedures within a single router. This technique simplifies retrieving complex, related data structures from your server-side API.

Do I need TypeScript knowledge to develop a tRPC router?

Yes, developing a tRPC router requires prior knowledge of TypeScript and the tRPC library. Understanding TypeScript is essential for following the conventions and procedure patterns required by the framework.

What conventions should I follow for error handling and input validation in tRPC?

tRPC conventions dictate specific patterns for error handling, input validation, router naming, procedure naming, and logging. Adhering to these standard return shapes ensures your server-side API endpoints remain consistent and maintainable.