npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openapi-to-skills

v0.2.1

Published

Convert OpenAPI specifications to Agent Skills format with progressive disclosure

Readme

openapi-to-skills

Convert OpenAPI specifications into Agent Skills format - structured markdown documentation that minimizes context size for AI agents.

AI agents often need domain-specific knowledge to complete tasks. Rather than writing custom prompts or building MCP tools from scratch, leveraging existing API documentation is a practical approach - and OpenAPI is the de facto standard with battle-tested specifications maintained over years.

However, feeding raw OpenAPI specs to agents has limitations. Complex specifications can exceed LLM context limits, and even when they fit, loading the entire document for every request wastes valuable context.

Agent Skills solves this by structuring documentation for on-demand reading. Agents load only what they need - starting with an overview, then drilling into specific operations or schemas. Since file reading is a universal capability across agent frameworks, this approach works everywhere without special integrations.

Features

  • Semantic structure - Output organized by resources, operations, and schemas, enabling agents to load only relevant sections
  • Smart grouping - Operations grouped by tags or path prefix (auto-detected), schemas grouped by naming prefix
  • Filtering - Include/exclude by tags, paths, or deprecated status
  • Customizable templates - Override default Eta templates for custom output format

Usage

npx openapi-to-skills ./openapi.yaml -o ./output
# or
bunx openapi-to-skills ./openapi.yaml -o ./output

Options

| Option | Alias | Description | |--------|-------|-------------| | --output | -o | Output directory (default: ./output) | | --name | -n | Skill name (default: derived from API title) | | --include-tags | | Only include specified tags (comma-separated) | | --exclude-tags | | Exclude specified tags (comma-separated) | | --exclude-paths | | Exclude paths matching prefixes (comma-separated) | | --exclude-deprecated | | Exclude deprecated operations | | --group-by | -g | How to group operations: tags, path, or auto (default: auto) | | --templates | -t | Custom templates directory | | --force | -f | Overwrite existing output directory | | --quiet | -q | Suppress output except errors |

Output Structure

{skill-name}/
  SKILL.md                 # Entry point with API overview
  references/
    resources/             # One file per tag
    operations/            # One file per operation
    schemas/               # Grouped by naming prefix
    authentication.md      # Auth schemes (if any)

External References

If your OpenAPI spec contains external $ref references (e.g., ./common.yaml#/components/schemas/Error), bundle them first:

npx swagger-cli bundle ./api.yaml -o ./bundled.yaml
npx openapi-to-skills ./bundled.yaml -o ./output

Programmatic API

The package exports convertOpenAPIToSkill for integration into build pipelines or custom tooling:

import { convertOpenAPIToSkill } from 'openapi-to-skills';

const spec = { /* OpenAPI spec object */ };

await convertOpenAPIToSkill(spec, {
  outputDir: './output',
  parser: {
    skillName: 'my-api',
    filter: {
      includeTags: ['users', 'orders'],
      excludeDeprecated: true,
    },
  },
});

For advanced use cases, individual components (createParser, createRenderer, createWriter) are also exported.

Examples

Petstore (simple)

See examples/ for a simple demo with the classic Petstore spec (3 resources, 19 operations).

Stripe API (production-scale)

stripe-api-skills demonstrates real-world usage with the full Stripe API:

| Metric | Original | Agent Skills | |--------|----------|--------------| | Source | 1 file (7.2 MB) | 2,135 files | | Resources | - | 77 index files | | Operations | 588 (all in one) | 588 individual files | | Schemas | 1,315 (all in one) | 1,468 individual files |

A 7.2 MB monolithic spec becomes 2,135 focused files that agents can navigate on-demand.

Roadmap

  • [ ] Detect unresolved external $ref and warn users
  • [ ] Support fetching OpenAPI specs from URL

Contributing

Development guidelines are maintained in CLAUDE.md, designed as a shared reference for both human contributors and AI agents.

We welcome AI-assisted development. However, whether a patch is written manually or with AI collaboration, the author must fully review all changes before submission and take responsibility for the content.

License

Apache-2.0