api-contract

Generate and validate OpenAPI 3.x and AsyncAPI specifications from source code or requirements.

22|4|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/weisser-dev/awesome-opencode --skill api-contract-weisser-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-contract
Source: https://github.com/weisser-dev/awesome-opencode/tree/main/cli-tool/templates/skills/api-contract
Command: npx skills add https://github.com/weisser-dev/awesome-opencode --skill api-contract-weisser-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires openapi-generator, asyncapi-validator, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the complexities of API specification management, ensuring consistency, compliance, and quality across your APIs.

Core Features & Use Cases

  • Spec Generation: Automate the creation of OpenAPI and AsyncAPI specifications from code or requirements.
  • Validation: Check for completeness and consistency of existing API specifications.
  • Standardization: Apply consistent naming conventions, error formats, and pagination patterns.
  • Use Case: Streamline the development of RESTful or asynchronous APIs, maintaining consistency in design and response handling.

Quick Start

Generate an OpenAPI spec for your existing API by running 'api-contract generate'.

Frequently Asked Questions about api-contract

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

FAQPage Schema
How do I generate OpenAPI specifications from existing source code?

You can generate OpenAPI specifications from source code automatically by running the 'api-contract generate' command. This analyzes your codebase to produce compliant OpenAPI 3.x specs, maintaining consistency in design and response handling without manual writing.

How do I validate and check consistency for an existing AsyncAPI specification?

To validate an AsyncAPI specification, this Skill checks for completeness and consistency. It verifies that your asynchronous API specs adhere to standardized naming conventions, error formats, and pagination patterns, highlighting any discrepancies in your design.

What is the best way to standardize API error formats and pagination patterns?

The best way to standardize API error formats and pagination is by applying consistent rules during spec generation and validation. This Skill enforces uniform naming conventions and pagination patterns across both OpenAPI and AsyncAPI definitions to streamline maintenance.

Does this API specification validation work with both OpenAPI and AsyncAPI?

Yes, API specification validation works with both OpenAPI 3.x and AsyncAPI formats. It checks for completeness and consistency across RESTful and asynchronous APIs, ensuring compliance with standardized error formats and pagination patterns.

Do I need openapi-generator and asyncapi-validator to automate API spec creation?

Yes, you need openapi-generator and asyncapi-validator dependencies to automate API spec creation. This Skill relies on these tools to generate and validate specifications from source code or requirements, ensuring compliance and quality.

Why does my API specification lack consistency across different endpoints?

Your API specification lacks consistency because naming conventions, error formats, and pagination patterns are often applied manually. Automating spec generation and validation standardizes these elements across all endpoints, solving complexities in API management and ensuring uniform design.