api-patterns

Define REST and GraphQL APIs with consistent contracts and validation.

3|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/vtgiang-dotcom/Solo-Code-Harness --skill api-patterns-vtgiang-dotcom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-patterns
Source: https://github.com/vtgiang-dotcom/Solo-Code-Harness/tree/main/.gemini/antigravity/skills/api-patterns
Command: npx skills add https://github.com/vtgiang-dotcom/Solo-Code-Harness --skill api-patterns-vtgiang-dotcom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Design stable, well-documented interfaces that reduce misuse and breaking changes. Public APIs, GraphQL schemas, and module boundaries often become fragile when teams evolve; this Skill helps you define clear contracts first, so implementations follow predictable rules and consumers can rely on the surface area.

Core Features & Use Cases

  • Contract-first design: define the API surface before implementation to reduce back-compat surprises.
  • Consistent error semantics: choose a single error model across endpoints to simplify client handling.
  • Boundary validation: enforce validation at the API edge to protect internal logic and ensure data quality.
  • Naming and standards: apply consistent REST/GraphQL naming conventions, pagination, and documentation alignment.

Quick Start

Define the interface before implementing it.

Frequently Asked Questions about api-patterns

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

FAQPage Schema
What is contract-first API design and why does it matter?

Contract-first API design means defining the interface and typed schemas before implementation. This approach reduces back-compat surprises and ensures consumers can rely on a predictable, stable surface area.

How do I enforce consistent error handling across REST and GraphQL endpoints?

To enforce consistent error handling, define a single error model across all REST and GraphQL endpoints. This simplifies client handling by applying consistent error semantics throughout the API surface.

What's the best way to validate data at module boundaries and public interfaces?

The best way to validate boundaries is enforcing validation at the API edge before processing. This protects internal logic and ensures data quality by satisfying typed input/output schemas.

Can I use contract-first design for both REST and GraphQL schemas?

Yes, contract-first design applies to both REST and GraphQL endpoints, as well as module boundaries. It enforces addition-only evolution, clear naming conventions, and documentation alignment across endpoints.

How do I evolve an API contract without introducing breaking changes?

To evolve an API contract without breaking changes, apply addition-only evolution rules. By defining the API surface before implementation, you ensure implementations follow predictable rules and maintain stability.

Why does my API surface become fragile as teams evolve?

APIs become fragile when teams evolve without clear contracts. Defining clear contracts first ensures implementations follow predictable rules, reducing misuse and preventing breaking changes across the public interface.