Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

orpc-contract

Skill by middleapi

Designs oRPC v2 APIs contract-first, using oc from @orpc/contract and implement from @orpc/server. It is for teams that share an API contract between server and client packages or publish a typed client to npm.

  • Score 83
  • 5.8k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install orpc-contract

Built from the published package, never by AI.

git clone --depth 1 https://github.com/middleapi/orpc /tmp/orpc && mkdir -p ~/.claude/skills && cp -r /tmp/orpc/skills/orpc-contract ~/.claude/skills/orpc-contract

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install orpc-contract in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill guides work on oRPC v2 contract-first APIs. A contract defines schemas, errors, and metadata without business logic, using oc from @orpc/contract. An implementation is then built from that contract with implement from @orpc/server, and clients consume the contract with typed link and client helpers.

The skill covers shipping a contract as minified JSON, publishing a typed client factory to npm with tsdown, and generating a contract from an existing OpenAPI spec with the Hey API orpc plugin. It says to fetch the oRPC docs when unsure, since pretrained knowledge may describe v1. It is for developers building or consuming oRPC v2 APIs in separate server and client packages.

Written from the project's SKILL.md and checked against it.

What it can do

  • Define a contract with ocBuild procedure contracts with input, output, and typed error declarations using oc from @orpc/contract.
  • Implement a contractCreate type-checked handlers from a contract with implement from @orpc/server, including router-level middleware.
  • Consume the contract from clientsCreate typed clients with RPCLink or OpenAPILink and infer router contract client types.
  • Ship the contract as JSONMinify a router contract with minifyRouterContract so clients can import it without server internals.
  • Publish a typed client to npmExport a client factory that pairs the contract with a link, then bundle and publish it.
  • Generate a contract from OpenAPIUse the Hey API orpc plugin to generate contract files from an existing OpenAPI spec.

What you need

  • An oRPC v2 project that depends on @orpc/contract
  • Zod, Valibot, ArkType, or another Standard Schema library for schemas
  • An npm account if publishing a client package

Try asking

  • Define an oRPC v2 contract for a planets list and find endpoint with NOT_FOUND errors
  • Implement this oRPC contract on the server with a context database
  • Generate an oRPC contract from my OpenAPI spec using the Hey API plugin

Good to know

  • Targets oRPC v2; the skill notes pretrained knowledge is often wrong for v2
  • Generated OpenAPI output requires the @hey-api/openapi-ts@next tag until a stable release
  • Contract JSON loses schemas on serialization, so clients must cast it

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/orpc-contract/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md10 KB

Alternatives to orpc-contract

All alternatives →
openclaw-github-repo-commandersickn33
94

Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.

AAA Skill 50k
gradiogradio-app
94

Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.

AAA Skill 44k
hig-components-menussickn33
94

Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.

AAA Skill 50k
fastapi-templateswshobson
94

Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.

AAA Skill 43k
appfunctionsandroid
94

Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.

AAA Skill 11k
agent-qa-authoringsickn33
94

Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.

AAA Skill 50k

Compare with openclaw-github-repo-commander, gradio or hig-components-menus

orpc-contract: common questions

When should I use contract-first instead of the os-first flow in oRPC?

The skill recommends contract-first when server and client are separate packages or teams, when the shape starts from an OpenAPI spec, or when publishing a client to npm. The os-first flow suits one codebase where the client can import the router type directly.

Does this skill cover REST and OpenAPI serving?

Not in depth. The source points REST routing, prefix rules, spec generation, and OpenAPILink details to the separate orpc-openapi skill.

How do I get the docs for oRPC v2?

The skill says to fetch pages from https://orpc.dev, starting with https://orpc.dev/llms.txt, and to trust those pages over the skill summary if they disagree.

How do I install orpc-contract?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is orpc-contract free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is orpc-contract safe to use?

It scores 83 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to orpc-contract?

Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.

orpc-contract Install

Add to stack

Loading.