orpc-api

Create and modify oRPC API routers, procedures, and middleware for ChatbotX.

601|129|Updated Dec 9, 2024
One-click install
npx skills add https://github.com/ChatbotXIO/ChatbotX --skill orpc-api-chatbotxio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: orpc-api
Source: https://github.com/ChatbotXIO/ChatbotX/tree/main/.agents/skills/orpc-api
Command: npx skills add https://github.com/ChatbotXIO/ChatbotX --skill orpc-api-chatbotxio

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create and maintain oRPC API routes in the ChatbotX builder app without breaking the project's routing, auth, or validation patterns. It removes guesswork when adding endpoints, wiring middleware, or exposing new functionality through RPC and OpenAPI.

Core Features & Use Cases

  • Router and Procedure Design: Define new oRPC procedures with the correct route metadata, input validation, optional output schemas, and handler structure.
  • Authentication Patterns: Choose between session-based authorized APIs and workspace token APIs, then apply workspace-scoped authorization where needed.
  • API Organization: Register feature routers in the correct app indexes and split authenticated and public APIs into consistent feature-level files.
  • Production Guardrails: Use the expected error mapping, logging conventions, and schema patterns that match the ChatbotX codebase.
  • Use Case: Add a new workspace feature endpoint, expose it in OpenAPI, and ensure it respects the project's auth and middleware conventions.

Quick Start

Use the orpc-api skill to design and implement a new authenticated workspace endpoint that follows ChatbotX router, schema, and logging conventions.

Frequently Asked Questions about orpc-api

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

FAQPage Schema
How do I add a new authenticated oRPC endpoint with OpenAPI metadata?

To add an authenticated oRPC endpoint, define a procedure with route metadata, Zod input validation, optional output schemas, and session-based auth middleware. You must follow project chaining conventions and register the feature router in the app index.

What is the best way to structure oRPC routers for public token routes versus authorized workspace APIs?

Structuring oRPC routers requires splitting authenticated and public APIs into separate feature-level files. You apply workspace-scoped authorization for authenticated routes and select the appropriate public token auth stack for token routes.

Does oRPC support Zod validation and automatic OpenAPI schema generation?

Yes, oRPC supports Zod validation and OpenAPI schema generation. You define input validation using Zod schemas and attach OpenAPI metadata to your procedures, ensuring the endpoint exposes correct documentation and validates inputs properly.

How do I apply middleware mapping and auth stack selection in an oRPC procedure?

Applying middleware mapping in oRPC involves selecting the correct auth stack, mapping it through middleware chaining, and applying workspace-scoped authorization. This ensures session-based or token-based authentication is enforced before the handler executes.

What logging and error handling conventions should I use when building oRPC APIs?

Building oRPC APIs requires using the project's expected error mapping and logging conventions. You must apply standardized error handling and logging patterns within your procedures to match production guardrails and maintain codebase consistency.