go-generics
Use when deciding whether to introduce Go generics, writing generic functions or types, composing type constraints, or choosing between type aliases and type definitions. Apply proactively when a user is writing a utility function that could conceivably work with multiple types, even if they didn't mention generics. Does not cover interface-only designs (see go-interfaces).
- Version
- 0.1.0
- License
- MIT
- Compatibility
- Designed for Claude Code or similar AI coding agents. Generics require Go 1.18+; `cmp.Ordered` requires Go 1.21+.
Pinned to revision 121b47cd4371, so it is the text this page describes rather than whatever the author pushed since.
Pre-approved tools experimental
Experimental field. Support varies between clients, so this list is what the author declared, not what your client will enforce.
- Read
- Edit
- Write
- Glob
- Grep
- Bash(go:*)
- Bash(golangci-lint:*)
Files
- skills/go-generics/SKILL.md
- skills/go-generics/references/constraints.md
- skills/go-generics/references/generics-vs-interfaces.md
Every link opens the file at its source, pinned to the revision this page describes.