api-patterns

Guides API design decisions covering REST, GraphQL, tRPC, versioning, and security testing.

Updated Apr 30, 2026
One-click install
npx skills add https://github.com/AdityaBorkar/igbot-fork --skill api-patterns-adityaborkar
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-patterns
Source: https://github.com/AdityaBorkar/igbot-fork/tree/main/.agents/skills/api-patterns
Command: npx skills add https://github.com/AdityaBorkar/igbot-fork --skill api-patterns-adityaborkar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Choosing the right API style and applying consistent design rules is hard when teams default to REST for everything or ship inconsistent response formats. This Skill provides decision frameworks and reference material so you design APIs deliberately instead of copying fixed patterns. ## Core Features & Use Cases - API Style Selection: Decision trees for choosing between REST, GraphQL, tRPC, WebSocket, and gRPC based on consumers, data complexity, and caching needs. - Design References: In-depth guides on resource naming, HTTP methods, status codes, response envelopes, pagination, versioning, authentication, and rate limiting. - Security Testing: OWASP API Top 10 checklist covering BOLA, broken auth, injection, and GraphQL-specific attacks. - Automated Validation: A Python script that scans OpenAPI specs and API code for missing error handling, validation, status codes, and rate limiting. - Use Case: When designing a new public API, consult the decision tree to confirm REST fits, then apply the naming, status code, and pagination guides, and finally run the validator script against your OpenAPI spec before release. ## Quick Start Ask the assistant to help design a REST API for your project and validate the existing endpoints using the api-patterns guidelines.

Frequently Asked Questions about api-patterns

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

FAQPage Schema
How do I choose between REST, GraphQL, and tRPC for my API?▼

Choose REST with OpenAPI for public APIs needing wide compatibility, GraphQL for complex interconnected data across multiple frontends, and tRPC for TypeScript monorepos needing end-to-end type safety. Base the decision on your API consumers, data complexity, and caching requirements.

What HTTP status codes should a REST API return?▼

Use 200 for successful reads, 201 for created resources, 204 for success with no content, 400 for malformed requests, 401 for missing auth, 403 for insufficient permissions, 404 for missing resources, 409 for conflicts, 422 for validation errors, and 429 for rate limiting.

When should I use cursor pagination instead of offset pagination?▼

Use cursor pagination for large datasets where offset performance degrades, and keyset pagination when performance is critical and a sortable key exists. Offset pagination works for small datasets where users need to jump to specific pages.

Does the API validator script work with OpenAPI specifications?▼

Yes, the api_validator.py script parses OpenAPI JSON and YAML files to check for version definitions, paths, schema components, endpoint descriptions, and response definitions. It also scans API source code for error handling, validation, and rate limiting patterns.

What are the most important API security vulnerabilities to test?▼

The OWASP API Top 10 highlights Broken Object Level Authorization (BOLA), broken authentication, excessive data exposure, and lack of rate limiting as critical risks. Test by replaying requests across user sessions, manipulating JWTs, and probing for injection in all parameters.

When is tRPC a poor fit for an API project?▼

tRPC is a poor fit when clients are not TypeScript, when you need a public API with REST conventions, or when multiple language backends are involved. It works best in TypeScript monorepos where both frontend and backend share types.