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
TRPCErrorcodes 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:
- Define the slice — Which feature? (e.g.,
invitations,payments,users) - Schema first — Input schema with Zod, output schema for response contract
- Create procedures — Query, mutation, or subscription with
.procedure.input().query() - Add middleware — Authentication, logging, authorization; chain with
unstable_pipe()
Related skills
More from ravnhq/ai-toolkit
core-coding-standards
Universal code quality rules — KISS, DRY, clean code, code review. Base
81promptify
Transform user requests into detailed, precise prompts for AI models.
66lang-typescript
TypeScript language patterns and type safety rules — strict mode, no
53tech-react
React 19 patterns for components, hooks, Server Components, and data
52design-frontend
Visual design system patterns for web UIs. Tailwind CSS v4 design tokens
43platform-backend
Server-side architecture and security — API design, error handling, validation,
39