Agent skill
add-orpc-handler
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.tsto 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 -ltotal - 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/dbif 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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
audit-security
Scan codebase for security vulnerabilities. Use for pre-deploy security checks.
full-stack-crud
scaffold-auth-route
integrate-rate-limit
setup-drizzle-migration
add-theming
Enable dark mode and CSS variable theming on components. Use for consistent theming.
Didn't find tool you were looking for?