oas-generator

oas-generator is a skill for Claude Code from pactflow/pactflow-agent-skills. It costs 164 tokens per session (2,011 once invoked), scanned A, original, MIT.

A tool that generates an OpenAPI 3.x YAML description from a service's source code when no API specification exists. OpenAPI is a standard format describing HTTP routes, inputs, and outputs.

In plain words
What is it for?
Use it to discover routes in Ruby, Node.js, or Python services and create a specification for API path-coverage testing.
Why use it?
It provides a usable API description for testing when documentation is missing, while marking schemas that the code analysis cannot fully resolve.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the swagger-contract-testing plugin — 6 skills, 6 agents, 2 hooks, 1 MCP server shipped together

Good fit Use it to discover routes in Ruby, Node.js, or Python services and create a specification for API path-coverage testing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pactflow/pactflow-agent-skills/oas-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add pactflow/pactflow-agent-skills --skill oas-generator
Clone the repo
git clone --depth 1 https://github.com/pactflow/pactflow-agent-skills

Made for: Claude Code.

Or install swagger-contract-testing, the plugin that ships this one along with the rest of its 6 skills, 6 agents, 2 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for oas-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/pactflow/pactflow-agent-skills/oas-generator/github.svg)](https://agentmods.dev/skills/pactflow/pactflow-agent-skills/oas-generator)
Your own site
<a href="https://agentmods.dev/skills/pactflow/pactflow-agent-skills/oas-generator"><img src="https://agentmods.dev/badge/skills/pactflow/pactflow-agent-skills/oas-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for oas-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/pactflow/pactflow-agent-skills/oas-generator"><img src="https://agentmods.dev/badge/skills/pactflow/pactflow-agent-skills/oas-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 164 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,011 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00164 $0.02011
Opus 5.5 $0.00066 $0.00804
Sonnet 5.5 $0.00033 $0.00402
Haiku 4.5 $0.00016 $0.00201

Measured 15d ago against content hash 4de9e7822154, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

oas-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 15d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/swagger-contract-testing/skills/oas-generator/SKILL.md · 222 lines

How it starts

The opening of the file, as written. The whole thing — 222 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OAS Generator

Generates an OpenAPI 3.x YAML spec by statically analysing a provider codebase with ripwire. The spec may be incomplete (stubs for unresolvable schemas), but it will always be valid OAS and immediately usable for path-coverage testing.

Prerequisites: ripwire on PATH. If absent, check pact-coverage/references/install-ripwire.md.


Step 1 — Identify the framework

Run ripwire to get oriented, then infer the framework from the ranked output and config files:

ripwire <provider-root> --for="HTTP route definitions and request handlers"

Also check for framework config files in the project root:

  • Gemfile with sinatra or rails → Ruby
  • package.json with express, fastify, koa, or hapi → Node.js
  • pyproject.toml / requirements.txt with flask or fastapi → Python

If the framework is still ambiguous after these checks, ask the user.


Step 2 — Extract all routes

Use framework-specific patterns to find every route registration. Run all applicable patterns and deduplicate results. Use --regex= for these patterns: --grep= is a literal match, so alternation (a|b) silently returns zero hits.

Ruby — Rails

ripwire <root> --regex="resources|get '|post '|put '|patch '|delete '|namespace"

Also expand config/routes.rb to get the full route DSL, then trace each action to its controller method to find what each path actually maps to.

Ruby — Sinatra

ripwire <root> --regex="get '|post '|put '|patch '|delete '"

Each match is a route; the enclosing block is the handler. Note the in= attribute from grep hits to get the enclosing symbol name, then --expand it for the full handler body.

Node.js — Express / Fastify / Koa

ripwire <root> --regex='\.get\(|\.post\(|\.put\(|\.patch\(|\.delete\(|\.route\('

Also check for router objects (e.g. router.get() and app.use( with sub-routers.

Python — Flask

ripwire <root> --regex='@app\.route|@blueprint\.|@bp\.'

Read the full file on GitHub · 222 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 15d ago Changed · +1 lines 4de9e7822154
  2. 25d ago First seen · 221 lines · 164 tokens per session scan A 3735ab8871f3

Subscribe to this mod's changes

oas-generator is a skill published in the GitHub repository pactflow/pactflow-agent-skills (7 stars, last pushed yesterday), licensed MIT. It adds 164 tokens to every session and 2,011 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-22.

Related

Other skills, from other repositories