orpc-contracts

Define API contracts and endpoints using oRPC contracts for NestJS and Next.js.

2|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/Quanby-IT-Solutions/turbo-template --skill orpc-contracts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: orpc-contracts
Source: https://github.com/Quanby-IT-Solutions/turbo-template/tree/main/.ruler/skills/orpc-contracts
Command: npx skills add https://github.com/Quanby-IT-Solutions/turbo-template --skill orpc-contracts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The oRPC contract-first API design approach defines schemas and routes before implementation, enabling end-to-end type safety and consistent client-server contracts across the monorepo.

Core Features & Use Cases

  • Contract-first workflow: define schemas and routes in @repo/contracts, then implement on backend with @orpc/nest and on frontend with @orpc/client for guaranteed type safety.
  • Cross-framework compatibility: works with NestJS backend and Next.js frontend to ensure uniform contracts and OpenAPI metadata.
  • Use Case: rapidly spin up new API endpoints by authoring contracts, then generate typed server and client implementations.

Quick Start

Start by defining a v1 contract in the contracts package and wire it into the backend and frontend through the version router.

Frequently Asked Questions about orpc-contracts

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

FAQPage Schema
What is contract-first API design and how does it ensure type safety between NestJS and Next.js?

Contract-first API design defines schemas and routes in a shared contracts package before implementation, guaranteeing end-to-end type-safe communication between a NestJS backend and Next.js frontend.

How do I generate type-safe API clients and endpoints using oRPC contracts?

You define a v1 contract within a contracts package, wire it into the backend using framework adapters, and implement the frontend with the oRPC client to generate typed server and client implementations.

Can I use oRPC contracts to maintain consistent OpenAPI metadata across my monorepo?

Yes, oRPC contracts enforce contract-driven schemas, routes, and OpenAPI-compatible metadata across both server and client code, ensuring uniform API definitions throughout your monorepo.

Does this contract-first workflow work with my existing NestJS and Next.js monorepo setup?

Yes, the workflow is specifically designed for monorepos, applying oRPC contracts to backend NestJS and frontend Next.js projects to enable consistent type-safe routes, schemas, and clients.

What is the best way to spin up new API endpoints rapidly without losing type safety?

Author API contracts first, then use oRPC framework adapters and generated types to rapidly spin up new endpoints, yielding typed server and client implementations with guaranteed contract alignment.

Why define API schemas and routes before implementation in a TypeScript monorepo?

Defining schemas and routes before implementation enforces a contract-driven workflow that provides end-to-end type safety and consistent client-server contracts across your monorepo.