implementing-api-patterns_skill

This skill helps design and implement REST, GraphQL, gRPC, and tRPC APIs with framework guidance, patterns, and OpenAPI documentation.
  • Python

291

GitHub Stars

3

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill ancoleman/ai-design-components --skill implementing-api-patterns

  • outputs.yaml9.5 KB
  • README.md8.7 KB
  • SKILL.md11.7 KB

Overview

This skill helps design and implement backend APIs across REST, GraphQL, gRPC, and tRPC patterns, with practical framework recommendations and integration patterns. It focuses on choosing the right approach for public APIs, internal services, and frontend integrations while addressing pagination, rate limiting, caching, versioning, and OpenAPI generation.

How this skill works

The skill inspects API consumer requirements, performance needs, and team ownership to recommend a pattern and framework (e.g., FastAPI, Hono, Axum, Gin, Strawberry, gqlgen, Tonic, tRPC). It provides concrete code snippets, pagination strategies, rate limiting and caching patterns, OpenAPI generation guidance, and frontend integration examples for forms, tables, dashboards and AI-chat streaming. It includes performance tradeoffs and scripts for generating and validating specs and running benchmarks.

When to use it

  • Building web, mobile, or public backend APIs where pattern choice matters
  • Connecting frontend components (forms, tables, dashboards) to backend services
  • Designing service-to-service communication with performance and typing needs
  • Implementing pagination, rate limiting, caching, or API versioning
  • Auto-generating OpenAPI docs or integrating GraphQL/tRPC for flexible data fetching

Best practices

  • Pick API style by consumer: REST for public/third-party, tRPC for same-team TypeScript, GraphQL for flexible frontend queries, gRPC for high-performance microservices
  • Use cursor-based pagination in production to avoid skipped or duplicated records; use offset only for small static datasets
  • Prefer frameworks with built-in OpenAPI support for public APIs (e.g., FastAPI, Hono middleware)
  • Apply rate limiting (token bucket or sliding window) and use Redis for distributed limits
  • Document versioning strategy early (URI, header, or media-type) and keep breaking changes behind explicit versions

Example use cases

  • Public REST API for third-party developers with FastAPI and automatic OpenAPI docs
  • Full-stack TypeScript app using tRPC for end-to-end type safety and React Query integration
  • Mobile app backend using GraphQL to minimize payloads and support selective fetching
  • High-throughput microservices using gRPC (Tonic or Connect-Go) for low-latency streaming
  • AI chat endpoint using SSE for streaming LLM responses to a web client

FAQ

Choose tRPC when frontend and backend are TypeScript and the same team owns both; it gives end-to-end type safety and simple RPC style. Use GraphQL when multiple clients need flexible querying or mobile bandwidth is a concern.

Is cursor pagination always better than offset?

For production-scale, dynamic datasets, cursor-based pagination is recommended to avoid missing or duplicate records. Offset is acceptable for small, static datasets or where direct page access is required.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational