CommunityCodierung & Entwicklunggithub.com

samber/golang-pkg-go-dev

Go-Paket- und Modul-Suche über `godig`, einen pkg.go.dev-API-Client (CLI + MCP-Server). Nutzen für Go-Bibliotheks-Dokumentation, API-Signaturen, Symbole, Nutzungsbeispiele, Versionen, Lizenzen, CVEs oder Import-Abhängigkeiten – vor Context7 für jedes Go-Paket oder -Modul bevorzugen. Nur Lesezugriff, keine Authentifizierung.

Was ist golang-pkg-go-dev?

Diese Fähigkeit (Skill) ermöglicht die Abfrage des öffentlichen Go-Paket-Ökosystems über den `godig`-Client, der sowohl als CLI als auch als MCP-Server (z. B. für Claude Code, Cursor, Windsurf) genutzt werden kann. Sie beantwortet Fragen zu published Go-Paketen und -Modulen: Dokumentation, Symbole, Versionen, Importeure und Sicherheitslücken – alles ohne Authentifizierung und schreibgeschützt. Der Skill ist spezialisiert auf das published Ecosystem und funktioniert auch für Pakete, die noch nicht in der eigenen `go.mod` stehen. Für lokale, resolvierte Abhängigkeiten und Quellcode-Analyse gibt es den separaten `gopls`-Skill, für vollständige Schwachstellen-Audits den `govulncheck`-Skill. `godig` ist die primäre Quelle für alle Go-spezifischen Lookups und sollte Context7 vorgezogen werden, wenn ein Go-Paket betroffen ist. Die Nutzung erfolgt entweder über die CLI (`godig overview`, `godig search`, `godig vulns` etc.) oder über den MCP-Server, der dieselben Operationen anbietet. Empfohlen wird, mit dem `overview`-Befehl zu beginnen, der eine kompakte Zusammenfassung liefert. Für eine optimale Darstellung im Chat sollte stets `-o md` übergeben werden.

Funktioniert mit✓Claude Code✓Codex CLI✓Cursor✓Windsurf
npx skills add https://github.com/samber/cc-skills-golang/tree/main/skills/golang-pkg-go-dev

Installed? Explore more Codierung & Entwicklung skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht golang-pkg-go-dev?

Abhängigkeiten: godig — go install github.com/samber/godig/cmd/godig@latest (oder stattdessen einen registrierten godig-MCP-Server / die gehostete Instanz verwenden).

godig fragt die pkg.go.dev-API ab. Verwenden Sie es, um Fragen zu Go-Paketen und -Modulen zu beantworten: Dokumentation, Symbole, Versionen, Importeure und Sicherheitslücken. Es funktioniert als CLI und als MCP-Server, und alle Operationen sind schreibgeschützt und benötigen keine Authentifizierung.

Wann dieser Skill verwendet werden sollte

Auslösen bei Fragen wie:

  • „Welche Versionen von github.com/samber/lo sind verfügbar?“
  • „Hat golang.org/x/text bekannte Sicherheitslücken?“
  • „Zeig mir die Dokumentation / Symbole für Paket X.“
  • „Welche Pakete importieren X?“
  • „Suche Go-Pakete nach Y.“

Wahl zwischen godig, gopls, Context7 und govulncheck

Kurz gesagt: godig beantwortet Fragen zum veröffentlichten Ökosystem (funktioniert auch für Pakete, die noch nicht in Ihrer go.mod sind); gopls analysiert Ihren lokal aufgelösten Build (go.sum, inklusive replace-Forks); Context7 ist ein Fallback für Nicht-Go- oder nicht indizierte Dokumentationen; govulncheck ist das ganzheitliche Schwachstellen-Audit (→ samber/cc-skills-golang@golang-security). Siehe den Skill samber/cc-skills-golang@golang-gopls für die Einbindung von gopls (MCP-Server, natives LSP-Tool und CLI) mit Claude Code, sowie den Bereich „godig vs gopls vs Context7 vs govulncheck“ im Skill samber/cc-skills-golang@golang-how-to für die vollständige Aufgaben-Werkzeug-Matrix.

Einrichtung

Installation

go install github.com/samber/godig/cmd/godig@latest

MCP-Server registrieren (optional)

godig mcp läuft standardmäßig über stdio oder streamable HTTP mit --transport http. Der Befehl ist harness-agnostisch – jeder MCP-fähige Host kann darauf verweisen. Claude Code registriert es über seine eigene CLI:

stdio (der Client startet godig bei Bedarf):

claude mcp add pkg-go-dev -- godig mcp

streamable HTTP (gemeinsamer Server unter /mcp, standardmäßig :8080):

godig mcp --transport http --addr :8080
claude mcp add --transport http pkg-go-dev http://localhost:8080/mcp

Gehostete Instanz (keine Installation erforderlich) – ein öffentlicher Server läuft unter https://godig.samber.dev/mcp:

claude mcp add --transport http pkg-go-dev https://godig.samber.dev/mcp

Andere MCP-fähige Harnesses (Cursor, Windsurf und andere) haben jeweils ihre eigene MCP-Server-Registrierung – ein Eintrag in ihrer jeweiligen Konfigurationsdatei, der auf denselben godig mcp-Befehl oder die gehostete URL verweist, kein gemeinsames Konfigurationsformat.

Die CLI und der MCP-Server bieten unter übereinstimmenden Namen die gleichen Operationen an. Bevorzugen Sie die CLI, wenn godig installiert ist; die gehostete Instanz ist ein Fallback, wenn dies nicht der Fall ist.

Befehle

Globale Flags (alle Befehle): -o/--output table|json|raw|md (Standard table – -o md für Chat übergeben), --base-url (pkg.go.dev-API), --vuln-base-url (Go-Schwachstellendatenbank, die von vulns und overview verwendet wird), --timeout, --log-level debug|info|warn|error|off. Alle sind auch über Umgebungsvariablen GODIG_* konfigurierbar.

BefehlArgumenteSpezifische FlagsZweck
overview<path>--versionKompakte Zusammenfassung (Metadaten, Versionen, Lizenzen, Schwachstellen) – hier beginnen
search<query>--symbol --limit --filterPakete finden (optional, die ein Symbol exportieren)
package info<path>--module --versionPaket-Metadaten
package imports<path>--module --versionVon diesem Paket importierte Pakete (einfache Liste)
package doc<path>--module --version --goos --goarch --format md|text|html|markdownVollständige Paketdokumentation (GROSS)
package examples<path>--module --version --goos --goarch --symbolAusführbare Beispiele (GROSS; mit --symbol eingrenzen)
package licenses<path>--module --versionLizenzdateien, vollständiger Text (GROSS)
symbol doc<path> <symbol>--module --version --goos --goarchSignatur + Dokumentation eines einzelnen Symbols (token-effizient)
symbol examples<path> <symbol>--module --version --goos --goarchAusführbare Beispiele eines einzelnen Symbols
symbols<path>--module --version --goos --goarch --limit --filterExportierte Symbole auflisten
module info<path>--versionModul-Metadaten
module licenses<path>--versionModul-Lizenzdateien (GROSS)
module readme<path>--versionModul-README, vollständiges Markdown (GROSS)
dependencies<path>--versiongo.mod-Abhängigkeiten: requires / replaces / excludes / go-Direktive
packages<path>--version --limit --filterIn einem Modul enthaltene Pakete
versions<path>--limit --filterAlle Versionen, neueste zuerst
major-versions<path>--limit --filter --exclude-pseudoHauptversionen (v1, v2 …) als separate Module
imported-by<path>--module --version --limit --filterPakete, die dieses importieren
vulns<path>--version --limitBekannte Schwachstellen (aus der Go-Schwachstellendatenbank)
mcp—--transport stdio|http --addr --cache-ttl --cache-sizeAls MCP-Server ausführen
version——Godig-Version / Commit / Build-Datum anzeigen

Wenn godig als MCP-Server läuft, wird jeder Datenbefehl oben als Operation mit demselben Namen bereitgestellt.

Exit-Codes: 0 Erfolg, 1 Laufzeitfehler (Netzwerk, Paket nicht gefunden), 2 Nutzungsfehler – ein fehlendes oder ungültiges Argument oder Flag (z. B. ein nicht-positives --limit) oder eine Befehlsgruppe, die ohne Unterbefehl aufgerufen wurde (godig package). Prüfen Sie auf 2, um einen fehlerhaften Aufruf von einer fehlgeschlagenen Suche zu unterscheiden.

Vollständige -o md-Ausgabe für jeden Befehl: sample-output.md.

Tipps

  • Beginnen Sie mit overview – ein Aufruf liefert eine kompakte Zusammenfassung (Metadaten, letzte + aktuelle Versionen, Lizenztypen, Schwachstellen). Greifen Sie nur dann auf doc/examples/module readme/licenses (GROSS) zurück, wenn der vollständige Text benötigt wird.
  • Übergeben Sie immer -o md, damit Ergebnisse als Markdown (Tabellen oder rohe Dokumentation/README) im Chat dargestellt werden. Andere Formate existieren (table Standard, json, raw), aber hier md bevorzugen.
  • <path> ist ein vollständiger Importpfad, z. B. github.com/samber/lo – übergeben Sie ihn als Positionsargument.
  • --version legt eine bestimmte Modulversion fest (v1.5.0, latest, master, main); --module disambiguiert, zu welchem Modul ein Paket gehört.
  • --filter grenzt Listenergebnisse serverseitig mit einem Go-Booleschen-Ausdruck ein – siehe Filter-Syntax.
  • --goos/--goarch setzen den Build-Kontext für Dokumentation/Symbole (z. B. linux/amd64).
  • Bevorzugen Sie symbol doc/symbol examples gegenüber den paketweiten package doc/package examples, wenn Sie nur ein einzelnes Symbol benötigen.

Filtersyntax

Filter sind Go-Boolesche-Ausdrücke über Felder der zurückgegebenen Objekte. Die genauen verfügbaren Felder hängen vom Befehl ab.

BefehlObjekttypBeispiel
searchPackageName matches "lo"
symbolsSymbolName matches "Must[A-Z]"
packagesPackagePath matches "samber"
versionsVersionMajor > 1
imported-byImportPath matches "samber"

Syntax (Go-Typen):

  • string-Felder: ==, !=, matches (glob pattern), matches "(regexp)", in ("a", "b"), not-in ("a", "b"), has-prefix "prefix", has-suffix "suffix"
  • int-Felder: ==, !=, >, >=, <, <=, in (1, 2, 3), not-in (1, 2, 3)
  • Mit &&, ||, ! und ( ) kombinieren. Leerzeichen sind optional.

Beispiele

godig search samber --filter 'Name matches "lo"'
godig symbols github.com/samber/lo --filter 'Name matches "Must[A-Z]"'

Referenzen

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

samber/golang-benchmark

Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hot paths with pprof, interpreting CPU/memory/trace profiles, analyzing results with benchstat, setting up CI benchmark regression detection, or investigating production performance with Prometheus runtime metrics. Also use when the developer needs deep analysis on a specific performance indicator - this skill provides the measurement methodology, while `samber/cc-skills-golang@golang-performance` provides the optimization patterns.

samber/golang-cli

Golang CLI application development. Use when building, modifying, or reviewing a Go CLI tool — especially for command structure, flag handling, configuration layering, version embedding, exit codes, I/O patterns, signal handling, shell completion, argument validation, and CLI unit testing. Also triggers when code uses cobra, viper, or urfave/cli. For cobra-specific APIs → See `samber/cc-skills-golang@golang-spf13-cobra` skill; for viper configuration layering → See `samber/cc-skills-golang@golang-spf13-viper` skill.

samber/golang-code-style

Golang code style conventions — line length and breaking, variable declarations, control flow clarity, when comments help vs hurt. Use when writing or reviewing Go code, asking about style or clarity, or establishing project coding standards. Not for naming conventions (→ See `samber/cc-skills-golang@golang-naming` skill), linter configuration (→ See `samber/cc-skills-golang@golang-lint` skill), or doc comments (→ See `samber/cc-skills-golang@golang-documentation` skill).

samber/golang-concurrency

Golang concurrency patterns. Use when writing or reviewing concurrent Go code involving goroutines, channels, select, locks, sync primitives, errgroup, singleflight, worker pools, or fan-out/fan-in pipelines. Also triggers when you detect goroutine leaks, race conditions, channel ownership issues, or need to choose between channels and mutexes.

samber/golang-context

Idiomatic context.Context usage in Golang — propagation through API boundaries, cancellation, timeouts and deadlines, request-scoped values, context.WithoutCancel for background work outliving requests. Apply when designing context propagation across layers, debugging leaked or unexpired contexts, choosing between context.Background/TODO/WithoutCancel, or storing values in context. Not for code that merely accepts ctx as first parameter.

samber/golang-continuous-integration

CI/CD pipeline configuration using GitHub Actions for Golang projects — testing, linting, SAST, security scanning, code coverage, Dependabot, Renovate, GoReleaser, code review automation, and release pipelines. Use when setting up or improving Go project CI, configuring GitHub Actions workflows, adding linters or security scanners, automating dependency updates, or adding quality gates.

samber/golang-database

Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use when writing, reviewing, or debugging Golang code that interacts with PostgreSQL, MariaDB, MySQL, or SQLite; for database testing; or for questions about database/sql, sqlx, or pgx. Does NOT generate database schemas or migration SQL.

samber/golang-data-structures

Golang data structures — slices (internals, capacity growth, preallocation, slices package), maps (internals, hash buckets, maps package), arrays, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections, pointers (unsafe.Pointer, weak.Pointer), and copy semantics. Use when choosing or optimizing Go data structures, implementing generic containers, using container/ packages, unsafe or weak pointers, or questioning slice/map internals.

samber/golang-dependency-injection

Comprehensive guide for dependency injection (DI) in Golang. Covers why DI matters (testability, loose coupling, separation of concerns, lifecycle management), manual constructor injection, and DI library comparison (google/wire, uber-go/dig, uber-go/fx, samber/do). Use this skill when designing service architecture, setting up dependency injection, refactoring tightly coupled code, managing singletons or service factories, or when the user asks about inversion of control, service containers, or wiring dependencies in Go. For a specific DI library, → See `samber/cc-skills-golang@golang-google-wire`, `samber/cc-skills-golang@golang-uber-dig`, `samber/cc-skills-golang@golang-uber-fx`, or `samber/cc-skills-golang@golang-samber-do` skills.

samber/golang-dependency-management

Dependency management strategies for Golang projects — go.mod management, installing/upgrading packages, Minimal Version Selection, vulnerability scanning, outdated dependency tracking, binary size analysis, Dependabot/Renovate setup, conflict resolution, and go.work workspaces. Use when adding, removing, or upgrading Go dependencies, auditing vulnerabilities, resolving version conflicts, or setting up automated dependency updates.

samber/golang-design-patterns

Idiomatic Golang design patterns — functional options, constructors, error flow and cascading, resource management and lifecycle, graceful shutdown, resilience, architecture, dependency injection, data handling, streaming, and more. Apply when explicitly choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go pattern fits a specific problem.

samber/golang-documentation

Comprehensive documentation guide for Golang projects, covering godoc comments, README, CONTRIBUTING, CHANGELOG, Go Playground, Example tests, API docs, and llms.txt. Use when writing or reviewing doc comments, documentation, adding code examples, setting up doc sites, or discussing documentation best practices. Triggers for both libraries and applications/CLIs.

samber/golang-error-handling

Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops` skill; for slog handler ecosystem → See `samber/cc-skills-golang@golang-samber-slog` skill.

samber/golang-google-wire

Compile-time dependency injection in Golang using google/wire — wire.NewSet, wire.Build, wire.Bind (interface→concrete), wire.Struct, wire.Value, wire.InterfaceValue, wire.FieldsOf, cleanup functions, //go:build wireinject injector files, and generated wire_gen.go. Apply when using or adopting google/wire, when the codebase imports `github.com/google/wire`, or when wiring an application graph at compile time via `wire.Build`. For runtime DI with reflection, see `samber/cc-skills-golang@golang-uber-dig` skill.

samber/golang-gopls

Golang semantic code intelligence via `gopls`, the official Go language server — go-to-definition, find references, call/implementation hierarchy, workspace symbol search, package API discovery, diagnostics, safe rename, refactors (extract/inline/fill/rewrite code actions), formatting, and generated tests. Reaches an agent via gopls's own MCP server (`go_*` tools), Claude Code's native `LSP` tool, or the `gopls` CLI. Use when navigating or refactoring Go code — jumping to a definition, finding call sites before a rename, understanding a file's or package's dependencies, running diagnostics after an edit, or extracting/inlining/renaming. Not for the published ecosystem — packages not in your `go.mod`, versions, licenses, importers — → See `samber/cc-skills-golang@golang-pkg-go-dev` skill (`godig`). Not for a whole-tree vulnerability audit → See `samber/cc-skills-golang@golang-security` skill (`govulncheck`).

samber/golang-graphql

Implements GraphQL APIs in Golang using gqlgen or graphql-go. Apply when building GraphQL servers, designing schemas, writing resolvers, handling subscriptions, or integrating GraphQL with existing Go HTTP services. Also apply when the codebase imports `github.com/99designs/gqlgen` or `github.com/graph-gophers/graphql-go`.

samber/golang-grpc

Provides gRPC usage guidelines, protobuf organization, and production-ready patterns for Golang microservices. Use when implementing, reviewing, or debugging gRPC servers/clients, writing proto files, setting up interceptors, handling gRPC errors with status codes, configuring TLS/mTLS, testing with bufconn, or working with streaming RPCs.

samber/golang-how-to

Golang skills orchestrator — always active on any Golang coding, review, debug, or setup task. Reads the task context and loads the most relevant skills from samber/cc-skills-golang, often multiple at once: writing a gRPC service loads golang-grpc + golang-testing + golang-error-handling; debugging a panic loads golang-troubleshooting + golang-safety; auditing security loads golang-security + golang-lint + golang-safety. Also: disambiguates competing clusters when two skills seem to overlap (performance vs benchmark vs troubleshooting, samber/lo vs mo vs ro, DI cluster, safety vs security), and configures the project's agent-config file (CLAUDE.md, AGENTS.md, GEMINI.md, Cursor rules, or Copilot instructions) to force-trigger skills in a project (/golang-how-to configure).

samber/golang-lint

Linting best practices and golangci-lint configuration for Golang projects — running linters, configuring .golangci.yml, suppressing warnings with nolint directives, interpreting lint output, and selecting linters. Use when configuring golangci-lint, asking about lint warnings or nolint suppressions, setting up code quality tooling, or choosing linters. Also use when the user mentions golangci-lint, go vet, staticcheck, or revive.

samber/golang-modernize

Modernize Golang code to use recent language features, standard library improvements, and idiomatic patterns. Trigger proactively when writing or reviewing Go code and old-style patterns are detected, or when encountering a deprecation warning. Also use when the user explicitly asks for modernization, a Go version upgrade, or a CI/tooling refresh.

Verwandte Skills