Skip to main content

Convert OpenAPI specifications to Agent Skills format

Project description

openapi-to-agent-skills

Convert OpenAPI specifications to Agent Skills format — structured markdown documentation optimized for AI agents.

Installation

pip install openapi-to-agent-skills

Usage

openapi-to-agent-skills <path-or-url-to-openapi-spec> [OPTIONS]

Options

Option Description Default
-o, --output Output directory ./output
-n, --name Skill name (derived from API title if omitted)
--include-tags Only include these tags (comma-separated)
--exclude-tags Exclude these tags (comma-separated)
--exclude-deprecated Exclude deprecated operations False
-t, --templates Custom templates directory
-a, --assets Static assets directory overlaid onto output
--exclude-paths Exclude paths matching prefixes (comma-separated)
-g, --group-by Grouping strategy: tags, path, auto auto
--case-strategy lowercase for case-insensitive filesystem safety
-f, --force Overwrite existing output directory False
-q, --quiet Suppress output except errors False

Examples

# From a local file
openapi-to-agent-skills api.yaml -o ./skills

# From a URL
openapi-to-agent-skills https://petstore3.swagger.io/api/v3/openapi.json -o ./skills

# Filter by tags
openapi-to-agent-skills api.yaml --include-tags users,orders

# Case-safe output for Windows/macOS
openapi-to-agent-skills api.yaml --case-strategy lowercase

Output Structure

<skill-name>/
├── SKILL.md                          # Entry point with YAML frontmatter
└── references/
    ├── authentication.md             # Auth schemes (if any)
    ├── resources/
    │   └── <tag>.md                  # One per resource group
    ├── operations/
    │   └── <operationId>.md          # One per operation
    └── schemas/
        └── <prefix>/
            ├── _index.md
            └── <SchemaName>.md       # One per schema

Programmatic Usage

from openapi_to_skills import convert_openapi_to_skill
from openapi_to_skills.types import ConvertOptions

import yaml

with open("api.yaml") as f:
    spec = yaml.safe_load(f)

convert_openapi_to_skill(spec, ConvertOptions(output_dir="./output"))

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openapi_to_agent_skills-0.3.2.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openapi_to_agent_skills-0.3.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

Details for the file openapi_to_agent_skills-0.3.2.tar.gz.

File metadata

  • Download URL: openapi_to_agent_skills-0.3.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for openapi_to_agent_skills-0.3.2.tar.gz
Algorithm Hash digest
SHA256 72ed494e56a275c09af545a52dc9f18aac8744a06242ec0fe1ac73b1fea1998a
MD5 a88d61e51739bd3b0a16904b008ff14b
BLAKE2b-256 ece4ce1ee218f47d8f687a0eae660ff1e1e2fbe1e31239c1cd2dcdd88162dbcd

See more details on using hashes here.

File details

Details for the file openapi_to_agent_skills-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for openapi_to_agent_skills-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ce87489251ce2f9d7c6ec193f98710060c4ee667a06b7d723696b4f08131854
MD5 067677f947151e285c24c9f5ee070e38
BLAKE2b-256 efa0f6ebd395f045fb46d05b95da3a9528ef9b61cc8e80807d30dd60bbead888

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page