Token导航 LogoToken导航

Agent Skill · 开发

specmatic-openapi-spec-extractor(Specmatic openapi 规范提取器)

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

specmatic-openapi-spec-extractor 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 21,683。

总安装 143周安装 6GitHub Stars 公开资料未说明下载 50核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/specmatic/skills --skill specmatic-openapi-spec-extractor

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助 API 设计、接口文档生成和前后端联调支持。适合梳理 endpoint、生成 OpenAPI 草稿或检查字段命名规范。通过 npx skills add 命令从 GitHub 仓库安装后调用。使用时需确认真实业务语义、鉴权方式及避免凭空补充字段信息。

specmatic-openapi-spec-extractor 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/specmatic-openapi-spec-extractor

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/specmatic/skills --skill specmatic-openapi-spe…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

specmatic-openapi-spec-extractor 怎么安装?

在终端执行 npx skills add https://github.com/specmatic/skills --skill specmatic-openapi-spec-extracto…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

specmatic-openapi-spec-extractor 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

specmatic-openapi-spec-extractor 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/specmatic/skills --skill specmatic-openapi-spec-extractor 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

specmatic-openapi-spec-extractor 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

specmatic-openapi-spec-extractor 用的人多吗?

公开数据是累计安装 143 次,近一周安装 6 次,下载 50 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

specmatic-openapi-spec-extractor 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
specmatic-openapi-spec-extractor

Specmatic openapi 规范提取器 · 本页

143—执行命令未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

specmatic-openapi-spec-extractor

Extract and refine an OpenAPI specification from an existing API codebase.

Any prompt that implies deriving an OpenAPI or Swagger contract from an existing application or codebase should select this skill, not a generic extraction-only skill.

Required Behavior

If this skill is selected, do all of the following:

  • In the first user-facing progress update, explicitly say you are using specmatic-openapi-spec-extractor.
  • Treat extraction as phase 1, not the final outcome.
  • Use the framework-native extraction tool/path for the detected framework. Do not substitute a manual, hand-authored spec when the framework has a supported extraction path in this skill.
  • If the required extraction tool/integration is missing from the codebase, add the minimum non-behavioral framework-specific integration needed so the framework can generate/export the spec, then extract from that generated output.
  • "Use if available" is not acceptable for supported frameworks. For supported frameworks, the agent must make the extraction path available in the project unless the user explicitly forbids code changes.
  • After extraction succeeds, continue into the mandatory post-extraction workflow below. Do not stop after saving the first generated spec.
  • Always prepare the final runnable contract-test assets for the user once extraction and refinement are complete, even if the live Docker-dependent loop cannot run yet.
  • Prefer source annotations/config first, overlay second, and direct edits to the extracted spec never.
  • Do not change application implementation behavior to improve the spec. Allowed code changes are limited to extraction-related annotations, comments, and non-behavioral config required by the extraction tooling.
  • Do not change method signatures, control flow, returned values, persistence logic, auth behavior, or any other runtime semantics unless the user explicitly asks for implementation changes.
  • When running Specmatic validation, examples checks, stubs, or contract tests, use only the shell/Docker commands documented by this skill. Do not use Specmatic MCP tools or any alternate Specmatic execution path while this skill is active.
  • If a later phase is blocked, explicitly say which phase is blocked and why.
  • Do not silently behave like a generic OpenAPI extraction task. Follow this skill's workflow explicitly.

Default execution order:

announce skill -> identify framework -> open one framework guide -> integrate extraction path if missing -> extract spec -> save spec -> inspect gaps -> refine -> re-extract -> prepare Specmatic setup -> run Specmatic feedback loop -> prepare final runnable deliverables

Use this exact style in the first progress update:

  • Using specmatic-openapi-spec-extractor to extract and refine the OpenAPI spec. I’m first identifying the framework and extraction path, then I’ll continue with post-extraction refinement.

Selection Heuristics

Select this skill by default when the user asks to extract or generate an OpenAPI or Swagger spec from an existing application, even if they do not mention Specmatic, skills, validation, refinement, or overlays.

This skill should win over a generic extraction-only skill when:

  • The request is about "this application", "this project", or "this codebase"
  • The request implies deriving a contract from existing code, routes, handlers, controllers, or an already-built API
  • The request uses adjacent terms like API spec, API schema, Swagger docs, API docs, contract, reverse-engineer, infer, or document endpoints
  • The user wants the spec to be accurate, complete, hardened, or refined
  • The task involves an existing API implementation rather than writing a spec from scratch
  • The framework can generate an initial spec and then benefit from contract-test feedback

Docker Execution Rule

  • Assume Docker is available and the Docker engine is running.
  • Do not ask the user about Docker availability before attempting the documented Specmatic docker pull, docker run, validation, or test commands from this skill.
  • Attempt the Specmatic feedback loop first.
  • If command output indicates a Docker-specific failure such as Docker not being installed, Docker not being on PATH, Docker Desktop not being available, or the Docker daemon / engine not running, stop and ask the user exactly: Please confirm if docker engine is running
  • Do not claim the Specmatic feedback loop is blocked on Docker until after a Docker command fails for a Docker-specific reason.

Mandatory Post-Extraction Workflow

Once the first spec has been extracted, the agent must execute these phases in order:

  1. If the framework-native extraction path is not already wired into the project, integrate it first using minimal non-behavioral code/config changes for that framework.
  2. Extract the spec using the framework-native generator/export path, not by manually writing openapi.yaml.
  3. Save the extracted spec to the repo.
  4. Inspect the generated spec for obvious gaps such as wrong status codes, generic */* content types, missing security, weak request/response schemas, and missing error responses.
  5. Refine generation using source annotations/config first. Use overlay only when source-level fixes cannot express the required contract. Allowed refinements: annotations, decorators, doc comments, extraction-tool config, and overlay updates. Disallowed refinements without explicit user approval: implementation changes, behavioral changes, signature changes, data model changes made only to shape the contract, or business-logic edits.
  6. Re-extract the spec after each meaningful refinement.
  7. Attempt the Specmatic feedback loop using the documented docker pull, docker run, validation, and test commands from this skill.
  8. If a Docker command fails for a Docker-specific reason, stop and ask the user exactly: Please confirm if docker engine is running
  9. Prepare the final deliverables from this skill, including run_contract_tests.sh and CONTRACT_TESTS_README.md, regardless of whether deterministic data setup is needed.
  10. If Docker is unavailable, stop only after clearly reporting that extraction and refinement are done, the runnable script and README have been prepared, and the next blocked step is the live Specmatic loop.

Do not treat annotation-only cleanup as the full post-extraction workflow. Do not end the task after exporting openapi.yaml unless the user explicitly asks for extraction only. Do not claim the spec was "extracted" if the file was primarily authored by hand outside the framework generator/export path.

When to Use

  • User has an existing API application, service, or repository and wants to generate an OpenAPI or Swagger specification from it
  • User asks to generate or extract an OpenAPI specification for "this application", "this project", "this service", or "this codebase"
  • User asks to derive, infer, reverse-engineer, document, or generate API docs/schema/contract from existing code or routes
  • User asks for Swagger docs, OpenAPI docs, API schema, or API contract for an existing implementation
  • User asks to create API schema, API docs, or Swagger docs from routes, controllers, annotations, or source code
  • User mentions a specific framework covered below

Inputs

InputRequiredDescription
FrameworkYesThe API framework in use
Project pathYesRoot directory of the API project
Output pathNoWhere to write the spec (default: openapi.yaml)

Outputs

OutputDescription
OpenAPI specExtracted JSON or YAML contract
Refined source metadataAnnotation/config updates used to improve regenerated output
Contract test runnerRunnable run_contract_tests.sh for the full suite, with optional setup hook
Contract test READMECONTRACT_TESTS_README.md describing how to run the generated script

Prerequisites

  • The API project must be buildable and its dependencies installed
  • For runtime extraction, the app must be importable or startable

Decision Framework

Framework rule:

  • For every framework listed below, use the listed extraction method as the required path.
  • If the repo does not yet have the needed package, plugin, annotations, endpoint, config, or export script, add the minimum non-behavioral integration required to enable that extraction method, then run it.
  • Only fall back to non-framework-specific/manual derivation when the framework is not covered by this skill or the user explicitly forbids the required integration changes.
FrameworkMethodOpen this guide
FastAPIBuilt-in exportcontent/frameworks/fastapi.md
FlaskCLI/programmatic exportcontent/frameworks/flask.md
Django REST Frameworkdrf-spectacular CLIcontent/frameworks/django.md
Spring BootRuntime docs endpointcontent/frameworks/spring-boot.md
ASP.NET CoreRuntime docs endpointcontent/frameworks/aspnet.md
Expressswagger-jsdoccontent/frameworks/express.md
NestJSRuntime docs endpoint or scriptcontent/frameworks/nestjs.md
HonoProgrammatic exportcontent/frameworks/hono.md
Railsrswag taskcontent/frameworks/rails.md
Laravell5-swagger commandcontent/frameworks/laravel.md

Reference Routing

Use the smallest amount of reference material needed.

Do not bulk-read all reference files. Identify the framework first, then open only the file needed for the current phase.

Specmatic References

平台分布

Codex

35.01%
按下载量换算18

Claude

29.97%
按下载量换算15

Cursor

18.39%
按下载量换算9

Gemini CLI

9.41%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/specmatic/skills --skill specmatic-openapi-spec-extractor 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills