api-patterns_skill

This skill helps you choose the right API style and design consistent, scalable responses across REST, GraphQL, and tRPC.
  • TypeScript

5.7k

GitHub Stars

11

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 vudovn/antigravity-kit --skill api-patterns

  • api-style.md1.1 KB
  • auth.md576 B
  • documentation.md549 B
  • graphql.md977 B
  • rate-limiting.md726 B
  • response.md921 B
  • rest.md1.3 KB
  • security-testing.md2.8 KB
  • SKILL.md2.4 KB
  • trpc.md801 B
  • versioning.md651 B

Overview

This skill teaches practical API design principles and decision-making for modern services. It helps choose between REST, GraphQL, and tRPC, and covers response formats, versioning, pagination, and related operational concerns. The focus is on thinking through trade-offs and applying patterns appropriately rather than copy-pasting templates.

How this skill works

It guides you through a decision flow that matches API style to consumer needs, team constraints, and deployment patterns. It inspects common concerns—naming, HTTP semantics, type safety, response envelopes, error handling, and versioning—and gives concrete recommendations. It also highlights anti-patterns and a checklist to validate design choices before implementation.

When to use it

  • Selecting an API style for a new product or microservice
  • Refining response formats and error contracts for client teams
  • Planning API versioning and migration strategies
  • Choosing pagination and filtering approaches for large datasets
  • Deciding auth, rate limiting, and security testing needs

Best practices

  • Base style choice on client needs and team expertise, not inertia
  • Use consistent response envelopes and clear error schemas across endpoints
  • Prefer nouns and resource-based routes in REST; avoid verbs in URLs
  • Adopt semantic HTTP status codes and standard pagination metadata
  • Plan versioning up front (URI/header/query) and document migration paths
  • Include rate limiting and basic security checks early in design

Example use cases

  • Choosing GraphQL for rich client-driven querying and reduced round trips
  • Picking tRPC in a TypeScript monorepo to leverage end-to-end typesafety
  • Designing REST endpoints with clear resource names and correct HTTP methods
  • Defining a stable versioning strategy for public APIs to support backward compatibility
  • Implementing consistent error envelopes and pagination for mobile clients

FAQ

Choose GraphQL if clients need flexible queries, efficient bundling of related data, or when you cannot predict client data needs. Avoid it for simple CRUD APIs or when caching and predictable endpoints are priorities.

Is tRPC only for full TypeScript stacks?

tRPC shines in TypeScript monorepos because of runtime-free type safety; avoid it for polyglot clients or public APIs where language-agnostic contracts are required.

How do I handle breaking changes?

Use versioning (URI or header) and deprecation headers, document migration steps, and support old versions for a defined window. Prefer additive changes and non-breaking evolutions when possible.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
api-patterns skill by vudovn/antigravity-kit | VeilStrat