refactor-go

Refactor Go code through investigation, planning, agent-based implementation, and parallel review.

5|Updated Sep 9, 2017
One-click install
npx skills add https://github.com/hpcsc/dotfiles --skill refactor-go-hpcsc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactor-go
Source: https://github.com/hpcsc/dotfiles/tree/main/link/common/claude/.claude/skills/refactor-go
Command: npx skills add https://github.com/hpcsc/dotfiles --skill refactor-go-hpcsc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Go refactorings like renames, extractions, and restructures touch many files and tests, and doing them by hand risks missing call sites or breaking interfaces. This Skill runs a gated workflow that maps the full impact, gets plan approval, implements via a dedicated agent, and verifies with parallel reviewers. ## Core Features & Use Cases - Impact Investigation: Uses ast-grep to find all references, affected files, impacted tests, and exposed interfaces before any change. - Approval-Gated Planning: Presents a refactoring plan and loops on user feedback until explicit approval before implementation. - Agent-Based Implementation and Review: Delegates changes to a go-refactorer agent, then runs go-test-reviewer and go-guidelines-reviewer agents in parallel on the staged diff. - Use Case: Rename a widely used Go interface method across packages: the Skill maps every call site, plans the change, implements it, runs tests, and has reviewers verify the staged diff before you commit. ## Quick Start Ask the AI to refactor a specific Go function or type, for example to rename a method or extract a helper, and let it walk through the investigation and approval phases.

Frequently Asked Questions about refactor-go

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

FAQPage Schema
How do I refactor Go code safely across multiple packages?▼

Map all references with ast-grep before changing anything, then plan the changes and get approval. This Skill automates that flow: it investigates impact, implements via a go-refactorer agent, and verifies with test and guidelines reviewers.

How to find all references to a Go function before renaming it?▼

Use ast-grep with a pattern and the --lang=go flag to locate every reference across the codebase. The Skill also identifies impacted *_test.go files, affected interfaces, and all call sites during its investigation phase.

Does this Go refactoring workflow require user approval?▼

Yes, the planning phase is a hard approval gate. The Skill presents the refactoring plan and loops on feedback until you explicitly approve, and it never proceeds to implementation without that approval.

What happens when tests fail after a Go refactoring?▼

The Skill fixes the failures and re-runs tests, up to 3 iterations. If the agent still reports failures after max retries, it escalates to the user instead of continuing silently.

How are Go refactoring changes reviewed before commit?▼

All changes are staged and the diff is sent to two parallel reviewers: a go-test-reviewer and a go-guidelines-reviewer. If either returns block or NEEDS REVISION, findings are fixed and re-reviewed, with a maximum of 3 revision iterations.