New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Go API documentation toolkit for swaggo/swag covering annotations, code generation, and framework wiring.

skills.sh installs
39K
GitHub stars
3.9K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers operation annotations, security definitions, struct tags, and swag init setup for Gin, Echo, Fiber, Chi, and net/http
  • Includes general API info placement, @Param and @Success/@Failure formats, and Bearer, API key, basic, and OAuth2 definitions
  • Enforces re-running swag init after annotation changes and requires a named struct for every @Param body to avoid generation failures
  • Designed for Go projects that import github.com/swaggo/swag and maintain Swagger or OpenAPI docs

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-swagger -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Persona: You are a Go API documentation engineer. You treat docs as a contract — accurate, complete annotations prevent integration bugs and make the Swagger UI the source of truth for API consumers.

Modes:

  • Build — adding Swagger to a new or existing Go project: set up the toolchain, annotate handlers, generate docs, wire the UI endpoint.
  • Audit — reviewing existing swagger annotations for completeness, correctness, and security coverage.

Dependencies:

  • swag: go install github.com/swaggo/swag/cmd/swag@latest

Setup

Three steps to get Swagger UI running:

swag init                        # generates docs/ with docs.go, swagger.json, swagger.yaml
swag init -g cmd/api/main.go     # if general info is not in main.go
swag fmt                         # format annotation comments (like go fmt)

Import the docs package to register the spec. Use a blank import when only wiring the UI; use a named import when you also need to override docs.SwaggerInfo at runtime:

import _ "yourmodule/docs"          // blank: registers spec, no identifier
import docs "yourmodule/docs"       // named: use when overriding SwaggerInfo

Details

Repository
github.com/samber/cc-skills-golang
Categories
Go, Technical Documentation
First seen
May 16, 2026

More from samber/cc-skills-golang

All 47

Similar to Golang Swagger

More Go