pact-api-design

Design API contracts for REST, GraphQL, versioning, and error handling.

Updated Dec 17, 2025
One-click install
npx skills add https://github.com/v4lheru/linkedin-comments-telegram --skill pact-api-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pact-api-design
Source: https://github.com/v4lheru/linkedin-comments-telegram/tree/main/.claude/skills/pact-api-design
Command: npx skills add https://github.com/v4lheru/linkedin-comments-telegram --skill pact-api-design

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps architects and backend developers design consistent, maintainable APIs by applying established API contract design patterns across REST, GraphQL, versioning, error handling, and documentation standards.

Core Features & Use Cases

  • Architecture Decision Guidance: Choose between REST, GraphQL, RPC, or a hybrid approach.
  • Contract Design: Define resource models, naming, and schema contracts.
  • Versioning & Deprecation: Design evolution strategies that minimize client disruption.
  • Error Handling & Documentation: Standardize error formats and API docs (OpenAPI/Swagger, GraphQL schemas).
  • Documentation Standards: Ensure APIs are documented with OpenAPI/Swagger or GraphQL schema.

Quick Start

Use this skill to evaluate API style and draft initial contracts and docs for a new feature.

Frequently Asked Questions about pact-api-design

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

FAQPage Schema
How do I design REST vs GraphQL APIs and choose between them?

REST and GraphQL represent different architectural approaches to API design. REST uses standard HTTP methods on resource endpoints, while GraphQL allows clients to query exactly the data they need through a single endpoint. Choose REST for simple, resource-oriented domains and GraphQL for complex queries with variable client needs. This Skill guides you through decision criteria for each approach based on your requirements.

What's the best way to version APIs without breaking client applications?

API versioning strategies minimize disruption during evolution. Common approaches include URL versioning, header-based versioning, and deprecation windows with clear timelines. Design a versioning strategy upfront by defining how you'll signal changes, maintain backward compatibility, and communicate deprecation schedules. This Skill helps you architect versioning and deprecation plans that keep clients stable.

How do I standardize error handling and responses across my API?

Standardized error formats improve client integration and debugging. Define consistent error schemas that include status codes, error messages, and actionable details. Apply the same structure across all endpoints so clients can handle failures predictably. This Skill provides patterns for designing error handling formats that work across REST and GraphQL APIs.

Can I use OpenAPI and GraphQL schemas together for API documentation?

OpenAPI (Swagger) and GraphQL schemas serve different documentation needs. OpenAPI works best for REST APIs, generating interactive documentation from structured specifications. GraphQL includes schema introspection built-in, enabling self-documenting APIs and tooling. This Skill covers both documentation standards and helps you choose or combine them based on your API design.

What pagination patterns should I implement for large API datasets?

Pagination patterns control data returned per request and improve performance. Common patterns include offset/limit pagination, cursor-based pagination for consistency across changes, and keyset pagination for scalability. Design your pagination strategy early to ensure consistent behavior across endpoints. This Skill includes established pagination patterns applicable to REST and GraphQL APIs.

How do I define and document API contracts before implementation?

API contracts define the interface between client and server through resource models, naming conventions, and schema specifications. Document contracts using OpenAPI, GraphQL schemas, or similar specifications before coding to align teams early. This Skill helps you draft initial contracts and documentation that serve as implementation blueprints and client references.