api-contract-normalizer

Standardizes API response envelopes, pagination, errors, and versioning across endpoints.

2|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/sathishssj3/NexVR-Engine --skill api-contract-normalizer-sathishssj3
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-contract-normalizer
Source: https://github.com/sathishssj3/NexVR-Engine/tree/main/.agents/skills/api-contract-normalizer
Command: npx skills add https://github.com/sathishssj3/NexVR-Engine --skill api-contract-normalizer-sathishssj3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? APIs built by different teams or over time often return inconsistent response shapes, pagination formats, error structures, and status codes, forcing frontend and API consumers to write special-case handling for every endpoint. ## Core Features & Use Cases - Standard Response Envelope: Defines shared TypeScript types (ApiResponse, ApiError, PaginatedResponse) so every endpoint returns the same success/data/error/meta structure. - Normalization Middleware: Provides Express middleware that automatically wraps responses and errors into the standard format without rewriting every route handler. - Pagination, Error Taxonomy & Versioning: Standardizes offset and cursor pagination, maps error codes to HTTP status codes, and sets up URL-based API versioning. - Migration Plan & OpenAPI Docs: Includes a phased rollout strategy and an OpenAPI specification so existing clients are not broken during adoption. - Use Case: A backend team with dozens of inconsistent REST endpoints uses this Skill to audit the inconsistencies, generate shared contract types, deploy normalization middleware, and publish a unified OpenAPI contract. ## Quick Start Ask the AI to audit the API endpoints in this repository and generate a standardized response contract with normalization middleware and a migration plan.

Frequently Asked Questions about api-contract-normalizer

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

FAQPage Schema
How do I standardize API response formats across endpoints?▼

Define a single response envelope with success, data, error, and meta fields, then apply normalization middleware that wraps every res.json call automatically. This converts existing endpoints to the standard format without rewriting each route handler.

What is the best pagination format for a REST API?▼

Use offset pagination with page, limit, total, total_pages, has_next, and has_prev fields for typical lists. For large datasets, use cursor-based pagination returning next_cursor, prev_cursor, and has_more to avoid performance issues with deep offsets.

How should API errors be structured in JSON responses?▼

Return a consistent error object with a machine-readable code, human-readable message, optional field-level details, and a trace_id for debugging. Map each error code to a fixed HTTP status code, such as VALIDATION_ERROR to 400 or RATE_LIMIT_EXCEEDED to 429.

How do I migrate an existing API to a new contract without breaking clients?▼

Use a phased rollout: deploy normalization alongside existing responses, add deprecation headers, support both old and new formats via a query parameter, switch the default, then remove the old format after an extended support period.

Should I use URL versioning or header versioning for APIs?▼

URL versioning such as /api/v1/users is recommended because it is explicit, easy to route, and simple to document. Header versioning via Accept headers works but is harder for consumers to discover and test.