golang-swagger

golang-swagger is a skill for Claude Code from alexastrum/skl. It costs 146 tokens per session (2,193 once invoked), scanned A, a copy of golang-swagger, MIT.

A Go API documentation workflow for describing HTTP endpoints and generating OpenAPI/Swagger files and a Swagger UI. OpenAPI is a common format that explains how an API can be used.

In plain words
What is it for?
Use it to add or review annotations on Go API handlers, generate documentation with swag, and connect a Swagger UI endpoint in Gin, Echo, Fiber, Chi, or net/http applications.
Why use it?
It removes the need to write and maintain API documentation by hand, helping keep the documented endpoints, parameters, responses, and security rules aligned with the code.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; mentions Claude Code; installed under .agents/ (shared by several agents).

Good fit Use it to add or review annotations on Go API handlers, generate documentation with swag, and connect a Swagger UI endpoint in Gin, Echo, Fiber, Chi, or net/http applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alexastrum/skl/golang-swagger
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add alexastrum/skl --skill golang-swagger
Clone the repo
git clone --depth 1 https://github.com/alexastrum/skl

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for golang-swagger

README.md
[![agentmods](https://agentmods.dev/badge/skills/alexastrum/skl/golang-swagger/github.svg)](https://agentmods.dev/skills/alexastrum/skl/golang-swagger)
Your own site
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-swagger"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/golang-swagger/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for golang-swagger

Your own site · 80×15
<a href="https://agentmods.dev/skills/alexastrum/skl/golang-swagger"><img src="https://agentmods.dev/badge/skills/alexastrum/skl/golang-swagger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 146 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,193 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00146 $0.02193
Opus 5 $0.00073 $0.01097
Sonnet 5 $0.00029 $0.00439
Haiku 4.5 $0.00015 $0.00219

Measured 11d ago against content hash 5ac1592d9632, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

golang-swagger scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to golang-swagger — 18 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/golang-swagger/SKILL.md · 225 lines

How it starts

The opening of the file, as written. The whole thing — 225 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

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

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))

// net/http
mux.Handle("/swagger/", httpSwagger.Handler(swaggerFiles.Handler))

// Chi
r.Get("/swagger/*", httpSwagger.Handler(swaggerFiles.Handler))

Access the UI at /swagger/index.html.

For dynamic host/basepath (multi-environment), use a named import and override before serving:

import docs "yourmodule/docs"

docs.SwaggerInfo.Host     = os.Getenv("API_HOST")
docs.SwaggerInfo.BasePath = "/api/v1"

Full CLI reference

General API Info

Place in main.go (or the file passed via -g). These annotations define the top-level spec:

// @title           My API
// @version         1.0
// @description     Short description of the API.
// @host            localhost:8080
// @BasePath        /api/v1
// @schemes         http https

// @contact.name    API Support
// @contact.email   [email protected]
// @license.name    Apache 2.0

// @securityDefinitions.apikey Bearer
// @in header
// @name Authorization
// @description Type "Bearer" followed by a space and the JWT token.

Read the full file on GitHub · 225 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 225 lines · 146 tokens per session scan A 5ac1592d9632

Subscribe to this mod's changes

golang-swagger is a skill published in the GitHub repository alexastrum/skl (11 stars, last pushed 3mo ago), licensed MIT. It adds 146 tokens to every session and 2,193 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to golang-swagger, differing in 18 lines, and is treated as a copy.

Related

Other skills, from other repositories

printing-press

Set up a new integration, connector, or CLI binding for any API. Wrap or generate a ship-ready Go CLI from an OpenAPI, HAR, or Postman spec via the lean research -> generate -> build -> shipcheck loop. Use when the user says build a CLI, wrap this API, set up a new integration, add a connector, integrate with a…

mvanhorn/cli-printing-press · 86 tokens

gograph

Go repository intelligence for Claude Code. Use when reading, navigating, editing, reviewing, or refactoring a Go codebase. Exposes 64 query, analysis, and workflow capabilities through the local gograph MCP server, including bounded first-call exploration, AST-aware call graphs, blast-radius analysis, impact, and…

ozgurcd/gograph · 69 tokens

go

Use when writing, reviewing, testing, or shipping Go code and HTTP services: idioms, %w error wrapping, goroutine/context/errgroup concurrency, net/http 1.22 routing, log/slog, project layout, table-driven tests, Go hardening. NOT language-agnostic threat modeling (that is secure-coding), NOT Dockerfile/CI shipping…

ericrisco/rsc-harness · 86 tokens

Cursor rules for Go development with backend scalability

Skill "Cursor rules for Go development with backend scalability" from AmariahAK/atlarix-skills, covering cursor rules for go development with backend scalability, when to use this skill and source.

AmariahAK/atlarix-skills · 8 tokens

Go Patterns

Use this skill when building Go services/CLIs and you want practical patterns for package layout, error handling, concurrency, and testing that keep code readable and reliable.

AmariahAK/atlarix-skills · 2 tokens

Cursor rules for Go development with ServeMux REST API integration

Skill "Cursor rules for Go development with ServeMux REST API integration" from AmariahAK/atlarix-skills, covering when to use this skill and source.

AmariahAK/atlarix-skills · 11 tokens