Skip to content
Development
Agent

contract-and-openapi

The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to structure that document and what `scripts/lint-openapi.mjs` enforces.

From plugin
skills
954 skills54 agents

Claude Code

$ npx -y skills add vanara-agents/skills --agent claude-code

Agent definition

contract-and-openapi.md

Contract & OpenAPI

The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This reference covers how to structure that document and what `scripts/lint-openapi.mjs` enforces.

Why OpenAPI

  • It is the lingua franca: tooling generates client SDKs, mock servers, request validators, and docs

from it.

  • It forces you to be explicit about every status code and schema โ€” the things designers skip.
  • It is diffable, so a reviewer can see exactly what a change adds or removes.

Minimum viable document

Every OpenAPI doc must have these top-level fields, or downstream tooling rejects it:

openapi: 3.1.0           # the spec version โ€” required
info:
  title: Orders API      # required
  version: "1.0.0"       # required โ€” the API version, not the spec version
paths: {}                # required โ€” the endpoints (may start empty but must exist)
components:
  schemas: {}            # reusable schemas referenced via $ref

`scripts/lint-openapi.mjs` checks exactly these load-bearing fields on a doc supplied as **JSON** (no YAML parser dependency): `openapi` is present, `info.title` and `info.version` are non-empty strings, `paths` is an object, and every operation's responses carry at least a schema or description. Run it with `--selftest` to see it pass a valid doc and fail an invalid one.

Structure for reuse with `$ref`

Define each schema once under `components/schemas` and reference it. Define the **error envelope and common error responses once** and `$ref` them from every operation โ€” this is how you guarantee the "one error shape everywhere" rule mechanically rather than by discipline.

components:
  responses:
    Error:
      description: Standard error envelope
      content:
        application/json:
          schema: { $ref: "#/components/schemas/ErrorEnvelope" }
  schemas:
    Order:
      type: object
      properties:
        id: { type: string }
        status: { type: string, enum: [open, paid, refunded] }
    ErrorEnvelope:
      type: object
      properties:
        data: { nullable: true }
        error:
          type: object
          properties:
            code: { type: string }
            message: { type: string }
            details: { type: array, items: { type: object } }
            requestId: { type: string }

What to specify per operation

For every operation:

  • `summary` โ€” one line.
  • `parameters` โ€” path, query (incl. `limit`/`cursor` for lists), and headers (`Idempotency-Key`).
  • `requestBody` โ€” schema for write operations, `required: true` where applicable.
  • `responses` โ€” **every** status code, success and failure, each with a schema or `$ref`.
  • Auth via `security` referencing a `securityScheme`.

Checklist before emitting

  • [ ] Top-level required fields present (`openapi`, `info.title`, `info.version`, `paths`).
  • [ ] Shared schemas and error responses defined once and `$ref`-ed.
  • [ ] Every operation documents both success and error responses.
  • [ ] List operations declare `limit` + `cursor` (or `offset`) parameters.
  • [ ] The doc passes `node scripts/lint-openapi.mjs <doc.json>`.
Read more
@vanara-agents
Ships withskills

๐Ÿ’ Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code โ€” free, Apache-2.0, install with one command.

917 skills54 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
9
Star history of vanara-agents/skills on GitHub, a chart by star-history.com

Other agents on skills.

AGENT

AGENT

Agent

Use when designing a new HTTP/GraphQL API or changing an existing one โ€” modeling resources, defining endpoint contracts, choosingโ€ฆ

review-notes

review-notes

Agent

This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes theโ€ฆ

design-checklist

design-checklist

Agent

Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cuttingโ€ฆ

versioning-and-evolution

versioning-and-evolutiโ€ฆ

Agent

APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add withoutโ€ฆ

pr-comment-template

pr-comment-template

Agent

Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.

sample-review-output

sample-review-output

Agent

A complete review of a hypothetical PR, in the standard format. Use this as the model for tone, structure, and the anchor โ†’โ€ฆ

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UIโ€ฆ

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research acrossโ€ฆ

react3d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such asโ€ฆ

codex3d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hardโ€ฆ

caveman4d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about contract-and-openapi.

Which coding agents can use contract-and-openapi?
contract-and-openapi installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.