From go-agent-skills
Navigates and analyzes Go codebases using gopls (references, implementations, call hierarchy), go list (dependency graph), and go doc (API docs). Use before refactoring shared code or understanding type relationships.
How this skill is triggered — by the user, by Claude, or both
Slash command
/go-agent-skills:go-semantic-toolsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
grep finds strings; the toolchain finds meaning. Method names repeat
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.
| 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.
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 editornpx claudepluginhub eduardo-sl/go-agent-skills --plugin go-agent-skillsProvides semantic code intelligence for Go via gopls: go-to-definition, references, refactoring, diagnostics, and formatting. Use when navigating or refactoring Go code.
Type-aware Go code analysis via gopls: definitions, implementations, references, call hierarchy, dependency graphs, and rename previews. Prefer over grep for semantic Go tasks.
Analyzes Go codebases with AST-aware call graphs, blast-radius, and security-flow analysis. Provides 61 query capabilities for reading, navigating, reviewing, and refactoring Go code.