Agent skill

Go Performance

by cxuu in cxuu/golang-skills

A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections.

Apache-2.0Auto-check passedDevelopment

Install Go Performance

skills CLI
$ npx skills add cxuu/golang-skills --skill go-performance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install cxuu/golang-skills go-performance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/go-performance .claude/skills/go-performance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
go-performance
GitHub stars
170
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
463 words
Files
4 (incl. scripts, references)
Skills in repo
20
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections.

  • Optimizing Go code
  • SKILL.md covers Resource Routing, Prefer strconv over fmt, Avoid Repeated String-to-Byte… and Prefer Specifying Container…, plus 5 more sections
  • Runs Shell scripts from its folder; calls go and bash
  • Investigating slow performance

What it does

Go Performance is an agent skill from cxuu/golang-skills. Use when optimizing Go code, investigating slow performance, or writing performance-critical sections. Also use when a user mentions slow Go code, string concatenation in loops, or asks about benchmarking, even if the user doesn't explicitly mention performance patterns. Does not cover concurrent performance patterns (see go-concurrency).

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/BENCHMARKS.md`, `references/STRING-OPTIMIZATION.md` and `scripts/bench-compare.sh`).

It sits in Development. The repository describes itself as: AI Agent Skills for idiomatic, production-ready Go code, distilled from Google, Uber, Community. The licence is Apache-2.0.

When your agent uses it

  • Optimizing Go code
  • Investigating slow performance
  • Writing performance-critical sections
  • A user mentions slow Go code

Example prompts

  • “/go-performance”

Requirements

  • A Bash shell
  • Pre-approved tools (allowed-tools): Bash(bash:*)

What it can do on your machine

Read from SKILL.md and the folder at commit 91f0c2e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(bash:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • go
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Go Performance loads about 1.3k tokens when it runs, and up to ~3.8k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 463 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from cxuu/golang-skills at commit 91f0c2e, republished under its Apache-2.0 licence (© cxuu). 463 words, ~1,275 tokens.

Download SKILL.mdSave it as .claude/skills/go-performance/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
go-performance
description
Use when optimizing Go code, investigating slow performance, or writing performance-critical sections. Also use when a user mentions slow Go code, string concatenation in loops, or asks about benchmarking, even if the user doesn't explicitly mention performance patterns. Does not cover concurrent performance patterns (see go-concurrency).
allowed-tools
Bash(bash:*)

Go Performance Patterns

Resource Routing

  • scripts/bench-compare.sh - Run when comparing benchmark results, saving baselines, or producing JSON benchmark metadata.
  • references/BENCHMARKS.md - Read when writing benchmarks, using benchstat, or profiling with pprof.
  • references/STRING-OPTIMIZATION.md - Read when optimizing string conversion, concatenation, or byte/string boundaries.

Performance-specific guidelines apply only to the hot path. Don't prematurely optimize—focus these patterns where they matter most.


Prefer strconv over fmt

When converting primitives to/from strings, strconv is faster than fmt:

go
s := strconv.Itoa(rand.Int()) // ~2x faster than fmt.Sprint()
ApproachSpeedAllocations
fmt.Sprint143 ns/op2 allocs/op
strconv.Itoa64.2 ns/op1 allocs/op

Avoid Repeated String-to-Byte Conversions

Convert a fixed string to []byte once outside the loop:

go
data := []byte("Hello world")
for b.Loop() { // Go 1.24+; use b.N loops only for older Go
    w.Write(data) // ~7x faster than []byte("...") each iteration
}

Prefer Specifying Container Capacity

Specify container capacity where possible to allocate memory up front. This minimizes subsequent allocations from copying and resizing as elements are added.

Map Capacity Hints

Provide capacity hints when initializing maps with make():

go
m := make(map[string]os.DirEntry, len(files))

Note: Unlike slices, map capacity hints do not guarantee complete preemptive allocation—they approximate the number of hashmap buckets required.

Slice Capacity

Provide capacity hints when initializing slices with make(), particularly when appending:

go
data := make([]int, 0, size)

Unlike maps, slice capacity is not a hint—the compiler allocates exactly that much memory. Subsequent append() operations incur zero allocations until capacity is reached.

ApproachTime (100M iterations)
No capacity2.48s
With capacity0.21s

The capacity version is ~12x faster due to zero reallocations during append.


Pass Values

Don't pass pointers as function arguments just to save a few bytes. If a function refers to its argument x only as *x throughout, then the argument shouldn't be a pointer.

go
func process(s string) { // not *string — strings are small fixed-size headers
    fmt.Println(s)
}

Common pass-by-value types: string, io.Reader, small structs.

Exceptions:

  • Large structs where copying is expensive
  • Small structs that might grow in the future

Show full SKILL.md (196 more words)Show less

String Concatenation

Choose the right strategy based on complexity:

MethodBest For
+Few strings, simple concat
fmt.SprintfFormatted output with mixed types
strings.BuilderLoop/piecemeal construction
strings.JoinJoining a slice
Backtick literalConstant multi-line text

Benchmarking and Profiling

Always measure before and after optimizing. Use Go's built-in benchmark framework and profiling tools.

bash
go test -bench=. -benchmem -count=10 ./...

Validation: After applying optimizations, run bash scripts/bench-compare.sh to measure the actual impact. Only keep optimizations with measurable improvement.


Quick Reference

PatternBadGoodImprovement
Int to stringfmt.Sprint(n)strconv.Itoa(n)~2x faster
Repeated []byte[]byte("str") in loopConvert once outside~7x faster
Map initializationmake(map[K]V)make(map[K]V, size)Fewer allocs
Slice initializationmake([]T, 0)make([]T, 0, cap)~12x faster
Small fixed-size args*string, *io.Readerstring, io.ReaderNo indirection
Simple string joins1 + " " + s2(already good)Use + for few strings
Loop string buildRepeated +=strings.BuilderO(n) vs O(n²)

  • Data structures: See go-data-structures when choosing between slices, maps, and arrays, or understanding allocation semantics
  • Declaration patterns: See go-declarations when using make with capacity hints or initializing maps and slices
  • Concurrency: See go-concurrency when parallelizing work across goroutines or using sync.Pool for buffer reuse
  • Style principles: See go-style-core when deciding whether an optimization is worth the readability cost

© cxuu, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/go-performance of cxuu/golang-skills.

  • SKILL.md
  • references/BENCHMARKS.md
  • references/STRING-OPTIMIZATION.md
  • scripts/bench-compare.sh

Open the folder on GitHubat commit 91f0c2e

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in cxuu/golang-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Go Performance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Go Performance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Performance this skillcxuu/golang-skills1701 repos~1.3kAutomated safety check: PassApache-2.0
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from cxuu/golang-skills

All 20 skills in this repo
  • Go Testing

    cxuu/golang-skills

    A skill your agent uses when writing, reviewing, or improving Go test code — including table-driven tests, subtests, parallel tests, test helpers, test doubles, and assertions with cmp.Diff.

    170 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Go Code Review

    cxuu/golang-skills

    A skill your agent uses when reviewing Go code or checking code against community style standards.

    170 GitHub stars~2.7k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Documentation

    cxuu/golang-skills

    A skill your agent uses when writing or reviewing documentation for Go packages, types, functions, or methods.

    170 GitHub stars~1.3k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Error Handling

    cxuu/golang-skills

    A skill your agent uses when writing Go code that returns, wraps, or handles errors — choosing between sentinel errors, custom types, and fmt.Errorf (%w vs %v), structuring error flow, or deciding…

    170 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Interfaces

    cxuu/golang-skills

    A skill your agent uses when defining or implementing Go interfaces, designing abstractions, creating mockable boundaries for testing, or composing types through embedding.

    170 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Go Naming

    cxuu/golang-skills

    A skill your agent uses when naming any Go identifier — packages, types, functions, methods, variables, constants, or receivers — to ensure idiomatic, clear names.

    170 GitHub stars~1.7k tokensUpdated 3 mo ago
    Auto-check passed

Categories

Questions about Go Performance

What does Go Performance do?

A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections. Go Performance is an agent skill from cxuu/golang-skills. Use when optimizing Go code, investigating slow performance, or writing performance-critical sections.

When should I use Go Performance?

Go Performance fits situations like: optimizing Go code; investigating slow performance; writing performance-critical sections; A user mentions slow Go code.

How do I install Go Performance in Claude Code?

Run `npx skills add cxuu/golang-skills --skill go-performance -a claude-code`. Or copy the skill folder (skills/go-performance in cxuu/golang-skills) into .claude/skills/go-performance in your project. Claude Code loads it when a task matches its description.

How do I install Go Performance in Codex?

Run `npx skills add cxuu/golang-skills --skill go-performance -a codex`. Or copy the skill folder (skills/go-performance in cxuu/golang-skills) into .agents/skills/go-performance in your project. Codex loads it when a task matches its description.

Can I use Go Performance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add cxuu/golang-skills --skill go-performance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/go-performance, .gemini/skills/go-performance, .github/skills/go-performance and .opencode/skills/go-performance in your project.

What does Go Performance need to run?

Going by SKILL.md and its folder, Go Performance needs a shell for the scripts in its folder and the command-line tools its instructions call (go and bash). Our summary lists: A Bash shell. Its frontmatter pre-approves these tools: Bash(bash:*).

Does Go Performance access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Go Performance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Go Performance use?

Go Performance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Go Performance use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Go Performance?

Skills that share tags, products or a category with Go Performance: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Performance?

cxuu (a GitHub user) maintains it in cxuu/golang-skills, which has 170 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on June 20, 2026.

Source: cxuu/golang-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.