Install any skill in seconds. Free to start, no credit card required.
Get Started Free →samber/golang-swagger
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/ec
Passed 20 of 22 test cases with the skill, and 15 of 22 without it.
and 3 more in the full report
5 fixed15 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 5 test cases the skill fixed. Same model, same prompt, with and without the skill.
We need to define top-level OpenAPI security annotations in `main.go` for an OAuth2 Authorization Code flow named `OAuth2`. The authorize URL is `https://auth.example.com/oauth/authorize` and the token URL is `https://auth.example.com/oauth/token`, with scope `read` ("Read access"). Show the required `@securityDefinitions` comments.
| Checked | Without skill | With skill |
|---|---|---|
| Defines the flow using @securityDefinitions.oauth2.authorizationCode OAuth2 | Missed | Passed |
| Includes the @authorizationUrl annotation under the security definition | Passed | Passed |
The instructions your model reads when the skill loads.
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:
Dependencies:
go install github.com/swaggo/swag/cmd/swag@latestThree 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
Wire the UI endpoint — pick your framework:
// Gin
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
// Echo
e.GET("/swagger/*", echoSwagger.WrapHandler)
// Fiber
app.Get("/swagger/*", fiberSwagger.WrapHandler(swaggerFiles.Handler))
test cases passed, vs 15 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.