Zum Inhalt springen
Skillpedia
APIs & Server (Backend)18k · #10696

openapi-expert

Was er macht

Dieser Skill führt durch das Schreiben von OpenAPI-Spezifikationen, die Pfade, Schemata, Sicherheit und Antworten einer API beschreiben. Er ist für Backend- und API-Entwerfende gedacht, die anderen Entwicklern einen klaren Vertrag geben wollen.

Wann du ihn nutzt

  • ✓Wenn du eine neue API entwirfst und vor dem Programmieren einen klaren Vertrag willst.
  • ✓Wenn du eine bestehende API im OpenAPI-Format dokumentieren musst.
  • ✓Wenn du eine Spezifikation in der CI auf Fehler oder inkompatible Änderungen prüfen willst.

Link zum Skill

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/openapi-expert/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/openapi-expert/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Schreibe eine OpenAPI-Spezifikation für unsere Bestell-API mit versionierten Pfaden, wiederverwendbaren Schemata und klaren Beschreibungen.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill empfiehlt, die Spezifikation zuerst zu schreiben, Schemata über Referenzen wiederzuverwenden, die API zu versionieren und die Spezifikation mit Lint-Werkzeugen zu prüfen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

OpenAPI Expert

An API design architect with deep expertise in the OpenAPI Specification, RESTful API conventions, and the tooling ecosystem for validation, documentation, and code generation. This skill provides guidance for designing clear, consistent, and evolvable API contracts using OpenAPI 3.0 and 3.1, covering schema composition, security definitions, versioning strategies, and developer experience optimization.

Key Principles

  • Design the API specification before writing implementation code; the spec serves as the contract between frontend, backend, mobile, and third-party consumers
  • Use $ref extensively to define reusable schemas, parameters, and responses in the components section; duplication across paths leads to inconsistency and maintenance burden
  • Version your API explicitly through URL path prefixes (/v1/, /v2/) or custom headers; never break existing consumers by changing response shapes without a version boundary
  • Write meaningful descriptions for every path, parameter, schema property, and response; the spec doubles as your API documentation and should be understandable without reading source code
  • Validate the spec in CI using linting tools to catch breaking changes, missing descriptions, inconsistent naming, and schema errors before they reach production

Techniques

  • Structure the OpenAPI document with info (title, version, contact), servers (base URLs per environment), paths (endpoints), and components (schemas, securitySchemes, parameters, responses)
  • Compose schemas using allOf for inheritance (base object + extension), oneOf for polymorphism (exactly one match), and anyOf for flexible unions (at least one match)
  • Provide request and response examples at both the schema level and the media type level; tools like Swagger UI and Redoc render these prominently for developer reference
  • Define security schemes (Bearer JWT, API key, OAuth2 flows) in components/securitySchemes and apply them globally or per-operation with the security field
  • Distinguish path parameters (/users/{id}), query parameters (?page=2&limit=20), and header parameters for different use cases; path parameters identify resources, query parameters filter or paginate
  • Implement consistent pagination with limit/offset or cursor-based patterns, documenting the pagination metadata schema (total, next_cursor, has_more) in a reusable component
  • Generate server stubs and client SDKs using openapi-generator with language-specific templates; customize templates for your coding conventions

Common Patterns

  • Error Response Schema: Define a reusable error object with code (machine-readable string), message (human-readable), and details (array of field-level errors) applied consistently across all error responses
  • Polymorphic Responses: Use discriminator with oneOf to model responses that can be different types (e.g., a notification that is either an EmailNotification or PushNotification) with a type field
  • Pagination Envelope: Wrap list responses in a standard envelope with data (array of items), pagination (cursor or offset metadata), and optional meta (total count, timing)
  • Webhook Definitions: Use the webhooks section (OpenAPI 3.1) to document callback payloads your API sends to consumers, specifying the event schema and expected acknowledgment

Pitfalls to Avoid

  • Do not use additionalProperties: true by default; it makes schemas permissive and hides unexpected fields that may cause client parsing issues
  • Do not define inline schemas for every request and response body; extract them to components/schemas with descriptive names for reuse and clarity
  • Do not mix naming conventions (camelCase and snake_case) within the same API; pick one convention and enforce it with a linter rule
  • Do not skip providing enum descriptions; raw enum values like "PENDING", "ACTIVE", "SUSPENDED" need documentation explaining what each state means and what transitions are valid
Häufige Fragen

Warum die Spezifikation vor dem Code schreiben?

Die Spezifikation dient als Vertrag zwischen Frontend, Backend und anderen Nutzern, sodass sich alle zuerst auf die Form einigen.

Wie versioniere ich eine API?

Der Skill schlägt explizite Versionen im URL-Pfad oder in einem Header vor, damit bestehende Clients durch Änderungen nicht brechen.

Was braucht die Spezifikation über die Endpunkte hinaus?

Beschreibungen für jeden Pfad, jeden Parameter, jede Eigenschaft und jede Antwort, damit die Spezifikation als lesbare Dokumentation funktioniert.

Details

Originalbeschreibung des Autors

OpenAPI/Swagger expert for API specification design, validation, and code generation

repo: RightNow-AI/openfang

Beliebtheit

GitHub-Sterne
18k
Platz im Ranking
#10696
Lizenz
Apache-2.0
Aktualisiert
2.7.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills