
Go openapi
Guides Go REST APIs built spec-first with OpenAPI, oapi-codegen and contract tests
Go openapi is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 90
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Go openapi
This skill sets up Go REST services around an OpenAPI document as the single source of truth. It walks the agent through choosing a generator, pinning oapi-codegen as a Go tool, and generating server interfaces, models and an embedded spec from a YAML config, with a go:generate directive and a CI check that fails when generated files are stale.
It covers implementing the strict server interface so the compiler enforces documented responses, adding request validation middleware for constraints the generated types do not check, and using a single RFC 9457 Problem schema served as application/problem+json. It also covers linting the spec, requiring an operationId on every operation, and running oasdiff in CI to catch breaking changes against the main branch.
The guidance expects a Go toolchain and, when needed, the oapi-codegen, oasdiff and vacuum command-line tools, which the agent is allowed to run. Handler structure, gRPC and GraphQL are handled by separate skills.
When your agent uses it
Spec-first REST development in Go with OpenAPI: generating server interfaces and clients with oapi-codegen, request validation middleware, RFC 9457 error bodies, contract testing, and detecting breaking API changes. Use when the API has or should have an OpenAPI document, when wiring code generation into the build, or when a hand-written handler has drifted from its published contract. Trigger examples: "OpenAPI", "swagger spec", "oapi-codegen", "generate a client from the spec", "validate requests against the schema", "breaking API change". Not for: handler structure and shutdown (go-api-design), gRPC and protobuf (go-grpc), GraphQL schemas and resolvers (go-graphql).
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Instructions only, no scripts(see the files on GitHub)
- Asks for: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(gofmt:*), Bash(oapi-codegen:*)…(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 1 file (8 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Download the skill folder from https://github.com/eduardo-sl/go-agent-skills and copy it into your agent's skills folder.
What it does
- Generator selection
- Compares oapi-codegen, ogen and swag and explains when each fits an existing or new project.
- Build-integrated code generation
- Sets up a pinned generator, a YAML config and a go:generate directive with committed output.
- Strict server implementation
- Shows how to implement typed request and response interfaces with compile-time compliance checks.
- Request validation middleware
- Enforces schema constraints such as patterns, enums and required parameters at the HTTP boundary.
- Problem Details errors
- Defines one RFC 9457 error schema and how to return safe error titles and details.
- Breaking change detection
- Runs oasdiff against the base spec in CI and lists which changes count as breaking.
- Contract tests
- Drives a generated client against the real handler so spec drift fails the test suite.
Good for
- Generate Go server types and a client from an OpenAPI spec
- Add request validation to an existing net/http API
- Check whether a spec change breaks existing API clients
- Define a consistent RFC 9457 error response for a REST API
- Write contract tests that use the generated client
- Set up CI to fail when generated Go code is out of date
Go openapi FAQ
What does the skill need to run?
It requires the Go toolchain. oapi-codegen, oasdiff and a spec linter such as vacuum or spectral are installed on demand.
Does Go openapi change how my handlers are structured?
Handler structure and shutdown are covered by a separate go-api-design skill. This one focuses on the spec, generated code, validation, errors and tests.
Can I use Go openapi with chi or echo instead of net/http?
Yes. The config notes that oapi-codegen also supports chi-server and echo-server when those routers are in use.
Does Go openapi run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Go openapi?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Go openapi?
The closest alternatives to Go openapi are Openapi to application code, Openapi spec generator, Go API design, Openapi to application java spring boot and Go GraphQL.
Where this comes from
- Description: from the skill's own SKILL.md.
More from eduardo-sl/go-agent-skills

Guides Go agents in designing HTTP REST APIs, handlers, middleware and shutdown
- Open source
- 90 GitHub stars
- Developer tools

Reviews Go project structure, dependency direction and module boundaries
- Open source
- 90 GitHub stars
- Developer tools

Guides an AI agent to build Go command-line tools with clean flags, streams and exit codes
- Open source
- 90 GitHub stars
- Developer tools

Guides Go code toward constructor injection, explicit wiring and no global state
- Open source
- 90 GitHub stars
- Developer tools

Guides Go code toward idiomatic design patterns like functional options and factories
- Open source
- 90 GitHub stars
- Developer tools

Guides building Go GraphQL servers with gqlgen, covering N+1 batching and query limits
- Open source
- 90 GitHub stars
- Developer tools



