dsjacobsen

Go Refactor — Code Quality skill for Claude Code

Code Quality community

Refactor Go code to improve structure and readability.

How to install Go Refactor

Installs to ~/.claude/commands/dsjacobsen-agent-resources-go-refactor.md

Terminal
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/dsjacobsen/agent-resources/HEAD/.claude/commands/go-refactor.md -o ~/.claude/commands/dsjacobsen-agent-resources-go-refactor.md

Restart Claude Code, or start a new session, for it to be picked up.

What Go Refactor does


name: go-refactor description: Refactor Go code to improve structure and readability

Refactor the Go code in context to improve quality:

Use the `go-refactor` agent. Before refactoring:

  1. Verify tests exist - Don't refactor without tests
  2. Run tests - Ensure passing baseline

**Common refactorings:**

  • Extract function - Break up long functions
  • Extract interface - Create abstractions for testing
  • Simplify conditionals - Use early returns
  • **Remove duplicatio

Alternatives in Code Quality

  • Refactor — We are about to refactor code 1.6k ★
  • Refactor Claude Md — Refactor CLAUDE.md by extracting sections to dedicated docs with path-scoped rules 1.6k ★
  • Repren — Power rename/refactor tool (now with Claude Code skill support 371 ★

Full documentation available on GitHub

View Source Repository