chao-go-perf
go perf skill
chao-go-perf is an AI agent skill for analyzing and improving the performance of Go programs. It is built from authoritative Go performance references including Dave Cheney's high-performance Go workshop, dgryski's go-perfbook, Effective Go, and Go 101 Optimizations. The skill is designed for use with Claude Code and activates when you ask about Go performance topics such as benchmarks, pprof, escape analysis, or garbage collection.
The skill covers six main areas. For diagnosing bottlenecks, it uses Go's built-in profiling tool (pprof) to analyze CPU hot spots, memory allocation patterns, garbage collection pressure, lock contention, and concurrency scaling problems. For memory optimization, it addresses escape analysis, pre-allocating slices and maps, using sync.Pool for object reuse, optimizing struct field layout with fieldalignment, and tuning the garbage collector with GOGC and GOMEMLIMIT settings.
On the compiler side, the skill covers boundary-check elimination, inlining decisions, and visualizing compiler optimization passes using GOSSAFUNC. For CPU cache performance, it helps detect and remove false sharing across CPU cache lines, improve data locality by choosing between array-of-structs and struct-of-arrays layouts, and write code that is friendlier to the CPU branch predictor.
The skill also includes guidance on concurrency choices (when to use Mutex, RWMutex, atomic operations, or sync.Map), goroutine leak detection, writing correct benchmarks, and interpreting pprof and trace output. A version migration section covers performance-relevant changes across Go 1.12 through 1.27 and the full workflow for Profile-Guided Optimization.
The README is written in Chinese. To install, you clone the repository into Claude Code's global skills directory or use the npx skills command. It is licensed under MIT.