Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides safe, behavior-preserving Go refactoring using gopls, gofmt -r, eg, gopatch and go/analysis fixers, landed as small stacked PRs.
57% 83%+26 ptsof test cases passed
Passed 19 of 23 test cases with the skill, and 13 of 23 without it.
3 of 3 safety checks passed
8 agent runs
1 forkA fork is a copy of this skill that someone made so they could edit it for their own use. The original doesn't change.
Thinking mode: reason as thoroughly as possible here — on Claude Code, use ultrathink to trigger extended thinking explicitly. A wrong ordering call does not surface as an obviously wrong plan — it surfaces later as a broken build or a conflict-riddled merge, once several PRs are already in flight. Getting the sequencing right up front is cheaper than untangling it after the fact.
gopls codeaction surface the mechanical options available at each site — its day-to-day mechanics (rename, browsing references, call hierarchy) are owned by the samber/cc-skills-golang@golang-gopls skill.Once the blast radius is mapped, turn it into a refactoring inventory — one row per atomic change, so the whole refactor is visible as a single artifact before any PR exists:
| Transform | Files / callers touched | Risk | S/B |
|---|---|---|---|
Extract validateOrder from ProcessOrder | internal/orders/process.go (1 file, no external callers) | Low | S |
Rename Client.Send → Client.Publish | pkg/client/*.go, 14 call sites across 3 packages | Low | S |
Break import cycle billing ↔ orders via consumer-side interface | internal/billing/service.go, internal/orders/service.go | High | S |
Move Invoice type to pkg/billing, alias from old location | internal/orders/invoice.go → pkg/billing/invoice.go, ~9 call sites | High | S |
Replace Invoice.Total's O(n²) discount-lookup loop with a map lookup | pkg/billing/invoice.go | Medium | S |
Switch Invoice.Total computation to Decimal instead of float64 | pkg/billing/invoice.go and its tests | Medium | B |
SKILL.md (Low/Medium/High).samber/cc-skills-golang@golang-benchmark skill) and a closer read for subtle correctness changesThis step ends with explicit user sign-off before any code is touched. This is a hard gate, not a suggestion: present the inventory and the staged PR plan derived from it (see below), and wait for approval. A refactor that starts moving code before the human has seen the shape of the whole plan cannot be course-corrected cheaply — by the time a wrong assumption surfaces, several PRs may already be staged on top of it.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.