openapi-spec
Skill5 starsChanged 5 months agoMITView on GitHub
Write, generate, or review an OpenAPI 3.1 specification for an HTTP API so that it is accurate to the implementation, complete for consumers (schemas, examples, errors, auth, pagination), and usable by tooling (validation, client generation, mock servers). Covers design-first and code-first workflows, linting with Spectral, and keeping the spec in sync in CI. Use when documenting an API, when a client generator or contract test needs a spec, or when the existing spec no longer matches the routes.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- CrazyElephantX/OpenCodetheir own version, first seen Aug 10, 2026
- amjadjibon/skillstheir own version, first seen Jul 12, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- amjadjibon/skills★ 2same name
- CrazyElephantX/OpenCode★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository89 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- site/llms-full.txtllms.txt
- site/llms.txtllms.txt
- improveSkill
- academic-writingSkill
- benchmark-reportingSkill
- bibtex-managerSkill
- citation-graphSkill
- citation-verifierSkill
- design-science-methodologySkill
- docx-thesisSkill
- experiment-reproducibilitySkill
- latex-toolkitSkill
- literature-searchSkill
- lit-review-synthesisSkill
- paper-readerSkill
- proofread-academicSkill
- research-figuresSkill
- research-methodologySkill
- research-questionSkill
- statistics-advisorSkill
- supervisor-updateSkill
- systematic-reviewSkill
- thesis-proposalSkill
- coolify-image-appSkill
- coolify-vps-baselineSkill
- deploy-verificationSkill
- express-prisma-coolify-imageSkill
- ghcr-coolify-pipelineSkill
- live-domain-cutoverSkill
- nextjs-coolify-imageSkill
- proxy-client-addressSkill
- vps-ops-toolkitSkill
- adr-writingSkill
- readme-writingSkill
- technical-writingSkill
- adversarial-reviewerSkill
- api-design-reviewSkill
- code-review-responseSkill
- create-agentSkill
- create-commandSkill
- create-hookSkill
- create-skillSkill
- db-migration-safetySkill
- dependency-upgradeSkill
- dockerfile-best-practicesSkill
- error-handling-patternsSkill
- executing-plansSkill
- explain-codebaseSkill
- fix-ciSkill
- github-actions-pipelineSkill
- grill-with-docsSkill
- incident-postmortemSkill
- logging-and-observabilitySkill
- parallel-agentsSkill
- performance-optimizationSkill
- refactoring-recipesSkill
- solid-principlesSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Every operation: operationId (unique, verbNoun, used as the client method name), summary (one line), description (when behaviour needs it), …
- Very specific: line 41
Run spectral lint; fix errors, evaluate warnings.
- Very specific: line 42
Check examples validate against their schemas (openapi-examples-validator or Spectral's oas3-valid-media-example).
- Very specific: line 70
Keep the file split with $ref to components/ files once it passes a thousand lines, and bundle for publishing (redocly bundle).
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
infowith a real description, version (semver, bumped with breaking changes), contact.serversfor each environment, with variables for the base URL.securitySchemes(bearer JWT, API key header, OAuth2 flows) and a top-levelsecuritydefault, overridden per operation where public.- Every operation:
operationId(unique, verbNoun, used as the client method name),summary(one line),description(when behaviour needs it),tags(one per resource), parameters with types, formats, constraints, and examples, request body with schema and example, every response the server can send (200/201/204, 400, 401, 403, 404, 409, 422, 429, 500) with a schema. - One error schema used everywhere (RFC 9457 problem details:
type,title,status,detail,instance, pluserrors[]for validation). - Pagination described once (cursor or page/limit) as reusable parameters and a response envelope schema.
- Schemas in
components/schemaswithrequired,nullable(3.1:type: [string, "null"]),enum,format(date-time,uuid,email,uri),minimum/maxLength,readOnlyfor server-set fields,exampleorexampleson each. deprecated: truewith adescriptionsaying the replacement and the removal date.
Design rules that show up in the spec
- Resource nouns, plural, kebab-case paths:
/api/v1/order-items/{orderItemId}. - Ids as opaque strings (
format: uuidwhen true); never expose sequential integers unless they are the public key. - Filtering, sorting, and field selection as query parameters with documented syntax.
- Idempotency:
PUTandDELETEidempotent by definition;POSTcreates take anIdempotency-Keyheader when retries are expected. - Versioning in the path or an
Acceptheader, one scheme, stated ininfo.description. - Timestamps ISO 8601 UTC; money as integer minor units plus a currency code, never floats.
Reviewing an existing spec
- List the routes the code actually serves (framework route table,
grepfor the router) and diff againstpaths. Undocumented and phantom routes are the first findings. - For each operation, call it (or read the handler) and compare the real response shape and status codes with the spec.
- Run
spectral lint; fix errors, evaluate warnings. - Check examples validate against their schemas (
openapi-examples-validatoror Spectral'soas3-valid-media-example). - Generate a client (
openapi-generator-cli,openapi-typescript) and read the output; awkward names reveal missingoperationIds and inline schemas that should be components.
Minimal skeleton
openapi: 3.1.0
info: { title: Orders API, version: 1.2.0, description: ... }
servers: [{ url: https://api.example.com/v1 }]
security: [{ bearerAuth: [] }]
tags: [{ name: orders }]
paths:
/orders:
get:
operationId: listOrders
summary: List orders
tags: [orders]
parameters: [{ $ref: '#/components/parameters/Cursor' }, { $ref: '#/components/parameters/Limit' }]
responses:
'200': { description: A page of orders, content: { application/json: { schema: { $ref: '#/components/schemas/OrderPage' } } } }
'401': { $ref: '#/components/responses/Unauthorized' }
components:
securitySchemes: { bearerAuth: { type: http, scheme: bearer, bearerFormat: JWT } }
parameters: ...
responses: ...
schemas: ...Keep the file split with $ref to components/ files once it passes a thousand lines, and bundle for publishing (redocly bundle).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

