openapi-format
Original:🇺🇸 English
Translated
Configure and run openapi-format CLI workflows for OpenAPI/AsyncAPI documents. Use when you need to sort fields, filter operations/tags/flags/content, change casing, generate operationIds, apply overlays, convert OpenAPI versions (3.0/3.1 to 3.1/3.2), rename titles, split specs, bundle refs, or manage .openapiformatrc/--configFile driven formatting pipelines with minimal config overrides.
1installs
Sourcethim81/openapi-format
Added on
NPX Install
npx skill4agent add thim81/openapi-format openapi-formatTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →openapi-format
Follow this skill when a user asks to transform an OpenAPI document with the CLI.
openapi-formatCore workflow
- Identify the target outcome first.
- Determine exactly what should change: order, filtering, casing, generation, overlay, conversion, rename, output format, split.
- Determine input source (local file, remote URL, or overlay fallback).
extends
- Choose command shape.
- Prefer a single command with explicit input/output unless the user asks for stdout.
- Use for reusable workflows.
--configFile - Use for project defaults.
.openapiformatrc
- Keep config minimal.
- Start from defaults.
- Add only keys required for requested behavior.
- Avoid writing exhaustive config unless requested.
- Apply correct precedence.
- Load only when
.openapiformatrcis not supplied.--configFile - Load and merge values.
--configFile - Apply CLI options last.
- Normalize and
--no-sortinto--no-bundleandsort=false.bundle=false
- Respect processing order.
generate -> filter -> overlay -> sort -> casing -> convertTo -> rename -> write/split/stdout
- Produce the output safely.
- Use for file writes.
--output - If is true, require
--splitand treat it as split target root.--output - Use or
--jsonfor stdout output formatting.--yaml
Decision rules
Filter semantics
- Treat ,
methods,tags,operationIds,operations,flags,flagValues, andresponseContentas removal filters.requestContent - Treat ,
inverseMethods,inverseTags,inverseOperationIds,inverseFlags,inverseFlagValues, andinverseResponseContentas keep filters.inverseRequestContent - Use to remove unreferenced components recursively (iterative cleanup).
unusedComponents - Use to delete marker fields after filtering.
stripFlags
Overlay behavior
- Accept with
--overlayFile.actions - If input file is omitted and overlay has , use
extendsas effective input.extends - Resolve local relative to overlay file directory.
extends
Sorting and components
- Default sorting comes from .
defaultSort.json - controls path ordering (
sortPathsBy,original,path).tags - controls which component groups are alphabetized.
--sortComponentsFile - alphabetizes schema properties in
--sortComponentsProps.components.schemas.*.properties
Output constraints
- requires
--split.--output - only affects YAML comment preservation.
--keepComments - controls YAML line wrapping (
--lineWidthmeans unlimited).-1
Use references
Open only what is needed:
- for option behavior, defaults, and interactions.
references/feature-matrix.md - for minimal config templates.
references/config-patterns.md - for runnable command patterns.
references/command-recipes.md - for failure diagnosis and fixes.
references/troubleshooting.md
Delivery checklist
- Return the exact command(s) to run.
- Return minimal config file contents if config files are needed.
- Explain expected transformation result in plain terms.
- Call out side effects (component pruning, split output tree, version conversion changes).
- Highlight any assumptions (input path, output path, format, bundle behavior).