new-trpc-router
OfficialQuickly add and wire a new tRPC router
System Documentation
What problem does it solve?
Creating new API domains in a tRPC-based Next.js app often requires repetitive boilerplate: creating router files, defining procedures with input validation, co-locating database queries, and registering the router in the central appRouter. This Skill standardizes that workflow so new feature APIs are created consistently, validated, and discoverable by the application.
Core Features & Use Cases
- Router file template: Provides a consistent pattern for list, byId, and create procedures and encourages input validation with Zod.
- App registration guidance: Shows how to export the router and register it in server/api/root.ts so the appRouter exposes the new domain.
- Auth and DB conventions: Recommends using publicProcedure for unauthenticated routes, adding Supabase auth checks for protected endpoints, and keeping queries co-located or extracting them to server/db/queries when large.
- Use Case: Add a comments feature with endpoints to list comments, fetch a comment by UUID, and create new comments with server-side validation and auth.
Quick Start
Create a new router file named comments at server/api/routers/comments.ts with zod-validated procedures, export commentsRouter, and import and register it in server/api/root.ts so the appRouter exposes the comments domain.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: new-trpc-router Download link: https://github.com/PlazaCC/antes-da-tela/archive/main.zip#new-trpc-router Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.