Agent skill

Golang Gopls

by context-labs in context-labs/whip

Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors.

MITAuto-check passedDevelopment

Install Golang Gopls

skills CLI
$ npx skills add context-labs/whip --skill golang-gopls -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install context-labs/whip golang-gopls --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/context-labs/whip.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/golang-gopls .claude/skills/golang-gopls && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
golang-gopls
GitHub stars
1.1k
Used in
1 other repo
Token cost
~2.3k tokens
SKILL.md length
1,064 words
Files
6 (incl. references)
Skills in repo
40
Repo updated
First seen
Licence
MIT

At a glance

Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors.

  • Works in 4 steps: go_workspace — layout… → go_search — fuzzy-locate a… → go_file_context — right after reading… → …
  • Refactoring Go code
  • SKILL.md covers Three ways to reach gopls, Capability → CLI → MCP →…, Use cases and Efficient workflows, plus 1 more section
  • Calls go and claude

What it does

Golang Gopls is an agent skill from context-labs/whip. Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors. Use when navigating or refactoring Go code. Not for published ecosystem → golang-pkg-go-dev; vuln audits → golang-security.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/cli.md`, `references/features.md` and `references/matrix.md`). Compatibility notes: Designed for Claude Code, Codex or similar harness. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH.

It sits in Development, covering Refactoring and Codebase onboarding. It works with Go and Model Context Protocol. The repository describes itself as: A fast coding-agent harness in Go. Tool-use loop, bubbletea TUI, provider-routable models with live catalog discovery, MCP support, background subagents. One binary, no runtime… The licence is MIT.

When your agent uses it

  • Refactoring Go code
  • Tasks that involve Refactoring
  • Tasks that involve Codebase onboarding

Example prompts

  • “/golang-gopls”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code, Codex or similar harness. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH.
  • Pre-approved tools (allowed-tools): Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(golangci-lint:*), Bash(git:*), Agent, Bash(gopls:*), LSP, mcp__gopls__*

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. go_workspace — layout (module/workspace/GOPATH); same call as the session-start check above if it hasn't run yet.
  2. go_search — fuzzy-locate a type/function/variable by name.
  3. go_file_context — right after reading any Go file for the first time, see what it pulls in from the rest of its package; re-run if that…
  4. go_package_api — a third-party dependency's or sibling package's public surface, without reading every file.

What it can do on your machine

Read from SKILL.md and the folder at commit 8876467. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Edit
    • Write
    • Glob
    • Grep
    • Bash(go:*)
    • Bash(golangci-lint:*)
    • Bash(git:*)
    • Agent
    • Bash(gopls:*)

    …and 2 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code, Codex or similar harness. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH.

    From compatibility in the SKILL.md frontmatter.

Context cost

Golang Gopls loads about 2.3k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 69 tokens; SKILL.md has 1,064 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from context-labs/whip at commit 8876467, republished under its MIT licence (© context-labs). 1,064 words, ~2,261 tokens.

Download SKILL.mdSave it as .claude/skills/golang-gopls/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
golang-gopls
description
Golang semantic code intelligence via `gopls` — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors. Use when navigating or refactoring Go code. Not for published ecosystem → `golang-pkg-go-dev`; vuln audits → `golang-security`.
allowed-tools
Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(golangci-lint:*), Bash(git:*), Agent, Bash(gopls:*), LSP, mcp__gopls__*
compatibility
Designed for Claude Code, Codex or similar harness. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH.
user-invocable
true
license
MIT
metadata.author
samber
metadata.version
1.1.0
paths
**/*.go

Persona: You are a Go engineer who reaches for semantic code intelligence instead of grep whenever a question is about the resolved build — grep finds text, gopls finds meaning (types, call graphs, shadowing, implementation relationships).

Dependencies: gopls — go install golang.org/x/tools/gopls@latest (v0.20+). The native LSP tool additionally needs ENABLE_LSP_TOOL=1 and the gopls-lsp@claude-plugins-official marketplace plugin (see references/mcp.md).

gopls is the official Go language server. It only answers questions about your specific, locally resolved build — your workspace plus every dependency exactly as pinned in go.sum, including replace directives. For a package that isn't part of that build (versions, docs, licenses, CVEs of something you haven't added yet), → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig) instead.

Three ways to reach gopls

Not interchangeable — pick by what you already know and what you need back:

  • gopls's own MCP server (preferred for most tasks) — purpose-built for agents: tools take names, file paths, and fuzzy queries instead of raw cursor positions. Register once per machine: claude mcp add gopls -- gopls mcp. Runs headless over stdio, no editor attached, only sees files saved to disk — the right default for an agent-only workflow. See references/mcp.md for every tool.
  • The native LSP tool — Claude Code's built-in editor-style integration. Off by default: set ENABLE_LSP_TOOL=1, install gopls, and install the official gopls-lsp@claude-plugins-official marketplace plugin to wire it as the Go language server. Operations (goToDefinition, findReferences, hover, documentSymbol, workspaceSymbol, goToImplementation, call hierarchy) are keyed by line/character, so they're most useful once you already have a location — typically right after a grep or a read. Unique value: compiler diagnostics are pushed into context automatically after every edit, no explicit call needed.
  • The gopls CLI — same engine, invoked as gopls <command> <file:line:col>. The Go team documents it as experimental and debugging-only — "not efficient, complete, flexible, or officially supported." Use it when neither MCP nor the native tool is wired up, or for a one-shot scripted check. Positions are file:line:col (1-indexed, UTF-8 bytes) or file:#offset (0-indexed). See references/cli.md.

Preference order: MCP → native LSP → CLI. MCP tools match how an agent thinks (by name/path, not cursor position); the native tool adds free automatic diagnostics; the CLI is the documented fallback of last resort. Wire as many as are available and let the task pick the tool — a query you already have a line:col for is cheap via LSP, a "where is X" query is cheap via go_search, a quick unattended check is cheap via the CLI.

Capability → CLI → MCP → native LSP

Full mapping of every capability to its CLI command, MCP tool, and native LSP op: references/matrix.md.

Use cases

  • Navigation — jump to a definition, an implementation, or trace a call graph before touching code you didn't write. Details: references/features.md.
  • Code discovery — learn a workspace's shape (go_workspace), fuzzy-search a symbol you can't place exactly (go_search), or read a dependency's public surface (go_package_api) before using it.
  • Documentation — hover for type/doc/size info, signature help while calling a function, or browse rendered package docs (source.doc, including internal packages pkg.go.dev never sees).
  • Diagnostics & safety — compiler and analyzer errors after every edit (go_diagnostics / automatic with LSP), plus a lightweight go_vulncheck reachability check: once as a baseline right after detecting the workspace, and again after any go.mod change.
  • Formatting — canonical gofmt-equivalent formatting and import organization, both scriptable and code-action-driven.
  • Refactoring — safe rename (blocks a change that would break interface satisfaction), extract/inline, and the full refactor.rewrite.* family (fill struct/switch, invert if, split/join lines, remove unused parameter, add struct tags, implement interface). Full catalog with gotchas: references/features.md.
Show full SKILL.md (496 more words)Show less

Efficient workflows

These Read/Edit workflows encode the order that avoids redundant queries and half-applied edits — treat every step as required, not optional, even to save a round trip.

  • Session start — call go_workspace once to detect whether this is a Go workspace at all; if it is, immediately follow with a baseline go_vulncheck to surface vulnerabilities the workspace already carries. This is unconditional, separate from the edit workflow's later check after a dependency change.

Read workflow (understand before touching anything):

  1. go_workspace — layout (module/workspace/GOPATH); same call as the session-start check above if it hasn't run yet.
  2. go_search — fuzzy-locate a type/function/variable by name.
  3. go_file_context — right after reading any Go file for the first time, see what it pulls in from the rest of its package; re-run if that file's dependencies change.
  4. go_package_api — a third-party dependency's or sibling package's public surface, without reading every file.

Edit workflow (iterate until diagnostics are clean):

  1. Read first (workflow above).
  2. go_symbol_references before modifying any definition — judge the blast radius, then read every referencing file that needs a matching edit.
  3. Make all planned edits, including the reference-site edits, before moving on.
  4. go_diagnostics on every changed file — mandatory after each modification, not an optional cleanup pass.
  5. Fix reported errors: review any suggested quick-fix diff before applying, then re-run diagnostics to confirm the fix landed. Ignore hint/info diagnostics unrelated to the task. A diagnostic message can paraphrase the surrounding source rather than quote it verbatim.
  6. Only if go.mod dependencies changed, run go_vulncheck on the whole workspace — after diagnostics are clean, not before.
  7. Run go test <changed-package-paths> — not ./... unless explicitly asked, since a full-repo run slows the iteration loop.

Gotchas worth knowing before you rely on a result:

  • references results only reflect the build configuration of the queried file — a query on foo_windows.go will not surface matches in bar_linux.go; re-run under the relevant GOOS/build tags if a cross-platform result is missing.
  • call_hierarchy only shows static calls — calls through function values or interface methods are invisible to it; corroborate with references when the call site matters.
  • Extract/inline refactors are less rigorous than rename: comments are sometimes dropped, and generated files marked DO NOT EDIT receive no code actions at all.
  • refactor.rewrite.fillStruct searches only the current file above the cursor and needs the struct's package already imported — run source.organizeImports first if the type was just typed in.

gopls vs godig vs Context7 vs govulncheck

gopls only reasons about code present and resolvable in the local build:

  • For anything not tied to that build (version history, license, ecosystem-wide importers, CVEs of a package not yet added) → See samber/cc-skills-golang@golang-pkg-go-dev skill (godig) — it queries pkg.go.dev directly, no local checkout needed.
  • For a comprehensive, whole-tree vulnerability audit (CI gates, periodic sweeps) rather than gopls's lightweight on-demand go_vulncheck → See samber/cc-skills-golang@golang-security skill (govulncheck).
  • Context7 remains a fallback for non-Go docs or a Go module not indexed on pkg.go.dev.

The full task-to-tool matrix lives in the samber/cc-skills-golang@golang-how-to skill's "godig vs gopls vs Context7 vs govulncheck" section.

© context-labs, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in .agents/skills/golang-gopls of context-labs/whip.

  • SKILL.md
  • references/cli.md
  • references/features.md
  • references/matrix.md
  • references/mcp.md
  • references/settings.md

Open the folder on GitHubat commit 8876467

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in context-labs/whip, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Golang Gopls next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Golang Gopls compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Golang Gopls this skillcontext-labs/whip1.1k1 repos~2.3kAutomated safety check: PassMIT
Gograph Go Repository Intelligenceozgurcd/gograph229—~4.8kAutomated safety check: NotesMIT
Grepaiyoanbernabeu/grepai1.9k—~1.1kAutomated safety check: PassMIT
Releaseyoanbernabeu/grepai1.9k—~918Automated safety check: PassMIT
Typed Dependencies with fp-go EffectIBM/fp-go2k—~4.3kAutomated safety check: PassApache-2.0
Ast Grep Findparcadei/Continuous-Claude-v33.9k1 repos~677Automated safety check: NotesMIT

Similar skills

  • Gives an agent working in a Go codebase a structural view through a local MCP server: call graphs, blast-radius and impact analysis, and bounded first-call exploration.

    229 GitHub stars~4.8k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Grepai

    yoanbernabeu/grepai

    Semantic code search and call-graph tracing. An agent skill from yoanbernabeu/grepai.

    1.9k GitHub stars~1.1k tokensUpdated 20 days ago
    DevelopmentAuto-check passed
  • Release

    yoanbernabeu/grepai

    Create a new release for grepai. An agent skill from yoanbernabeu/grepai.

    1.9k GitHub stars~918 tokensUpdated 20 days ago
    DevelopmentAuto-check passed
  • Teaches an agent to write fp-go v2 services with the Effect type, carrying dependencies in its type parameter instead of in context.Context or parameters.

    2k GitHub stars~4.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Ast Grep Find

    parcadei/Continuous-Claude-v3

    AST-based code search and refactoring via ast-grep MCP. An agent skill from parcadei/Continuous-Claude-v3.

    3.9k GitHub starsUsed in 1 repo~677 tokens
    DevelopmentAuto-check: notes
  • ast-grep Structural Search

    code-yeongyu/oh-my-openagent

    Searches and rewrites code by syntax-tree shape across 25 languages with ast-grep, for codemods, structural queries and YAML lint rules, using a Python wrapper script.

    70k GitHub stars~3.3k tokensUpdated today
    DevelopmentAuto-check passed

More from context-labs/whip

All 40 skills in this repo
  • Golang Lint

    context-labs/whip

    Linting best practices and golangci-lint configuration for Go — running linters, configuring .golangci.yml, nolint suppressions, selecting linters.

    1.1k GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • Golang Project Layout

    context-labs/whip

    Golang project layouts and workspaces. An agent skill from context-labs/whip.

    1.1k GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Golang Pkg Go Dev

    context-labs/whip

    Golang package/module docs via godig, a pkg.go.dev API client (CLI + MCP) — APIs, symbols, versions, importers, licenses, vulnerabilities.

    1.1k GitHub starsUsed in 2 repos~3k tokens
    Auto-check passed
  • Golang Stretchr Testify

    context-labs/whip

    Golang testing with stretchr/testify — assert, require, mock, suite: assertions, mock expectations, argument matchers, suite lifecycle, Eventually, JSONEq.

    1.1k GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • CI/CD with GitHub Actions for Golang — testing, linting, SAST, security scanning, coverage, Dependabot, Renovate, GoReleaser, release pipelines.

    1.1k GitHub stars~3.5k tokensUpdated 6 days ago
    Auto-check passed
  • Golang Data Structures

    context-labs/whip

    Golang data structures — slices/maps internals (capacity growth, preallocation, hash buckets), slices/maps packages, container/list/heap/ring, strings.Builder vs bytes.Buffer, generic collections…

    1.1k GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed

Categories

Questions about Golang Gopls

What does Golang Gopls do?

Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors. Golang Gopls is an agent skill from context-labs/whip. Golang semantic code intelligence via gopls — go-to-definition, references, call hierarchy, symbols, diagnostics, rename, refactors.

When should I use Golang Gopls?

Golang Gopls fits situations like: refactoring Go code; tasks that involve Refactoring; tasks that involve Codebase onboarding.

How do I install Golang Gopls in Claude Code?

Run `npx skills add context-labs/whip --skill golang-gopls -a claude-code`. Or copy the skill folder (.agents/skills/golang-gopls in context-labs/whip) into .claude/skills/golang-gopls in your project. Claude Code loads it when a task matches its description.

How do I install Golang Gopls in Codex?

Run `npx skills add context-labs/whip --skill golang-gopls -a codex`. Or copy the skill folder (.agents/skills/golang-gopls in context-labs/whip) into .agents/skills/golang-gopls in your project. Codex loads it when a task matches its description.

Can I use Golang Gopls in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add context-labs/whip --skill golang-gopls -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/golang-gopls, .gemini/skills/golang-gopls, .github/skills/golang-gopls and .opencode/skills/golang-gopls in your project.

What does Golang Gopls need to run?

Going by SKILL.md and its folder, Golang Gopls needs the command-line tools its instructions call (go and claude). Its frontmatter pre-approves these tools: Read, Edit, Write, Glob, Grep, Bash(go:*), Bash(golangci-lint:*), Bash(git:*), Agent, Bash(gopls:*), LSP, mcp__gopls__*. Compatibility (from SKILL.md): Designed for Claude Code, Codex or similar harness. Requires the gopls binary (go install golang.org/x/tools/gopls@latest) v0.20+ on PATH..

Does Golang Gopls access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Golang Gopls safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Golang Gopls use?

Golang Gopls is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Golang Gopls use?

About 2.3k tokens (SKILL.md is roughly 9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 10k tokens, read only when the agent opens those files.

What are the alternatives to Golang Gopls?

Skills that share tags, products or a category with Golang Gopls: Gograph Go Repository Intelligence (ozgurcd/gograph, 229 stars), Grepai (yoanbernabeu/grepai, 1.9k stars), Release (yoanbernabeu/grepai, 1.9k stars) and Typed Dependencies with fp-go Effect (IBM/fp-go, 2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Golang Gopls?

context-labs (a GitHub organization) maintains it in context-labs/whip, which has 1,083 GitHub stars. The repository holds 40 skills in this directory. The repository was last updated on October 5, 2026.

Source: context-labs/whip on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.