Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计通过

manage-openapi-overlays管理 openapi 覆盖

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

978

周安装

42

GitHub Stars

13

下载量

343
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:manage-openapi-overlays(管理 openapi 覆盖)
来源仓库:https://github.com/speakeasy-api/skills
仓库路径:skills/manage-openapi-overlays
安装命令:
npx skills add https://github.com/speakeasy-api/skills --skill manage-openapi-overlays
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/speakeasy-api/skills --skill manage-openapi-overlays

简介

用于辅助 API 设计和接口文档生成。

  • 适合梳理 endpoint 或检查字段命名规范。
  • 需确认业务语义和鉴权方式。manage-openapi-overlays 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 避免凭空补字段,应基于现有代码或样例。
  • 建议参考原始文档了解支持的格式类型。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

manage-openapi-overlays

Overlays let you customize an OpenAPI spec for SDK generation without modifying the source. This skill covers creating overlay files, applying them to specs, and using them to fix validation errors.

Content Guides

TopicGuide
OpenAPI Validationcontent/validation.md
Security Schemescontent/security-schemes.md

These guides cover validating specs, fixing common issues, and configuring authentication methods.

Authentication

Set SPEAKEASY_API_KEY env var or run speakeasy auth login.

When to Use

Use this skill when you need to manually work with overlay files:

  • Creating an overlay file from scratch with specific JSONPath targets
  • Applying an existing overlay file to a spec
  • Validating overlay syntax and structure
  • Comparing two specs to generate an overlay
  • Understanding overlay mechanics (actions, targets, update/remove)
  • Fixing lint issues via manual overlay creation
  • User says: "create overlay", "apply overlay", "overlay file", "manual overlay", "overlay syntax", "JSONPath targeting", "validate overlay"

NOT for: AI-powered naming suggestions (see improve-sdk-naming instead)

Inputs

InputRequiredDescription
Target specYesOpenAPI spec to customize or fix
CustomizationsDependsChanges to apply (groups, names, retries, descriptions)
Overlay fileDependsExisting overlay to apply (for apply workflow)
Lint outputHelpfulValidation errors to fix (for fix workflow)

Outputs

OutputDescription
Overlay fileYAML file with JSONPath-targeted changes
Modified specTransformed OpenAPI spec (when applying)

Commands

Generate an Overlay by Comparing Specs

speakeasy overlay compare -b <before-spec> -a <after-spec> -o <output-overlay>

Use this when you have a modified version of a spec and want to capture the differences as a reusable overlay.

Apply an Overlay to a Spec

speakeasy overlay apply -s <spec-path> -o <overlay-path> --out <output-path>

Validate an Overlay

speakeasy overlay validate -o <overlay-path>

Creating an Overlay Manually

Create an overlay file with this structure:

overlay: 1.0.0
info:
  title: My Overlay
  version: 1.0.0
actions:
  - target: "$.paths['/example'].get"
    update:
      x-speakeasy-group: example
      x-speakeasy-name-override: getExample

Each action has a target (JSONPath expression) and an update (object to merge) or remove (boolean to delete the target).

Example: SDK Method Naming and Grouping

overlay: 1.0.0
info:
  title: SDK Customizations
  version: 1.0.0
actions:
  - target: "$.paths['/users'].get"
    update:
      x-speakeasy-group: users
      x-speakeasy-name-override: list
  - target: "$.paths['/users'].post"
    update:
      x-speakeasy-group: users
      x-speakeasy-name-override: create
  - target: "$.paths['/users/{id}'].get"
    update:
      x-speakeasy-group: users
      x-speakeasy-name-override: get
  - target: "$.paths['/users/{id}'].delete"
    update:
      x-speakeasy-group: users
      x-speakeasy-name-override: delete
      deprecated: true

This produces SDK methods: sdk.users.list(), sdk.users.create(), sdk.users.get(), sdk.users.delete().

Example: Apply Overlay

# Apply overlay and write merged spec
speakeasy overlay apply -s openapi.yaml -o sdk-overlay.yaml --out openapi-modified.yaml

# Compare two specs to generate an overlay
speakeasy overlay compare -b original.yaml -a modified.yaml -o changes-overlay.yaml

Using in Workflow (Recommended)

Instead of applying overlays manually, add them to .speakeasy/workflow.yaml:

sources:
  my-api:
    inputs:
      - location: ./openapi.yaml
    overlays:
      - location: ./naming-overlay.yaml
      - location: ./grouping-overlay.yaml

Overlays are applied in order. Later overlays can override earlier ones. This approach ensures overlays are always applied during speakeasy run.

Common Fix Patterns

Use overlays to fix validation issues when you cannot edit the source spec.

IssueOverlay Fix
Poor operation namesAdd x-speakeasy-name-override to the operation
Missing descriptionsAdd summary or description to the operation
Missing tagsAdd tags array to the operation
Need operation groupingAdd x-speakeasy-group to operations
Need retry configAdd x-speakeasy-retries to operations or globally
Deprecate an endpointAdd deprecated: true to the operation
Add SDK-specific metadataAdd any x-speakeasy-* extension

Fix Workflow

# 1. Validate the spec to identify issues
speakeasy lint openapi --non-interactive -s openapi.yaml

# 2. Create an overlay file targeting each issue (see patterns above)

# 3. Add overlay to workflow.yaml under sources.overlays

# 4. Regenerate the SDK
speakeasy run --output console

Speakeasy Extensions Reference

Extensions (x-speakeasy-*) customize SDK generation. Apply them via overlays.

ExtensionApplies ToPurpose
x-speakeasy-retriesOperation or rootConfigure retry behavior
x-speakeasy-paginationOperationEnable automatic pagination
x-speakeasy-name-overrideOperationOverride SDK method name
x-speakeasy-groupOperationGroup methods under namespace
x-speakeasy-unknown-valuesSchema with enumAllow unknown enum values
x-speakeasy-globalsRootDefine SDK-wide parameters
x-speakeasy-custom-security-schemeSecurity schemeMulti-part custom auth

Retries

actions:
  - target: "$.paths['/resources'].get"  # Or "$" for global
    update:
      x-speakeasy-retries:
        strategy: backoff
        backoff:
          initialInterval: 500      # ms
          maxInterval: 60000        # ms
          maxElapsedTime: 3600000   # ms
          exponent: 1.5
        statusCodes: ["5XX", "429"]
        retryConnectionErrors: true

Pagination

Offset/Limit:

actions:
  - target: "$.paths['/users'].get"
    update:
      x-speakeasy-pagination:
        type: offsetLimit
        inputs:
          - name: offset
            in: parameters
            type: offset
          - name: limit
            in: parameters
            type: limit
        outputs:
          results: $.data
          numPages: $.meta.total_pages

Cursor:

actions:
  - target: "$.paths['/events'].get"
    update:
      x-speakeasy-pagination:
        type: cursor
        inputs:
          - name: cursor
            in: parameters
            type: cursor
        outputs:
          results: $.events
          nextCursor: $.next_cursor

Open Enums (Anti-Fragility)

Prevent SDK breakage when APIs return new enum values:

actions:
  - target: "$.components.schemas.Status"
    update:
      x-speakeasy-unknown-values: allow

For all enums (add x-speakeasy-jsonpath: rfc9535 at overlay root):

actions:
  - target: $..[?length(@.enum) > 1]
    update:
      x-speakeasy-unknown-values: allow

Global Headers

Add SDK-wide headers as constructor options:

actions:
  - target: $
    update:
      x-speakeasy-globals:
        parameters:
          - $ref: "#/components/parameters/TenantId"
  - target: $.components
    update:
      parameters:
        TenantId:
          name: X-Tenant-Id
          in: header
          schema:
            type: string

Result: client = SDK(api_key="...", tenant_id="tenant-123")

Custom Security Schemes

For complex auth (HMAC, multi-part credentials):

actions:
  - target: $.components
    update:
      securitySchemes:
        hmacAuth:
          type: http
          scheme: custom
          x-speakeasy-custom-security-scheme:
            schema:
              type: object
              properties:
                keyId:
                  type: string
                keySecret:
                  type: string
  - target: $
    update:
      security:
        - hmacAuth: []

With envVarPrefix: MYAPI in gen.yaml, generates env var support for MYAPI_KEY_ID, MYAPI_KEY_SECRET.

JSONPath Targeting Reference

TargetSelects
$.paths['/users'].getGET /users operation
$.paths['/users/{id}'].*All operations on /users/{id}
$.paths['/users'].get.parameters[0]First parameter of GET /users
$.components.schemas.UserUser schema definition
$.components.schemas.User.properties.nameName property of User schema
$.infoAPI info object
$.info.titleAPI title
$.servers[0]First server entry

What NOT to Do

  • Do NOT use overlays for invalid YAML/JSON syntax errors -- fix the source file
  • Do NOT try to fix broken $ref paths with overlays -- fix the source spec
  • Do NOT use overlays to fix wrong data types -- this is an API design issue
  • Do NOT try to deduplicate schemas with overlays -- requires structural analysis
  • Do NOT ignore errors that require source spec fixes -- overlays cannot solve everything
  • Do NOT modify source OpenAPI specs directly if they are externally managed
  • Do NOT use a speakeasy overlay create command -- it does not exist

Troubleshooting

ErrorCauseSolution
"target not found"JSONPath does not match spec structureVerify exact path and casing by inspecting the spec
Changes not appliedOverlay not in workflowAdd overlay to sources.overlays in workflow.yaml
"invalid overlay"Malformed YAMLCheck overlay structure: needs overlay, info, actions
YAML parse errorInvalid overlay syntaxCheck YAML indentation and quoting
No changes visibleWrong target pathUse $.paths['/exact-path'] with exact casing
Errors persist after overlayIssue not overlay-appropriateCheck if the issue requires a source spec fix instead
Overlay order conflictLater overlay overrides earlierReorder overlays in workflow.yaml or merge into one file

After Making Changes

After creating or modifying overlay files and adding them to workflow.yaml, prompt the user to regenerate the SDK:

Overlay configuration complete. Would you like to regenerate the SDK now with speakeasy run?

If the user confirms, run:

speakeasy run --output console

Overlay changes only take effect in the SDK after regeneration.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.88%
按下载量换算123

Claude

27.24%
按下载量换算93

Cursor

17.75%
按下载量换算61

Gemini CLI

9.14%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills