tech-trpc

Installation
SKILL.md

tRPC End-to-End Typesafe APIs

Type-safe remote procedure calls with full client-server type inference. No code generation needed. tRPC excels at:

  • Zero API generation — Shared types between client and server; type-safe mutations/queries by default
  • Middleware composition — Chain middlewares with unstable_pipe() for authentication, logging, authorization
  • Input validation — Zod schema validation with auto-formatted error responses
  • Error handling — Domain-specific TRPCError codes mapped to HTTP status automatically
  • Vertical Slice pattern — Organize by feature (slice), not layer; each slice owns procedures, schemas, data access

Core patterns: procedures (queries/mutations) in routers, input/output schemas for contracts, middleware for cross-cutting concerns, domain errors with proper codes.

Workflow

When designing tRPC APIs:

  1. Define the slice — Which feature? (e.g., invitations, payments, users)
  2. Schema first — Input schema with Zod, output schema for response contract
  3. Create procedures — Query, mutation, or subscription with .procedure.input().query()
  4. Add middleware — Authentication, logging, authorization; chain with unstable_pipe()
Related skills
Installs
26
GitHub Stars
15
First Seen
Feb 14, 2026