Go Pedantry
chromedp/chromedp
This skill should be used when the user is writing Go code and needs guidance on Go-specific pedantry: error wrapping with fmt.Errorf and %w, interface design (accept interfaces return structs)…
A skill your agent uses when deciding whether to use Go generics, writing generic functions or types, choosing constraints, or picking between type aliases and type definitions.
$ npx skills add cxuu/golang-skills --skill go-generics -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install cxuu/golang-skills go-generics --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/go-generics .claude/skills/go-generics && rm -rf skills-srcUse ~/.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/
Install the "go-generics" agent skill from https://github.com/cxuu/golang-skills/tree/main/skills/go-generics into .claude/skills/go-generics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "go-generics", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/cxuu/golang-skills/tree/main/skills/go-genericsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add cxuu/golang-skills --skill go-generics -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install cxuu/golang-skills go-generics --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/go-generics .agents/skills/go-generics && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "go-generics" agent skill from https://github.com/cxuu/golang-skills/tree/main/skills/go-generics into .agents/skills/go-generics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "go-generics", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add cxuu/golang-skills --skill go-generics -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install cxuu/golang-skills go-generics --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/go-generics .cursor/skills/go-generics && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "go-generics" agent skill from https://github.com/cxuu/golang-skills/tree/main/skills/go-generics into .cursor/skills/go-generics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "go-generics", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/cxuu/golang-skills.git --path skills/go-generics--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add cxuu/golang-skills --skill go-generics -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install cxuu/golang-skills go-generics --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/go-generics .gemini/skills/go-generics && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "go-generics" agent skill from https://github.com/cxuu/golang-skills/tree/main/skills/go-generics into .gemini/skills/go-generics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "go-generics", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install cxuu/golang-skills go-genericsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add cxuu/golang-skills --skill go-generics -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/go-generics .github/skills/go-generics && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "go-generics" agent skill from https://github.com/cxuu/golang-skills/tree/main/skills/go-generics into .github/skills/go-generics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "go-generics", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add cxuu/golang-skills --skill go-generics -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install cxuu/golang-skills go-generics --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/cxuu/golang-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/go-generics .opencode/skills/go-generics && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "go-generics" agent skill from https://github.com/cxuu/golang-skills/tree/main/skills/go-generics into .opencode/skills/go-generics/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "go-generics", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
go-genericsA skill your agent uses when deciding whether to use Go generics, writing generic functions or types, choosing constraints, or picking between type aliases and type definitions.
Go Generics is an agent skill from cxuu/golang-skills. Use when deciding whether to use Go generics, writing generic functions or types, choosing constraints, or picking between type aliases and type definitions. Also use when a user is writing a utility function that could work with multiple types, even if they don't mention generics explicitly. Does not cover interface design without generics (see go-interfaces).
Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/CONSTRAINTS.md`).
It sits in Development, covering API design. 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.
Read from SKILL.md and the folder at commit 91f0c2e. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are go).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Go Generics loads about 1.2k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 94 tokens; SKILL.md has 361 words of instructions outside code blocks.
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.
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.
The full file from cxuu/golang-skills at commit 91f0c2e, republished under its Apache-2.0 licence (© cxuu). 361 words, ~1,230 tokens.
.claude/skills/go-generics/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Compatibility: Generics require Go 1.18+.
references/CONSTRAINTS.md - Read when composing constraints, using type sets, or choosing between generics and interfaces.Start with concrete types. Generalize only when a second type appears.
any and excessive type switching"Write code, don't design types." — Robert Griesemer and Ian Lance Taylor
Do multiple types share identical logic?
├─ No → Use concrete types
├─ Yes → Do they share a useful interface?
│ ├─ Yes → Use an interface
│ └─ No → Use genericsBad:
// Premature generics: only ever called with int
func Sum[T constraints.Integer | constraints.Float](vals []T) T {
var total T
for _, v := range vals {
total += v
}
return total
}Good:
func SumInts(vals []int) int {
var total int
for _, v := range vals {
total += v
}
return total
}| Name | Typical Use |
|---|---|
T | General type parameter |
K | Map key type |
V | Map value type |
E | Element/item type |
For complex constraints, a short descriptive name is acceptable:
func Marshal[Opts encoding.MarshalOptions](v any, opts Opts) ([]byte, error)Type aliases (type Old = new.Name) are rare — use only for package migration
or gradual API refactoring.
Combine constraints with ~ (underlying type) and | (union):
type Numeric interface {
~int | ~int8 | ~int16 | ~int32 | ~int64 |
~float32 | ~float64
}
func Sum[T Numeric](vals []T) T {
var total T
for _, v := range vals {
total += v
}
return total
}Use the constraints package or cmp package (Go 1.21+) for standard constraints
like cmp.Ordered instead of writing your own.
// Bad: generic wrapper adds complexity without value
type Set[T comparable] struct {
m map[T]struct{}
}
// Better: use map[T]struct{} directly when the usage is simple
seen := map[string]struct{}{}Generics justify their complexity when they eliminate duplication across multiple call sites. A single-use generic is just indirection.
// Bad: T is only used to satisfy an interface — just use the interface
func Process[T io.Reader](r T) error { ... }
// Good: accept the interface directly
func Process(r io.Reader) error { ... }// Bad: constraint is more restrictive than needed
func Contains[T interface{ ~int | ~string }](slice []T, target T) bool { ... }
// Good: comparable is sufficient
func Contains[T comparable](slice []T, target T) bool { ... }| Topic | Guidance |
|---|---|
| When to use generics | Only when multiple types share identical logic and interfaces don't suffice |
| Starting point | Write concrete code first; generalize later |
| Naming | Single uppercase letter (T, K, V, E) |
| Type aliases | Same type, alternate name; use only for migration |
| Constraint composition | Use ~ for underlying types, ` |
| Common pitfall | Don't genericize single-use code or when interfaces suffice |
© 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
SKILL.md and 1 other file (references) in skills/go-generics of cxuu/golang-skills.
Open the folder on GitHubat commit 91f0c2e
Go Generics 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Go Generics this skillcxuu/golang-skills | 172 | — | ~1.2k | Automated safety check: Pass | Apache-2.0 | |
| Go Pedantrychromedp/chromedp | 13k | — | ~3.7k | Automated safety check: Pass | MIT | |
| LangBot Core Developmentlangbot-app/LangBot | 18k | — | ~1.4k | Automated safety check: Notes | Apache-2.0 | |
| Breaking Change Analysisruby-git/ruby-git | 1.8k | — | ~1.7k | Automated safety check: Pass | MIT | |
| Atomui Control OptimizationAtomUI/AtomUI | 842 | — | ~3.4k | Automated safety check: Pass | LGPL-3.0 | |
| Go Standardsasymmetric-research/solana-exporter | 133 | — | ~1.6k | Automated safety check: Pass | Apache-2.0 |
chromedp/chromedp
This skill should be used when the user is writing Go code and needs guidance on Go-specific pedantry: error wrapping with fmt.Errorf and %w, interface design (accept interfaces return structs)…
langbot-app/LangBot
Covers developing the LangBot core backend and web UI: dev setup, repo layout, API auth types, adding endpoints, migrations and keeping the MCP server in step.
ruby-git/ruby-git
Assesses what an API change would break before it is made, finds every usage, documents the impact and plans a deprecation or migration path.
AtomUI/AtomUI
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…
asymmetric-research/solana-exporter
Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design.
sketch7/FluentlyHttpClient
Write modern, high-performance C code using records, pattern matching, value objects, async/await, Span<T/Memory<T, and best-practice API design patterns.
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.
cxuu/golang-skills
A skill your agent uses when reviewing Go code or checking code against community style standards.
cxuu/golang-skills
A skill your agent uses when optimizing Go code, investigating slow performance, or writing performance-critical sections.
cxuu/golang-skills
A skill your agent uses when writing or reviewing documentation for Go packages, types, functions, or methods.
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…
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.
Categories
A skill your agent uses when deciding whether to use Go generics, writing generic functions or types, choosing constraints, or picking between type aliases and type definitions. Go Generics is an agent skill from cxuu/golang-skills. Use when deciding whether to use Go generics, writing generic functions or types, choosing constraints, or picking between type aliases and type definitions.
Go Generics fits situations like: deciding whether to use Go generics; writing generic functions; choosing constraints; picking between type aliases and type definitions.
Run `npx skills add cxuu/golang-skills --skill go-generics -a claude-code`. Or copy the skill folder (skills/go-generics in cxuu/golang-skills) into .claude/skills/go-generics in your project. Claude Code loads it when a task matches its description.
Run `npx skills add cxuu/golang-skills --skill go-generics -a codex`. Or copy the skill folder (skills/go-generics in cxuu/golang-skills) into .agents/skills/go-generics in your project. Codex loads it when a task matches its description.
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-generics -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-generics, .gemini/skills/go-generics, .github/skills/go-generics and .opencode/skills/go-generics in your project.
SKILL.md names no scripts, command-line tools or credentials: Go Generics is instructions for the agent only.
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.
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.
Go Generics 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.
About 1.2k tokens (SKILL.md is roughly 4.9k 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 1.2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Go Generics: Go Pedantry (chromedp/chromedp, 13k stars), LangBot Core Development (langbot-app/LangBot, 18k stars), Breaking Change Analysis (ruby-git/ruby-git, 1.8k stars) and Atomui Control Optimization (AtomUI/AtomUI, 842 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
cxuu (a GitHub user) maintains it in cxuu/golang-skills, which has 172 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.