Openapi to llmstxt
Convert OpenAPI JSON specifications to llms.txt format. Use for: generating LLM-friendly documentation from API specs, filtering API documentation by tags, or extracting schema-only documentation for LLM context. By default it will convert fully the entire OpenAPI spec.From its SKILL.md
npx -y skills add ducva/awesome-agents --skill openapi-to-llmstxtAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.8 KB, as published. Nobody here has run it
OpenAPI to llms.txt Converter
This skill provides a streamlined workflow for converting complex OpenAPI (Swagger) JSON specifications into the llms.txt format, which is optimized for consumption by Large Language Models.
Workflow
- Obtain OpenAPI JSON: Ensure you have the local path to the OpenAPI JSON file.
- Identify Requirements: Determine if the user wants the full API, specific tags, only endpoints or only the schemas.
- Run Conversion: Use the provided script to generate the
llms.txtfile.
Usage
Full Conversion
To convert the entire OpenAPI spec:
python3 ./scripts/convert.py input.json llms.txt
Filter by Tags
To include only specific tags (e.g., "Actions", "Users"):
python3 ./scripts/convert.py input.json llms.txt --tags Actions Users
Schemas Only
To generate a file containing only the data models (schemas) related to specific tags:
python3 ./scripts/convert.py input.json llms.txt --tags Actions --schemas-only
Script Details
The convert.py script handles:
- Recursive Schema Resolution: When
--schemas-onlyis used, it automatically finds all nested schemas referenced by the selected endpoints. - llms.txt Compliance: Generates H1 titles, blockquote summaries, and H2 sections as per the standard.
- Optional Section: Places detailed parameters or full schema definitions in the
## Optionalsection to allow for context window management.