Agent skill

add-orpc-handler

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/MonDevHub/gakom/tree/tanstack-query/.claude/skills/add-orpc-handler

SKILL.md

Generate a new ORPC procedure handler for the backend server layer.

Use this skill to add new API endpoints following the repo's ORPC pattern for type-safe RPC calls.

Create:

  • Handler file in apps/website/src/lib/server/orpc/handlers/{domain}/
  • Update router.ts to register the new procedure
  • Generate client stubs for type-safe frontend calls
  • Integrate with existing middleware (auth, rate limiting)

Current API Structure

  • Existing handlers: !find apps/website/src/lib/server/orpc/handlers -name "*.ts" | wc -l total
  • Router structure: !grep -A 10 "export const router" apps/website/src/lib/server/orpc/router.ts || echo "Router not found"

Handler conventions:

  • Use type-safe inputs/outputs from $repo/orpc
  • Import db from @repo/db if queries needed
  • Throw ORPCError for auth/validation failures (e.g., new ORPCError("UNAUTHORIZED"))
  • Follow async/await pattern
  • Add rate limiting where appropriate

Generated Structure

  • Handler: apps/website/src/lib/server/orpc/handlers/{$DOMAIN}/$HANDLER_NAME.ts
  • Router update: Register handler in router.ts
  • Client export: Type-safe frontend callable

Reference template.md for handler skeleton. See examples.md for health_check sample.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results