api

Generate Connect RPC CRUD handlers from proto service definitions.

4|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/reliant-labs/forge --skill api-reliant-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api
Source: https://github.com/reliant-labs/forge/tree/main/internal/templates/project/skills/forge/api
Command: npx skills add https://github.com/reliant-labs/forge --skill api-reliant-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write production-grade Connect RPC handlers by standardizing proto-driven CRUD behavior, RBAC enforcement, pagination semantics, and consistent error handling so clients receive correct codes without leaking internals.

Core Features & Use Cases

  • Proto-to-handler conventions: Define RPCs in the expected proto paths to unlock auto-generated CRUD handlers, AIP-158 cursor pagination, optional List filters, per-method required_roles RBAC, and Idempotency-Key support.
  • Handler anatomy for maintainability: Implement handlers as thin, wire-format glue by validating inputs, extracting auth context via middleware, converting proto types to internal input types, calling service-layer contracts, mapping internal results back to proto, and wrapping errors consistently.
  • Safety-focused error handling: Use connect.NewError with the correct Connect codes (InvalidArgument, NotFound, PermissionDenied, Unauthenticated, Internal) and keep server details out of client responses.
  • Transactional database access patterns: For multi-step mutations, use ORM operations from internal/db within explicit transactions to ensure consistency.

Quick Start

Use the api Skill to implement a new Connect service by adding your proto definitions (CRUD naming, optional List filters, required_roles, and pagination fields) and then writing any hand-crafted handler methods in the service layer’s handler location using connect.NewError for precise error codes.

Frequently Asked Questions about api

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

FAQPage Schema
How do I generate Connect RPC handlers from proto service definitions?

To generate Connect RPC handlers from proto service definitions, define your RPCs using standardized CRUD naming, optional List filters, required_roles, and pagination fields to unlock auto-generated handler code, RBAC enforcement, and AIP-158 cursor pagination.

How do I map internal errors to Connect RPC codes?

To map internal errors to Connect RPC codes, use connect.NewError with appropriate Connect codes like InvalidArgument, NotFound, PermissionDenied, Unauthenticated, or Internal, ensuring server details are kept out of client responses for safety.

How do I implement cursor-based pagination for Connect RPC List methods?

To implement cursor-based pagination for Connect RPC List methods, define pagination fields in your proto service definition, which enables AIP-158 cursor pagination semantics automatically within the generated handler conventions for your List endpoints.

How do I structure Connect RPC handlers for maintainability and testability?

To structure Connect RPC handlers for maintainability, implement them as thin wire-format glue that validates inputs, extracts auth context via middleware, converts proto types to internal inputs, calls service-layer contracts, and wraps errors consistently with unit and integration tests.

How do I ensure data consistency for multi-step mutations in Connect RPC handlers?

To ensure data consistency for multi-step mutations in Connect RPC handlers, use ORM operations from your internal database layer within explicit transactions, guaranteeing that complex state changes remain atomic and consistent.

How do I enforce role-based access control in Connect RPC endpoints?

To enforce role-based access control in Connect RPC endpoints, define per-method required_roles within your proto service definitions, which translates into RBAC-gated endpoints that extract and validate auth context via middleware during request handling.