gopls-refactor
Installation
SKILL.md
gopls Refactoring
gopls is Go's LSP server. It renames symbols with semantic precision — scope, packages, and interface implementations all handled correctly.
Three blind spots, each with a known fallback to sed:
- CGo files (
import "C") — gopls's type-checker cannot parse the C preamble, so it cannot rename inside these files. - Unexporting (uppercase→lowercase) when other packages reference the symbol — gopls's visibility rules treat this as illegal, so it refuses.
go:generatecomments — gopls renames Go identifiers, not comment text, so lines like//go:generate moq ... DeviceInterfacemust be updated by hand.
See WORKED-EXAMPLE.md for an end-to-end walkthrough (renaming DeviceInterface→Device in the hgml package).
Phase 0 — Collect facts
Run all four checks. Don't decide the path yet — you need Phase 3's reference list first.