fix-spec

A preview-first tool for correcting common problems in OpenAPI specification files, which describe web APIs.

In plain words
What is it for?
Use it to add missing path-parameter settings, rename generic schemas, deduplicate operation IDs, remove unused content, or create placeholders for missing references.
Why use it?
It shows the proposed changes before applying them, making it easier to review fixes and avoid changing a specification unexpectedly.

Skill for Claude CodeCodex

Part of the oastools plugin — 5 skills, 1 hook shipped together

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.

agentmods
npx agentmods add skills/erraggy/oastools/fix-spec
Any agent
npx skills add erraggy/oastools --skill fix-spec
Clone the repo
git clone --depth 1 https://github.com/erraggy/oastools

Made for: Claude Code, Codex.

Or install oastools, the plugin that ships this one along with the rest of its 5 skills, 1 hook.

Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00016 $0.00610
Opus 5 $0.00008 $0.00305
Sonnet 5 $0.00003 $0.00122
Haiku 4.5 $0.00002 $0.00061

Measured 3d ago against content hash 0b4ad284041e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-spec 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 3d 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.

plugin/skills/fix-spec/SKILL.md · 80 lines

How it starts

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

Fix an OpenAPI Specification

Step 1: Preview fixes with dry run

Always start with a dry run to see what would change:

{
  "spec": {"file": "<path>"},
  "dry_run": true
}

Include any specific fix flags the user requested:

  • fix_schema_names -- Rename generic names like Object1, Model2 to meaningful names
  • fix_duplicate_operationids -- Deduplicate operationId values
  • prune -- Remove empty paths and unused schemas
  • stub_missing_refs -- Create stub schemas for missing $ref targets

If no specific flags are given, the tool applies the default fixes: adding missing path parameters, and setting required: true on path parameters that omit it.

Step 2: Present the preview

Show the user a clear summary of planned fixes:

  • Number of fixes that will be applied
  • For each fix: what it changes, where (JSON path), and why

Paginating large fix lists

Results are paginated (default limit: 100). When returned < fix_count, there are more fixes:

{"spec": {"file": "<path>"}, "dry_run": true, "offset": 100, "limit": 100}

✅ Page through all fixes so the user gets a complete picture before confirming. Group fixes by type for readability (e.g., "842 missing path parameters, 12 duplicate operationIds").

Ask the user to confirm before proceeding. If they want to exclude certain fixes, adjust the flags accordingly.

Step 3: Apply fixes and persist

Run the fix tool without dry_run, using output to write the result to disk:

{
  "spec": {"file": "<path>"},
  "output": "<output-path>",
  "fix_schema_names": true
}

⚠️ Important: The fix tool does not modify the input file. Without output, the fixed document only exists in the response (when include_document: true). Always use output to persist the result for subsequent steps.

For in-place updates, set output to the same path as the input file. Add "include_document": true if the user also wants to see the full corrected spec in the response.

Step 4: Validate the result

Read the full file on GitHub · 80 lines

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. 3d ago First seen · 80 lines · 16 tokens per session scan A 0b4ad284041e

Subscribe to this mod's changes

fix-spec is a skill published in the GitHub repository erraggy/oastools (5 stars, last pushed 5d ago), licensed MIT. It adds 16 tokens to every session and 610 once invoked, about $0.0001 per session on Opus 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-08-31.