backend-trpc-openapi

Generate REST endpoints and OpenAPI documentation from tRPC routers.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/andrey-belen/alto-iam-cloud --skill backend-trpc-openapi-andrey-belen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-trpc-openapi
Source: https://github.com/andrey-belen/alto-iam-cloud/tree/main/.claude/skills/backend-trpc-openapi
Command: npx skills add https://github.com/andrey-belen/alto-iam-cloud --skill backend-trpc-openapi-andrey-belen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill generates REST endpoints and OpenAPI documentation from your tRPC routers, enabling external access and comprehensive API docs without duplicating logic.

Core Features & Use Cases

  • OpenAPI/Swagger generation: Automatically creates a specification from tRPC meta.
  • REST fallback for internal TS apps: Exposes REST endpoints while keeping tRPC as the single source of truth.
  • Use Case: When you have a tRPC-based API but need public or third-party REST access and clear documentation.

Quick Start

  1. Install the active fork and Swagger UI express packages: npm install trpc-to-openapi swagger-ui-express
  2. Install TypeScript typings for Swagger UI Express (development dependency): npm install -D @types/swagger-ui-express
  3. Integrate the OpenAPI generation in your server setup as shown in the provided examples, then run your server to access REST endpoints and Docs at /api and /docs respectively.

Frequently Asked Questions about backend-trpc-openapi

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

FAQPage Schema
How do I generate OpenAPI documentation from a tRPC router?

You can generate OpenAPI documentation from a tRPC router by using the trpc-to-openapi package to automatically create a specification from your tRPC meta data without duplicating logic.

Can I expose REST endpoints from tRPC while keeping it as the single source of truth?

Yes, you can expose REST endpoints from tRPC while keeping it as the single source of truth, enabling public or third-party REST access without maintaining separate API logic.

What packages do I need to install to set up Swagger UI with tRPC?

To set up Swagger UI with tRPC, you need to install the trpc-to-openapi and swagger-ui-express packages, along with the @types/swagger-ui-express development dependency for TypeScript typings.

Does this approach support generating a Swagger specification automatically from TypeScript?

Yes, this approach supports generating a Swagger specification automatically from TypeScript by deriving the OpenAPI documentation directly from your existing tRPC router meta data.

What is the best way to provide public REST access for an internal TypeScript app using tRPC?

The best way to provide public REST access for an internal TypeScript app using tRPC is to use a REST fallback that exposes endpoints while keeping tRPC as the single source of truth for API logic.