golang-swagger
golang swagger
What it does
- 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.
- swag: go install github.com/swaggo/swag/cmd/swag@latest
- → See samber/cc-skills-golang@golang-security for securing the Swagger UI endpoint in production (disable or gate with auth middleware).
- → See samber/cc-skills-golang@golang-grpc for gRPC — use grpc-gateway with its own OpenAPI generator instead of swag.
Requirements & configuration
- 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:
- // @description Type "Bearer" followed by a space and the JWT token.
- // API key in header
- // @tokenUrl https://example.com/oauth/token
Derived from the skill's own SKILL.md documentation · extracted 2026-07-23
golang-swagger FAQ
What does the golang-swagger skill do?
Golang OpenAPI/Swagger documentation with swaggo/swag — annotation comments (@Summary, @Param, @Success, @Router, @Security), swag init code generation, framework integrations (gin, echo, fiber, chi, net/http), security definitions (Bearer/JWT, OAuth2, API key), and struct tags (swaggertype, enums, example, swaggerignore). Apply when adding or maintaining Swagger/OpenAPI docs in a Go project, or when the codebase imports github.com/swaggo/swag, github.com/swaggo/gin-swagger, github.com/swaggo/echo-swagger, github.com/swaggo/http-swagger, or github.com/swaggo/files. 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.
What does golang-swagger require?
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: // @description Type "Bearer" followed by a space and the JWT token. // API key in header // @tokenUrl https://example.com/oauth/token
How do I install golang-swagger?
Run: npx -y skills add https://github.com/samber/cc-skills-golang --skill golang-swagger --agent claude-code — the source lives at github.com/samber/cc-skills-golang.
Maintain golang-swagger?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[](https://getagentictools.com/skills/samber-cc-skills-golang-golang-swagger?ref=badge) npx agentictools info skills/samber-cc-skills-golang-golang-swagger The second line is the CLI lookup for this page — handy in READMEs and docs.