Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design.

Apache-2.0Auto-check passedDevelopment

Install Go Standards

skills CLI
$ npx skills add asymmetric-research/solana-exporter --skill go-standards -a claude-code

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

GitHub CLI
$ gh skill install asymmetric-research/solana-exporter go-standards --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/asymmetric-research/solana-exporter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/go-standards .claude/skills/go-standards && 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-standards
GitHub stars
133
Token cost
~1.6k tokens
SKILL.md length
761 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design.

  • Works in 5 steps: gofmt -w . (or goimports -w .) — CI gate. → go build ./... and go test ./... pass… → go vet ./... clean. → …
  • Refactoring any .go file
  • SKILL.md covers Naming, Errors, Control Flow & Style and Concurrency, plus 4 more sections
  • Calls go

What it does

Go Standards is an agent skill from asymmetric-research/solana-exporter. Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design. Use when writing, reviewing, or refactoring any .go file.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering API design and Refactoring. The repository describes itself as: Prometheus monitor for the Solana blockchain. The licence is Apache-2.0.

When your agent uses it

  • Refactoring any .go file
  • Tasks that involve API design
  • Tasks that involve Refactoring

Example prompts

  • “/go-standards”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. gofmt -w . (or goimports -w .) — CI gate.
  2. go build ./... and go test ./... pass (-race if concurrency changed).
  3. go vet ./... clean.
  4. Errors wrapped with context; no silent _ = err.
  5. Exported symbols documented; happy path un-nested.

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    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 Standards loads about 1.6k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 761 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from asymmetric-research/solana-exporter at commit 4b7d4ab, republished under its Apache-2.0 licence (© asymmetric-research). 761 words, ~1,555 tokens.

Download SKILL.mdSave it as .claude/skills/go-standards/SKILL.md (or your agent's skills folder).
name
go-standards
description
Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design. Use when writing, reviewing, or refactoring any .go file.

Go Standards

Idiomatic Go for this codebase. Distilled from Effective Go, the Google Go Style Guide, and Go Code Review Comments. When in doubt, optimize for the reader: clarity over cleverness, simplicity over abstraction.

Always run gofmt -w . before finishing. CI fails on any unformatted file. Prefer goimports to keep imports grouped and sorted.

Naming

  • Packages: short, lowercase, no underscores or camelCase (rpc, slog, not rpcClient or rpc_client). The package name is part of every identifier's path — avoid stutter: rpc.Client, not rpc.RPCClient.
  • Exported identifiers: MixedCaps. Unexported: mixedCaps. Never snake_case.
  • Getters: no Get prefix. A field owner is read via Owner(), not GetOwner(). (RPC method names mirroring an external API like GetVoteAccounts are the exception — they name the wire call, not a Go getter.)
  • Interfaces: single-method interfaces take the method name + -er (Reader, Watcher, Collector).
  • Length tracks scope: i, r, b are fine in a 3-line loop; use descriptive names for package-level or long-lived values. Receiver names are 1–2 chars and consistent across all methods of a type (c *Client, not this or self).
  • Acronyms keep their case: URL, ID, RPC, HTTP — parseURL, userID, serveHTTP. Not parseUrl or userId.
  • Errors: sentinel values are ErrFoo; error types are FooError.

Errors

  • Return error as the last return value. Handle it — never discard with _ unless you can articulate why.
  • Add context when propagating, and wrap with %w so callers can errors.Is/errors.As:
    go
    if err != nil {
        return fmt.Errorf("fetching block %d: %w", slot, err)
    }
  • Error strings are lowercase, no trailing punctuation (they get wrapped): "connection refused", not "Connection refused.".
  • Compare with errors.Is (sentinels) and errors.As (typed errors). Do not compare with == across wrap boundaries or string-match on err.Error().
  • Keep the happy path at minimum indentation. Return early on error rather than nesting the success case in an else:
    go
    if err != nil {
        return err
    }
    // happy path continues unindented
  • panic is for programmer bugs / truly unrecoverable state, not ordinary error flow. Library code returns errors.

Control Flow & Style

  • No else after a block that ends in return/continue/break.
  • Use defer for cleanup (Close, Unlock, Done) immediately after acquiring the resource — it runs even on panic and keeps acquire/release adjacent.
  • Prefer for range. Zero values are usable: a nil slice appends fine, a nil map reads fine (writes panic), a zero sync.Mutex is unlocked and ready.
  • Slices: make([]T, 0, n) when you know the capacity. Distinguish nil from empty only when the API contract does.
  • Accept interfaces, return concrete types. Don't define an interface until there are ≥2 implementations or a real seam for testing — Go interfaces are satisfied implicitly, so add them at the consumer, not preemptively at the producer.
  • Keep interfaces small. The bigger the interface, the weaker the abstraction.
Show full SKILL.md (373 more words)Show less

Concurrency

  • "Don't communicate by sharing memory; share memory by communicating" — but a plain sync.Mutex is often the simplest correct choice. Pick the clearest tool, not the cleverest.
  • The goroutine that creates a channel usually owns closing it. Never close a channel from the receiver side or close it twice.
  • Every goroutine needs a clear exit path. Thread a context.Context for cancellation; pass it as the first parameter (ctx context.Context) and never store it in a struct.
  • Protect shared mutable state with a mutex; keep the critical section small. Guard-then-defer Unlock at the top of the method when the whole body is critical.
  • Run tests with -race when touching concurrent code: go test -race ./....

Comments & Docs

  • Every exported identifier has a doc comment, starting with the identifier's name: // Client issues RPC calls…, // WatchSlots advances the watermark….
  • Comments explain why, not what the code plainly shows. Delete comments that restate the code.
  • Package doc: one // Package x … comment, on the primary file.

Testing

  • Table-driven tests are the default. Name cases and run subtests so failures are addressable:
    go
    tests := []struct {
        name string
        in   int
        want int
    }{
        {"zero", 0, 0},
        {"positive", 2, 4},
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            if got := Double(tt.in); got != tt.want {
                t.Errorf("Double(%d) = %d, want %d", tt.in, got, tt.want)
            }
        })
    }
  • Message format: t.Errorf("Func(%v) = %v, want %v", in, got, want) — got before want, always.
  • Use t.Helper() in assertion helpers. Use t.Cleanup over bare defer for test teardown. Use t.Parallel() where cases are independent.
  • Prefer the in-repo MockServer (pkg/rpc/mock.go) over hitting a real node; extend it rather than adding new test infra.
  • testify/require (stop on failure) vs assert (continue) — use require for preconditions that make the rest of the test meaningless.

Project-Specific

  • Go 1.22, CGO_ENABLED=0. No new CGO dependencies.
  • Logging goes through pkg/slog (zap wrapper): slog.Get(). Don't use the standard log package or fmt.Println in production paths.
  • mj_utils.go / prettyPrint helpers are debug-only — never in production code paths.
  • Keep the README metrics/labels/flags tables in sync when adding metrics or flags (see AGENTS.md).

Quick Checklist

Before finishing any Go change:

  1. gofmt -w . (or goimports -w .) — CI gate.
  2. go build ./... and go test ./... pass (-race if concurrency changed).
  3. go vet ./... clean.
  4. Errors wrapped with context; no silent _ = err.
  5. Exported symbols documented; happy path un-nested.

© asymmetric-research, 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

Just SKILL.md in .agents/skills/go-standards of asymmetric-research/solana-exporter.

Open the folder on GitHubat commit 4b7d4ab

Compare with similar skills

Go Standards 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 Standards compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Go Standards this skillasymmetric-research/solana-exporter133—~1.6kAutomated safety check: PassApache-2.0
Atomui Control OptimizationAtomUI/AtomUI842—~3.4kAutomated safety check: PassLGPL-3.0
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT
Rust Skillsnoh-rs/nohrs156—~5.3kAutomated safety check: PassMIT
Software Design Philosophyluoling8192/software-design-philosophy-skill346—~3.4kAutomated safety check: PassMIT
Goinference-gateway/inference-gateway214—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • A skill your agent uses when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness…

    842 GitHub stars~3.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-check passed
  • Rust Skills

    noh-rs/nohrs

    Comprehensive Rust coding guidelines with 179 rules across 14 categories.

    156 GitHub stars~5.3k tokensUpdated 9 days ago
    DevelopmentAuto-check passed
  • Software Design Philosophy

    luoling8192/software-design-philosophy-skill

    Software design philosophy guide based on John Ousterhout's "A Philosophy of Software Design." Use this skill during: code reviews, architecture discussions, API design, module decomposition…

    346 GitHub stars~3.4k tokensUpdated 3 mo ago
    DevelopmentAuto-check passed
  • Go

    inference-gateway/inference-gateway

    Idiomatic Go - package and interface design, error wrapping, table-driven tests, generics, the modern standard library (slices/maps/cmp/errors.Join), current syntax, and logging discipline.

    214 GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • Code Quality

    static-web-server/static-web-server

    Review or self-check a change to the Static Web Server (SWS) project before it is called done — correctness, invariants, API design, concurrency, maintainability, and an SWS-specific review checklist.

    2.4k GitHub stars~1.1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from asymmetric-research/solana-exporter

  • Writing Markdown

    asymmetric-research/solana-exporter

    Formatting conventions for markdown files — line width, table alignment, diagrams, and style.

    133 GitHub stars~576 tokensUpdated 2 mo ago
    Auto-check passed

Questions about Go Standards

What does Go Standards do?

Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design. Go Standards is an agent skill from asymmetric-research/solana-exporter. Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design.

When should I use Go Standards?

Go Standards fits situations like: refactoring any .go file; tasks that involve API design; tasks that involve Refactoring.

How do I install Go Standards in Claude Code?

Run `npx skills add asymmetric-research/solana-exporter --skill go-standards -a claude-code`. Or copy the skill folder (.agents/skills/go-standards in asymmetric-research/solana-exporter) into .claude/skills/go-standards in your project. Claude Code loads it when a task matches its description.

How do I install Go Standards in Codex?

Run `npx skills add asymmetric-research/solana-exporter --skill go-standards -a codex`. Or copy the skill folder (.agents/skills/go-standards in asymmetric-research/solana-exporter) into .agents/skills/go-standards in your project. Codex loads it when a task matches its description.

Can I use Go Standards 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 asymmetric-research/solana-exporter --skill go-standards -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-standards, .gemini/skills/go-standards, .github/skills/go-standards and .opencode/skills/go-standards in your project.

What does Go Standards need to run?

Going by SKILL.md and its folder, Go Standards needs the command-line tools its instructions call (go).

Does Go Standards 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 Standards 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. Review the folder before installing.

What licence does Go Standards use?

Go Standards 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 Standards use?

About 1.6k tokens (SKILL.md is roughly 6.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Go Standards?

Skills that share tags, products or a category with Go Standards: Atomui Control Optimization (AtomUI/AtomUI, 842 stars), Rust Skills (JMBeresford/retrom, 2.1k stars), Rust Skills (noh-rs/nohrs, 156 stars) and Software Design Philosophy (luoling8192/software-design-philosophy-skill, 346 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Go Standards?

asymmetric-research (a GitHub organization) maintains it in asymmetric-research/solana-exporter, which has 133 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on July 31, 2026.

Source: asymmetric-research/solana-exporter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.