AGENT
AgentUse when designing a new HTTP/GraphQL API or changing an existing one โ modeling resources, defining endpoint contracts, choosingโฆ
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.
Claude Code
$ npx -y skills add vanara-agents/skills --agent claude-code
Cursor
Cursor also loads subagents from .claude/agents, so copy this file there to use it in Cursor.
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 it.
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.
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 }For every operation:
๐ 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.
Use when designing a new HTTP/GraphQL API or changing an existing one โ modeling resources, defining endpoint contracts, choosingโฆ
This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes theโฆ
Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cuttingโฆ
APIs are forever once published: a consumer you've never met may depend on any field you expose. Design so you can **add withoutโฆ
Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.
A complete review of a hypothetical PR, in the standard format. Use this as the model for tone, structure, and the anchor โโฆ
Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hardโฆ