Community코딩 & 개발github.com

samber/golang-pkg-go-dev

`godig`를 통해 Go 패키지 및 모듈 문서, API 시그니처, 심볼, 사용 예제, 버전, 라이선스, 취약점(CVE), 임포트 관계를 조회합니다. 읽기 전용이며 인증이 필요 없습니다.

golang-pkg-go-dev란 무엇인가요?

이 스킬은 `godig` CLI 및 MCP 서버를 활용하여 Go 생태계의 공개 패키지와 모듈에 대한 정보를 제공합니다. pkg.go.dev API를 기반으로 동작하며, 패키지 문서, 내보낸 심볼 목록, 특정 심볼의 시그니처와 문서, 사용 예제, 버전 목록, 라이선스 텍스트, 종속성 그래프, 그리고 Go 취약점 데이터베이스에 등록된 알려진 취약점까지 조회할 수 있습니다. 특히 `overview` 명령어로 메타데이터, 최신 버전, 라이선스, 취약점을 한 번에 확인할 수 있어 효율적입니다. 로컬에 설치된 `godig` 바이너리 또는 호스팅된 MCP 서버를 통해 동작하며, `-o md` 플래그를 사용하면 결과를 채팅 친화적인 마크다운 형식으로 출력합니다. 이 스킬은 아직 `go.mod`에 추가되지 않은 패키지도 조회할 수 있어 프로젝트 탐색이나 의존성 검토에 유용하며, `gopls`(로컬 빌드 분석), Context7(비Go/미인덱스 문서 대체), `govulncheck`(전체 트리 취약점 감사)와 용도가 다르므로 상황에 맞게 선택해야 합니다. 주요 지원 플랫폼은 Claude Code, Cursor, Windsurf 등 MCP를 지원하는 모든 AI 에이전트이며, CLI와 MCP 서버는 동일한 연산을 제공합니다.

지원 대상✓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 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

golang-pkg-go-dev은(는) 무엇을 하나요?

종속성: godig — go install github.com/samber/godig/cmd/godig@latest (또는 등록된 godig MCP 서버 / 호스팅 인스턴스를 사용).

godig는 pkg.go.dev API를 조회합니다. Go 패키지 및 모듈에 대한 문서, 심볼, 버전, 임포터, 취약점 등을 질문하는 데 사용합니다. CLI와 MCP 서버로 작동하며, 모든 작업은 읽기 전용이며 인증이 필요 없습니다.

이 스킬을 사용해야 할 때

다음과 같은 질문에 트리거됩니다:

  • "github.com/samber/lo의 사용 가능한 버전은 무엇인가요?"
  • "golang.org/x/text에 알려진 취약점이 있나요?"
  • "패키지 X의 문서/심볼을 보여주세요."
  • "어떤 패키지가 X를 임포트하나요?"
  • "Y에 대한 Go 패키지를 검색해 주세요."

godig, gopls, Context7, govulncheck 중 선택하기

간단히 말해: godig는 공개된 생태계에 대한 질문에 답합니다 (go.mod에 아직 없는 패키지에도 작동). gopls는 로컬에서 해석된 빌드 (go.sum, replace된 포크 포함)를 분석합니다. Context7은 Go가 아니거나 인덱싱되지 않은 문서를 위한 대체 도구입니다. govulncheck는 전체 트리 취약점 감사 도구입니다 (→ samber/cc-skills-golang@golang-security). samber/cc-skills-golang@golang-gopls 스킬에서 Claude Code와 함께 gopls(MCP 서버, 네이티브 LSP 도구, CLI)를 연결하는 방법을, samber/cc-skills-golang@golang-how-to 스킬의 "godig vs gopls vs Context7 vs govulncheck" 섹션에서 작업-도구 매트릭스를 확인하세요.

설정

설치

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

MCP 서버 등록 (선택 사항)

godig mcp는 기본적으로 stdio 위에서 실행되며, --transport http로 스트리밍 가능 HTTP를 사용할 수 있습니다. 이 명령은 하네스에 독립적입니다 — MCP를 지원하는 모든 호스트가 이를 가리킬 수 있습니다. Claude Code는 자체 CLI를 통해 등록합니다:

stdio (클라이언트가 필요 시 godig를 실행):

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

스트리밍 가능 HTTP (/mcp에서 공유 서버, 기본 :8080):

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

호스팅 인스턴스 (설치 불필요) — https://godig.samber.dev/mcp에서 공개 서버 실행:

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

MCP를 지원하는 다른 하네스(Cursor, Windsurf 등)는 각자의 MCP 서버 등록 방식을 따릅니다 — 해당 설정 파일에 동일한 godig mcp 명령 또는 호스팅 URL을 가리키는 항목을 추가하면 되며, 공유된 설정 형식은 없습니다.

CLI와 MCP 서버는 일치하는 이름으로 동일한 연산을 제공합니다. godig가 설치된 경우 CLI를 선호하고, 설치되지 않은 경우 호스팅 인스턴스를 대체 수단으로 사용하세요.

명령어

전역 플래그 (모든 명령어): -o/--output table|json|raw|md (기본값 table — 채팅용으로 -o md 전달), --base-url (pkg.go.dev API), --vuln-base-url (Go 취약점 데이터베이스, vulns 및 overview에서 참조), --timeout, --log-level debug|info|warn|error|off. 모두 GODIG_* 환경 변수로도 설정 가능합니다.

명령어인자특정 플래그목적
overview<path>--version간결한 요약 (메타데이터, 버전, 라이선스, 취약점) — 여기서 시작
search<query>--symbol --limit --filter패키지 찾기 (선택적으로 심볼 내보내기)
package info<path>--module --version패키지 메타데이터
package imports<path>--module --version이 패키지가 임포트하는 패키지 (간단한 목록)
package doc<path>--module --version --goos --goarch --format md|text|html|markdown전체 패키지 문서 (큰 용량)
package examples<path>--module --version --goos --goarch --symbol실행 가능한 예제 (큰 용량; --symbol로 범위 축소)
package licenses<path>--module --version라이선스 파일, 전체 텍스트 (큰 용량)
symbol doc<path> <symbol>--module --version --goos --goarch단일 심볼의 시그니처 + 문서 (토큰 효율적)
symbol examples<path> <symbol>--module --version --goos --goarch단일 심볼의 실행 가능한 예제
symbols<path>--module --version --goos --goarch --limit --filter내보낸 심볼 목록
module info<path>--version모듈 메타데이터
module licenses<path>--version모듈 라이선스 파일 (큰 용량)
module readme<path>--version모듈 README, 전체 마크다운 (큰 용량)
dependencies<path>--versiongo.mod 의존성: requires / replaces / excludes / go 지시문
packages<path>--version --limit --filter모듈에 포함된 패키지
versions<path>--limit --filter모든 버전, 최신순
major-versions<path>--limit --filter --exclude-pseudo별도 모듈로 존재하는 주요 버전 (v1, v2 …)
imported-by<path>--module --version --limit --filter이 패키지를 임포트하는 패키지
vulns<path>--version --limit알려진 취약점 (Go 취약점 DB에서 조회)
mcp—--transport stdio|http --addr --cache-ttl --cache-sizeMCP 서버로 실행
version——godig 버전 / 커밋 / 빌드 날짜 출력

godig가 MCP 서버로 실행될 때, 위의 각 데이터 명령어는 동일한 이름의 연산으로 노출됩니다.

종료 코드: 0 성공, 1 런타임 오류 (네트워크, 패키지 없음), 2 사용 오류 — 누락되거나 잘못된 인자/플래그 (예: 양수가 아닌 --limit), 또는 하위 명령어 없이 명령어 그룹 호출 (godig package). 2를 확인하여 잘못된 호출과 실패한 조회를 구분하세요.

모든 명령어의 전체 -o md 출력: sample-output.md.

팁

  • overview로 시작 — 한 번 호출로 간결한 요약(메타데이터, 최신 + 최근 버전, 라이선스 유형, 취약점)을 반환합니다. 전체 텍스트가 필요할 때만 doc/examples/module readme/licenses (큰 용량)를 사용하세요.
  • 항상 -o md 전달 — 결과가 채팅에서 마크다운(테이블 또는 원시 문서/README)으로 렌더링됩니다. 다른 형식도 있지만(table 기본값, json, raw), 여기서는 md를 선호합니다.
  • <path>는 전체 임포트 경로입니다(예: github.com/samber/lo). 위치 인자로 전달하세요.
  • --version은 특정 모듈 버전(v1.5.0, latest, master, main)을 고정합니다. --module은 패키지가 속한 모듈을 명확히 합니다.
  • --filter는 서버 측에서 Go 부울 표현식으로 목록 결과를 좁힙니다 — 필터 구문 참조.
  • --goos/--goarch는 문서/심볼의 빌드 컨텍스트를 설정합니다(예: linux/amd64).
  • 특정 심볼에 대한 정보만 필요할 때는 패키지 전체의 package doc/package examples 대신 symbol doc/symbol examples를 선호하세요.

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.

관련 스킬