One-click install
npx skills add https://github.com/deancochran/gradientpeak --skill backend-deancochran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend
Source: https://github.com/deancochran/gradientpeak/tree/main/.opencode/skills/backend
Command: npx skills add https://github.com/deancochran/gradientpeak --skill backend-deancochran

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Backend API development for tRPC-based services often suffers from inconsistent router patterns, insufficient input validation, and fragile error handling, leading to brittle backends and maintenance challenges.

Core Features & Use Cases

  • Standardized tRPC router patterns with protectedProcedure, input validation via Zod, and clear ownership checks.
  • Supabase integration with structured error mapping to TRPCError and reliable data access patterns.
  • Production-grade guidelines, including migration practices, anti-patterns, and scalable API design for real-world apps.
  • Use Case: Build an activities API with create, list, update, and delete operations that enforce authentication and resource ownership.

Quick Start

Implement a guarded tRPC router for your services with typed inputs and safe database interactions.

Frequently Asked Questions about backend

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure tRPC routers with Zod validation and Supabase?

Structure tRPC routers by applying protectedProcedure for authentication, validating inputs with Zod schemas, and mapping Supabase interactions to standardized TRPCError outputs. This enforces secure data access and reliable API design.

What is the best way to handle errors in a tRPC backend?

Handle tRPC backend errors by mapping Supabase database failures to standardized TRPCError objects. This ensures consistent error responses across your API and prevents brittle backend maintenance issues caused by unstructured exceptions.

How do I enforce ownership verification in tRPC API routes?

Enforce ownership verification in tRPC routes by implementing explicit ownership checks within protectedProcedure definitions before executing database operations. This secures resources by ensuring users only access data they own.

Can I use this tRPC pattern for create, update, and delete operations?

Yes, you can use this tRPC pattern to build a complete activities API with create, list, update, and delete operations. The pattern enforces authentication and resource ownership across all CRUD interactions.

What are common anti-patterns when building tRPC APIs with Supabase?

Common anti-patterns include inconsistent router structures, insufficient Zod input validation, and fragile error handling that fails to map Supabase errors to TRPCError. These lead to brittle backends and maintenance challenges.