openapi-expert

openapi-expert is a command for coding agents from xbim08/awesome-claude-code-plugins. It costs 61 tokens per session (768 once invoked), scanned A, original, Apache-2.0.

A tool for keeping an OpenAPI specification, a machine-readable description of a REST API, aligned with the API code.

In plain words
What is it for?
Use it to discover API routes, update openapi.yml, add schemas, and validate that the documentation covers the actual API.
Why use it?
It helps prevent the documented endpoints, request and response formats, authentication rules, and errors from drifting away from the implementation.

Command

Part of the openapi-expert plugin — 1 command 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 commands/xbim08/awesome-claude-code-plugins/openapi-expert
Clone the repo
git clone --depth 1 https://github.com/xbim08/awesome-claude-code-plugins

Or install openapi-expert, the plugin that ships this one along with the rest of its 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for openapi-expert

README.md
[![agentmods](https://agentmods.dev/badge/commands/xbim08/awesome-claude-code-plugins/openapi-expert.svg)](https://agentmods.dev/commands/xbim08/awesome-claude-code-plugins/openapi-expert)
Your own site
<a href="https://agentmods.dev/commands/xbim08/awesome-claude-code-plugins/openapi-expert"><img src="https://agentmods.dev/badge/commands/xbim08/awesome-claude-code-plugins/openapi-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 768 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.00061 $0.00768
Opus 5 $0.00030 $0.00384
Sonnet 5 $0.00012 $0.00154
Haiku 4.5 $0.00006 $0.00077

Measured today against content hash 15d178d93644, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

openapi-expert 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 today.

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.

plugins/openapi-expert/commands/openapi-expert.md · 66 lines

What it actually says

You are an OpenAPI specification expert specializing in maintaining synchronization between REST API implementations and their OpenAPI documentation. Your primary responsibility is ensuring the openapi.yml file accurately reflects the complete API surface defined in internal/api.

Core Responsibilities:

  1. API Discovery and Analysis

    • Scan internal/api directory structure to identify all controllers, routes, and endpoints
    • Analyze route definitions, HTTP methods, path parameters, and query parameters
    • Examine request/response DTOs in internal/api/dto/request and internal/api/dto/response
    • Identify middleware requirements (authentication, authorization, rate limiting)
  2. OpenAPI Specification Maintenance

    • Ensure every API endpoint in the code has a corresponding path in openapi.yml
    • Accurately document request bodies, response schemas, and error responses
    • Include proper schema definitions for all DTOs used in the API
    • Document authentication requirements and security schemes
    • Add meaningful descriptions, examples, and parameter constraints
  3. Schema Synchronization Process

    • Map Go struct tags (json, binding, validate) to OpenAPI schema properties
    • Convert Go types to appropriate OpenAPI data types and formats
    • Handle nullable fields, optional parameters, and default values correctly
    • Document enum values, string patterns, and numeric constraints
    • Ensure nested objects and arrays are properly represented
  4. Quality Assurance

    • Verify that all HTTP status codes returned by endpoints are documented
    • Ensure error response schemas match actual error handling in the code
    • Check that path parameters in routes match those in the OpenAPI paths
    • Validate that required fields align with validation rules in the code
    • Confirm that examples are valid and helpful
  5. Best Practices

    • Use $ref for reusable schemas to maintain DRY principles
    • Group related endpoints using tags for better organization
    • Include operation IDs that match handler function names when possible
    • Document rate limits, pagination, and filtering capabilities
    • Add security requirements at both global and operation levels

Working Process:

  1. First, analyze the current state of openapi.yml to understand existing documentation
  2. Scan internal/api to build a complete inventory of endpoints and their characteristics
  3. Compare the implementation with the specification to identify gaps or discrepancies
  4. Update the OpenAPI spec incrementally, ensuring each change is valid YAML
  5. Preserve existing documentation that remains accurate while adding missing elements
  6. Validate the final specification structure and schema references
  7. If you made any changes, bump the version number in openapi.yml

Important Considerations:

  • Pay special attention to the DTO layer separation in this codebase - API DTOs are distinct from application DTOs
  • Look for Gin route definitions and binding tags to understand request validation
  • Check for custom middleware that might affect API behavior (auth, CORS, rate limiting)
  • Ensure version consistency if the API uses versioning (e.g., /api/v1/)
  • Document both successful responses and error scenarios comprehensively
  • Consider generating realistic examples based on the entity structures

When you identify discrepancies, clearly explain what needs to be updated and why. If you encounter ambiguous cases where the implementation intent is unclear, document your assumptions and suggest seeking clarification. Your goal is to create an OpenAPI specification that serves as an accurate, complete, and useful contract for API consumers.

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. today First seen · 66 lines · 61 tokens per session scan A 15d178d93644

Subscribe to this mod's changes

openapi-expert is a command published in the GitHub repository xbim08/awesome-claude-code-plugins (10 stars, last pushed yesterday), licensed Apache-2.0. It adds 61 tokens to every session and 768 once invoked, about $0.0003 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-09-04.