openapi-speclisted
Install: claude install-skill KhaledSaeed18/dotclaude
An OpenAPI document is a contract. It is worth having only if it is true, so the first question is always how it stays in sync with the code: generated from annotations or types (code-first), or validated against the implementation in CI (design-first). Pick one and make the check mechanical.
## Workflow
**Code-first** (existing API, typed framework): generate from the source of truth. NestJS (`@nestjs/swagger` decorators), FastAPI (automatic from Pydantic models), Spring (springdoc), Go (`swag`, or `huma`/`oapi-codegen` design-first), Express or Hono with zod (`zod-openapi`, `@asteasolutions/zod-to-openapi`). Commit the generated file and diff it in CI so an undocumented route change fails the build.
**Design-first** (new API, multiple implementers): write `openapi.yaml` by hand, generate server stubs and clients from it, and add a contract test (Prism mock or Dredd/Schemathesis against the running server) so the implementation cannot drift.
Either way: `spectral lint openapi.yaml` in CI with the `spectral:oas` ruleset plus house rules.
## What a complete spec has
- `info` with a real description, version (semver, bumped with breaking changes), contact.
- `servers` for each environment, with variables for the base URL.
- `securitySchemes` (bearer JWT, API key header, OAuth2 flows) and a top-level `security` default, overridden per operation where public.
- Every operation: `operationId` (unique, verbNoun, used as the client method name), `summary` (one line), `descript