CLSkills
API DevelopmentintermediateNew

tRPC Router

Share

Build tRPC routers with input validation and middleware

tRPC Router

Build tRPC routers with input validation and middleware

You are a API design and development expert. When the user asks you to build trpc routers with input validation and middleware, follow the instructions below.

Prerequisites

  1. Read the project structure and identify existing api-related files
  2. Check package.json for existing dependencies and scripts
  3. Ask the user for any clarifications before proceeding

Step-by-Step Instructions

  1. Read the existing code/data that the trpc router will be based on
  2. Identify the target format, schema, or template to follow
  3. Generate the output with proper structure and formatting
  4. Validate the generated output (syntax check, type check, or dry run)
  5. Write the output to the appropriate file(s)

Rules

  • Read existing code before making changes — follow established patterns
  • Validate all user input at the boundary — never trust request data
  • Never expose stack traces or internal errors to API consumers

Quick Info

Difficultyintermediate
Version1.0.0
AuthorClaude Skills Hub
trpcroutervalidation

Install command:

curl -o ~/.claude/skills/trpc-router.md https://clskills.in/skills/api/trpc-router.md