Skip to content
samber avatar

Golang Refactoring

Behavior-preserving Go refactoring workflow with a coverage-gated safety net, gopls-driven transforms, and small stacked PRs.

CCM score
65 of 100
skills.sh installs
14.1K
GitHub stars
4K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the core loop: blast-radius mapping with gopls, a safety net gated on coverage, tool-driven steps, verification, and atomic commits
  • Includes the Fowler refactoring catalog mapped to Go, tooling escalation from gofmt -r to eg, gopatch, and go/analysis fixers, plus import-cycle and package-move guidance
  • Enforces separate PRs for structural and behavioral changes, and separate PRs for code moves versus optimizations, targeting 100–500 lines each
  • Designed for planning and executing multi-step Go restructuring with human sign-off gates; style-specific work defers to naming, layout, modernize, code-style, and design-pattern skills

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-refactoring -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Community default. A company skill that explicitly supersedes samber/cc-skills-golang@golang-refactoring skill takes precedence.

Persona: You are a Go refactoring engineer. You never change structure and behavior in the same step — you keep a green test net, prefer behavior-preserving tools over hand-edits, and land changes as small, reviewable PRs.

Thinking mode: Reason as thoroughly as possible for the planning/ordering step — mapping blast radius, sequencing PRs to avoid merge conflicts, and deciding where a refactor can safely go parallel all punish shallow reasoning, since a wrong ordering call surfaces as a broken build or a conflict-riddled merge, not as an obviously wrong plan. On Claude Code, use ultrathink to trigger extended thinking explicitly.

Details

Repository
github.com/samber/cc-skills-golang
Categories
Go, Code Review & Quality
First seen
Jul 14, 2026

Questions

What is the golang-refactoring skill for?

The golang-refactoring skill guides an agent through safe, at-scale restructuring of existing Go code without changing its behavior. It covers a coverage-based safety net, behavior-preserving transforms with gopls, breaking import cycles, and landing changes as small stacked PRs.

How do I install the golang-refactoring skill?

Run npx -y skills add samber/cc-skills-golang --skill golang-refactoring -y in your project. Once installed, the agent can plan and carry out multi-step Go refactors with sign-off gates before any edit.

Where does golang-refactoring rank among Go skills?

It sits in the Go category on Claude Marketplaces, in the top 50 of the category page. Its neighbors there include golang-code-style, golang-testing, golang-error-handling, golang-design-patterns and golang-concurrency, which cover narrower topics it defers to.

What does golang-refactoring need to run?

It needs gopls as its primary tool and git, and the skill metadata lists go and gopls as required binaries. Optional tools such as golangci-lint, benchstat, eg and gopatch add extra checks and transforms.

More from samber/cc-skills-golang

All 47

Similar to Golang Refactoring

More Go