api-endpoints

Define and wire Connect-RPC API endpoints in the Shorts backend.

3|Updated Jan 22, 2024
One-click install
npx skills add https://github.com/castlemilk/shorted.com.au --skill api-endpoints
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-endpoints
Source: https://github.com/castlemilk/shorted.com.au/tree/main/.claude/skills/api-endpoints
Command: npx skills add https://github.com/castlemilk/shorted.com.au --skill api-endpoints

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defining and wiring new Connect-RPC API endpoints in the Shorts backend is a structured, repeatable process that minimizes integration errors and accelerates feature delivery.

Core Features & Use Cases

  • Protobuf-driven API expansion: define new methods and messages in proto/.
  • Automatic code generation: generate Go types and TypeScript clients from proto definitions.
  • End-to-end wiring: implement store methods and RPC handlers, and add tests to ensure reliability.
  • Use cases include adding new features, extending APIs, and keeping client SDKs in sync.

Quick Start

Define the new protobuf method, run code generation, implement the corresponding store and service handlers, and add tests.

Frequently Asked Questions about api-endpoints

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

FAQPage Schema
How do I add new Connect-RPC endpoints to a backend service?

To add new Connect-RPC endpoints, you define new protobuf methods and messages in proto files, run code generation, and implement the corresponding store and service handlers. This structured process minimizes integration errors across the API surface.

What is the process for expanding a protobuf-driven API surface?

Expanding a protobuf-driven API surface involves defining new methods in proto files, regenerating Go types and TypeScript clients using code generation, and wiring the backend handlers. This ensures client SDKs remain in sync with backend services.

How do I generate Go and TypeScript client code from protobuf definitions?

You generate Go and TypeScript client code from protobuf definitions by running buf generate after updating your proto files. This automatic code generation creates the necessary types and clients to keep your frontend and backend synchronized.

Do I need to manually update store and service implementations when creating new RPC methods?

Yes, creating new RPC methods requires manually updating store and service implementations. After defining the protobuf and regenerating code, you must wire the end-to-end backend handlers and add tests to ensure reliability.

When should I use Connect-RPC for backend API expansion?

Use Connect-RPC for backend API expansion when you need a structured, repeatable process to add new features and extend APIs. It is ideal for projects requiring protobuf-driven definitions and automatic generation of client SDKs.

What are the limitations of automatically generating code for new API endpoints?

Automatic code generation handles creating types and clients, but it does not implement the actual business logic. You must manually wire the store methods and RPC handlers, and add tests to ensure the new endpoints function reliably.