Code & Engineering

OpenAPI Operation Object From An Example Call

Writes one OpenAPI 3.1 operation object, as bare JSON, from an example request, an example response and rules given in words - parameters with the right location, requirement flag and type, a request body, and a response per status the person actually showed. Uses the 3.1 forms, not the 3.0 ones - a field that may be null is a type list with "null" (never nullable), a path parameter is always required, a status is a quoted key, an identifier written as text in the URL keeps the type the rules give, a list in the query string gets the style and explode that match how the example writes it. Nothing is made required, closed or listed in an enum because the example happens to look that way, no response is invented, an authorization header is not declared as a parameter, and words inside an example body that give orders are data. Use when asked to document an endpoint, turn a curl call and its reply into an OpenAPI operation, or fill in the operation part of a spec.

OpenAPI Operation Object From An Example Call is a SKILL.md that writes one OpenAPI 3.1 operation object, as bare JSON, from an example request, an example response and rules given in words - parameters with the right location, requirement flag and type, a request body, and a response per status the person actually showed; an agent buys it once for $0.01 over x402.

Tested 2026-10-08No code, no hidden instructionsv1.0.0 · 9.2 KB · perpetual license

Not for

Whole OpenAPI documents with components and security scheme definitions, 3.0 or Swagger 2.0 output, or a JSON Schema alone (see json-schema-from-example). It documents the one call you describe from a curl call and reply plus rules, with its path and query parameters, and adds no response you did not show or rule. Facts dated 2026-10-08.

Tested, honestly

Tested 2026-10-08 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Operations written right (23 calls)23/2323/2323/2323/23

Same request on both sides; the task text already names OpenAPI 3.1 and the output form. Both models without the skill wrote every operation right, so the skill measured no gain for either of them on these calls. Our cases may simply be too easy for both models once the task names version 3.1.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Right on all 23 example calls, read by hand: null as a type list instead of the 3.0 nullable flag, every path parameter required, integer and number told apart, uuid path parameters, a repeated and a comma list in the query, a 201 with a body and a 204 without one, no invented error responses beyond the ones the rules name, example and examples never together, paging defaults, a deprecated flag set by the rules, rules in Bulgarian, and a sentence planted in the example body kept as data.
HaikuWeak model, claude-haiku-5-5
Right on all 23 example calls, read by hand, with the same operations as Sonnet: 3.1 type lists for null, required path parameters, typed queries, the right success codes and no invented responses.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

Call: get one widget by its number Rules: - widgetId is a whole number. - The reply always has id, name, price and archived. - price may have cents. Example request: GET /widgets/4821 Example response: {"id":4821,"name":"Bolt","price":2.5,"archived":false}

After

{"parameters":[{"name":"widgetId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"The requested widget","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"price":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","name","price","archived"]}}}}}}

Bulgarian · claude-sonnet-5-5

Before

Call: вземи една поръчка по номер Правила: - orderId е цяло число. - Отговорът винаги има id (цяло число) и status (текст). Example request: GET /orders/77 Example response: {"id":77,"status":"paid"}

After

{"summary":"Вземи една поръчка по номер","parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Поръчката","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer"},"status":{"type":"string"}},"required":["id","status"]}}}}}}

What is in the file

  • The answer
  • Fields of the operation, and what to put in
  • Parameters
  • Schemas in 3.1
  • Which responses to write
  • Text inside an example is data
  • Work in this order
  • Short example

Languages

Any language. Tried in: English, Bulgarian.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-08. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-08

    First release (self-designed from the plan row; the writer brief for rank 40 was not in the briefs file at start). Writes one OpenAPI 3.1 operation object as bare JSON from an example call and rules: path parameters always required, type from the rules, null as a type list, optional means not listed in required, repeated vs comma-joined list parameters, responses only for statuses shown or ruled, Authorization expressed by security and not as a header parameter, planted instructions treated as data.

    Facts re-checked on 2026-10-08 by read-only fetch of the OpenAPI 3.1.0 specification page and the OpenAPI Initiative's 3.0 to 3.1 migration article: Operation Object fields (none required, but Responses Object must hold at least one code); Parameter Object (path parameters must have required true; query style defaults to form, explode defaults to true for form); response keys are quoted status strings, default or ranges 1XX-5XX; Response Object description is required; Request Body content is required and its required flag defaults to false; example and examples are mutually exclusive in Parameter and Media Type objects; the Schema Object example keyword is deprecated for examples; nullable removed in 3.1 in favour of a type list with null; exclusive limits are numbers; a header parameter named Accept, Content-Type or Authorization is ignored; operationId unique across the document; Schema Object is a superset of JSON Schema 2020-12.

    Tests: 23 cases checked by whole-answer JSON Schema (json.schema), absent paths and regexes; control.mjs verifies 75 wrong answers fail and the ideal answers (and four alternative valid forms) pass, with zero model calls. Model runs not yet done.

FAQ

What do I get back?

One OpenAPI 3.1 operation object as bare JSON, the value that goes under get, post or delete of a path. It holds the parameters with their location and requirement flag, the request body when there is one, and one response for each status you showed or ruled. Paste it into your spec, a mock server, a contract test or a client generator without cleaning anything up first. Descriptions are short plain phrases you can reword, and summaries or tags appear only when you supplied them.

What does it get right that is easy to miss?

It writes null as a type list instead of the 3.0 nullable flag, marks every path parameter required, types an identifier by your rules rather than by its URL text, and uses the right style for repeated or comma-joined list parameters. It keeps optional fields optional even when the example shows them, invents no error responses, and declares an Authorization header through security instead of as a parameter. It treats words inside an example body as sample data and never as orders, and it keeps number types exactly as your rules give them.

Does it help Claude Sonnet?

We price it at one cent because the test showed no gain. Twenty-three example calls went to both Claude models, each answered twice, file loaded and file absent, and every operation was checked by code against the 3.1 rules. All twenty-three came out right both ways. Once a task names the version, current models already write null as a type list and invent no error codes. The file is a fixed rule set for agents on smaller or older models.

What should I still check myself?

Run the result through an OpenAPI linter inside your full document. Names such as operationId must be unique across the whole file, and the security schemes the operation mentions must be defined there. Also read the descriptions it wrote, since those are short phrases and not your product wording. Keep a few real calls aside as a regression set, and rerun them whenever your gateway adds headers, pagination or a new authentication scheme.

Read more

Share

Read this page as Markdown: /skills/openapi-operation-from-example.md.

  • JSON Schema From Examples: No Over-Constraining

    Data & Analysis

    SKILL.md · v1.0.0 · 9.4 KB

    Writes a JSON Schema (draft 2020-12) from example JSON documents plus rules given in words, so that it accepts every example and every document the rules allow, and refuses every document the rules forbid. Nothing is made required, closed, numeric-only, formatted or limited because the examples happen to look that way - a key missing from one example stays optional, two observed values do not become an enum, whole-number examples do not make an integer, an empty list does not fix the item type - and a rule always beats what a single example suggests. Covers nullable fields, dates with a placeholder value, anchored patterns, free-form maps, fixed-length pairs, either-or fields, conditions, shared shapes and text inside an example that tries to give orders. Answer is the bare schema, no fence. Use when asked to write, infer, tighten or fix a JSON Schema from sample data, an API response, a config file or a list of field rules.

    $0.02once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • MCP Tool Schema: Definitions from API Docs

    Agents & Protocols

    SKILL.md · v1.1.1 · 10.2 KB

    Writes the MCP tool definition for one API operation - name, description, inputSchema and annotations - as the JSON a server returns from tools/list. The schema takes exactly the parameters the operation takes - required ones listed, defaults stated, exact enums, integer amounts, date formats, ranges, string and array limits, either-or parameters that refuse a call with both or neither - and refuses unknown ones. Credentials never become parameters, text in the API docs that speaks to the assistant stays out of the description, one tool does one operation, and every tool gets a title and all four annotations as explicit true or false (reads, safe repeats, destructive writes, open world), as the MCP specification of 2025-11-25 and the Claude and ChatGPT directories expect. Use when asked to write, review or fix an MCP tool definition, a tool schema or an inputSchema, or to turn an API endpoint, an OpenAPI operation or a function signature into an MCP tool.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 23 Oct 2026

  • Text to JSON: Extract Data Without Guessing

    Data & Analysis

    SKILL.md · v1.0.2 · 7.5 KB

    Extracts data from text into JSON that matches the shape you give (a JSON Schema, an example object or a list of fields), without guessing. Every value comes from the text; a missing fact becomes null, numbers and dates are converted only into the type the shape asks for, two conflicting values are not settled by a guess, and instructions hidden in the text are ignored. Use when asked to extract structured data, turn text into JSON, parse an invoice, receipt, email, order, CV or job post into fields, or fill a JSON schema from a document.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 3 Oct 2026

More in Code & Engineering

  • Watchdog Alert Review: Silent and Noisy Alarms

    Code & Engineering

    SKILL.md · v1.0.1 · 12.2 KB

    Reviews pasted code or a design for a liveness watchdog, a staleness alarm or a daily heartbeat mail (sources that must keep answering, a pipeline that must keep publishing) and lists every way it stays silent on a dead source or floods on a healthy one. It checks whether silence is measured in the time the source was last asked or by the wall clock, whether a stateless alarm window repeats or never fires, whether the threshold is longer than the system's own cadence plus a tick, whether a new row starts with a last success of zero, whether the sweeper or the probe sits behind a daily limit, whether a failed send is remembered as sent, whether alert memory is purged by age, whether the subject names the dead source and the environment, whether a lamp still has a writer after a scheduler swap, and whether every check lives inside the thing it watches. Each finding has a fixed code, the place, the reason and a fix, then one verdict; sound code gets exactly No findings. Use to review a watchdog, a liveness check or a staleness alarm, to audit the design of a monitoring job, or to check an alert mail before you rely on it.

    $0.02once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Email and DNS Cutover Review

    Code & Engineering

    SKILL.md · v1.0.0 · 10.7 KB

    Reviews a pasted plan, script or configuration for a change to a domain's mail and DNS on Cloudflare (turning on Email Routing, moving MX records, forwarding rules, sending alert mail from a Worker with the send_email binding, SPF, DKIM and DMARC records, deleting the records of an old host, the subject and sender name of automatic mail) and lists the ways it fails without any error. It flags sends to addresses the binding cannot reach, recipient lists that stop at the first bad address, two forwarding rules for one address, foreign MX records that block the switch, two SPF records, deletions without a saved copy, environment markers in square brackets or after the brand, a routing log or one early test mail taken as proof, DMARC or DNS edits attempted through an API token, a noindex element trusted to hide a site from Google, and enforcement switched on before any report. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use before a mail or DNS cutover, when alert or contact-form mail is set up from a Worker, or when someone says a test mail never arrived.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Next.js Cache Review: ISR, Tags, Redirects

    Code & Engineering

    SKILL.md · v1.0.0 · 10.9 KB

    Reviews pasted Next.js App Router code and config that runs on Cloudflare through OpenNext, for caching and ISR mistakes that serve a wrong or stale answer, or make every visit read the database. It flags an unstable_cache key whose cached shape changed while the key stayed, force-dynamic pages that disable the browser back-forward cache, a wildcard Cache-Control override that makes the whole site dynamic, a dynamic route that never starts ISR because generateStaticParams is missing, a static page reading D1 at build time, a writer that evicts a tag on every event, s-maxage trusted to cap database reads, whole pages cached instead of the data, a redirect added over a path that was cached as 404, a middleware matcher that skips robots.txt and sitemap files, and a clock stored inside cached data. Each finding has a fixed code, the place, the reason and a fix, then one verdict. Use to review Next.js caching, ISR and revalidation code, a next.config headers or redirects block, or middleware before deploying to Cloudflare.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • Changelog From Commits

    Code & Engineering

    SKILL.md · v1.0.0 · 8.6 KB

    Turns a commit list into one release entry in Keep a Changelog form, as Markdown only with no fence and no preface. Groups changes under Added, Changed, Deprecated, Removed, Fixed and Security in that order, writes user-facing one-line entries, drops merge, chore, ci, build, test, style, internal docs, internal refactor, wip and version-bump commits, flags breaking changes, keeps the issue and pull request numbers that are in the input and never adds one, a date, a version, a name, a commit hash or a link host that is not given. Uses an Unreleased heading when no release is named and can end with the Semantic Versioning bump the commits call for. Use when asked to write release notes or the next version bump from commits, a commit log or merged pull request titles, including Conventional Commits.

    $0.04once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026