go-refactoring

Refactor Go codebases by moving code, renaming symbols, and restructuring packages with validation.

1|1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/dapperdivers/roundtable-arsenal --skill go-refactoring-dapperdivers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-refactoring
Source: https://github.com/dapperdivers/roundtable-arsenal/tree/main/coding/go-refactoring
Command: npx skills add https://github.com/dapperdivers/roundtable-arsenal --skill go-refactoring-dapperdivers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces the risk and complexity of Go code refactoring by providing safe, incremental patterns for moving code, renaming symbols, and restructuring packages without introducing compilation errors.

Core Features & Use Cases

  • Type-Safe Refactoring: Uses gopls workflows for reliable renames and reference discovery across Go codebases.
  • Incremental Code Changes: Applies build checks, goimports, and validation steps after each modification to keep changes controlled.
  • Use Case: Help a developer extract a Go function into a new package, update callers safely, and verify the resulting code with compilation and tests.

Quick Start

Use the go-refactoring skill to safely move a function from one Go package to another while keeping the project compiling.

Frequently Asked Questions about go-refactoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely move a function to a new package in Go without breaking compilation?

To safely move a function during Go refactoring, extract it into a new package and update callers incrementally. Validate the refactoring correctness by applying build checks and incremental compilation after each modification to maintain type safety.

What is the best way to rename symbols across a large Go codebase?

The best way to rename symbols in Go refactoring is using gopls workflows for reliable reference discovery. This ensures type-safe renames across the codebase, while incremental code changes and validation steps prevent compilation errors.

Do I need golangci-lint and gopls to restructure Go packages?

Yes, gopls and golangci-lint are required for Go code refactoring. Gopls handles reliable reference discovery and renames, while golangci-lint, goimports, and incremental compilation validate refactoring correctness and maintain type safety.

How does incremental code change validation work during Go refactoring?

Incremental code change validation applies build checks, goimports, and validation steps after each modification during Go refactoring. This controlled approach maintains type safety and verifies refactoring correctness throughout package extraction and API changes.

Can I use this approach for large-scale code maintenance workflows in Go?

Yes, this Go refactoring approach applies directly to large-scale code maintenance workflows. It handles package extraction, API changes, moving code, and restructuring packages safely by verifying refactoring correctness with incremental compilation practices.

Why does my Go project fail to compile after extracting a package?

A Go project may fail to compile after package extraction if callers are not updated safely. Apply incremental code changes with build checks, goimports, and gopls reference discovery after each modification to verify refactoring correctness.