PlugWiki

golang-swagger Skill for Claude: What It Does and How to Install It

Makes Claude add OpenAPI and Swagger docs to a Go API with swaggo/swag, from annotations to a working Swagger UI.

Installs
37.9K
on skills.sh
Stars
3.7K
on GitHub
Files
2
besides SKILL.md
Updated
Nov 2026
last repo commit

This skill covers swaggo/swag. Claude writes the annotation comments (@Summary, @Param, @Success, @Router, @Security), runs swag init to generate the docs/ package and wires a Swagger UI route.

It loads when you add or maintain Swagger docs, or when code imports a swaggo package. The skill says it requires Go and the swag CLI.

Good for

  • Go developers documenting a REST API
  • Teams using gin, echo, fiber, chi or net/http
  • Anyone adding Bearer, OAuth2 or API key security to API docs

Install golang-swagger

Claude Code

  1. 1

    Copy this prompt.

    Install the golang-swagger skill in Claude Code. Run this command:
    
    npx skills add https://github.com/samber/cc-skills-golang --skill golang-swagger
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

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.

Sections in SKILL.md

  1. Setup
  2. General API Info
  3. Operation Annotations
  4. Security Definitions
  5. Struct Tags
  6. Common Mistakes
  7. Cross-References

Key facts

Author
samber
License
MIT
Installs on skills.sh
37,903 (Nov 2, 2026)
Last repo commit
Nov 1, 2026
Skill version
1.1.2
Library version covered
2.0.0-rc5

What it includes

  • Add Swagger to a project, or review existing annotations

    Build sets up the toolchain, annotates handlers, generates docs and wires the UI endpoint. Audit reviews existing annotations for completeness, correctness and security coverage.

    Write · Build and Audit modes

  • swag init, swag fmt and the docs import

    SKILL.md lists go install github.com/swaggo/swag/cmd/swag@latest as a dependency. swag init generates docs.go, swagger.json and swagger.yaml. swag fmt formats annotation comments.

    Try: “Add Swagger docs to this gin API and serve them at /swagger.”

    Runs code · Setup

  • Title, version, host and base path annotations

    Sets the top-level info. A named docs import lets you override host and base path at runtime.

    Write · General API info

  • @Summary, @Param, @Success, @Router, @Security

    Describes each endpoint in comments above the handler.

    Write · Operation annotations

  • Wires the UI for gin, echo, fiber, net/http or chi

    Serves the UI at /swagger/index.html.

    Write · Swagger UI route

  • Bearer/JWT, OAuth2 and API key

    Adds security schemes to the generated spec.

    Write · Security definitions

  • swaggertype, enums, example, swaggerignore

    Controls how Go types appear in the spec.

    Write · Struct tags

  • Checklist of annotation and generation errors

    Short list of frequent errors to avoid.

    Read · Common mistakes

From the official docs

Permissions

Low risk

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It installs the swag CLI from GitHub

    SKILL.md lists go install github.com/swaggo/swag/cmd/swag@latest as a dependency and in its install metadata. That downloads and builds third-party code at the latest version. Check the version it installs. github.com

  • It lists git and shell commands as allowed tools

    The allowed-tools line covers any go, golangci-lint and git command (git:*), not just read ones. Keep Claude Code's permission prompts on for git commands that change history. github.com

  • It may fetch web pages or query Context7

    It lists WebFetch and the Context7 tools as allowed. Library names and questions can leave your machine. Do not put secrets in prompts about this code. github.com

  • swag init writes generated files to your project

    It creates a docs/ folder with docs.go, swagger.json and swagger.yaml. Decide whether to commit them. github.com

  • The Swagger UI can expose your API in production

    SKILL.md points to the golang-security skill for disabling the UI or gating it with auth middleware in production. github.com

Security advisories

No published security advisories as of Nov 2, 2026.

Technical details
Turning on read-onlyNo read-only mode in SKILL.md. Use version control.
Talks toWebFetch is listed as an allowed tool. Library lookups go to Context7 if the Context7 MCP server is installed (the skill uses it as a fallback). go install downloads the swag module
Sign-in and keysSKILL.md does not mention any account or key.
Scopes
  • Reads and edits files in your Go project

  • SKILL.md lists these as allowed tools: go, golangci-lint, git, godig and gopls commands, swag

  • Runs swag init and swag fmt, which write files

  • Installs the swag CLI with go install if it is missing

Questions

What does the golang-swagger skill do?

It teaches Claude to document a Go API with swaggo/swag. Claude writes annotations, generates the spec with swag init and serves Swagger UI.

How do I install golang-swagger?

Use the install box at the top of this page. It is a text skill with reference guides, so there is nothing to compile. Start a new session so it loads, then work in a Go project.

Does it need the swag command?

Yes. The compatibility line says it requires go and the swag CLI. The allowed tools include swag commands, so Claude can run swag init for you.

What about gRPC APIs?

SKILL.md points to the golang-grpc skill and says to use grpc-gateway with its own OpenAPI generator instead of swag. It also points to golang-security for protecting the Swagger UI in production.

Does it need other skills from the same repo?

SKILL.md does not list any other skill as required. SKILL.md points to related skills in samber/cc-skills-golang for side topics, and the README says installing only a subset gives a partial and possibly inconsistent view of the guidelines. For best results it recommends installing the general-purpose Go skills together.

Is golang-swagger safe?

Mostly, for your own Go projects. It is instructions plus reference files, and it lets Claude edit files and run go and git commands. Review diffs, keep the project under version control and avoid secrets in prompts.

Does golang-swagger work in Codex, Cursor or the Claude app?

It is designed for Claude Code, Codex or a similar tool, and the README says the skills are built for Claude Code, Codex, Gemini, Copilot, Antigravity and Cursor. Because it works on your Go files and uses the go command, use a coding tool rather than the Claude app.

Information

updated Nov 2, 2026

Folder
skills/golang-swagger

samber/cc-skills-golangskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. golang-swagger SKILL.md · github.com
  2. cc-skills-golang README · github.com

Updated Nov 2, 2026.