Navigates Go codebases using gopls (references, implementations, call hierarchy, diagnostics), go list (dependency graph), and go doc (APIs). Use when finding callers, interface implementations, usages, or mapping module structure.
Ships in go-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
grep finds strings; the toolchain finds meaning. Method names repeat across types, interfaces are satisfied implicitly, and dot-imports lie to text search. Before changing shared code, get the truth from tools that understand types.
Detailed reference material, loaded on demand:
references/mcp-and-code-actions.md — gopls mcp setup and tools, the
read/edit loop, CLI code actions, build-tag gotchas.Read a reference file only when the summary below is not enough.
| Interface | Prefer it when |
|---|---|
gopls MCP server (gopls mcp, v0.20+) | Working as an agent — tools take symbol names and file paths, not cursor positions |
| The harness's built-in LSP integration, if enabled | You already have a position, and want diagnostics pushed after every edit |
gopls CLI (below) | Scripts and one-off checks; the Go team documents it as a debugging interface |
With the MCP server, follow its loop: go_symbol_references before
changing a definition, go_diagnostics after every edit until clean,
go_vulncheck after go.mod changes, then go test on the changed
packages only. Setup and the tool list: references/mcp-and-code-actions.md.
| Question | Command |
|---|---|
| Where is this symbol used? | gopls references file.go:LINE:COL |
| Where is it defined? | gopls definition file.go:LINE:COL |
| Who implements this interface? / which interfaces does this type satisfy? | gopls implementation file.go:LINE:COL |
| Who calls this function (transitively)? | gopls call_hierarchy file.go:LINE:COL |
| What's in this package's API? | go doc ./internal/service / go doc pkg Symbol |
| Which packages exist / depend on what? | go list ./..., go list -deps, go list -json |
| Find a symbol by name across the module | gopls workspace_symbol Name |
| Symbols in one file | gopls symbols file.go |
Positions are file.go:line:column (1-based). Get line/column from a
prior search or gopls symbols. All gopls commands run from within the
module and need a warm build cache — run go build ./... once first.
gopls references internal/service/user.go:42:6 # every call site, typed
gopls call_hierarchy internal/service/user.go:42:6
Text search for Process( would surface every type's Process;
references returns only this one's call sites — including usages via
interfaces and embeddings that grep cannot see.
# On the interface name: all implementations
gopls implementation internal/store/store.go:15:6
# On a method of a concrete type: interfaces it satisfies
gopls implementation internal/store/postgres/user.go:30:18
Run this before adding a method to an interface — every implementation listed will break.
go list ./... # all packages
go list -f '{{.ImportPath}} -> {{join .Imports " "}}' ./... # direct edges
go list -deps ./cmd/api | grep myorg # everything a binary pulls in
go list -json ./internal/service | jq .Imports # machine-readable
Use this to verify layering claims ("domain imports nothing") instead of trusting directory names.
go doc ./internal/payments # package overview
go doc ./internal/payments Gateway # one symbol, with doc comment
go doc -all ./internal/payments # full API surface
Prefer this to opening files: it shows the exported contract without implementation noise.
gopls rename -w internal/service/user.go:42:6 ProcessOrder
Renames the symbol everywhere it's referenced — through interfaces,
embedding, and test packages. Never rename an identifier with
find-and-replace; UserID the field and UserID the local variable
are different symbols with the same spelling.
gopls check ./internal/... # type errors + analyzer findings per file
go vet ./... # the vet suite standalone
gopls check surfaces the same diagnostics an IDE user sees — run it
when reviewing code you haven't opened in an editor.
gopls codeaction internal/order/service.go:42:2-58:3 # list
gopls codeaction -kind=refactor.extract.function -exec -diff \
internal/order/service.go:42:2-58:3 # preview
Extract (function, method, variable, constant, to new file), inline call,
fill struct/switch, invert if, remove an unused parameter at every call
site — each type-aware, unlike a hand edit. Diff before writing; extract
and inline are best-effort with comments.
Rule of thumb: identifiers → gopls; literals and prose → grep.
gopls references (not grep) before changing any shared symbolgopls implementation on the interfacegopls rename -w, never text replacementgo list import datago doc before reading implementationsgopls check / go vet run when reviewing without an editorgo_diagnostics or gopls check)GOOS/build tagsWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/go-agent-skills:go-semantic-toolsfrom go-agent-skills
npx claudepluginhub eduardo-sl/go-agent-skills --plugin go-agent-skills35 skills in this plugin
/git-commitStructured git commit messages following Conventional Commits format for Go projects. Generates well-scoped, atomic commits with clear descriptions. Use when committing changes, writing commit messages, preparing PRs, or reviewing commit history quality. Trigger examples: "commit these changes", "create commit", "commit message", "prepare PR", "squash commits". Not for: code review (go-code-review), changelog generation.
/go-api-designHTTP/REST API design for Go services: handlers, ServeMux routing, middleware, request validation, pagination, idempotency, health checks, error responses, and graceful shutdown. Use when designing APIs, writing HTTP handlers, implementing middleware, or structuring REST endpoints. Trigger examples: "design API", "REST endpoints", "HTTP handler", "middleware pattern", "graceful shutdown", "API versioning". Not for: gRPC services (go-grpc), spec-first OpenAPI work (go-openapi), general architecture (go-architecture-review), concurrency in handlers (go-concurrency-review).
/go-architecture-reviewReview Go project architecture: package structure, dependency direction, layering, separation of concerns, domain modeling, and module boundaries. Use when reviewing architecture, designing package layout, evaluating dependency graphs, or refactoring monoliths into modules. Trigger examples: "review architecture", "package structure", "project layout", "dependency direction", "clean architecture Go", "module boundaries". Not for: code-level style (go-coding-standards), endpoint design (go-api-design).
Other plugins' skills for the same job