tsrpc-api

Scaffold TSRPC API endpoints and interfaces in TypeScript projects.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you scaffold new TSRPC API endpoints and interfaces, accelerating backend development.

Core Features & Use Cases

  • Protocol-first development: Create and organize protocol definitions in shared/protocols/ with clear Req/Res interfaces.
  • API implementation guide: Implement API handlers in api/ following standard TSRPC patterns.
  • ServiceProto generation: Generate the service protocol via tsrpc-cli proto to keep client/server in sync.
  • Use Case: When starting a new feature like a product catalog, define PtProduct.ts, ApiProduct.ts, and run proto to update serviceProto.ts.

Quick Start

Create a Pt{ApiName}.ts protocol in shared/protocols, implement an Api{ApiName}.ts handler in api/, and run npm run proto in the backend to regenerate serviceProto.ts.

Frequently Asked Questions about tsrpc-api

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

FAQPage Schema
How do I scaffold new TSRPC API endpoints in a TypeScript backend?

To scaffold new TSRPC API endpoints, create a Pt{ApiName}.ts protocol file in shared/protocols, implement an Api{ApiName}.ts handler in the api/ directory, and run npm run proto to regenerate serviceProto.ts.

What is protocol-first development in TSRPC?

Protocol-first development in TSRPC involves defining clear Req/Res interfaces in shared/protocols/ before implementing API handlers in the api/ directory, ensuring type-safe client-server communication.

How do I generate serviceProto.ts to keep my TSRPC client and server in sync?

You generate serviceProto.ts by running npm run proto in the backend, which utilizes tsrpc-cli proto to automatically update the service protocol and keep the client and server synchronized.

Do I need to manually update serviceProto.ts when adding new TSRPC protocols?

No, you do not need to manually update serviceProto.ts. After adding new protocol definitions, running tsrpc-cli proto automatically regenerates the serviceProto.ts file to reflect the changes.

What naming conventions should I follow when creating TSRPC API interfaces?

When creating TSRPC API interfaces, follow the naming conventions of prefixing protocol files with Pt (Pt*.ts) and API handler files with Api (Api*.ts) to maintain consistent project structure.

What is the best way to structure a new feature like a product catalog using TSRPC?

To structure a new TSRPC feature like a product catalog, define PtProduct.ts for protocols, implement ApiProduct.ts for the handler logic, and run proto to update serviceProto.ts for synchronization.