tsrpc-guide

Build type-safe full-stack TypeScript RPC applications with runtime validation.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/NoirJ0e/tsrpc-ecommerce-admin-example --skill tsrpc-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tsrpc-guide
Source: https://github.com/NoirJ0e/tsrpc-ecommerce-admin-example/tree/main/.trae/skills/tsrpc-guide
Command: npx skills add https://github.com/NoirJ0e/tsrpc-ecommerce-admin-example --skill tsrpc-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TSRPC provides a clear, type-safe blueprint for building full-stack TypeScript RPC applications, reducing boilerplate and runtime errors by enforcing strict contracts between client and server.

Core Features & Use Cases

  • Protocol definitions: Define Req*.ts and Res*.ts to describe request/response shapes that are validated at runtime.
  • API implementation: Implement Api*.ts handlers that receive typed requests and respond with succ/error semantics.
  • ServiceProto workflow: Generate and synchronize serviceProto.ts to keep client and server in sync.
  • Client-Server patterns: HTTP and WebSocket clients and servers with typed APIs and safe coding practices.
  • Best practices: Emphasizes strict TypeScript, validation beyond types, and structured middleware flows.

Quick Start

Explain how to scaffold a minimal TSRPC project and implement a simple ApiHello.ts with PtHello.ts to illustrate the protocol-server-client flow.

Frequently Asked Questions about tsrpc-guide

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

FAQPage Schema
How do I build type-safe full-stack RPC applications in TypeScript?

To build type-safe full-stack RPC applications in TypeScript, define strict protocol files (Pt*.ts) and request/response types (Req*/Res*), then implement API handlers (Api*.ts) to enforce end-to-end runtime validation and robust client-server contracts.

What is a ServiceProto in TSRPC and how does it synchronize client and server?

ServiceProto in TSRPC is a generated definition that synchronizes client and server by maintaining a unified serviceProto.ts file, ensuring typed APIs and safe coding practices remain consistent across HTTP and WebSocket connections without manual boilerplate.

How to implement runtime validation for TypeScript RPC protocols beyond static types?

Implement runtime validation for TypeScript RPC protocols by defining strict Req*.ts and Res*.ts shapes that are automatically validated at runtime, ensuring incoming data matches expected types before executing API logic and preventing invalid client payloads.

Does TSRPC support both HTTP and WebSocket clients for real-time full-stack communication?

Yes, TSRPC supports both HTTP and WebSocket clients for real-time full-stack communication, allowing developers to implement typed APIs and structured middleware flows across different transport layers while maintaining strict end-to-end TypeScript safety.

What is the best way to structure a TypeScript RPC backend for typical CRUD dashboards?

The best way to structure a TypeScript RPC backend for CRUD dashboards is using Pt*.ts protocol definitions alongside Api*.ts handlers, utilizing succ/error response semantics and structured middleware to ensure maintainable, type-safe data operations.

Why do I need strict TypeScript usage and Pt*.ts files when building RPC systems?

You need strict TypeScript usage and Pt*.ts files when building RPC systems to eliminate boilerplate and runtime errors, enforcing robust contracts between client and server while ensuring end-to-end type safety throughout the application architecture.