golang-gopls

Provides semantic Go code navigation, diagnostics, and refactoring via the gopls language server.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/rockcookies/skills --skill golang-gopls-rockcookies
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-gopls
Source: https://github.com/rockcookies/skills/tree/main/skills/samber-golang/golang-gopls
Command: npx skills add https://github.com/rockcookies/skills --skill golang-gopls-rockcookies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gopls, and includes references (resource) components.

What problem does it solve? Text search with grep cannot answer questions about types, call graphs, interface satisfaction, or the blast radius of a rename in Go code. This Skill gives an agent semantic code intelligence over the locally resolved Go build through gopls, the official Go language server, so navigation, diagnostics, and refactors are based on the compiler's understanding rather than string matching. ## Core Features & Use Cases - Semantic navigation: go-to-definition, find references, call and implementation hierarchy, workspace symbol search, and package API discovery via gopls's MCP server, the native LSP tool, or the gopls CLI. - Diagnostics and safety: compiler and analyzer errors after every edit, plus an on-demand go_vulncheck reachability check for the current build. - Safe refactoring: rename with interface-satisfaction checks, extract/inline, fill struct/switch, organize imports, formatting, and generated table-driven tests. - Use Case: Before renaming a method on a widely used interface, run go_symbol_references to find every call site, apply the rename with go_rename_symbol, then run go_diagnostics on all changed files to confirm the build is clean. ## Quick Start Ask the agent to use gopls to find every reference to a Go function before renaming it, then run diagnostics on the changed files.

Frequently Asked Questions about golang-gopls

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find all references to a Go function before renaming it?▼

Use the go_symbol_references MCP tool or gopls references at a file:line:col position to list every use of the symbol. This shows the blast radius before editing, and go_rename_symbol then applies the rename workspace-wide with safety checks.

What is the difference between gopls MCP tools and the native LSP tool?▼

The gopls MCP server tools take names, paths, and fuzzy queries, suiting agent-first queries like go_search. The native LSP tool is keyed by line and character positions and pushes compiler diagnostics automatically after every edit.

Does gopls work on Go packages not in my go.mod?▼

No. gopls only reasons about code present and resolvable in the local build, meaning the workspace plus dependencies pinned in go.sum including replace directives. For packages not yet added, use the golang-pkg-go-dev skill with godig instead.

Why are gopls references results missing some call sites?▼

References reflect only the build configuration of the queried file, so a query on a windows-tagged file misses linux-tagged matches. Also, call hierarchy shows only static calls; calls through function values or interface methods are invisible to it.

Can gopls check for vulnerabilities in my Go project?▼

Yes, the go_vulncheck MCP tool runs a lightweight reachability check against the current build, recommended at session start and after go.mod changes. For a comprehensive whole-tree audit, use the golang-security skill with govulncheck.