trpc-router-creating

Scaffold tRPC v11 routers with Zod validation and service-layer separation.

Updated Jun 23, 2025
One-click install
npx skills add https://github.com/Dayopt/app --skill trpc-router-creating
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: trpc-router-creating
Source: https://github.com/Dayopt/app/tree/main/.claude/skills/trpc-router-creating
Command: npx skills add https://github.com/Dayopt/app --skill trpc-router-creating

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Dayopt projects require consistent, scalable tRPC v11 routers with proper separation of concerns, input validation, and uniform error handling. This skill provides a repeatable scaffold to bootstrap routers, schemas, and tests that align with the project's architecture, reducing boilerplate and onboarding time.

Core Features & Use Cases

  • Standardized tRPC v11 router scaffolding under src/server/api/routers/{entity}/ with index.ts, crud.ts, and optional files for bulk/statistics.
  • Zod-based validation templates placed in src/schemas/{entity}.ts to enforce strict input shape and multi-tenant filtering.
  • Centralized error handling and authentication patterns via protectedProcedure and a service layer, enabling reliable CRUD workflows across entities.
  • Use Case: Rapidly bootstrap a new resource with a consistent routing and validation pattern, then extend with additional routes without rewriting boilerplate.

Quick Start

Scaffold a new tRPC v11 router following the repository conventions.

Frequently Asked Questions about trpc-router-creating

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

FAQPage Schema
How do I scaffold a tRPC v11 router with clean architecture and Zod validation?

Scaffolding a tRPC v11 router involves generating routers, schemas, and tests under src/server/api/routers/{entity} to enforce service-layer separation, strict Zod validation, and standardized error handling.

What is the best way to structure tRPC routers for multi-tenant backend modules?

The best way to structure multi-tenant tRPC routers is by using a service-layer separation pattern with protectedProcedure, ensuring centralized authentication and uniform error handling across all entity CRUD workflows.

Can I use Zod schemas for input validation in a tRPC v11 project?

Yes, you can use Zod schemas for input validation in tRPC v11 by placing them in src/schemas/{entity}.ts to enforce strict input shapes and apply multi-tenant filtering to API requests.

Does tRPC router scaffolding support bulk operations and statistics routes?

tRPC router scaffolding supports bulk operations and statistics by generating optional files alongside index.ts and crud.ts within the entity directory, allowing you to extend routing without rewriting boilerplate.

How to generate a merged tRPC router entry and integrate it into the main app router?

To generate a merged tRPC router entry, the scaffolding process creates an index that merges entity routers and integrates them into the main app router, following project conventions for authentication and error handling.