- Home
- Skills
- Ehtbanton
- Claudeskillsrepo
- Trpc Router Generator
trpc-router-generator_skill
- TypeScript
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill ehtbanton/claudeskillsrepo --skill trpc-router-generator- SKILL.md614 B
Overview
This skill generates complete tRPC v11 router files with type-safe procedures and Zod validation. It produces ready-to-save *.router.ts files following tRPC 11.x patterns and idiomatic TypeScript. The goal is to speed up API scaffolding with correct types, input validation, and common CRUD patterns.
How this skill works
On trigger phrases like "create trpc router" or "trpc api", the skill emits a fully-formed router file that exports a tRPC router and its procedures. Each procedure includes Zod schemas for inputs and outputs, example contexts, and typed resolver stubs. The output adheres to tRPC v11 and Zod conventions so it can be dropped into a TypeScript project immediately.
When to use it
- Scaffolding a new resource API (users, posts, products) with CRUD endpoints
- Generating a typesafe API surface for front-end consumption
- Prototyping server-side logic with validation already wired
- Ensuring consistent tRPC + Zod patterns across a codebase
- Onboarding or pairing when you want a correct initial router file
Best practices
- Review and adapt the generated context typing to match your app's auth and DB clients
- Keep Zod schemas colocated with procedures for single-source validation
- Replace resolver stubs with actual business logic and preserve exported types
- Use explicit input/output schemas for stable client typings
- Run TypeScript checks after generation to catch environment-specific types
Example use cases
- Create users.router.ts with list, get, create, update, delete procedures and Zod schemas
- Generate posts.router.ts that includes pagination and search filters with typed inputs
- Produce an auth.router.ts scaffold with signUp, signIn, refreshToken procedures and validation
- Build nested routers (e.g., users.posts.router.ts) with typed context propagation
- Quickly scaffold APIs during prototype sprints to iterate on client-server contracts
FAQ
It targets tRPC v11 and uses Zod for runtime validation and type inference.
Does the generator write files to disk?
It outputs the complete file contents for a *.router.ts file; integrate with your tooling to write to disk as needed.