golang-swagger

Generate Swagger/OpenAPI documentation from Go code annotations.

23|1|Updated May 10, 2026
One-click install
npx skills add https://github.com/berksunduri/GOPost --skill golang-swagger-berksunduri
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-swagger
Source: https://github.com/berksunduri/GOPost/tree/main/.agents/skills/golang-swagger
Command: npx skills add https://github.com/berksunduri/GOPost --skill golang-swagger-berksunduri

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires go, swag, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the generation of Swagger/OpenAPI documentation for Go projects, simplifying the process of creating and maintaining API documentation.

Core Features & Use Cases

  • Automated Documentation: Generates Swagger/OpenAPI documentation from Go code annotations.
  • Framework Integration: Supports various Go web frameworks (Gin, Echo, Fiber, Chi, net/http).
  • Security and Validation: Handles security definitions and struct tags for Bearer, JWT, OAuth2, and API key authentication.
  • Use Case: When adding or maintaining Swagger/OpenAPI documentation in a Go project, especially when using the swaggo/swag library.

Quick Start

Run the 'swag init' command in your Go project directory to generate the documentation.

Frequently Asked Questions about golang-swagger

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

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

To generate Swagger documentation from Go code, you use the swaggo/swag library to parse general API annotations and struct tags. Running the 'swag init' command in your project directory automates the OpenAPI documentation generation process.

Does swaggo/swag work with Go web frameworks like Gin and Echo?

Yes, swaggo/swag works with various Go web frameworks including Gin, Echo, Fiber, Chi, and net/http. It parses framework-agnostic annotations from your Go code to generate compatible Swagger and OpenAPI documentation.

How do I document JWT and Bearer token authentication in OpenAPI for Go?

You document JWT and Bearer token authentication by adding specific security definitions and struct tags to your Go code. This Skill handles Bearer, JWT, OAuth2, and API key authentication automatically during the Swagger generation process.

What do I need to run swag init for OpenAPI code generation?

You need the Go environment and the swag CLI installed to run 'swag init' for OpenAPI code generation. The command scans your Go project directory for annotations and outputs the Swagger documentation files.

Why is my Swagger documentation not updating after changing Go annotations?

Swagger documentation fails to update if you do not rerun the generation process after changing Go annotations. You must execute 'swag init' in your project directory to regenerate the OpenAPI files from your updated code.