agentleFS
jkeddarijkeddari/go-skills/skills/golang-refactoring/SKILL.md

golang-refactoring

Skill1 starsChanged 4 months agoMITView on GitHub

Golang refactoring workflow for safe structural change: blast-radius discovery, coverage-adaptive safety nets, semantic rename and extract operations, package moves, import-cycle removal, staged commits, and behavior-preserving verification. Use when restructuring existing Go code without intentionally changing its public behavior.

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Thinking mode: Use ultrathink for large package moves, import-cycle removal, and refactors with weak test coverage.

    line 21
  2. Distinctive:

    Stop and reassess when a supposedly mechanical change alters behavior.

    line 32

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Persona: You are a Go refactoring engineer. Reduce uncertainty before changing structure and keep every step reviewable.

Thinking mode: Use ultrathink for large package moves, import-cycle removal, and refactors with weak test coverage.

Go Refactoring

Core loop

  1. State the smell, desired boundary, and behavior that must remain unchanged.
  2. Map definitions, references, callers, implementations, generated code, serialization tags, and tests.
  3. Build the smallest trustworthy safety net for the affected behavior.
  4. Apply one structural transformation at a time using semantic tools when possible.
  5. Format, compile, test, inspect the diff, and commit only coherent steps.
  6. Stop and reassess when a supposedly mechanical change alters behavior.

Conditional references

  • Safety-net selection: safety-net.md
  • End-to-end workflow: workflow.md
  • Refactoring catalog: catalog.md
  • Structural package changes: structural.md
  • Go tooling: go-tooling.md

→ See golang-gopls for semantic operations, golang-architecture for the destination design, golang-testing for behavioral constraints, and golang-code-quality for local improvements.

Download now (ZIP)

  • Other versions6 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 6

    1. samber/cc-skills-golang★ 3.6ksame name
    2. klawisha012/agentsync★ 18same name
    3. tstapler/dotfiles★ 8same name
    4. rockcookies/skills★ 1same name
    5. reagin/agent-skills★ 0same name
    6. rzisso/golang-skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use golang-pkg-go-dev, golang-samber-ro and 10 more.

    Other files people use alongside this one.

    Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
    • rockcookiesSkill

      golang-pkg-go-dev

      Golang package and module documentation and exploration via `godig`, a pkg.go.dev API client (CLI + MCP server) — package docs, API references, symbols, code examples, available versions, importers (who imports a package), licenses, and known vulnerabilities. Read-only, no auth. Use for looking up any Go/Golang library's documentation, API signatures, usage examples, which versions exist, whether a dependency has CVEs, or who imports a package — prefer this over Context7 for any Go package or module. Triggers on: how to use a Go library, Go API docs, import usage, code examples, pkg.go.dev. Not for upgrading dependencies (→ See `golang-dependency-management` skill) or choosing a library (→ See `golang-popular-libraries` skill). Not for local symbols, or for navigating an already-used dependency's resolved source, call sites, or generic instantiations — → See `golang-gopls` skill for those.

      Also in 5 projects that use this

    • guynhsichngeodiecSkill

      golang-samber-ro

      Reactive streams and event-driven programming in Golang using samber/ro — ReactiveX implementation with 150+ type-safe operators, cold/hot observables, 5 subject types (Publish, Behavior, Replay, Async, Unicast), declarative pipelines via Pipe, 40+ plugins (HTTP, cron, fsnotify, JSON, logging), automatic backpressure, error propagation, and Go context integration. Apply when using or adopting samber/ro, when the codebase imports github.com/samber/ro, or when building asynchronous event-driven pipelines, real-time data processing, streams, or reactive architectures in Go. Not for finite slice transforms (-> See golang-samber-lo skill).

      Also in 5 projects that use this

    • guynhsichngeodiecSkill

      golang-benchmark

      Golang benchmarking, profiling, and performance measurement. Use when writing, running, or comparing Go benchmarks, profiling hot paths with pprof, interpreting CPU/memory/trace profiles, analyzing results with benchstat, setting up CI benchmark regression detection, or investigating production performance with Prometheus runtime metrics. Also use when the developer needs deep analysis on a specific performance indicator - this skill provides the measurement methodology, while golang-performance provides the optimization patterns.

      Also in 5 projects that use this

    • alexastrumSkill

      golang-google-wire

      Compile-time dependency injection in Golang using google/wire — wire.NewSet, wire.Build, wire.Bind (interface→concrete), wire.Struct, wire.Value, wire.InterfaceValue, wire.FieldsOf, cleanup functions, //go:build wireinject injector files, and generated wire_gen.go. Apply when using or adopting google/wire, when the codebase imports `github.com/google/wire`, or when wiring an application graph at compile time via `wire.Build`. For runtime DI with reflection, see `samber/cc-skills-golang@golang-uber-dig` skill.

      Also in 4 projects that use this

    • alexastrumSkill

      golang-graphql

      Implements GraphQL APIs in Golang using gqlgen or graphql-go. Apply when building GraphQL servers, designing schemas, writing resolvers, handling subscriptions, or integrating GraphQL with existing Go HTTP services. Also apply when the codebase imports `github.com/99designs/gqlgen` or `github.com/graph-gophers/graphql-go`.

      Also in 4 projects that use this

    • +6 more from guynhsichngeodiec
    • +1 more from alexastrum
  • In this repository14 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.