# Golang Pkg Go Dev > Explora documentación y módulos de Go vía `godig`, cliente de la API de pkg.go.dev (CLI + servidor MCP): docs, API, símbolos, ejemplos, versiones, importadores, licencias y vulnerabilidades conocidas. Fuente: https://skillsagentes.com/skills/samber/cc-skills-golang/golang-pkg-go-dev Markdown: https://skillsagentes.com/skills/samber/cc-skills-golang/golang-pkg-go-dev.md Repositorio: https://github.com/samber/cc-skills-golang Autor: samber Licencia: MIT Actualizado: el mes pasado Coste de contexto: 247 tok instalada, 3.1k tok al activarse, 4.8k tok con todos los archivos del bundle Bundle: 2 archivos, 19 KB Permisos que pide: read edit write glob grep bash(go:*) bash(golangci-lint:*) bash(git:*) bash(godig:*) agent ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-dev --agent claude-code # Cursor npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-dev --agent cursor # Codex npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-dev --agent codex # Gemini CLI npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-dev --agent gemini # Windsurf npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-dev --agent windsurf # Cline npx -y skills add samber/cc-skills-golang --skill golang-pkg-go-dev --agent cline ``` ## Qué hace - Consulta la API de pkg.go.dev vía `godig` (CLI o servidor MCP) para docs, símbolos, ejemplos, versiones, importadores y vulnerabilidades de paquetes Go - Ofrece comandos como `overview`, `search`, `package doc`, `symbol doc`, `versions`, `imported-by` y `vulns` - Permite filtrar resultados server-side con expresiones booleanas Go vía `--filter` ## Cuándo usarla - Preguntas qué versiones existen de un paquete Go - Necesitas ver docs, símbolos o ejemplos de una librería Go - Quieres saber si una dependencia tiene CVEs conocidas - Buscas qué paquetes importan un paquete dado ## Cuándo no - Para actualizar dependencias (usar golang-dependency-management) - Para elegir una librería (usar golang-popular-libraries) - Para símbolos locales o navegar el código ya resuelto de una dependencia (usar golang-gopls) ## Qué la activa - "¿Qué versiones de github.com/samber/lo están disponibles?" - "¿golang.org/x/text tiene vulnerabilidades conocidas?" - "Muéstrame los símbolos exportados de github.com/samber/ro" - "¿Qué paquetes importan github.com/samber/lo?" - "Busca paquetes Go relacionados con result option" ## Antes de instalar - Requiere instalar el CLI `godig` (go install github.com/samber/godig/cmd/godig@latest) o acceso a un servidor MCP godig, y conexión a internet. - makes network requests ## Archivos - SKILL.md — 12 KB - references/sample-output.md — 7 KB ## SKILL.md Reproducido tal cual desde samber/cc-skills-golang bajo MIT. Esta sección es el documento original y está en inglés. # golang-pkg-go-dev **Dependencies:** `godig` — `go install github.com/samber/godig/cmd/godig@latest` (or use a registered godig MCP server / the hosted instance instead). `godig` queries the [pkg.go.dev](https://pkg.go.dev) API. Use it to answer questions about Go packages and modules: docs, symbols, versions, importers and vulnerabilities. It works as a CLI and as an MCP server. All operations are **read-only** and need no authentication. ## When to use this skill Trigger on questions like: - "What versions of github.com/samber/lo are available?" - "Does golang.org/x/text have known vulnerabilities?" - "Show me the docs / symbols for package X." - "Which packages import X?" - "Search Go packages for Y." ## Choosing between `godig`, gopls, Context7, and govulncheck In short: `godig` answers questions about the **published ecosystem** (works even for packages not yet in your `go.mod`); `gopls` reasons about **your locally resolved build** (`go.sum`, including `replace`d forks); Context7 is a fallback for non-Go or unindexed docs; `govulncheck` is the whole-tree vulnerability audit (→ `samber/cc-skills-golang@golang-security`). See the `samber/cc-skills-golang@golang-gopls` skill for wiring `gopls` (MCP server, native `LSP` tool, and CLI) with Claude Code, and the `samber/cc-skills-golang@golang-how-to` skill's "`godig` vs gopls vs Context7 vs govulncheck" section for the full task-to-tool matrix. ## Setup ### Install ```bash go install github.com/samber/godig/cmd/godig@latest ``` ### Register the MCP server (optional) `godig mcp` runs over **stdio** by default, or **streamable HTTP** with `--transport http`. stdio (the client launches godig on demand): ```bash claude mcp add pkg-go-dev -- godig mcp ``` streamable HTTP (shared server at `/mcp`, default `:8080`): ```bash godig mcp --transport http --addr :8080 claude mcp add --transport http pkg-go-dev http://localhost:8080/mcp ``` Hosted instance (no install needed) — a public server runs at `https://godig.samber.dev/mcp`: ```bash claude mcp add --transport http pkg-go-dev https://godig.samber.dev/mcp ``` The CLI and the MCP server expose the **same** operations under matching names. Prefer the CLI when `godig` is installed; the hosted instance is a fallback when it is not. ## Commands **Global flags (all commands):** `-o/--output table|json|raw|md` (default `table` — pass `-o md` for chat), `--base-url` (pkg.go.dev API), `--vuln-base-url` (Go vulnerability database, consulted by `vulns` and `overview`), `--timeout`, `--log-level debug|info|warn|error|off`. All are also settable via `GODIG_*` env vars. | Command | Args | Specific flags | Purpose | | --- | --- | --- | --- | | `overview` | `` | `--version` | Compact summary (metadata, versions, licenses, vulns) — start here | | `search` | `` | `--symbol --limit --filter` | Find packages (optionally exporting a symbol) | | `package info` | `` | `--module --version` | Package metadata | | `package imports` | `` | `--module --version` | Packages this package imports (plain list) | | `package doc` | `` | `--module --version --goos --goarch --format md\|text\|html\|markdown` | Full package doc (LARGE) | | `package examples` | `` | `--module --version --goos --goarch --symbol` | Runnable examples (LARGE; scope with `--symbol`) | | `package licenses` | `` | `--module --version` | License files, full text (LARGE) | | `symbol doc` | ` ` | `--module --version --goos --goarch` | One symbol's signature + doc (token-efficient) | | `symbol examples` | ` ` | `--module --version --goos --goarch` | One symbol's runnable examples | | `symbols` | `` | `--module --version --goos --goarch --limit --filter` | List exported symbols | | `module info` | `` | `--version` | Module metadata | | `module licenses` | `` | `--version` | Module license files (LARGE) | | `module readme` | `` | `--version` | Module README, full Markdown (LARGE) | | `dependencies` | `` | `--version` | go.mod deps: requires / replaces / excludes / go directive | | `packages` | `` | `--version --limit --filter` | Packages contained in a module | | `versions` | `` | `--limit --filter` | All versions, newest first | | `major-versions` | `` | `--limit --filter --exclude-pseudo` | Major versions (v1, v2 …) living as separate modules | | `imported-by` | `` | `--module --version --limit --filter` | Packages that import this one | | `vulns` | `` | `--version --limit` | Known vulnerabilities (from the Go vuln DB) | | `mcp` | — | `--transport stdio\|http --addr --cache-ttl --cache-size` | Run as an MCP server | | `version` | — | — | Print godig version / commit / build date | When `godig` runs as an MCP server, each data command above is exposed as an operation of the same name. **Exit codes:** `0` success, `1` runtime error (network, package not found), `2` usage error — a missing/invalid argument or flag (e.g. a non-positive `--limit`), or a command group invoked with no subcommand (`godig package`). Check for `2` to tell a malformed call apart from a failed lookup. Full `-o md` output for every command: [sample-output.md](references/sample-output.md). ### Tips - **Start with `overview`** — one call returns a compact summary (metadata, latest + recent versions, license types, vulnerabilities). Reach for `doc`/`examples`/`module readme`/`licenses` (LARGE) only when the full text is needed. - **Always pass `-o md`** so results render as Markdown (tables, or raw doc/README) in the chat. Other formats exist (`table` default, `json`, `raw`) but prefer `md` here. - `` is a full import path, e.g. `github.com/samber/lo` — pass it as the positional argument. - `--version` pins a specific module version (`v1.5.0`, `latest`, `master`, `main`); `--module` disambiguates which module a package belongs to. - `--filter` narrows list results server-side with a Go boolean expression — see [Filter syntax](#filter-syntax). - `--goos`/`--goarch` set the documentation/symbols build context (e.g. `linux`/`amd64`). - Prefer `symbol doc`/`symbol examples` over the package-wide `package doc`/`package examples` when you only need one symbol — far fewer tokens. - **Parallelize independent lookups** — every command is a self-contained, read-only HTTP query, so calls never depend on each other. When a task needs docs, examples, versions, or vulns for **several** symbols, packages, or modules, issue all the calls at once (multiple `godig` invocations in a single turn) rather than one after another — wall-clock drops from sum-of-latencies to slowest-single-call. For a large fan-out (documenting many symbols, comparing many candidate libraries, auditing CVEs across a dependency set), dispatch parallel sub-agents (up to 5) via the Agent tool, each running its own `godig` calls and returning a compact summary, so the raw LARGE output never lands in the main context. - Listing commands auto-paginate (return all results); use `--limit` to cap. ### Filter syntax `--filter` (on `search`, `versions`, `major-versions`, `packages`, `imported-by`, `symbols`) takes a **Go boolean expression evaluated server-side, once per result item**. It is not a regex — wrap the whole expression in single quotes for the shell. - **Identifiers are the item's fields, which differ per command** — a field valid for one list is rejected by another (e.g. `search` exposes `packagePath`, not `path`). An unknown field fails with `undefined identifier: ` (HTTP 400), which names the offending field. Fields use the item's lowercase JSON key; the exception is enum-like values such as `kind`, which are capitalized (`Function`, not `func`). - **Operators**: `==` `!=` `<` `<=` `>` `>=`, boolean `&&` `||` `!`, parentheses for grouping. - **String functions**: `contains(s, sub)`, `hasPrefix(s, pre)`, `hasSuffix(s, suf)`. - **Literals**: double-quoted strings (`"Function"`), `true`/`false`, numbers. Filterable fields per command (string unless noted): | Command | Fields | | --- | --- | | `search` | `modulePath`, `packagePath`, `synopsis`, `version` | | `versions` | `version`, `modulePath`, `deprecated` (bool), `retracted` (bool), `hasGoMod` (bool), `commitTime` | | `packages` | `path`, `name`, `synopsis`, `isRedistributable` (bool) | | `imported-by` | `path` (the importing package path) | | `symbols` | `name`, `kind` (`Function`/`Method`/`Type`/`Variable`/`Constant`), `synopsis`, `parent` | | `major-versions` | `modulePath`, `major`, `version`, `isLatest` (bool) | ```bash godig symbols github.com/samber/lo --filter 'kind=="Function"' -o md godig symbols github.com/samber/lo --filter 'kind=="Function" && hasPrefix(name,"Map")' -o md godig versions github.com/samber/lo --filter 'hasPrefix(version,"v1.5")' -o md godig versions github.com/samber/lo --filter 'deprecated==false && retracted==false' -o md godig search "result option" --filter 'hasPrefix(packagePath,"github.com/samber/")' -o md ``` ### Examples Always request Markdown output (`-o md`): ```bash # Overview — start here (compact, one call) godig overview github.com/samber/ro -o md # Search godig search "result option monad" --limit 5 -o md # Package facets godig package info github.com/samber/ro -o md godig package imports github.com/samber/ro -o md godig package doc github.com/samber/ro --format md -o md godig package examples github.com/samber/ro --symbol Map -o md godig package licenses github.com/samber/ro -o md # Single symbol (token-efficient vs package-wide doc/examples) godig symbol doc github.com/samber/lo Map -o md godig symbol examples github.com/samber/oops OopsError.Error -o md # Module facets godig module info github.com/samber/ro -o md godig module readme github.com/samber/ro -o raw godig dependencies github.com/samber/ro -o md # Lists (auto-paginated; --limit to cap) godig versions github.com/samber/ro -o md godig major-versions github.com/samber/lo -o md godig packages github.com/samber/ro -o md godig imported-by github.com/samber/ro --limit 20 -o md godig symbols github.com/samber/ro --filter 'kind=="Function"' -o md # Pin a version / set the build context godig versions github.com/samber/ro --filter 'hasPrefix(version,"v0.3")' -o md godig package doc github.com/samber/lo --version v1.50.0 -o md godig symbols github.com/samber/ro --goos linux --goarch amd64 -o md # Vulnerabilities godig vulns github.com/samber/ro -o md ``` --- This skill is not exhaustive. `godig --help` and each sub-command's `--help` list current flags and output formats; the data mirrors what [pkg.go.dev](https://pkg.go.dev) exposes. If you encounter a bug or unexpected behavior in `godig`, open an issue at . ## Dónde encaja - Categoría: [Herramientas para desarrolladores](https://skillsagentes.com/categorias/herramientas-desarrollo.md) — Skills que cambian cómo tu agente escribe, revisa y despliega código. - Creador: [samber](https://skillsagentes.com/creators/samber.md) — 0 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Golang Lint](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-lint.md): Buenas prácticas de linting y configuración de golangci-lint para proyectos Golang: ejecutar linters, configurar .golangci.yml, suprimir avisos con nolint, interpretar salidas y elegir linters. - [Golang How To](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-how-to.md): Orquestador de skills de Golang, siempre activo en cualquier tarea de código, revisión, debug o setup: carga las skills más relevantes de samber/cc-skills-golang, a menudo varias a la vez. - [Golang Benchmark](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-benchmark.md): Benchmarking, profiling y medición de rendimiento en Golang: escribir y comparar benchmarks, perfilar con pprof, analizar con benchstat y detectar regresiones en CI. - [Golang Testing](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-testing.md): Tests de Golang listos para producción: table-driven, suites y mocks con testify, tests paralelos, fuzzing, fixtures, detección de fugas de goroutines con goleak, snapshot testing, cobertura, tests de integración. - [Golang Performance](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-performance.md): Patrones y metodología de optimización de rendimiento en Golang: si hay cuello de botella X, aplica el patrón Y, una vez que profiling o benchmarks ya lo identificaron. ## Skills relacionadas - [Golang Samber Hot](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-samber-hot.md): Caché en memoria en Golang con samber/hot: algoritmos de expulsión (LRU, LFU, TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, loaders, sharding y métricas Prometheus. - [Golang Samber Lo](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-samber-lo.md): Helpers funcionales para Go con samber/lo: 500+ funciones genéricas type-safe para slices, maps, canales, strings, math, tuplas y concurrencia. - [Golang Samber Mo](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-samber-mo.md): Tipos monádicos para Golang con samber/mo — Option, Result, Either, Future, IO, Task y State para valores nulos seguros, manejo de errores y composición funcional. - [Golang Samber Slog](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-samber-slog.md): Extensiones de logging estructurado para Go con paquetes samber/slog-****: pipelines multi-handler, sampling, formateo de atributos, middleware HTTP y enrutamiento a backends como Datadog, Sentry o Loki. - [Golang Spf13 Viper](https://skillsagentes.com/skills/samber/cc-skills-golang/golang-spf13-viper.md): Librería de configuración en Go con spf13/viper: precedencia en capas (flag > env > archivo > KV > default), BindPFlag, AutomaticEnv, Unmarshal con mapstructure, Sub, WatchConfig y aislamiento en tests. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)