go-api-docs

Generate OpenAPI specifications from Go swaggo annotations.

Updated Jan 18, 2026
One-click install
npx skills add https://github.com/333-333-333/agents --skill go-api-docs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-api-docs
Source: https://github.com/333-333-333/agents/tree/main/skills/go-api-docs
Command: npx skills add https://github.com/333-333-333/agents --skill go-api-docs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Efficiently derive OpenAPI specifications and service-level README conventions from Go code annotations, keeping API docs accurate with minimal manual editing.

Core Features & Use Cases

  • Swagger/OpenAPI generation from Go annotations using swaggo/swag
  • Per-service docs: each service maintains its own docs/swagger.json and README_TEMPLATE
  • Documentation consistency: keeps API docs and READMEs in sync with code changes (CI integration)

Quick Start

Run swag to generate OpenAPI docs from your Go code and review them in the docs directory.

Frequently Asked Questions about go-api-docs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate OpenAPI documentation from Go code annotations?

You can generate OpenAPI documentation from Go code by applying swaggo annotations to your handlers and models, then running swag to output swagger.json specifications into your docs directory.

How do I keep Swagger specs in sync with API changes in CI?

To keep Swagger specs synced with API changes in CI, configure your pipeline to run swag and regenerate the OpenAPI specifications whenever Go microservice code is updated, ensuring docs never drift.

Does this approach work for documenting individual Go microservices separately?

Yes, this approach works for individual Go microservices by maintaining a separate docs/swagger.json and README template per service, keeping each service's API documentation isolated and accurate.

What's the best way to maintain per-service API docs without manual editing?

The best way to maintain per-service API docs without manual editing is deriving OpenAPI specifications directly from Go swaggo annotations, keeping READMEs and Swagger specs automatically consistent with code.

Why are my swaggo annotations not showing up in the generated Swagger UI?

Swaggo annotations might not appear in Swagger UI if they are incorrectly formatted or placed outside the handler function, preventing swag from parsing your Go code into OpenAPI specifications.