# golang-refactoring

> Golang refactoring — safe, at-scale restructuring of existing Go code: a coverage-adaptive safety net, behavior-preserv…

Golang refactoring — safe, at-scale restructuring of existing Go code: a coverage-adaptive safety net, behavior-preserving transforms (gopls Rename/Extract, `gofmt -r`, `gopatch`), the Fowler catalog mapped to Go, breaking import cycles, and small stacked PRs. Apply when a function or type has grown too large, a code smell blocks a feature, or the user asks to refactor Go code — also for renaming at scale, extracting functions or interfaces, moving code between packages, or planning a multi-step refactor. Target styles owned elsewhere → See `samber/cc-skills-golang@golang-naming` (renames), `samber/cc-skills-golang@golang-project-layout` (splits), `samber/cc-skills-golang@golang-modernize` (idioms), `samber/cc-skills-golang@golang-code-style` (control flow), `samber/cc-skills-golang@golang-design-patterns` (patterns/DI).

- Type: Skill
- Made by: samber
- Category: Developer tools
- Formats: Skills
- Version: 1.1.1
- Source: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring
- Page: https://pluginboard.ai/skills/golang-refactoring

## Works with

- ChatGPT
- Claude
- Gemini
- GitHub Copilot
- Cursor
- Claude Code
- Codex
- Antigravity
- Gemini CLI
- Replit
- OpenClaw
- OpenCode
- Hermes Agent

## Install

### ChatGPT

In ChatGPT: Download the golang-refactoring folder and zip it, then Plugins → Skills → Create → Upload from your computer. Business and Enterprise plans.

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Claude

In Claude (web or desktop): Download the golang-refactoring folder and zip the folder itself, then upload it in Customize → Skills.

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Gemini

In Gemini: Download the golang-refactoring folder, then at gemini.google.com click Customize → Skills → Create → Upload and pick the folder (or a .zip of it).

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### GitHub Copilot

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.copilot/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Cursor

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.cursor/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Claude Code

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.claude/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Codex

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.agents/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Antigravity

In Antigravity: Copy the golang-refactoring folder into ~/.gemini/config/skills (Antigravity app and IDE) or ~/.gemini/antigravity-cli/skills (Antigravity CLI).

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Gemini CLI

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.gemini/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Replit

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring .agents/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### OpenClaw

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.openclaw/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### OpenCode

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.config/opencode/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

### Hermes Agent

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-refactoring ~/.hermes/skills/golang-refactoring
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-refactoring

---
From Pluginboard (https://pluginboard.ai).
